@swmansion/argent 0.21.1-next.8 → 0.22.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.
@@ -45,7 +45,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
45
45
  // ../../node_modules/dotenv/lib/main.js
46
46
  var require_main = __commonJS({
47
47
  "../../node_modules/dotenv/lib/main.js"(exports2, module2) {
48
- var fs56 = require("fs");
48
+ var fs57 = require("fs");
49
49
  var path41 = require("path");
50
50
  var os15 = require("os");
51
51
  var crypto8 = require("crypto");
@@ -177,7 +177,7 @@ var require_main = __commonJS({
177
177
  if (options && options.path && options.path.length > 0) {
178
178
  if (Array.isArray(options.path)) {
179
179
  for (const filepath of options.path) {
180
- if (fs56.existsSync(filepath)) {
180
+ if (fs57.existsSync(filepath)) {
181
181
  possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
182
182
  }
183
183
  }
@@ -187,7 +187,7 @@ var require_main = __commonJS({
187
187
  } else {
188
188
  possibleVaultPath = path41.resolve(process.cwd(), ".env.vault");
189
189
  }
190
- if (fs56.existsSync(possibleVaultPath)) {
190
+ if (fs57.existsSync(possibleVaultPath)) {
191
191
  return possibleVaultPath;
192
192
  }
193
193
  return null;
@@ -240,7 +240,7 @@ var require_main = __commonJS({
240
240
  const parsedAll = {};
241
241
  for (const path42 of optionPaths) {
242
242
  try {
243
- const parsed = DotenvModule.parse(fs56.readFileSync(path42, { encoding }));
243
+ const parsed = DotenvModule.parse(fs57.readFileSync(path42, { encoding }));
244
244
  DotenvModule.populate(parsedAll, parsed, options);
245
245
  } catch (e) {
246
246
  if (debug) {
@@ -610,6 +610,8 @@ var init_failure_codes = __esm({
610
610
  IOS_SETTINGS_PERMISSION_FAILED: "IOS_SETTINGS_PERMISSION_FAILED",
611
611
  IOS_SHAKE_FAILED: "IOS_SHAKE_FAILED",
612
612
  ANDROID_SHAKE_FAILED: "ANDROID_SHAKE_FAILED",
613
+ PASTE_CLIPBOARD_SET_FAILED: "PASTE_CLIPBOARD_SET_FAILED",
614
+ PASTE_CLIPBOARD_UNSUPPORTED: "PASTE_CLIPBOARD_UNSUPPORTED",
613
615
  SETTINGS_PERMISSION_UNSUPPORTED: "SETTINGS_PERMISSION_UNSUPPORTED",
614
616
  NATIVE_DEVTOOLS_DESCRIBE_ERROR: "NATIVE_DEVTOOLS_DESCRIBE_ERROR",
615
617
  NATIVE_DEVTOOLS_VIEW_AT_POINT_ERROR: "NATIVE_DEVTOOLS_VIEW_AT_POINT_ERROR",
@@ -36306,7 +36308,7 @@ var require_view = __commonJS({
36306
36308
  "use strict";
36307
36309
  var debug = require_src()("express:view");
36308
36310
  var path41 = require("node:path");
36309
- var fs56 = require("node:fs");
36311
+ var fs57 = require("node:fs");
36310
36312
  var dirname14 = path41.dirname;
36311
36313
  var basename13 = path41.basename;
36312
36314
  var extname6 = path41.extname;
@@ -36386,7 +36388,7 @@ var require_view = __commonJS({
36386
36388
  function tryStat(path42) {
36387
36389
  debug('stat "%s"', path42);
36388
36390
  try {
36389
- return fs56.statSync(path42);
36391
+ return fs57.statSync(path42);
36390
36392
  } catch (e) {
36391
36393
  return void 0;
36392
36394
  }
@@ -68691,7 +68693,7 @@ var require_send = __commonJS({
68691
68693
  var escapeHtml = require_escape_html();
68692
68694
  var etag = require_etag();
68693
68695
  var fresh = require_fresh();
68694
- var fs56 = require("fs");
68696
+ var fs57 = require("fs");
68695
68697
  var mime = require_mime_types4();
68696
68698
  var ms = require_ms();
68697
68699
  var onFinished = require_on_finished();
@@ -68973,7 +68975,7 @@ var require_send = __commonJS({
68973
68975
  var i = 0;
68974
68976
  var self2 = this;
68975
68977
  debug('stat "%s"', path42);
68976
- fs56.stat(path42, function onstat(err, stat5) {
68978
+ fs57.stat(path42, function onstat(err, stat5) {
68977
68979
  var pathEndsWithSep = path42[path42.length - 1] === sep5;
68978
68980
  if (err && err.code === "ENOENT" && !extname6(path42) && !pathEndsWithSep) {
68979
68981
  return next(err);
@@ -68990,7 +68992,7 @@ var require_send = __commonJS({
68990
68992
  }
68991
68993
  var p = path42 + "." + self2._extensions[i++];
68992
68994
  debug('stat "%s"', p);
68993
- fs56.stat(p, function(err2, stat5) {
68995
+ fs57.stat(p, function(err2, stat5) {
68994
68996
  if (err2) return next(err2);
68995
68997
  if (stat5.isDirectory()) return next();
68996
68998
  self2.emit("file", p, stat5);
@@ -69008,7 +69010,7 @@ var require_send = __commonJS({
69008
69010
  }
69009
69011
  var p = join47(path42, self2._index[i]);
69010
69012
  debug('stat "%s"', p);
69011
- fs56.stat(p, function(err2, stat5) {
69013
+ fs57.stat(p, function(err2, stat5) {
69012
69014
  if (err2) return next(err2);
69013
69015
  if (stat5.isDirectory()) return next();
69014
69016
  self2.emit("file", p, stat5);
@@ -69020,7 +69022,7 @@ var require_send = __commonJS({
69020
69022
  SendStream.prototype.stream = function stream(path42, options) {
69021
69023
  var self2 = this;
69022
69024
  var res = this.res;
69023
- var stream2 = fs56.createReadStream(path42, options);
69025
+ var stream2 = fs57.createReadStream(path42, options);
69024
69026
  this.emit("stream", stream2);
69025
69027
  stream2.pipe(res);
69026
69028
  function cleanup() {
@@ -74511,7 +74513,7 @@ var require_websocket = __commonJS({
74511
74513
  var EventEmitter2 = require("events");
74512
74514
  var https = require("https");
74513
74515
  var http5 = require("http");
74514
- var net6 = require("net");
74516
+ var net7 = require("net");
74515
74517
  var tls = require("tls");
74516
74518
  var { randomBytes, createHash: createHash4 } = require("crypto");
74517
74519
  var { Duplex, Readable: Readable2 } = require("stream");
@@ -75255,12 +75257,12 @@ var require_websocket = __commonJS({
75255
75257
  }
75256
75258
  function netConnect(options) {
75257
75259
  options.path = options.socketPath;
75258
- return net6.connect(options);
75260
+ return net7.connect(options);
75259
75261
  }
75260
75262
  function tlsConnect(options) {
75261
75263
  options.path = void 0;
75262
75264
  if (!options.servername && options.servername !== "") {
75263
- options.servername = net6.isIP(options.host) ? "" : options.host;
75265
+ options.servername = net7.isIP(options.host) ? "" : options.host;
75264
75266
  }
75265
75267
  return tls.connect(options);
75266
75268
  }
@@ -76644,7 +76646,7 @@ var require_safe_json_stringify = __commonJS({
76644
76646
  // ../../node_modules/ncp/lib/ncp.js
76645
76647
  var require_ncp = __commonJS({
76646
76648
  "../../node_modules/ncp/lib/ncp.js"(exports2, module2) {
76647
- var fs56 = require("fs");
76649
+ var fs57 = require("fs");
76648
76650
  var path41 = require("path");
76649
76651
  module2.exports = ncp;
76650
76652
  ncp.ncp = ncp;
@@ -76673,7 +76675,7 @@ var require_ncp = __commonJS({
76673
76675
  return getStats(source2);
76674
76676
  }
76675
76677
  function getStats(source2) {
76676
- var stat5 = dereference ? fs56.stat : fs56.lstat;
76678
+ var stat5 = dereference ? fs57.stat : fs57.lstat;
76677
76679
  if (running >= limit) {
76678
76680
  return setImmediate(function() {
76679
76681
  getStats(source2);
@@ -76713,7 +76715,7 @@ var require_ncp = __commonJS({
76713
76715
  });
76714
76716
  }
76715
76717
  if (modified) {
76716
- var stat5 = dereference ? fs56.stat : fs56.lstat;
76718
+ var stat5 = dereference ? fs57.stat : fs57.lstat;
76717
76719
  stat5(target, function(err, stats) {
76718
76720
  if (file2.mtime.getTime() > stats.mtime.getTime())
76719
76721
  copyFile2(file2, target);
@@ -76725,7 +76727,7 @@ var require_ncp = __commonJS({
76725
76727
  });
76726
76728
  }
76727
76729
  function copyFile2(file2, target) {
76728
- var readStream = fs56.createReadStream(file2.name), writeStream = fs56.createWriteStream(target, { mode: file2.mode });
76730
+ var readStream = fs57.createReadStream(file2.name), writeStream = fs57.createWriteStream(target, { mode: file2.mode });
76729
76731
  readStream.on("error", onError);
76730
76732
  writeStream.on("error", onError);
76731
76733
  if (transform2) {
@@ -76737,13 +76739,13 @@ var require_ncp = __commonJS({
76737
76739
  }
76738
76740
  writeStream.once("finish", function() {
76739
76741
  if (modified) {
76740
- fs56.utimesSync(target, file2.atime, file2.mtime);
76742
+ fs57.utimesSync(target, file2.atime, file2.mtime);
76741
76743
  cb();
76742
76744
  } else cb();
76743
76745
  });
76744
76746
  }
76745
76747
  function rmFile(file2, done) {
76746
- fs56.unlink(file2, function(err) {
76748
+ fs57.unlink(file2, function(err) {
76747
76749
  if (err) {
76748
76750
  return onError(err);
76749
76751
  }
@@ -76760,7 +76762,7 @@ var require_ncp = __commonJS({
76760
76762
  });
76761
76763
  }
76762
76764
  function mkDir(dir, target) {
76763
- fs56.mkdir(target, dir.mode, function(err) {
76765
+ fs57.mkdir(target, dir.mode, function(err) {
76764
76766
  if (err) {
76765
76767
  return onError(err);
76766
76768
  }
@@ -76768,7 +76770,7 @@ var require_ncp = __commonJS({
76768
76770
  });
76769
76771
  }
76770
76772
  function copyDir(dir) {
76771
- fs56.readdir(dir, function(err, items) {
76773
+ fs57.readdir(dir, function(err, items) {
76772
76774
  if (err) {
76773
76775
  return onError(err);
76774
76776
  }
@@ -76780,7 +76782,7 @@ var require_ncp = __commonJS({
76780
76782
  }
76781
76783
  function onLink(link) {
76782
76784
  var target = link.replace(currentPath, targetPath);
76783
- fs56.readlink(link, function(err, resolvedPath) {
76785
+ fs57.readlink(link, function(err, resolvedPath) {
76784
76786
  if (err) {
76785
76787
  return onError(err);
76786
76788
  }
@@ -76795,7 +76797,7 @@ var require_ncp = __commonJS({
76795
76797
  if (writable) {
76796
76798
  return makeLink(resolvedPath, target);
76797
76799
  }
76798
- fs56.readlink(target, function(err, targetDest) {
76800
+ fs57.readlink(target, function(err, targetDest) {
76799
76801
  if (err) {
76800
76802
  return onError(err);
76801
76803
  }
@@ -76812,7 +76814,7 @@ var require_ncp = __commonJS({
76812
76814
  });
76813
76815
  }
76814
76816
  function makeLink(linkPath, target) {
76815
- fs56.symlink(linkPath, target, function(err) {
76817
+ fs57.symlink(linkPath, target, function(err) {
76816
76818
  if (err) {
76817
76819
  return onError(err);
76818
76820
  }
@@ -76820,7 +76822,7 @@ var require_ncp = __commonJS({
76820
76822
  });
76821
76823
  }
76822
76824
  function isWritable2(path42, done) {
76823
- fs56.lstat(path42, function(err) {
76825
+ fs57.lstat(path42, function(err) {
76824
76826
  if (err) {
76825
76827
  if (err.code === "ENOENT") return done(true);
76826
76828
  return done(false);
@@ -76832,7 +76834,7 @@ var require_ncp = __commonJS({
76832
76834
  if (options.stopOnError) {
76833
76835
  return cback(err);
76834
76836
  } else if (!errs && options.errs) {
76835
- errs = fs56.createWriteStream(options.errs);
76837
+ errs = fs57.createWriteStream(options.errs);
76836
76838
  } else if (!errs) {
76837
76839
  errs = [];
76838
76840
  }
@@ -77961,7 +77963,7 @@ var require_sync = __commonJS({
77961
77963
  "../../node_modules/glob/sync.js"(exports2, module2) {
77962
77964
  module2.exports = globSync;
77963
77965
  globSync.GlobSync = GlobSync;
77964
- var fs56 = require("fs");
77966
+ var fs57 = require("fs");
77965
77967
  var minimatch = require_minimatch();
77966
77968
  var Minimatch = minimatch.Minimatch;
77967
77969
  var Glob = require_glob().Glob;
@@ -78006,7 +78008,7 @@ var require_sync = __commonJS({
78006
78008
  for (var p in matchset) {
78007
78009
  try {
78008
78010
  p = self2._makeAbs(p);
78009
- var real = fs56.realpathSync(p, self2.realpathCache);
78011
+ var real = fs57.realpathSync(p, self2.realpathCache);
78010
78012
  set2[real] = true;
78011
78013
  } catch (er) {
78012
78014
  if (er.syscall === "stat")
@@ -78133,7 +78135,7 @@ var require_sync = __commonJS({
78133
78135
  var lstat;
78134
78136
  var stat5;
78135
78137
  try {
78136
- lstat = fs56.lstatSync(abs);
78138
+ lstat = fs57.lstatSync(abs);
78137
78139
  } catch (er) {
78138
78140
  return null;
78139
78141
  }
@@ -78157,7 +78159,7 @@ var require_sync = __commonJS({
78157
78159
  return c;
78158
78160
  }
78159
78161
  try {
78160
- return this._readdirEntries(abs, fs56.readdirSync(abs));
78162
+ return this._readdirEntries(abs, fs57.readdirSync(abs));
78161
78163
  } catch (er) {
78162
78164
  this._readdirError(abs, er);
78163
78165
  return null;
@@ -78261,13 +78263,13 @@ var require_sync = __commonJS({
78261
78263
  if (!stat5) {
78262
78264
  var lstat;
78263
78265
  try {
78264
- lstat = fs56.lstatSync(abs);
78266
+ lstat = fs57.lstatSync(abs);
78265
78267
  } catch (er) {
78266
78268
  return false;
78267
78269
  }
78268
78270
  if (lstat.isSymbolicLink()) {
78269
78271
  try {
78270
- stat5 = fs56.statSync(abs);
78272
+ stat5 = fs57.statSync(abs);
78271
78273
  } catch (er) {
78272
78274
  stat5 = lstat;
78273
78275
  }
@@ -78341,7 +78343,7 @@ var require_inflight = __commonJS({
78341
78343
  var require_glob = __commonJS({
78342
78344
  "../../node_modules/glob/glob.js"(exports2, module2) {
78343
78345
  module2.exports = glob;
78344
- var fs56 = require("fs");
78346
+ var fs57 = require("fs");
78345
78347
  var minimatch = require_minimatch();
78346
78348
  var Minimatch = minimatch.Minimatch;
78347
78349
  var inherits = require_inherits();
@@ -78478,7 +78480,7 @@ var require_glob = __commonJS({
78478
78480
  var set2 = this.matches[index] = /* @__PURE__ */ Object.create(null);
78479
78481
  found.forEach(function(p, i) {
78480
78482
  p = self2._makeAbs(p);
78481
- fs56.realpath(p, self2.realpathCache, function(er, real) {
78483
+ fs57.realpath(p, self2.realpathCache, function(er, real) {
78482
78484
  if (!er)
78483
78485
  set2[real] = true;
78484
78486
  else if (er.syscall === "stat")
@@ -78673,7 +78675,7 @@ var require_glob = __commonJS({
78673
78675
  var self2 = this;
78674
78676
  var lstatcb = inflight(lstatkey, lstatcb_);
78675
78677
  if (lstatcb)
78676
- fs56.lstat(abs, lstatcb);
78678
+ fs57.lstat(abs, lstatcb);
78677
78679
  function lstatcb_(er, lstat) {
78678
78680
  if (er)
78679
78681
  return cb();
@@ -78702,7 +78704,7 @@ var require_glob = __commonJS({
78702
78704
  return cb(null, c);
78703
78705
  }
78704
78706
  var self2 = this;
78705
- fs56.readdir(abs, readdirCb(this, abs, cb));
78707
+ fs57.readdir(abs, readdirCb(this, abs, cb));
78706
78708
  };
78707
78709
  function readdirCb(self2, abs, cb) {
78708
78710
  return function(er, entries) {
@@ -78840,10 +78842,10 @@ var require_glob = __commonJS({
78840
78842
  var self2 = this;
78841
78843
  var statcb = inflight("stat\0" + abs, lstatcb_);
78842
78844
  if (statcb)
78843
- fs56.lstat(abs, statcb);
78845
+ fs57.lstat(abs, statcb);
78844
78846
  function lstatcb_(er, lstat) {
78845
78847
  if (lstat && lstat.isSymbolicLink()) {
78846
- return fs56.stat(abs, function(er2, stat6) {
78848
+ return fs57.stat(abs, function(er2, stat6) {
78847
78849
  if (er2)
78848
78850
  self2._stat2(f, abs, null, lstat, cb);
78849
78851
  else
@@ -78879,7 +78881,7 @@ var require_rimraf = __commonJS({
78879
78881
  rimraf.sync = rimrafSync;
78880
78882
  var assert2 = require("assert");
78881
78883
  var path41 = require("path");
78882
- var fs56 = require("fs");
78884
+ var fs57 = require("fs");
78883
78885
  var glob = require_glob();
78884
78886
  var globOpts = {
78885
78887
  nosort: true,
@@ -78899,9 +78901,9 @@ var require_rimraf = __commonJS({
78899
78901
  "readdir"
78900
78902
  ];
78901
78903
  methods.forEach(function(m) {
78902
- options[m] = options[m] || fs56[m];
78904
+ options[m] = options[m] || fs57[m];
78903
78905
  m = m + "Sync";
78904
- options[m] = options[m] || fs56[m];
78906
+ options[m] = options[m] || fs57[m];
78905
78907
  });
78906
78908
  options.maxBusyTries = options.maxBusyTries || 3;
78907
78909
  options.emfileWait = options.emfileWait || 1e3;
@@ -78923,7 +78925,7 @@ var require_rimraf = __commonJS({
78923
78925
  var n = 0;
78924
78926
  if (options.disableGlob || !glob.hasMagic(p))
78925
78927
  return afterGlob(null, [p]);
78926
- fs56.lstat(p, function(er, stat5) {
78928
+ fs57.lstat(p, function(er, stat5) {
78927
78929
  if (!er)
78928
78930
  return afterGlob(null, [p]);
78929
78931
  glob(p, globOpts, afterGlob);
@@ -79080,7 +79082,7 @@ var require_rimraf = __commonJS({
79080
79082
  results = [p];
79081
79083
  } else {
79082
79084
  try {
79083
- fs56.lstatSync(p);
79085
+ fs57.lstatSync(p);
79084
79086
  results = [p];
79085
79087
  } catch (er) {
79086
79088
  results = glob.sync(p, globOpts);
@@ -79143,7 +79145,7 @@ var require_rimraf = __commonJS({
79143
79145
  var require_mkdirp = __commonJS({
79144
79146
  "../../node_modules/mkdirp/index.js"(exports2, module2) {
79145
79147
  var path41 = require("path");
79146
- var fs56 = require("fs");
79148
+ var fs57 = require("fs");
79147
79149
  var _0777 = parseInt("0777", 8);
79148
79150
  module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
79149
79151
  function mkdirP(p, opts, f, made) {
@@ -79154,7 +79156,7 @@ var require_mkdirp = __commonJS({
79154
79156
  opts = { mode: opts };
79155
79157
  }
79156
79158
  var mode = opts.mode;
79157
- var xfs = opts.fs || fs56;
79159
+ var xfs = opts.fs || fs57;
79158
79160
  if (mode === void 0) {
79159
79161
  mode = _0777;
79160
79162
  }
@@ -79193,7 +79195,7 @@ var require_mkdirp = __commonJS({
79193
79195
  opts = { mode: opts };
79194
79196
  }
79195
79197
  var mode = opts.mode;
79196
- var xfs = opts.fs || fs56;
79198
+ var xfs = opts.fs || fs57;
79197
79199
  if (mode === void 0) {
79198
79200
  mode = _0777;
79199
79201
  }
@@ -79230,7 +79232,7 @@ var require_mkdirp = __commonJS({
79230
79232
  // ../../node_modules/mv/index.js
79231
79233
  var require_mv = __commonJS({
79232
79234
  "../../node_modules/mv/index.js"(exports2, module2) {
79233
- var fs56 = require("fs");
79235
+ var fs57 = require("fs");
79234
79236
  var ncp = require_ncp().ncp;
79235
79237
  var path41 = require("path");
79236
79238
  var rimraf = require_rimraf();
@@ -79257,13 +79259,13 @@ var require_mv = __commonJS({
79257
79259
  }
79258
79260
  function doRename() {
79259
79261
  if (clobber) {
79260
- fs56.rename(source, dest, function(err) {
79262
+ fs57.rename(source, dest, function(err) {
79261
79263
  if (!err) return cb();
79262
79264
  if (err.code !== "EXDEV") return cb(err);
79263
79265
  moveFileAcrossDevice(source, dest, clobber, limit, cb);
79264
79266
  });
79265
79267
  } else {
79266
- fs56.link(source, dest, function(err) {
79268
+ fs57.link(source, dest, function(err) {
79267
79269
  if (err) {
79268
79270
  if (err.code === "EXDEV") {
79269
79271
  moveFileAcrossDevice(source, dest, clobber, limit, cb);
@@ -79276,15 +79278,15 @@ var require_mv = __commonJS({
79276
79278
  cb(err);
79277
79279
  return;
79278
79280
  }
79279
- fs56.unlink(source, cb);
79281
+ fs57.unlink(source, cb);
79280
79282
  });
79281
79283
  }
79282
79284
  }
79283
79285
  }
79284
79286
  function moveFileAcrossDevice(source, dest, clobber, limit, cb) {
79285
79287
  var outFlags = clobber ? "w" : "wx";
79286
- var ins = fs56.createReadStream(source);
79287
- var outs = fs56.createWriteStream(dest, { flags: outFlags });
79288
+ var ins = fs57.createReadStream(source);
79289
+ var outs = fs57.createWriteStream(dest, { flags: outFlags });
79288
79290
  ins.on("error", function(err) {
79289
79291
  ins.destroy();
79290
79292
  outs.destroy();
@@ -79304,7 +79306,7 @@ var require_mv = __commonJS({
79304
79306
  outs.once("close", onClose);
79305
79307
  ins.pipe(outs);
79306
79308
  function onClose() {
79307
- fs56.unlink(source, cb);
79309
+ fs57.unlink(source, cb);
79308
79310
  }
79309
79311
  }
79310
79312
  function moveDirAcrossDevice(source, dest, clobber, limit, cb) {
@@ -79359,7 +79361,7 @@ var require_bunyan = __commonJS({
79359
79361
  throw new Error("unknown runtime environment");
79360
79362
  }
79361
79363
  var os15;
79362
- var fs56;
79364
+ var fs57;
79363
79365
  var dtrace;
79364
79366
  if (runtimeEnv === "browser") {
79365
79367
  os15 = {
@@ -79367,11 +79369,11 @@ var require_bunyan = __commonJS({
79367
79369
  return window.location.host;
79368
79370
  }
79369
79371
  };
79370
- fs56 = {};
79372
+ fs57 = {};
79371
79373
  dtrace = null;
79372
79374
  } else {
79373
79375
  os15 = require("os");
79374
- fs56 = require("fs");
79376
+ fs57 = require("fs");
79375
79377
  try {
79376
79378
  dtrace = require("dtrace-provider");
79377
79379
  } catch (e) {
@@ -79751,7 +79753,7 @@ var require_bunyan = __commonJS({
79751
79753
  s.reemitErrorEvents = true;
79752
79754
  }
79753
79755
  if (!s.stream) {
79754
- s.stream = fs56.createWriteStream(
79756
+ s.stream = fs57.createWriteStream(
79755
79757
  s.path,
79756
79758
  { flags: "a", encoding: "utf8" }
79757
79759
  );
@@ -79821,7 +79823,7 @@ var require_bunyan = __commonJS({
79821
79823
  s.stream.destroySoon();
79822
79824
  delete s.stream;
79823
79825
  }
79824
- s.stream = fs56.createWriteStream(
79826
+ s.stream = fs57.createWriteStream(
79825
79827
  s.path,
79826
79828
  { flags: "a", encoding: "utf8" }
79827
79829
  );
@@ -80163,7 +80165,7 @@ var require_bunyan = __commonJS({
80163
80165
  }
80164
80166
  var lastModified = null;
80165
80167
  try {
80166
- var fileInfo = fs56.statSync(this.path);
80168
+ var fileInfo = fs57.statSync(this.path);
80167
80169
  lastModified = fileInfo.mtime.getTime();
80168
80170
  } catch (err) {
80169
80171
  }
@@ -80174,7 +80176,7 @@ var require_bunyan = __commonJS({
80174
80176
  rotateAfterOpen = true;
80175
80177
  }
80176
80178
  }
80177
- this.stream = fs56.createWriteStream(
80179
+ this.stream = fs57.createWriteStream(
80178
80180
  this.path,
80179
80181
  { flags: "a", encoding: "utf8" }
80180
80182
  );
@@ -80341,7 +80343,7 @@ var require_bunyan = __commonJS({
80341
80343
  }
80342
80344
  n -= 1;
80343
80345
  self2._debug(" rm %s", toDel);
80344
- fs56.unlink(toDel, function(delErr) {
80346
+ fs57.unlink(toDel, function(delErr) {
80345
80347
  moves();
80346
80348
  });
80347
80349
  }
@@ -80355,7 +80357,7 @@ var require_bunyan = __commonJS({
80355
80357
  before += "." + String(n - 1);
80356
80358
  }
80357
80359
  n -= 1;
80358
- fs56.exists(before, function(exists2) {
80360
+ fs57.exists(before, function(exists2) {
80359
80361
  if (!exists2) {
80360
80362
  moves();
80361
80363
  } else {
@@ -80373,7 +80375,7 @@ var require_bunyan = __commonJS({
80373
80375
  }
80374
80376
  function finish() {
80375
80377
  self2._debug(" open %s", self2.path);
80376
- self2.stream = fs56.createWriteStream(
80378
+ self2.stream = fs57.createWriteStream(
80377
80379
  self2.path,
80378
80380
  { flags: "a", encoding: "utf8" }
80379
80381
  );
@@ -91324,14 +91326,14 @@ var require_parser2 = __commonJS({
91324
91326
  case "scalar":
91325
91327
  case "single-quoted-scalar":
91326
91328
  case "double-quoted-scalar": {
91327
- const fs56 = this.flowScalar(this.type);
91329
+ const fs57 = this.flowScalar(this.type);
91328
91330
  if (atNextItem || it.value) {
91329
- map2.items.push({ start: start2, key: fs56, sep: [] });
91331
+ map2.items.push({ start: start2, key: fs57, sep: [] });
91330
91332
  this.onKeyLine = true;
91331
91333
  } else if (it.sep) {
91332
- this.stack.push(fs56);
91334
+ this.stack.push(fs57);
91333
91335
  } else {
91334
- Object.assign(it, { key: fs56, sep: [] });
91336
+ Object.assign(it, { key: fs57, sep: [] });
91335
91337
  this.onKeyLine = true;
91336
91338
  }
91337
91339
  return;
@@ -91459,13 +91461,13 @@ var require_parser2 = __commonJS({
91459
91461
  case "scalar":
91460
91462
  case "single-quoted-scalar":
91461
91463
  case "double-quoted-scalar": {
91462
- const fs56 = this.flowScalar(this.type);
91464
+ const fs57 = this.flowScalar(this.type);
91463
91465
  if (!it || it.value)
91464
- fc.items.push({ start: [], key: fs56, sep: [] });
91466
+ fc.items.push({ start: [], key: fs57, sep: [] });
91465
91467
  else if (it.sep)
91466
- this.stack.push(fs56);
91468
+ this.stack.push(fs57);
91467
91469
  else
91468
- Object.assign(it, { key: fs56, sep: [] });
91470
+ Object.assign(it, { key: fs57, sep: [] });
91469
91471
  return;
91470
91472
  }
91471
91473
  case "flow-map-end":
@@ -95690,7 +95692,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
95690
95692
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
95691
95693
  function readCliVersion() {
95692
95694
  if (true) {
95693
- return "0.21.1-next.8";
95695
+ return "0.22.0";
95694
95696
  }
95695
95697
  return "0.0.0";
95696
95698
  }
@@ -97027,7 +97029,7 @@ var import_node_path5 = __toESM(require("node:path"));
97027
97029
  var import_semver2 = __toESM(require_semver2());
97028
97030
 
97029
97031
  // ../tool-server/package.json
97030
- var version2 = "0.21.0";
97032
+ var version2 = "0.22.0";
97031
97033
 
97032
97034
  // ../tool-server/src/utils/update-checker.ts
97033
97035
  var import_update_core = __toESM(require_dist4());
@@ -98281,23 +98283,23 @@ var InvalidToolInputError = class extends Error {
98281
98283
  });
98282
98284
  }
98283
98285
  };
98284
- function platformMatrix(platform, capability33) {
98286
+ function platformMatrix(platform, capability34) {
98285
98287
  switch (platform) {
98286
98288
  case "ios":
98287
- return capability33.apple;
98289
+ return capability34.apple;
98288
98290
  case "ios-remote":
98289
- return capability33.appleRemote;
98291
+ return capability34.appleRemote;
98290
98292
  case "android":
98291
- return capability33.android;
98293
+ return capability34.android;
98292
98294
  case "chromium":
98293
- return capability33.chromium;
98295
+ return capability34.chromium;
98294
98296
  case "vega":
98295
- return capability33.vega;
98297
+ return capability34.vega;
98296
98298
  }
98297
98299
  }
98298
- function assertSupported(toolId, capability33, device) {
98299
- if (!capability33) return;
98300
- const matrix = platformMatrix(device.platform, capability33);
98300
+ function assertSupported(toolId, capability34, device) {
98301
+ if (!capability34) return;
98302
+ const matrix = platformMatrix(device.platform, capability34);
98301
98303
  if (!matrix) {
98302
98304
  throw new UnsupportedOperationError(toolId, device, `no ${device.platform} support declared`);
98303
98305
  }
@@ -98305,7 +98307,7 @@ function assertSupported(toolId, capability33, device) {
98305
98307
  if (!supported) {
98306
98308
  throw new UnsupportedOperationError(toolId, device, `kind '${device.kind}' not supported`);
98307
98309
  }
98308
- if (capability33.supports && !capability33.supports(device)) {
98310
+ if (capability34.supports && !capability34.supports(device)) {
98309
98311
  throw new UnsupportedOperationError(toolId, device, "supports() refiner rejected device");
98310
98312
  }
98311
98313
  }
@@ -108077,7 +108079,7 @@ var path12 = __toESM(require("node:path"));
108077
108079
  var os4 = __toESM(require("node:os"));
108078
108080
  var import_node_crypto5 = require("node:crypto");
108079
108081
  var import_node_url = require("node:url");
108080
- var DEFAULT_SCREENSHOT_SCALE = 0.3;
108082
+ var DEFAULT_SCREENSHOT_SCALE = 0.25;
108081
108083
  var NO_IMAGE_ERROR = /no image to export/i;
108082
108084
  var FIRST_FRAME_WAIT_MS = 6e3;
108083
108085
  var FIRST_FRAME_POLL_MS = 250;
@@ -108130,6 +108132,42 @@ async function pointerPost(api, body, signal) {
108130
108132
  return false;
108131
108133
  }
108132
108134
  }
108135
+ async function setSimulatorClipboardText(api, text, signal) {
108136
+ let res;
108137
+ try {
108138
+ res = await fetch(`${api.apiUrl}/api/clipboard/text`, {
108139
+ method: "POST",
108140
+ headers: { "Content-Type": "application/json" },
108141
+ body: JSON.stringify({ text }),
108142
+ signal
108143
+ });
108144
+ } catch (err) {
108145
+ throw toSimulatorNetworkError("Paste", err, api.apiUrl);
108146
+ }
108147
+ if (res.status === 404) {
108148
+ throw new FailureError(
108149
+ "Paste failed: this simulator-server build has no clipboard endpoint. Update argent so its bundled simulator-server includes clipboard support, or type the text with the keyboard tool instead.",
108150
+ {
108151
+ error_code: FAILURE_CODES.PASTE_CLIPBOARD_UNSUPPORTED,
108152
+ failure_stage: "simulator_clipboard_endpoint_missing",
108153
+ failure_area: "tool_server",
108154
+ error_kind: "unsupported"
108155
+ }
108156
+ );
108157
+ }
108158
+ const body = await res.json().catch(() => null);
108159
+ if (!res.ok || body?.status !== "ok") {
108160
+ throw new FailureError(
108161
+ `Paste failed: could not set the device clipboard (${body?.error ?? `HTTP ${res.status}`}).`,
108162
+ {
108163
+ error_code: FAILURE_CODES.PASTE_CLIPBOARD_SET_FAILED,
108164
+ failure_stage: "simulator_clipboard_set",
108165
+ failure_area: "tool_server",
108166
+ error_kind: "unknown"
108167
+ }
108168
+ );
108169
+ }
108170
+ }
108133
108171
  async function simulatorPost(toolLabel, api, endpoint, reqBody, signal, fallbackHint) {
108134
108172
  let res;
108135
108173
  try {
@@ -108245,10 +108283,6 @@ function routeViaTransport(transport, cmd) {
108245
108283
  case "rotate":
108246
108284
  transport.rotate(cmd.direction);
108247
108285
  return;
108248
- case "paste": {
108249
- void Promise.resolve(transport.paste(cmd.text));
108250
- return;
108251
- }
108252
108286
  default:
108253
108287
  throw new Error(`MoQ transport does not implement sendCommand cmd '${String(cmd.cmd)}'`);
108254
108288
  }
@@ -111799,7 +111833,21 @@ function adaptAXDescribeToDescribeResult(response) {
111799
111833
  }
111800
111834
 
111801
111835
  // ../tool-server/src/tools/describe/platforms/ios/index.ts
111802
- var DEGRADED_HINT = "This simulator was not booted through argent \u2014 system dialogs and native modals may not appear. You MUST call boot-device with force=true now to restart the simulator and apply full accessibility settings before continuing.";
111836
+ var DEGRADED_BLIND_HINT = "The accessibility read returned no elements, and this simulator was not booted through argent, so the pre-boot accessibility settings were never applied. Unless the screen is genuinely blank, call boot-device with force=true to reboot it with those settings \u2014 this restarts the simulator";
111837
+ var DEGRADED_STANDING_HINT = "This simulator was not booted through argent, so system dialogs and native modals may not appear in this tree; everything else reads normally. If something you expect is missing, boot-device with force=true reboots the simulator with the full accessibility settings";
111838
+ var bootCaveatToldDevices = /* @__PURE__ */ new Set();
111839
+ function withBootCaveatOncePerDevice(deviceId, data) {
111840
+ if (data.hint !== DEGRADED_STANDING_HINT) {
111841
+ if (data.hint !== DEGRADED_BLIND_HINT) bootCaveatToldDevices.delete(deviceId);
111842
+ return data;
111843
+ }
111844
+ if (!bootCaveatToldDevices.has(deviceId)) {
111845
+ bootCaveatToldDevices.add(deviceId);
111846
+ return data;
111847
+ }
111848
+ const { hint: _alreadyTold, ...rest } = data;
111849
+ return rest;
111850
+ }
111803
111851
  function tcpArtifactHint(err) {
111804
111852
  const message = err instanceof Error ? err.message : typeof err === "string" ? err : "";
111805
111853
  return /TCP-transport (?:binary|dylib) not found/.test(message) ? message : void 0;
@@ -111820,17 +111868,21 @@ async function describeIos(registry2, device, params, options = {}) {
111820
111868
  return { tree: emptyTree(), source: "ax-service", hint: TVOS_HINT };
111821
111869
  }
111822
111870
  let tree;
111823
- let hint;
111871
+ let degraded;
111872
+ let resolverHint;
111824
111873
  try {
111825
111874
  const axRef = axServiceRef(device);
111826
111875
  const axApi = await registry2.resolveService(axRef.urn, axRef.options);
111827
111876
  const response = await axApi.describe();
111828
111877
  tree = adaptAXDescribeToDescribeResult(response);
111829
- hint = axApi.degraded ? DEGRADED_HINT : void 0;
111878
+ degraded = axApi.degraded;
111830
111879
  } catch (err) {
111831
111880
  tree = emptyTree();
111832
- hint = tcpArtifactHint(err) ?? DEGRADED_HINT;
111881
+ resolverHint = tcpArtifactHint(err);
111882
+ degraded = resolverHint === void 0;
111833
111883
  }
111884
+ const degradedHint = !degraded ? void 0 : tree.children.length === 0 ? DEGRADED_BLIND_HINT : DEGRADED_STANDING_HINT;
111885
+ const hint = resolverHint ?? degradedHint;
111834
111886
  if (tree.children.length > 0) {
111835
111887
  return { tree, source: "ax-service", hint };
111836
111888
  }
@@ -111907,6 +111959,15 @@ async function getAndroidScreenSize(serial) {
111907
111959
  }
111908
111960
  return { width, height };
111909
111961
  }
111962
+ function parseDumpRotation(rawOutput) {
111963
+ const value = Number(/<hierarchy[^>]*\brotation="([0-3])"/.exec(rawOutput)?.[1]);
111964
+ if (value === 0 || value === 1 || value === 2 || value === 3) return value;
111965
+ return null;
111966
+ }
111967
+ function orientScreenSize(size, rotation) {
111968
+ if (rotation !== 1 && rotation !== 3) return size;
111969
+ return { width: size.height, height: size.width };
111970
+ }
111910
111971
 
111911
111972
  // ../tool-server/src/tools/describe/platforms/android/uiautomator-parser.ts
111912
111973
  init_src();
@@ -113169,7 +113230,8 @@ async function describeAndroid(registry2, serial, _bundleId, isTv) {
113169
113230
  }
113170
113231
  );
113171
113232
  }
113172
- const tree = parseUiAutomatorDump(raw, size.width, size.height);
113233
+ const oriented = orientScreenSize(size, parseDumpRotation(raw));
113234
+ const tree = parseUiAutomatorDump(raw, oriented.width, oriented.height);
113173
113235
  return { tree, source: "uiautomator", hint };
113174
113236
  }
113175
113237
 
@@ -120674,6 +120736,205 @@ var os9 = __toESM(require("node:os"));
120674
120736
  var path22 = __toESM(require("node:path"));
120675
120737
  init_zod();
120676
120738
 
120739
+ // ../tool-server/src/utils/device-orientation.ts
120740
+ var import_node_fs13 = require("node:fs");
120741
+ init_adb();
120742
+
120743
+ // ../tool-server/src/utils/adb-server.ts
120744
+ var net6 = __toESM(require("node:net"));
120745
+ async function adbServerShell(serial, shellCommand, options = {}) {
120746
+ const { host, port } = adbServerAddress(process.env);
120747
+ const timeoutMs = options.timeoutMs ?? 5e3;
120748
+ return new Promise((resolve12, reject) => {
120749
+ const socket = net6.createConnection({ host, port });
120750
+ socket.setNoDelay(true);
120751
+ const chunks = [];
120752
+ let stage = "transport";
120753
+ let pending = Buffer.alloc(0);
120754
+ let settled = false;
120755
+ const finish = (err, value) => {
120756
+ if (settled) return;
120757
+ settled = true;
120758
+ clearTimeout(timer);
120759
+ socket.destroy();
120760
+ if (err) reject(err);
120761
+ else resolve12(value ?? "");
120762
+ };
120763
+ const timer = setTimeout(
120764
+ () => finish(new Error(`adb server shell timed out after ${timeoutMs}ms: ${shellCommand}`)),
120765
+ timeoutMs
120766
+ );
120767
+ const send = (message) => {
120768
+ const payload = Buffer.from(message, "utf8");
120769
+ socket.write(payload.length.toString(16).padStart(4, "0") + message);
120770
+ };
120771
+ const takeStatus = () => {
120772
+ if (pending.length < 4) return false;
120773
+ const status = pending.subarray(0, 4).toString("latin1");
120774
+ if (status === "OKAY") {
120775
+ pending = pending.subarray(4);
120776
+ return true;
120777
+ }
120778
+ if (status === "FAIL") {
120779
+ if (pending.length < 8) return false;
120780
+ const len = parseInt(pending.subarray(4, 8).toString("latin1"), 16);
120781
+ if (pending.length < 8 + len) return false;
120782
+ finish(new Error(`adb server: ${pending.subarray(8, 8 + len).toString("utf8")}`));
120783
+ return false;
120784
+ }
120785
+ finish(new Error(`adb server: unexpected status ${JSON.stringify(status)}`));
120786
+ return false;
120787
+ };
120788
+ socket.once("connect", () => send(`host:transport:${serial}`));
120789
+ socket.on("data", (data) => {
120790
+ if (stage === "output") {
120791
+ chunks.push(data);
120792
+ return;
120793
+ }
120794
+ pending = Buffer.concat([pending, data]);
120795
+ if (stage === "transport" && takeStatus()) {
120796
+ stage = "shell";
120797
+ send(`shell:${shellCommand}`);
120798
+ }
120799
+ if (stage === "shell" && takeStatus()) {
120800
+ stage = "output";
120801
+ if (pending.length) chunks.push(pending);
120802
+ pending = Buffer.alloc(0);
120803
+ }
120804
+ });
120805
+ socket.once("error", (err) => finish(err));
120806
+ socket.once("close", () => {
120807
+ if (stage === "output") finish(void 0, Buffer.concat(chunks).toString("utf8"));
120808
+ else finish(new Error("adb server closed the connection before answering"));
120809
+ });
120810
+ });
120811
+ }
120812
+ function adbServerAddress(env) {
120813
+ const socketSpec = env.ADB_SERVER_SOCKET;
120814
+ if (socketSpec) {
120815
+ const m = /^tcp:(?:(.*):)?(\d+)$/.exec(socketSpec.trim());
120816
+ if (m) return { host: m[1] || "127.0.0.1", port: Number(m[2]) };
120817
+ }
120818
+ const port = Number(env.ANDROID_ADB_SERVER_PORT);
120819
+ return {
120820
+ host: env.ANDROID_ADB_SERVER_ADDRESS?.trim() || "127.0.0.1",
120821
+ port: Number.isInteger(port) && port > 0 && port < 65536 ? port : 5037
120822
+ };
120823
+ }
120824
+
120825
+ // ../tool-server/src/utils/device-orientation.ts
120826
+ var SURFACE_ROTATION_TO_NAME = {
120827
+ 0: "Portrait",
120828
+ 1: "LandscapeLeft",
120829
+ 2: "PortraitUpsideDown",
120830
+ 3: "LandscapeRight"
120831
+ };
120832
+ function isSurfaceRotation(value) {
120833
+ return value === 0 || value === 1 || value === 2 || value === 3;
120834
+ }
120835
+ var ROTATION_PROBES = [
120836
+ {
120837
+ cmd: "dumpsys display | grep mCurrentOrientation || true",
120838
+ pattern: /mCurrentOrientation=([0-3])/
120839
+ },
120840
+ { cmd: "dumpsys window displays || true", pattern: /\bmRotation=([0-3])/ }
120841
+ ];
120842
+ async function readAndroidSurfaceRotation(serial, peek) {
120843
+ if (peek) {
120844
+ try {
120845
+ const value = await peek();
120846
+ if (typeof value === "number" && isSurfaceRotation(value)) return value;
120847
+ } catch {
120848
+ }
120849
+ }
120850
+ for (const shell of [adbServerShell, adbShell]) {
120851
+ for (const { cmd, pattern } of ROTATION_PROBES) {
120852
+ try {
120853
+ const out = await shell(serial, cmd, { timeoutMs: 5e3 });
120854
+ const value = Number(pattern.exec(out)?.[1]);
120855
+ if (Number.isInteger(value) && isSurfaceRotation(value)) return value;
120856
+ } catch {
120857
+ }
120858
+ }
120859
+ }
120860
+ return null;
120861
+ }
120862
+ function captureRotationForSurface(rotation) {
120863
+ if (rotation === null || rotation === 0) return void 0;
120864
+ return SURFACE_ROTATION_TO_NAME[rotation];
120865
+ }
120866
+ async function readPngSize2(path41) {
120867
+ let handle;
120868
+ try {
120869
+ handle = await import_node_fs13.promises.open(path41, "r");
120870
+ const buf = Buffer.alloc(24);
120871
+ const { bytesRead } = await handle.read(buf, 0, 24, 0);
120872
+ if (bytesRead < 24) return null;
120873
+ if (buf.readUInt32BE(0) !== 2303741511) return null;
120874
+ const width = buf.readUInt32BE(16);
120875
+ const height = buf.readUInt32BE(20);
120876
+ if (width <= 0 || height <= 0) return null;
120877
+ return { width, height };
120878
+ } catch {
120879
+ return null;
120880
+ } finally {
120881
+ await handle?.close().catch(() => {
120882
+ });
120883
+ }
120884
+ }
120885
+ function captureLooksUpright(requested, size) {
120886
+ if (!size || size.width === size.height) return true;
120887
+ const wantsLandscape = requested === "LandscapeLeft" || requested === "LandscapeRight";
120888
+ const isLandscape = size.width > size.height;
120889
+ return wantsLandscape === isLandscape;
120890
+ }
120891
+
120892
+ // ../tool-server/src/utils/rotation-aware-capture.ts
120893
+ async function captureScreenshotUpright(api, device, requestedRotation, signal, scale, capture = httpScreenshot, peek) {
120894
+ if (requestedRotation !== void 0 || device.platform !== "android") {
120895
+ return capture(api, requestedRotation, signal, scale);
120896
+ }
120897
+ const surface = await readAndroidSurfaceRotation(device.id, peek);
120898
+ const rotation = captureRotationForSurface(surface);
120899
+ if (!rotation) return capture(api, void 0, signal, scale);
120900
+ const result = await capture(api, rotation, signal, scale);
120901
+ if (!captureLooksUpright(rotation, await readPngSize2(result.path))) {
120902
+ console.warn(
120903
+ `[screenshot] ${device.id}: requested ${rotation} for surface rotation ${surface}, but the capture came back with the opposite aspect. Falling back to an unrotated capture \u2014 simulator-server's rotation handling may have changed.`
120904
+ );
120905
+ return capture(api, void 0, signal, scale);
120906
+ }
120907
+ return result;
120908
+ }
120909
+
120910
+ // ../tool-server/src/utils/android-devtools-rotation-peek.ts
120911
+ init_src();
120912
+ var PEEK_TIMEOUT_MS = 1e3;
120913
+ function androidDevtoolsRotationPeek(registry2, device) {
120914
+ return async () => {
120915
+ if (device.platform !== "android") return null;
120916
+ const ref = androidDevtoolsRef(device);
120917
+ let state3;
120918
+ try {
120919
+ state3 = registry2.getServiceState(ref.urn);
120920
+ } catch {
120921
+ return null;
120922
+ }
120923
+ if (state3 !== "RUNNING" /* RUNNING */) return null;
120924
+ try {
120925
+ const api = await registry2.resolveService(ref.urn, ref.options);
120926
+ if (!api.isReady()) return null;
120927
+ const size = await Promise.race([
120928
+ api.getScreenSize(),
120929
+ new Promise((resolve12) => setTimeout(() => resolve12(null), PEEK_TIMEOUT_MS).unref?.())
120930
+ ]);
120931
+ return size?.rotation ?? null;
120932
+ } catch {
120933
+ return null;
120934
+ }
120935
+ };
120936
+ }
120937
+
120677
120938
  // ../tool-server/src/utils/vega-screen.ts
120678
120939
  var import_promises10 = require("node:fs/promises");
120679
120940
  var import_node_os12 = require("node:os");
@@ -120890,10 +121151,10 @@ var zodSchema15 = external_exports.object({
120890
121151
  "Target device id from `list-devices` (iOS UDID, Android serial, Apple TV UDID, Vega serial, or Chromium id)."
120891
121152
  ),
120892
121153
  rotation: external_exports.enum(["Portrait", "LandscapeLeft", "LandscapeRight", "PortraitUpsideDown"]).optional().describe(
120893
- "Orientation override for the screenshot (rotates the captured image after Page.captureScreenshot on Chromium)."
121154
+ "Orientation override for the screenshot (rotates the captured image after Page.captureScreenshot on Chromium). On Android the capture already follows the device's rotation."
120894
121155
  ),
120895
121156
  scale: external_exports.number().min(0.01).max(1).optional().describe(
120896
- "Scale factor (0.01-1.0). Defaults to ARGENT_SCREENSHOT_SCALE env var, or 0.3 if unset for iOS/Android. On Chromium the default is 1.0 (no downscale); pass <1 to opt in. Downscaling on Chromium requires the optional `sharp` dependency."
121157
+ "Scale factor (0.01-1.0). Defaults to ARGENT_SCREENSHOT_SCALE env var, or 0.25 if unset for iOS/Android. On Chromium the default is 1.0 (no downscale); pass <1 to opt in. Downscaling on Chromium requires the optional `sharp` dependency."
120897
121158
  ),
120898
121159
  includeImageInContext: external_exports.boolean().optional().default(true).describe(
120899
121160
  "Default true. Set false only when capturing a full-resolution PNG (scale: 1.0) to save as a baseline/current for screenshot-diff \u2014 the file is still written, but the image bytes are not attached to the agent context."
@@ -120985,11 +121246,14 @@ Fails if the simulator-server / emulator backend / Chromium CDP is not reachable
120985
121246
  }
120986
121247
  const ref = simulatorServerRef(device);
120987
121248
  const api = await registry2.resolveService(ref.urn, ref.options);
120988
- const { path: capturedPath } = await httpScreenshot(
121249
+ const { path: capturedPath } = await captureScreenshotUpright(
120989
121250
  api,
121251
+ device,
120990
121252
  params.rotation,
120991
121253
  signal,
120992
- params.scale
121254
+ params.scale,
121255
+ void 0,
121256
+ androidDevtoolsRotationPeek(registry2, device)
120993
121257
  );
120994
121258
  const image = await requireArtifacts(ctx).register(capturedPath, { mimeType: "image/png" });
120995
121259
  return { image };
@@ -122328,13 +122592,176 @@ One call does one action: pass text OR key, never both. To type and then press a
122328
122592
  };
122329
122593
  }
122330
122594
 
122595
+ // ../tool-server/src/tools/paste/schema.ts
122596
+ init_zod();
122597
+ var pasteZodSchema = external_exports.object({
122598
+ udid: external_exports.string().min(1).describe(
122599
+ "Target device id from `list-devices` (iOS simulator UDID or Android emulator serial)."
122600
+ ),
122601
+ text: external_exports.string().min(1).describe(
122602
+ "Text to put on the device clipboard and paste into the focused field. Supports `{{secret:<NAME>}}` placeholders, resolved on the tool-server from the `ARGENT_SECRET_<NAME>` environment variable or an argent secrets file \u2014 the same sources as `keyboard` \u2014 so a credential never enters your context. If the secret is not set, the failure lists the available names and every source it looked in; ask the user to add it there, NEVER ask for the value in the conversation."
122603
+ )
122604
+ });
122605
+
122606
+ // ../tool-server/src/tools/paste/platforms/ios.ts
122607
+ var LEFT_GUI_KEYCODE = 227;
122608
+ var V_KEYCODE = charToKeyPress("v").keyCode;
122609
+ var CHORD_STEP_MS = 50;
122610
+ var sleep10 = (ms) => new Promise((r) => setTimeout(r, ms));
122611
+ function rejectTv(device) {
122612
+ throw new UnsupportedOperationError(
122613
+ "paste",
122614
+ device,
122615
+ "tvOS has no pasteboard to paste from \u2014 type into the focused field with keyboard instead"
122616
+ );
122617
+ }
122618
+ async function pasteSimulator(api, text) {
122619
+ await setSimulatorClipboardText(api, text);
122620
+ api.pressKey("Down", LEFT_GUI_KEYCODE);
122621
+ await sleep10(CHORD_STEP_MS);
122622
+ api.pressKey("Down", V_KEYCODE);
122623
+ await sleep10(CHORD_STEP_MS);
122624
+ api.pressKey("Up", V_KEYCODE);
122625
+ await sleep10(CHORD_STEP_MS);
122626
+ api.pressKey("Up", LEFT_GUI_KEYCODE);
122627
+ await sleep10(CHORD_STEP_MS);
122628
+ return { pasted: true };
122629
+ }
122630
+ function makeIosImpl4(registry2) {
122631
+ return {
122632
+ // `isTvOsSimulator` shells out to `simctl`; the simulator-server itself is
122633
+ // resolved through the blueprint.
122634
+ requires: ["xcrun"],
122635
+ async handler(_services, params, device) {
122636
+ if (await isTvOsSimulator(device.id)) rejectTv(device);
122637
+ const ref = simulatorServerRef(device);
122638
+ const api = await registry2.resolveService(ref.urn, ref.options);
122639
+ return pasteSimulator(api, params.text);
122640
+ }
122641
+ };
122642
+ }
122643
+ function makeIosRemoteImpl2(registry2) {
122644
+ return {
122645
+ requires: ["sim-remote"],
122646
+ async handler(_services, params, device) {
122647
+ if (await isRemoteTvOsSimulator(device.id)) rejectTv(device);
122648
+ const ref = simulatorServerRef(device);
122649
+ const api = await registry2.resolveService(ref.urn, ref.options);
122650
+ if (!api.transport) {
122651
+ throw new Error(
122652
+ `Tool 'paste' resolved an ios-remote simulator-server without a transport for ${device.id}.`
122653
+ );
122654
+ }
122655
+ await api.transport.paste(params.text);
122656
+ return { pasted: true };
122657
+ }
122658
+ };
122659
+ }
122660
+
122661
+ // ../tool-server/src/tools/paste/platforms/android.ts
122662
+ init_adb();
122663
+ var KEYCODE_PASTE = 279;
122664
+ function makeAndroidImpl2(registry2) {
122665
+ return {
122666
+ requires: ["adb"],
122667
+ async handler(_services, params, device) {
122668
+ if (await isAndroidTv(device.id)) {
122669
+ throw new UnsupportedOperationError(
122670
+ "paste",
122671
+ device,
122672
+ "Android TV is focus-driven \u2014 type into the focused field with keyboard instead"
122673
+ );
122674
+ }
122675
+ const ref = simulatorServerRef(device);
122676
+ const api = await registry2.resolveService(ref.urn, ref.options);
122677
+ await setSimulatorClipboardText(api, params.text);
122678
+ await injectAndroidKeycode(device.id, KEYCODE_PASTE);
122679
+ return { pasted: true };
122680
+ }
122681
+ };
122682
+ }
122683
+
122684
+ // ../tool-server/src/tools/paste/index.ts
122685
+ var capability17 = {
122686
+ // Simulators only. A physical iPhone's pasteboard is reachable through the
122687
+ // same simulator-server endpoint, but the paste keystroke is not verified
122688
+ // over the CoreDevice HID path, so `device` stays off until it is.
122689
+ apple: { simulator: true },
122690
+ // A remote simulator pastes through the MoQ transport's existing paste
122691
+ // primitive (device pasteboard + ⌘V on the remote host).
122692
+ appleRemote: { simulator: true },
122693
+ // Emulators only: the clipboard is set through the emulator's gRPC
122694
+ // endpoint, which a physical phone does not have. `unknown` is admitted
122695
+ // because an unresolved serial may still be an emulator — the
122696
+ // simulator-server refuses a phone either way.
122697
+ android: { emulator: true, unknown: true }
122698
+ // No `chromium`: the renderer can only reach the HOST clipboard, so a paste
122699
+ // there would overwrite whatever the user has copied. No `vega`: no
122700
+ // clipboard API is exposed by the VVD tooling.
122701
+ //
122702
+ // TV targets are not separate platforms (an Apple TV simulator is
122703
+ // `ios`/`simulator`, an Android TV emulator `android`/`emulator`), so each
122704
+ // handler probes the runtime kind and rejects a TV itself.
122705
+ };
122706
+ var pasteQueues = /* @__PURE__ */ new Map();
122707
+ function serializedPerDevice(deviceId, task) {
122708
+ const previous = pasteQueues.get(deviceId) ?? Promise.resolve();
122709
+ const next = previous.then(task, task);
122710
+ pasteQueues.set(deviceId, next);
122711
+ void next.then(
122712
+ () => {
122713
+ if (pasteQueues.get(deviceId) === next) pasteQueues.delete(deviceId);
122714
+ },
122715
+ () => {
122716
+ if (pasteQueues.get(deviceId) === next) pasteQueues.delete(deviceId);
122717
+ }
122718
+ );
122719
+ return next;
122720
+ }
122721
+ function createPasteTool(registry2) {
122722
+ const dispatch = dispatchByPlatform({
122723
+ toolId: "paste",
122724
+ capability: capability17,
122725
+ ios: makeIosImpl4(registry2),
122726
+ iosRemote: makeIosRemoteImpl2(registry2),
122727
+ android: makeAndroidImpl2(registry2)
122728
+ });
122729
+ return {
122730
+ id: "paste",
122731
+ interaction: {
122732
+ startedMsg: () => "Pasting text",
122733
+ completedMsg: () => "Pasted text",
122734
+ failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to paste text: ${failureSignal2.error_code}`
122735
+ },
122736
+ description: `Paste text into the focused field: puts \`text\` on the DEVICE clipboard (the host clipboard is untouched), then triggers the platform's paste shortcut (iOS simulator, Android emulator).
122737
+ Do NOT use this in place of \`keyboard\`. \`keyboard\` types as a user would and is the default for all text entry; use \`paste\` only where a real user would paste \u2014 a 2FA/OTP code copied from another app, a long link or token, or when testing the app's own paste handling.
122738
+ Tap the field first so it has focus. Returns { pasted: true }. Fails on a TV target, when the device clipboard cannot be set, or when the simulator-server build lacks clipboard support.
122739
+ Supports \`{{secret:<NAME>}}\` placeholders like \`keyboard\`; the value is never echoed back.`,
122740
+ searchHint: "paste clipboard pasteboard otp 2fa code fill field",
122741
+ zodSchema: pasteZodSchema,
122742
+ capability: capability17,
122743
+ services: () => ({}),
122744
+ execute: async (services, params, options) => {
122745
+ const { text, secrets } = resolveSecretPlaceholders(params.text);
122746
+ return serializedPerDevice(params.udid, async () => {
122747
+ if (secrets.length === 0) return dispatch(services, params, options);
122748
+ try {
122749
+ return await dispatch(services, { ...params, text }, options);
122750
+ } catch (err) {
122751
+ throw redactSecretsFromError(err, secrets);
122752
+ }
122753
+ });
122754
+ }
122755
+ };
122756
+ }
122757
+
122331
122758
  // ../tool-server/src/tools/rotate/index.ts
122332
122759
  init_zod();
122333
122760
  var zodSchema25 = external_exports.object({
122334
122761
  udid: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial)."),
122335
122762
  orientation: external_exports.enum(["Portrait", "LandscapeLeft", "LandscapeRight", "PortraitUpsideDown"]).describe("Target orientation")
122336
122763
  });
122337
- var capability17 = {
122764
+ var capability18 = {
122338
122765
  apple: { simulator: true, device: true },
122339
122766
  appleRemote: { simulator: true },
122340
122767
  android: { emulator: true, device: true, unknown: true }
@@ -122350,7 +122777,7 @@ var rotateTool = {
122350
122777
  Use to test layout in a different orientation. Re-run \`describe\` afterwards \u2014 frame coordinates change with the orientation.
122351
122778
  Returns { orientation }. Fails if the target device is not booted.`,
122352
122779
  zodSchema: zodSchema25,
122353
- capability: capability17,
122780
+ capability: capability18,
122354
122781
  services: (params) => ({
122355
122782
  simulatorServer: simulatorServerRef(resolveDevice(params.udid))
122356
122783
  }),
@@ -122581,9 +123008,9 @@ async function prepareHostWindowShake(target) {
122581
123008
  var execFileAsync20 = (0, import_node_util20.promisify)(import_node_child_process27.execFile);
122582
123009
  var SHAKE_NOTIFICATION = "com.apple.UIKit.SimulatorShake";
122583
123010
  var SHAKE_INTERVAL_MS = 400;
122584
- var sleep10 = (ms) => new Promise((r) => setTimeout(r, ms));
123011
+ var sleep11 = (ms) => new Promise((r) => setTimeout(r, ms));
122585
123012
  var NOTIFYUTIL_ARGV = ["notifyutil", "-p", SHAKE_NOTIFICATION];
122586
- function rejectTv(toolId, device) {
123013
+ function rejectTv2(toolId, device) {
122587
123014
  throw new UnsupportedOperationError(
122588
123015
  toolId,
122589
123016
  device,
@@ -122612,11 +123039,11 @@ var iosImpl4 = {
122612
123039
  async handler(_services, params, device) {
122613
123040
  const { udid } = params;
122614
123041
  const count2 = params.count ?? 1;
122615
- if (await isTvOsSimulator(udid)) rejectTv("shake", device);
123042
+ if (await isTvOsSimulator(udid)) rejectTv2("shake", device);
122616
123043
  const args = await simctlArgsForUdid(udid, ["spawn", udid, ...NOTIFYUTIL_ARGV]);
122617
123044
  const shaker = await prepareHostWindowShake({ kind: "ios", udid, name: device.name });
122618
123045
  for (let i = 0; i < count2; i++) {
122619
- if (i > 0) await sleep10(SHAKE_INTERVAL_MS);
123046
+ if (i > 0) await sleep11(SHAKE_INTERVAL_MS);
122620
123047
  shaker.begin();
122621
123048
  try {
122622
123049
  await execFileAsync20("xcrun", args, { timeout: 15e3 });
@@ -122634,9 +123061,9 @@ var iosRemoteImpl6 = {
122634
123061
  async handler(_services, params, device) {
122635
123062
  const { udid } = params;
122636
123063
  const count2 = params.count ?? 1;
122637
- if (await isRemoteTvOsSimulator(udid)) rejectTv("shake", device);
123064
+ if (await isRemoteTvOsSimulator(udid)) rejectTv2("shake", device);
122638
123065
  for (let i = 0; i < count2; i++) {
122639
- if (i > 0) await sleep10(SHAKE_INTERVAL_MS);
123066
+ if (i > 0) await sleep11(SHAKE_INTERVAL_MS);
122640
123067
  let result;
122641
123068
  try {
122642
123069
  result = await simctlSpawn(udid, { args: NOTIFYUTIL_ARGV });
@@ -122683,7 +123110,7 @@ function restingVectorFrom(stdout) {
122683
123110
  return read;
122684
123111
  }
122685
123112
  var fmt = (v) => `${v.x.toFixed(4)}:${v.y.toFixed(4)}:${v.z.toFixed(4)}`;
122686
- var sleep11 = (ms) => new Promise((r) => setTimeout(r, ms));
123113
+ var sleep12 = (ms) => new Promise((r) => setTimeout(r, ms));
122687
123114
  async function emuConsole(serial, args) {
122688
123115
  const { stdout } = await runAdb(["-s", serial, "emu", ...args], { timeoutMs: 1e4 });
122689
123116
  const lines = stdout.split("\n").map((line) => line.trim()).filter(Boolean);
@@ -122757,7 +123184,7 @@ var androidImpl6 = {
122757
123184
  y: rest.y,
122758
123185
  z: rest.z
122759
123186
  });
122760
- await sleep11(SWING_INTERVAL_MS);
123187
+ await sleep12(SWING_INTERVAL_MS);
122761
123188
  }
122762
123189
  }
122763
123190
  } catch (err) {
@@ -122782,7 +123209,7 @@ var androidImpl6 = {
122782
123209
  };
122783
123210
 
122784
123211
  // ../tool-server/src/tools/shake/index.ts
122785
- var capability18 = {
123212
+ var capability19 = {
122786
123213
  // Simulator only. A physical iPhone's motion comes from real hardware; there
122787
123214
  // is no host-side hook to fake it, so `device` stays false and a paired phone
122788
123215
  // gets a clean 400 instead of a silent no-op.
@@ -122820,13 +123247,13 @@ Works on local and remote (sim-remote) iOS simulators.
122820
123247
  Only phone/tablet simulators and emulators are supported.`,
122821
123248
  searchHint: "shake motion accelerometer undo typing dev menu gesture",
122822
123249
  zodSchema: shakeZodSchema,
122823
- capability: capability18,
123250
+ capability: capability19,
122824
123251
  // Talks to `simctl` / `adb` directly, so no simulator-server is resolved —
122825
123252
  // avoids spawning one (and its ready-wait) for a tool that never uses it.
122826
123253
  services: () => ({}),
122827
123254
  execute: dispatchByPlatform({
122828
123255
  toolId: "shake",
122829
- capability: capability18,
123256
+ capability: capability19,
122830
123257
  ios: iosImpl4,
122831
123258
  iosRemote: iosRemoteImpl6,
122832
123259
  android: androidImpl6
@@ -122876,14 +123303,14 @@ var APPLE_TV_UNSUPPORTED = /* @__PURE__ */ new Set([
122876
123303
  "volumeDown",
122877
123304
  "mute"
122878
123305
  ]);
122879
- function makeIosImpl4(registry2) {
123306
+ function makeIosImpl5(registry2) {
122880
123307
  return {
122881
123308
  handler: (_services, params, device, options) => pressFocusRemote(registry2, device, params, APPLE_TV_UNSUPPORTED, options)
122882
123309
  };
122883
123310
  }
122884
123311
 
122885
123312
  // ../tool-server/src/tools/tv-remote/platforms/android.ts
122886
- function makeAndroidImpl2(registry2) {
123313
+ function makeAndroidImpl3(registry2) {
122887
123314
  return {
122888
123315
  requires: ["adb"],
122889
123316
  handler: (_services, params, device, options) => pressFocusRemote(registry2, device, params, void 0, options)
@@ -122929,7 +123356,7 @@ var zodSchema26 = external_exports.object({
122929
123356
  'Repeat the whole `button` value this many times (default 1). Compact for long same-button runs, e.g. { button: "down", repeat: 12 }.'
122930
123357
  )
122931
123358
  });
122932
- var capability19 = {
123359
+ var capability20 = {
122933
123360
  apple: { simulator: true, device: true },
122934
123361
  android: { emulator: true, device: true, unknown: true },
122935
123362
  vega: { vvd: true }
@@ -122956,13 +123383,13 @@ Returns { pressed, count }.`,
122956
123383
  longRunning: true,
122957
123384
  searchHint: "tv remote dpad d-pad navigate focus up down left right select ok back home menu play pause rewind fast forward sequence path apple tv tvos android tv leanback vega fire tv",
122958
123385
  zodSchema: zodSchema26,
122959
- capability: capability19,
123386
+ capability: capability20,
122960
123387
  services: () => ({}),
122961
123388
  execute: dispatchByPlatform({
122962
123389
  toolId: "tv-remote",
122963
- capability: capability19,
122964
- ios: makeIosImpl4(registry2),
122965
- android: makeAndroidImpl2(registry2),
123390
+ capability: capability20,
123391
+ ios: makeIosImpl5(registry2),
123392
+ android: makeAndroidImpl3(registry2),
122966
123393
  vega: vegaImpl5
122967
123394
  })
122968
123395
  };
@@ -129134,7 +129561,7 @@ var conditionCompleted = {
129134
129561
  hidden: "UI element became hidden",
129135
129562
  text: "UI element matched expected text"
129136
129563
  };
129137
- var capability20 = {
129564
+ var capability21 = {
129138
129565
  apple: { simulator: true, device: true },
129139
129566
  android: { emulator: true, device: true, unknown: true },
129140
129567
  chromium: { app: true },
@@ -129226,7 +129653,7 @@ or before tapping an element that appears asynchronously.`,
129226
129653
  searchHint: "wait await poll until visible hidden exists text appears disappears timeout element condition settle",
129227
129654
  longRunning: true,
129228
129655
  zodSchema: zodSchema27,
129229
- capability: capability20,
129656
+ capability: capability21,
129230
129657
  services: (params) => {
129231
129658
  const device = resolveDevice(params.udid);
129232
129659
  if (device.platform === "chromium") {
@@ -129237,7 +129664,7 @@ or before tapping an element that appears asynchronously.`,
129237
129664
  async execute(services, params, ctx) {
129238
129665
  const signal = ctx?.signal;
129239
129666
  const device = resolveDevice(params.udid);
129240
- assertSupported(AWAIT_UI_ELEMENT_TOOL_ID, capability20, device);
129667
+ assertSupported(AWAIT_UI_ELEMENT_TOOL_ID, capability21, device);
129241
129668
  if (device.platform === "ios") await ensureDeps(iosRequires);
129242
129669
  else if (device.platform === "android") await ensureDeps(androidRequires);
129243
129670
  else if (device.platform === "vega") await ensureDeps(vegaRequires);
@@ -129294,6 +129721,9 @@ var ALLOWED_TOOLS = /* @__PURE__ */ new Set([
129294
129721
  "gesture-rotate",
129295
129722
  "button",
129296
129723
  "keyboard",
129724
+ // `paste` belongs in a sequence for the same reason `keyboard` does: the
129725
+ // focus tap, the paste and the submit are one user action.
129726
+ "paste",
129297
129727
  "rotate",
129298
129728
  // Sequencing matters for shake: the interesting cases are races (shake while
129299
129729
  // a sheet is dismissing, shake right after typing), which need the steps
@@ -129311,7 +129741,7 @@ var zodSchema28 = external_exports.object({
129311
129741
  steps: external_exports.array(
129312
129742
  external_exports.object({
129313
129743
  tool: external_exports.string().describe(
129314
- "Tool name \u2014 one of: gesture-tap, gesture-swipe, gesture-scroll, gesture-drag, gesture-custom, gesture-pinch, gesture-rotate, button, keyboard, rotate, shake, tv-remote, await-ui-element. On a TV target (Apple TV / Android TV / Vega) use tv-remote (remote presses) and keyboard (text)."
129744
+ "Tool name \u2014 one of: gesture-tap, gesture-swipe, gesture-scroll, gesture-drag, gesture-custom, gesture-pinch, gesture-rotate, button, keyboard, paste, rotate, shake, tv-remote, await-ui-element. On a TV target (Apple TV / Android TV / Vega) use tv-remote (remote presses) and keyboard (text)."
129315
129745
  ),
129316
129746
  args: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Tool arguments (excluding udid, which is injected automatically)"),
129317
129747
  delayMs: external_exports.number().optional().describe(
@@ -129320,7 +129750,7 @@ var zodSchema28 = external_exports.object({
129320
129750
  })
129321
129751
  ).min(1).describe("Ordered list of interaction steps to execute sequentially")
129322
129752
  });
129323
- var capability21 = {
129753
+ var capability22 = {
129324
129754
  apple: { simulator: true, device: true },
129325
129755
  appleRemote: { simulator: true },
129326
129756
  android: { emulator: true, device: true, unknown: true },
@@ -129362,6 +129792,7 @@ Allowed tools and their args (udid is auto-injected, do NOT include it in args):
129362
129792
  button: { button: "home"|"back"|"power"|"volumeUp"|"volumeDown"|"appSwitch"|"actionButton" } [ios/android]
129363
129793
  keyboard: { text?: string, key?: string, delayMs?: number } (text OR key per step, never both; TV: text only) [ios/android/chromium/vega/tv]
129364
129794
  text supports {{secret:<NAME>}} placeholders, resolved server-side from ARGENT_SECRET_<NAME> env vars or an argent secrets file \u2014 credentials never enter agent context
129795
+ paste: { text: string } (device clipboard + paste shortcut; only where a user would paste, e.g. an OTP \u2014 keyboard otherwise) [ios sim/android emu]
129365
129796
  rotate: { orientation: "Portrait"|"LandscapeLeft"|"LandscapeRight"|"PortraitUpsideDown" } [ios/android]
129366
129797
  shake: { count?: number } [ios sim/android emu]
129367
129798
  tv-remote: { button: <remote button | array of them>, repeat?: number } [apple tv/android tv/vega]
@@ -129400,7 +129831,7 @@ Stops on the first error (or unmet await-ui-element condition) and returns parti
129400
129831
  longRunning: true,
129401
129832
  searchHint: "batch sequence multiple gesture steps sequentially",
129402
129833
  zodSchema: zodSchema28,
129403
- capability: capability21,
129834
+ capability: capability22,
129404
129835
  // No eagerly-declared service: each step resolves its own services through
129405
129836
  // `invokeSubTool` below (simulator-server for iOS/Android, CDP for
129406
129837
  // Chromium), so run-sequence itself needs none. An eager resolver can't be
@@ -131678,7 +132109,7 @@ function formatDescribeTree(root, opts) {
131678
132109
  }
131679
132110
 
131680
132111
  // ../tool-server/src/tools/describe/platforms/tv.ts
131681
- var sleep12 = (ms) => new Promise((r) => setTimeout(r, ms));
132112
+ var sleep13 = (ms) => new Promise((r) => setTimeout(r, ms));
131682
132113
  var EMPTY_RETRY_ATTEMPTS = 3;
131683
132114
  var EMPTY_RETRY_DELAY_MS = 600;
131684
132115
  var EMPTY_HINT = "No focusable elements after retrying and recycling the read path. The app is most likely still launching (splash / loading screen) or mid-transition \u2014 this is normal right after launch-app / restart-app. Wait ~2-3s and call describe again; a React Native app only exposes focus once its JS bundle has loaded. If it stays empty, take a screenshot to confirm what's actually on screen.";
@@ -131719,7 +132150,7 @@ async function describeTv(registry2, device) {
131719
132150
  let res = await api.describe();
131720
132151
  if (device.platform !== "android") {
131721
132152
  for (let attempt = 1; attempt < EMPTY_RETRY_ATTEMPTS && isEmpty(res); attempt++) {
131722
- await sleep12(EMPTY_RETRY_DELAY_MS);
132153
+ await sleep13(EMPTY_RETRY_DELAY_MS);
131723
132154
  res = await api.describe();
131724
132155
  }
131725
132156
  }
@@ -131769,7 +132200,7 @@ var zodSchema38 = external_exports.object({
131769
132200
  "Optional app bundle ID. Used as a target hint on iOS when the AX-service returns no elements and the describe tool falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on Android / Chromium."
131770
132201
  )
131771
132202
  });
131772
- var capability22 = {
132203
+ var capability23 = {
131773
132204
  apple: { simulator: true, device: true },
131774
132205
  appleRemote: { simulator: true },
131775
132206
  android: { emulator: true, device: true, unknown: true },
@@ -131779,12 +132210,17 @@ var capability22 = {
131779
132210
  function makeDescribeExecute(registry2) {
131780
132211
  return dispatchByPlatform({
131781
132212
  toolId: "describe",
131782
- capability: capability22,
132213
+ capability: capability23,
131783
132214
  ios: {
131784
132215
  requires: iosRequires,
131785
132216
  handler: async (_services, params, device) => (
131786
132217
  // Probe tvOS once here, then pass the verdict into describeIos.
131787
- await isTvOsSimulator(device.id) ? describeTv(registry2, device) : withDescription(await describeIos(registry2, device, params, { isTvOs: false }))
132218
+ await isTvOsSimulator(device.id) ? describeTv(registry2, device) : withDescription(
132219
+ withBootCaveatOncePerDevice(
132220
+ device.id,
132221
+ await describeIos(registry2, device, params, { isTvOs: false })
132222
+ )
132223
+ )
131788
132224
  )
131789
132225
  },
131790
132226
  iosRemote: {
@@ -131793,7 +132229,12 @@ function makeDescribeExecute(registry2) {
131793
132229
  // ios-remote. Only the preflight dep differs. Remote sims are iOS-only
131794
132230
  // (never tvOS), so the isTvOs verdict is always false.
131795
132231
  requires: ["sim-remote"],
131796
- handler: async (_services, params, device) => withDescription(await describeIos(registry2, device, params, { isTvOs: false }))
132232
+ handler: async (_services, params, device) => withDescription(
132233
+ withBootCaveatOncePerDevice(
132234
+ device.id,
132235
+ await describeIos(registry2, device, params, { isTvOs: false })
132236
+ )
132237
+ )
131797
132238
  },
131798
132239
  android: {
131799
132240
  requires: androidRequires,
@@ -131854,7 +132295,7 @@ back/menu/home), then call describe again to confirm where focus landed.`,
131854
132295
  alwaysLoad: true,
131855
132296
  searchHint: "accessibility element tree ui hierarchy tap coordinates ios android chromium vega dom tv tvos apple tv android tv fire tv focus focusable remote dpad",
131856
132297
  zodSchema: zodSchema38,
131857
- capability: capability22,
132298
+ capability: capability23,
131858
132299
  services: (params) => {
131859
132300
  const device = resolveDevice(params.udid);
131860
132301
  if (device.platform === "chromium") {
@@ -131883,7 +132324,7 @@ var zodSchema39 = external_exports.object({
131883
132324
  `The screen must hold the same content for at least this long to count as settled (default ${DEFAULT_MIN_STABLE_MS}).`
131884
132325
  )
131885
132326
  });
131886
- var capability23 = {
132327
+ var capability24 = {
131887
132328
  apple: { simulator: true, device: true },
131888
132329
  android: { emulator: true, device: true, unknown: true },
131889
132330
  chromium: { app: true }
@@ -131927,7 +132368,7 @@ still before the timeout. Use after a launch/navigation to wait for the UI to re
131927
132368
  searchHint: "wait until screen settles idle stable stops changing animation transition rendered ready before screenshot",
131928
132369
  longRunning: true,
131929
132370
  zodSchema: zodSchema39,
131930
- capability: capability23,
132371
+ capability: capability24,
131931
132372
  services: (params) => {
131932
132373
  const device = resolveDevice(params.udid);
131933
132374
  if (device.platform === "chromium") {
@@ -131937,7 +132378,7 @@ still before the timeout. Use after a launch/navigation to wait for the UI to re
131937
132378
  },
131938
132379
  async execute(services, params, ctx) {
131939
132380
  const device = resolveDevice(params.udid);
131940
- assertSupported(AWAIT_SCREEN_IDLE_TOOL_ID, capability23, device);
132381
+ assertSupported(AWAIT_SCREEN_IDLE_TOOL_ID, capability24, device);
131941
132382
  if (device.platform === "ios") await ensureDeps(iosRequires);
131942
132383
  else if (device.platform === "android") await ensureDeps(androidRequires);
131943
132384
  const isTvOs = device.platform === "ios" && await isTvOsSimulator(device.id);
@@ -135164,7 +135605,7 @@ var nativeProfilerSessionBlueprint = {
135164
135605
  var import_child_process4 = require("child_process");
135165
135606
  init_src();
135166
135607
  var import_fs9 = require("fs");
135167
- var import_node_fs13 = require("node:fs");
135608
+ var import_node_fs14 = require("node:fs");
135168
135609
  var path25 = __toESM(require("path"));
135169
135610
 
135170
135611
  // ../tool-server/src/utils/ios-profiler/notify.ts
@@ -136822,7 +137263,7 @@ function resolveDefaultTemplatePath() {
136822
137263
  )
136823
137264
  ];
136824
137265
  for (const candidate of candidates) {
136825
- if ((0, import_node_fs13.existsSync)(candidate)) return candidate;
137266
+ if ((0, import_node_fs14.existsSync)(candidate)) return candidate;
136826
137267
  }
136827
137268
  throw new FailureError(
136828
137269
  `Argent.tracetemplate not found. Looked in:
@@ -138700,7 +139141,7 @@ var zodSchema48 = external_exports.object({
138700
139141
  "iOS-only. When true, cold-launches the app under the profiler with Malloc Stack Logging enabled so memory leaks carry an allocation backtrace (responsible frame + library). Without it, leaks are still detected but unattributable \u2014 Instruments reports '<Call stack limit reached>'. Trade-offs: this RESTARTS the app (current state is lost), adds memory/CPU overhead, and makes the app noticeably slow to launch (every startup allocation records a backtrace), so leave it off for pure CPU/hang profiling. Requires a non-degraded Xcode: on Xcode 26.4 and later the cold-launch path is broken, so the call is rejected up front (re-run without the flag, or set ARGENT_IOS_CAPTURE=device to override if the device path works on your host). ARGENT_IOS_CAPTURE=all-processes \u2014 e.g. exported globally for the normal capture path \u2014 also rejects this flag up front, since that fallback cannot cold-launch; unset it (or set it to device) first. Ignored on Android."
138701
139142
  )
138702
139143
  });
138703
- var capability24 = {
139144
+ var capability25 = {
138704
139145
  apple: { simulator: true, device: true },
138705
139146
  android: { emulator: true, device: true, unknown: true }
138706
139147
  };
@@ -138711,7 +139152,7 @@ var nativeProfilerStartTool = {
138711
139152
  completedMsg: () => "Started native profiler",
138712
139153
  failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to start native profiler: ${failureSignal2.error_code}`
138713
139154
  },
138714
- capability: capability24,
139155
+ capability: capability25,
138715
139156
  description: `Start native profiling on a booted device. iOS: Instruments via xctrace (CPU, hangs, memory). Android: Perfetto (CPU, jank, RSS-growth weak signal).
138716
139157
  Auto-detects the running app process unless app_process is explicitly provided.
138717
139158
  After starting, let the user interact with the app, then call native-profiler-stop.
@@ -138725,7 +139166,7 @@ Fails if no app is running on the device, or the profiler cannot attach to the p
138725
139166
  async execute(services, params) {
138726
139167
  const api = services.session;
138727
139168
  const device = resolveDevice(params.device_id);
138728
- assertSupported("native-profiler-start", capability24, device);
139169
+ assertSupported("native-profiler-start", capability25, device);
138729
139170
  if (api.platform === "ios") {
138730
139171
  await ensureDeps(["xcrun"]);
138731
139172
  return startNativeProfilerIos(api, params);
@@ -138742,7 +139183,7 @@ var zodSchema49 = external_exports.object({
138742
139183
  "Target device id from `list-devices` (iOS UDID or Android serial)."
138743
139184
  )
138744
139185
  });
138745
- var capability25 = {
139186
+ var capability26 = {
138746
139187
  apple: { simulator: true, device: true },
138747
139188
  android: { emulator: true, device: true, unknown: true }
138748
139189
  };
@@ -138763,7 +139204,7 @@ var nativeProfilerStopTool = {
138763
139204
  completedMsg: ({ result }) => `Saved native profile ${result.traceFile.filename}`,
138764
139205
  failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to stop native profiler: ${failureSignal2.error_code}`
138765
139206
  },
138766
- capability: capability25,
139207
+ capability: capability26,
138767
139208
  // Packaging plus the export passes routinely exceed the 30s fetch timeout.
138768
139209
  longRunning: true,
138769
139210
  description: `Stop native profiling and export trace data.
@@ -138780,7 +139221,7 @@ Fails if no active native-profiler-start session exists for the given device_id.
138780
139221
  async execute(services, params, ctx) {
138781
139222
  const api = services.session;
138782
139223
  const device = resolveDevice(params.device_id);
138783
- assertSupported("native-profiler-stop", capability25, device);
139224
+ assertSupported("native-profiler-stop", capability26, device);
138784
139225
  if (api.platform === "ios") {
138785
139226
  await ensureDeps(["xcrun"]);
138786
139227
  const ios = await stopNativeProfilerIos(api);
@@ -138812,7 +139253,7 @@ var zodSchema50 = external_exports.object({
138812
139253
  "Target device id from `list-devices` (iOS UDID or Android serial)."
138813
139254
  )
138814
139255
  });
138815
- var capability26 = {
139256
+ var capability27 = {
138816
139257
  apple: { simulator: true, device: true },
138817
139258
  android: { emulator: true, device: true, unknown: true }
138818
139259
  };
@@ -138823,7 +139264,7 @@ var nativeProfilerAnalyzeTool = {
138823
139264
  completedMsg: () => "Analyzed native profile",
138824
139265
  failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to analyze native profile: ${failureSignal2.error_code}`
138825
139266
  },
138826
- capability: capability26,
139267
+ capability: capability27,
138827
139268
  description: `Analyze exported native trace data and return an LLM-optimized markdown report.
138828
139269
  iOS: parses CPU time profile, UI hangs, and memory leaks from the exported XML files.
138829
139270
  Android: queries the Perfetto .pftrace via the in-process Perfetto trace-processor engine for CPU hotspots, UI hangs with jank reason + main-thread state breakdown, GC annotation, and an RSS-growth weak signal.
@@ -138840,7 +139281,7 @@ Fails if native-profiler-stop has not been called first to export trace data.`,
138840
139281
  async execute(services, params, ctx) {
138841
139282
  const api = services.session;
138842
139283
  const device = resolveDevice(params.device_id);
138843
- assertSupported("native-profiler-analyze", capability26, device);
139284
+ assertSupported("native-profiler-analyze", capability27, device);
138844
139285
  let result;
138845
139286
  if (api.platform === "ios") {
138846
139287
  await ensureDeps(["xcrun"]);
@@ -139819,7 +140260,7 @@ var zodSchema51 = external_exports.object({
139819
140260
  "Default true. Draw simulator-server's touch visualizer into the recording: a pulse marks each tap, a comet trail follows swipes and drags, and paired markers show two-finger pinch/rotate, so the video makes clear where every interaction landed. Set false to record the raw screen with no overlay."
139820
140261
  )
139821
140262
  });
139822
- var capability27 = {
140263
+ var capability28 = {
139823
140264
  apple: { simulator: true },
139824
140265
  android: { emulator: true, device: true, unknown: true }
139825
140266
  };
@@ -139831,7 +140272,7 @@ function createScreenRecordingStartTool(registry2) {
139831
140272
  completedMsg: () => "Started screen recording",
139832
140273
  failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to start screen recording: ${failureSignal2.error_code}`
139833
140274
  },
139834
- capability: capability27,
140275
+ capability: capability28,
139835
140276
  description: `Start recording the device screen to a video file (h264 mp4, 30fps at the device's native resolution).
139836
140277
  By default stretches where the screen does not change are trimmed out (see trimStatic), so a long session with only brief activity comes back as a short clip instead of minutes of dead air.
139837
140278
  By default every tap, swipe, drag, pinch and rotate is drawn into the video as an on-screen touch marker (see showTouches), so the recording shows where each interaction landed.
@@ -139851,7 +140292,7 @@ Fails if a recording is already running on the device, the device is not booted,
139851
140292
  async execute(services, params) {
139852
140293
  const api = services.session;
139853
140294
  const device = resolveDevice(params.udid);
139854
- assertSupported("screen-recording-start", capability27, device);
140295
+ assertSupported("screen-recording-start", capability28, device);
139855
140296
  if (device.platform === "ios" && await isTvOsSimulator(params.udid)) {
139856
140297
  throw new FailureError(
139857
140298
  `Screen recording is not supported on tvOS simulators (device ${params.udid}).`,
@@ -139926,7 +140367,7 @@ var zodSchema52 = external_exports.object({
139926
140367
  udid: external_exports.string().describe("Target device id from `list-devices` (iOS Simulator UDID or Android serial).")
139927
140368
  });
139928
140369
  var RECORDINGS_DIR = ".argent/recordings";
139929
- var capability28 = {
140370
+ var capability29 = {
139930
140371
  apple: { simulator: true },
139931
140372
  android: { emulator: true, device: true, unknown: true }
139932
140373
  };
@@ -139937,7 +140378,7 @@ var screenRecordingStopTool = {
139937
140378
  completedMsg: ({ result }) => `Saved screen recording ${result.video.filename}`,
139938
140379
  failedMsg: ({ failureSignal: failureSignal2 }) => `Failed to stop screen recording: ${failureSignal2.error_code}`
139939
140380
  },
139940
- capability: capability28,
140381
+ capability: capability29,
139941
140382
  description: `Stop the screen recording started by \`screen-recording-start\` and retrieve the video: frame capture ends and ffmpeg finalizes the mp4.
139942
140383
  Also retrieves the video when the recording already ended on its own (time limit reached, capture process died) \u2014 call it even after the cap fired.
139943
140384
  Use when the interaction being captured is finished, or a tool-result note reminds you a recording is still running.
@@ -139951,7 +140392,7 @@ Fails if no recording (running or finished-but-unretrieved) exists for the given
139951
140392
  async execute(services, params, ctx) {
139952
140393
  const api = services.session;
139953
140394
  const device = resolveDevice(params.udid);
139954
- assertSupported("screen-recording-stop", capability28, device);
140395
+ assertSupported("screen-recording-stop", capability29, device);
139955
140396
  const stopped = await stopCapture(api);
139956
140397
  const artifacts = requireArtifacts(ctx);
139957
140398
  const video = await artifacts.register(stopped.outputFile, {
@@ -142112,8 +142553,8 @@ init_zod();
142112
142553
 
142113
142554
  // ../tool-server/src/tools/flows/flow-utils.ts
142114
142555
  var path32 = __toESM(require("node:path"));
142115
- var fs44 = __toESM(require("node:fs/promises"));
142116
- var import_node_fs14 = require("node:fs");
142556
+ var fs45 = __toESM(require("node:fs/promises"));
142557
+ var import_node_fs15 = require("node:fs");
142117
142558
  init_src();
142118
142559
  var import_yaml = __toESM(require_dist5());
142119
142560
  init_src();
@@ -142303,7 +142744,7 @@ async function resolveFlowKey(projectRoot, name) {
142303
142744
  }
142304
142745
  var keyResolutions = /* @__PURE__ */ new Map();
142305
142746
  async function classifyOnDiskSpelling(dir, base) {
142306
- const entries = await fs44.readdir(dir).catch(() => null);
142747
+ const entries = await fs45.readdir(dir).catch(() => null);
142307
142748
  if (entries === null || entries.includes(base)) return { state: "listed" };
142308
142749
  const actual = entries.find((entry) => entry.toLowerCase() === base.toLowerCase());
142309
142750
  if (actual === void 0) return { state: "absent" };
@@ -143603,8 +144044,8 @@ function scrubTempPath(err, tmpPath, filePath) {
143603
144044
  return scrubbed;
143604
144045
  }
143605
144046
  async function canonicalFlowTarget(filePath) {
143606
- const dir = await fs44.realpath(path32.dirname(filePath)).catch(() => path32.dirname(filePath));
143607
- const real = await fs44.realpath(filePath).catch(() => null);
144047
+ const dir = await fs45.realpath(path32.dirname(filePath)).catch(() => path32.dirname(filePath));
144048
+ const real = await fs45.realpath(filePath).catch(() => null);
143608
144049
  if (real !== null) return { dir, target: real };
143609
144050
  return { dir, target: await followDanglingLink(path32.join(dir, path32.basename(filePath))) };
143610
144051
  }
@@ -143615,25 +144056,25 @@ var MAX_DANGLING_LINK_HOPS = 32;
143615
144056
  async function followDanglingLink(linkPath) {
143616
144057
  let current = linkPath;
143617
144058
  for (let hop = 0; hop < MAX_DANGLING_LINK_HOPS; hop++) {
143618
- const target = await fs44.readlink(current).catch(() => null);
144059
+ const target = await fs45.readlink(current).catch(() => null);
143619
144060
  if (target === null) return current;
143620
144061
  const resolved = path32.resolve(path32.dirname(current), target);
143621
- const real = await fs44.realpath(resolved).catch(() => null);
144062
+ const real = await fs45.realpath(resolved).catch(() => null);
143622
144063
  if (real !== null) return real;
143623
- const targetDir = await fs44.realpath(path32.dirname(resolved)).catch(() => path32.dirname(resolved));
144064
+ const targetDir = await fs45.realpath(path32.dirname(resolved)).catch(() => path32.dirname(resolved));
143624
144065
  current = path32.join(targetDir, path32.basename(resolved));
143625
144066
  }
143626
144067
  return current;
143627
144068
  }
143628
144069
  async function isWritable(filePath) {
143629
- return fs44.access(filePath, import_node_fs14.constants.W_OK).then(
144070
+ return fs45.access(filePath, import_node_fs15.constants.W_OK).then(
143630
144071
  () => true,
143631
144072
  () => false
143632
144073
  );
143633
144074
  }
143634
144075
  async function writeFlowFile(filePath, content) {
143635
144076
  const { dir: resolvedDir, target } = await canonicalFlowTarget(filePath);
143636
- const previousMode = await fs44.stat(target).then(
144077
+ const previousMode = await fs45.stat(target).then(
143637
144078
  (s) => s.mode & 4095,
143638
144079
  () => null
143639
144080
  );
@@ -143653,11 +144094,11 @@ async function writeFlowFile(filePath, content) {
143653
144094
  `.argent-flow-${process.pid}-${++flowWriteSeq}.tmp`
143654
144095
  );
143655
144096
  try {
143656
- await fs44.writeFile(tmpPath, content, "utf8");
143657
- if (previousMode !== null) await fs44.chmod(tmpPath, previousMode);
143658
- await fs44.rename(tmpPath, target);
144097
+ await fs45.writeFile(tmpPath, content, "utf8");
144098
+ if (previousMode !== null) await fs45.chmod(tmpPath, previousMode);
144099
+ await fs45.rename(tmpPath, target);
143659
144100
  } catch (err) {
143660
- await fs44.rm(tmpPath, { force: true }).catch(() => {
144101
+ await fs45.rm(tmpPath, { force: true }).catch(() => {
143661
144102
  });
143662
144103
  const errno = err instanceof Error ? err : void 0;
143663
144104
  const code = typeof errno?.code === "string" ? errno.code : void 0;
@@ -143693,7 +144134,7 @@ function mkdirFailureHint(code, dir) {
143693
144134
  async function writeNewFlowFile(filePath, content) {
143694
144135
  const dir = path32.dirname(filePath);
143695
144136
  try {
143696
- await fs44.mkdir(dir, { recursive: true });
144137
+ await fs45.mkdir(dir, { recursive: true });
143697
144138
  } catch (err) {
143698
144139
  const code = err instanceof Error ? err.code : void 0;
143699
144140
  throw new FailureError(
@@ -143711,13 +144152,13 @@ async function writeNewFlowFile(filePath, content) {
143711
144152
  }
143712
144153
  async function countStepsOnDisk(filePath) {
143713
144154
  try {
143714
- return parseFlow(await fs44.readFile(filePath, "utf8")).steps.length;
144155
+ return parseFlow(await fs45.readFile(filePath, "utf8")).steps.length;
143715
144156
  } catch {
143716
144157
  return void 0;
143717
144158
  }
143718
144159
  }
143719
144160
  async function appendStep(filePath, step) {
143720
- const content = await fs44.readFile(filePath, "utf8");
144161
+ const content = await fs45.readFile(filePath, "utf8");
143721
144162
  const flow = parseFlow(content);
143722
144163
  flow.steps.push(step);
143723
144164
  validateFlow(flow);
@@ -143874,13 +144315,13 @@ write serializes it over your edit.`,
143874
144315
 
143875
144316
  // ../tool-server/src/tools/flows/flow-add-step.ts
143876
144317
  init_zod();
143877
- var fs46 = __toESM(require("node:fs/promises"));
144318
+ var fs47 = __toESM(require("node:fs/promises"));
143878
144319
  var path33 = __toESM(require("node:path"));
143879
144320
  init_src();
143880
144321
 
143881
144322
  // ../tool-server/src/tools/flows/flow-finish-recording.ts
143882
144323
  init_zod();
143883
- var fs45 = __toESM(require("node:fs/promises"));
144324
+ var fs46 = __toESM(require("node:fs/promises"));
143884
144325
  function selectorLabel(sel) {
143885
144326
  return JSON.stringify(selectorToYaml(sel));
143886
144327
  }
@@ -143925,7 +144366,7 @@ You can still edit the .yaml file directly afterwards to remove or reorder steps
143925
144366
  flowFile2 = serializeFlow(session.flow);
143926
144367
  savedTo2 = clientFileDirective(filePath2, flowFile2);
143927
144368
  } else {
143928
- flowFile2 = await fs45.readFile(filePath2, "utf8");
144369
+ flowFile2 = await fs46.readFile(filePath2, "utf8");
143929
144370
  savedTo2 = filePath2;
143930
144371
  }
143931
144372
  const flow2 = parseFlow(flowFile2);
@@ -144715,7 +145156,7 @@ async function captureRunTarget(session, args) {
144715
145156
  }
144716
145157
  try {
144717
145158
  assertSafeFlowName(name);
144718
- const realFlowPath = await fs46.realpath(session.filePath);
145159
+ const realFlowPath = await fs47.realpath(session.filePath);
144719
145160
  const flowsDir = path33.dirname(realFlowPath);
144720
145161
  const fragPath = path33.join(flowsDir, `${name}.yaml`);
144721
145162
  const projectRoot = args.project_root;
@@ -144731,10 +145172,10 @@ async function captureRunTarget(session, args) {
144731
145172
  warning: `kept the raw flow-execute step \u2014 no sibling is named "${name}.yaml" (this filesystem matched it case-insensitively to "${spelling.actual}"), so a run: ${name} step would name a flow no case-sensitive checkout can find \u2014 ${recovery}`
144732
145173
  };
144733
145174
  }
144734
- parseFlow(await fs46.readFile(fragPath, "utf8"));
145175
+ parseFlow(await fs47.readFile(fragPath, "utf8"));
144735
145176
  let executedPath;
144736
145177
  try {
144737
- executedPath = await fs46.realpath(path33.join(flowsDirFor(projectRoot), `${name}.yaml`));
145178
+ executedPath = await fs47.realpath(path33.join(flowsDirFor(projectRoot), `${name}.yaml`));
144738
145179
  } catch {
144739
145180
  executedPath = void 0;
144740
145181
  }
@@ -144743,7 +145184,7 @@ async function captureRunTarget(session, args) {
144743
145184
  warning: `kept the raw flow-execute step \u2014 could not verify which file the live flow-execute ran ("${name}" has no canonical file in project_root's flows dir to compare the sibling against)`
144744
145185
  };
144745
145186
  }
144746
- if (executedPath !== await fs46.realpath(fragPath)) {
145187
+ if (executedPath !== await fs47.realpath(fragPath)) {
144747
145188
  return {
144748
145189
  warning: `kept the raw flow-execute step \u2014 project_root "${projectRoot}" resolves "${name}" to "${executedPath}", not the recording's sibling "${fragPath}", so "${name}.yaml" beside the recording's real file is not the file the live flow-execute ran and a run: ${name} step would replay a different flow than the one that just ran`
144749
145190
  };
@@ -144863,7 +145304,7 @@ Returns { message, stepCount, savedTo }. Fails if that flow has no recording in
144863
145304
 
144864
145305
  // ../tool-server/src/tools/flows/flow-run.ts
144865
145306
  init_zod();
144866
- var fs50 = __toESM(require("node:fs/promises"));
145307
+ var fs51 = __toESM(require("node:fs/promises"));
144867
145308
  var path36 = __toESM(require("node:path"));
144868
145309
  init_src();
144869
145310
 
@@ -144941,7 +145382,7 @@ function nestedOrchestratorOutcome(tool, result) {
144941
145382
  }
144942
145383
 
144943
145384
  // ../tool-server/src/tools/flows/flow-pixels.ts
144944
- var fs47 = __toESM(require("node:fs/promises"));
145385
+ var fs48 = __toESM(require("node:fs/promises"));
144945
145386
  var import_pngjs2 = __toESM(require_png());
144946
145387
  init_adb();
144947
145388
  var CAPTURE_SCALE = 0.25;
@@ -145011,9 +145452,9 @@ async function capturePng(env, budgetMs) {
145011
145452
  if (env.device.platform === "chromium") return captureChromiumPng(env);
145012
145453
  const file2 = await captureFile(env, budgetMs);
145013
145454
  try {
145014
- return await fs47.readFile(file2);
145455
+ return await fs48.readFile(file2);
145015
145456
  } finally {
145016
- await fs47.rm(file2, { force: true }).catch(() => {
145457
+ await fs48.rm(file2, { force: true }).catch(() => {
145017
145458
  });
145018
145459
  }
145019
145460
  }
@@ -145829,7 +146270,7 @@ function assertReason(condition, selector, expectedText, textMatch, matches2) {
145829
146270
 
145830
146271
  // ../tool-server/src/tools/flows/flow-visual.ts
145831
146272
  var import_node_crypto8 = require("node:crypto");
145832
- var fs49 = __toESM(require("node:fs/promises"));
146273
+ var fs50 = __toESM(require("node:fs/promises"));
145833
146274
  var os12 = __toESM(require("node:os"));
145834
146275
  var path35 = __toESM(require("node:path"));
145835
146276
  var import_pngjs4 = __toESM(require_png());
@@ -147890,7 +148331,7 @@ function roundToOne(value) {
147890
148331
  // ../tool-server/src/tools/flows/flow-visual.ts
147891
148332
  var DEFAULT_MAX_MISMATCH = 0.5;
147892
148333
  async function pngDimensions(file2) {
147893
- const fh = await fs49.open(file2, "r");
148334
+ const fh = await fs50.open(file2, "r");
147894
148335
  try {
147895
148336
  const buf = Buffer.alloc(24);
147896
148337
  await fh.read(buf, 0, 24, 0);
@@ -147914,18 +148355,18 @@ function baselineDir(flowsDir, flowName) {
147914
148355
  async function cleanupDiffDir(dir, keep) {
147915
148356
  try {
147916
148357
  if (!keep) {
147917
- await fs49.rm(dir, { recursive: true, force: true });
148358
+ await fs50.rm(dir, { recursive: true, force: true });
147918
148359
  return;
147919
148360
  }
147920
- for (const entry of await fs49.readdir(dir)) {
148361
+ for (const entry of await fs50.readdir(dir)) {
147921
148362
  const entryPath = path35.join(dir, entry);
147922
- if (entryPath !== keep) await fs49.rm(entryPath, { recursive: true, force: true });
148363
+ if (entryPath !== keep) await fs50.rm(entryPath, { recursive: true, force: true });
147923
148364
  }
147924
148365
  } catch {
147925
148366
  }
147926
148367
  }
147927
148368
  async function cropPngFile(src, dest, frame) {
147928
- const png = import_pngjs4.PNG.sync.read(await fs49.readFile(src));
148369
+ const png = import_pngjs4.PNG.sync.read(await fs50.readFile(src));
147929
148370
  const left = Math.max(0, Math.round(frame.x * png.width));
147930
148371
  const top = Math.max(0, Math.round(frame.y * png.height));
147931
148372
  const right = Math.min(png.width, Math.round((frame.x + frame.width) * png.width));
@@ -147935,7 +148376,7 @@ async function cropPngFile(src, dest, frame) {
147935
148376
  if (w < 1 || h < 1) return null;
147936
148377
  const out = new import_pngjs4.PNG({ width: w, height: h });
147937
148378
  import_pngjs4.PNG.bitblt(png, out, left, top, w, h, 0, 0);
147938
- await fs49.writeFile(dest, import_pngjs4.PNG.sync.write(out));
148379
+ await fs50.writeFile(dest, import_pngjs4.PNG.sync.write(out));
147939
148380
  return { w, h };
147940
148381
  }
147941
148382
  async function runSnapshot(env, opts) {
@@ -147992,7 +148433,7 @@ async function runSnapshot(env, opts) {
147992
148433
  };
147993
148434
  try {
147994
148435
  if (cropFrame !== void 0) {
147995
- cropDir = await fs49.mkdtemp(path35.join(os12.tmpdir(), "argent-flow-crop-"));
148436
+ cropDir = await fs50.mkdtemp(path35.join(os12.tmpdir(), "argent-flow-crop-"));
147996
148437
  const croppedPath = path35.join(cropDir, key2);
147997
148438
  const cropped = await cropPngFile(shot.image.hostPath, croppedPath, cropFrame);
147998
148439
  if (cropped === null) {
@@ -148006,10 +148447,10 @@ async function runSnapshot(env, opts) {
148006
148447
  }
148007
148448
  currentPath = croppedPath;
148008
148449
  }
148009
- const exists2 = await fs49.access(baselinePath).then(() => true).catch(() => false);
148450
+ const exists2 = await fs50.access(baselinePath).then(() => true).catch(() => false);
148010
148451
  if (opts.updateBaselines) {
148011
- await fs49.mkdir(dir, { recursive: true });
148012
- await fs49.copyFile(currentPath, baselinePath);
148452
+ await fs50.mkdir(dir, { recursive: true });
148453
+ await fs50.copyFile(currentPath, baselinePath);
148013
148454
  const baseline = await store.register(baselinePath, { mimeType: "image/png" });
148014
148455
  return {
148015
148456
  status: "pass",
@@ -148026,7 +148467,7 @@ async function runSnapshot(env, opts) {
148026
148467
  artifacts: { current: await currentArtifact() }
148027
148468
  };
148028
148469
  }
148029
- const outputDir = await fs49.mkdtemp(path35.join(os12.tmpdir(), "argent-flow-diff-"));
148470
+ const outputDir = await fs50.mkdtemp(path35.join(os12.tmpdir(), "argent-flow-diff-"));
148030
148471
  let keepInOutputDir;
148031
148472
  try {
148032
148473
  const result = await diffPngFiles({
@@ -148577,7 +149018,7 @@ Pass exactly one flow source: name for a saved flow under project_root, or flow_
148577
149018
  );
148578
149019
  const canonicalPath = await canonicalFlowPath2(filePath);
148579
149020
  const flowsDir = path36.dirname(canonicalPath);
148580
- const flow = parseFlow(await fs50.readFile(canonicalPath, "utf8"));
149021
+ const flow = parseFlow(await fs51.readFile(canonicalPath, "utf8"));
148581
149022
  if (viaUpload) assertUploadSelfContained(flow);
148582
149023
  const rootEntry = { canonical: canonicalPath, display: flowName };
148583
149024
  if (flow.executionPrerequisite && !pinnedToChromium(params.device)) {
@@ -148727,7 +149168,7 @@ async function scanLeadingLaunch(flow, stack) {
148727
149168
  const supplied = path36.posix.basename(step.flow);
148728
149169
  const spelling = await classifyOnDiskSpelling(path36.dirname(spelled), supplied);
148729
149170
  if (spelling.state === "case_folded") return null;
148730
- nested = parseFlow(await fs50.readFile(canonical, "utf8"));
149171
+ nested = parseFlow(await fs51.readFile(canonical, "utf8"));
148731
149172
  } catch {
148732
149173
  return null;
148733
149174
  }
@@ -148754,7 +149195,7 @@ function launchTargetPlatform(launch, platform) {
148754
149195
  async function resolveAppPath(specPath, flowDir) {
148755
149196
  const lexical = path36.resolve(flowDir, specPath);
148756
149197
  try {
148757
- return await fs50.realpath(lexical);
149198
+ return await fs51.realpath(lexical);
148758
149199
  } catch {
148759
149200
  return lexical;
148760
149201
  }
@@ -149064,10 +149505,10 @@ async function execWhenStep(state3, step, scope) {
149064
149505
  }
149065
149506
  async function canonicalFlowPath2(p) {
149066
149507
  try {
149067
- return await fs50.realpath(p);
149508
+ return await fs51.realpath(p);
149068
149509
  } catch {
149069
149510
  try {
149070
- return path36.join(await fs50.realpath(path36.dirname(p)), path36.basename(p));
149511
+ return path36.join(await fs51.realpath(path36.dirname(p)), path36.basename(p));
149071
149512
  } catch {
149072
149513
  return p;
149073
149514
  }
@@ -149115,7 +149556,7 @@ async function execRunStep(state3, step, scope) {
149115
149556
  }
149116
149557
  let fragment;
149117
149558
  try {
149118
- fragment = parseFlow(await fs50.readFile(canonical, "utf8"));
149559
+ fragment = parseFlow(await fs51.readFile(canonical, "utf8"));
149119
149560
  } catch (err) {
149120
149561
  return fail(`could not load fragment "${target}": ${errMsg3(err)}`);
149121
149562
  }
@@ -149404,7 +149845,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
149404
149845
 
149405
149846
  // ../tool-server/src/tools/flows/flow-read-prerequisite.ts
149406
149847
  init_zod();
149407
- var fs51 = __toESM(require("node:fs/promises"));
149848
+ var fs52 = __toESM(require("node:fs/promises"));
149408
149849
  var zodSchema66 = external_exports.object({
149409
149850
  name: external_exports.string().optional().describe(
149410
149851
  'Name of a saved flow to inspect from `.argent/flows` (e.g. "settings-explore"). Omit when flow_path is set.'
@@ -149465,7 +149906,7 @@ Address the flow exactly as you will address it in flow-execute: name or flow_pa
149465
149906
  ctx?.fileInputs?.flow_file,
149466
149907
  ctx?.fileInputs?.flow_path
149467
149908
  );
149468
- const flow = parseFlow(await fs51.readFile(filePath, "utf8"));
149909
+ const flow = parseFlow(await fs52.readFile(filePath, "utf8"));
149469
149910
  return {
149470
149911
  flow: flowName,
149471
149912
  executionPrerequisite: flow.executionPrerequisite
@@ -149813,13 +150254,13 @@ Fails if the workspacePath is not an absolute path or the directory cannot be ac
149813
150254
 
149814
150255
  // ../tool-server/src/tools/system/update-argent.ts
149815
150256
  var import_node_child_process31 = require("node:child_process");
149816
- var fs52 = __toESM(require("node:fs"));
150257
+ var fs53 = __toESM(require("node:fs"));
149817
150258
  var path37 = __toESM(require("node:path"));
149818
150259
  init_zod();
149819
150260
  function resolveCliEntry() {
149820
150261
  try {
149821
150262
  const entry = path37.join(__dirname, "cli.js");
149822
- return fs52.existsSync(entry) ? entry : null;
150263
+ return fs53.existsSync(entry) ? entry : null;
149823
150264
  } catch {
149824
150265
  return null;
149825
150266
  }
@@ -149833,14 +150274,14 @@ function classifyRunningInstall() {
149833
150274
  }
149834
150275
  let runningRoot;
149835
150276
  try {
149836
- runningRoot = fs52.realpathSync(path37.dirname(__dirname));
150277
+ runningRoot = fs53.realpathSync(path37.dirname(__dirname));
149837
150278
  } catch {
149838
150279
  return { kind: "global", projectRoot: null };
149839
150280
  }
149840
150281
  let dir = process.cwd();
149841
150282
  while (true) {
149842
150283
  try {
149843
- const nmReal = fs52.realpathSync(path37.join(dir, "node_modules"));
150284
+ const nmReal = fs53.realpathSync(path37.join(dir, "node_modules"));
149844
150285
  if (runningRoot === nmReal || runningRoot.startsWith(nmReal + path37.sep)) {
149845
150286
  return { kind: "local", projectRoot: dir };
149846
150287
  }
@@ -149855,14 +150296,14 @@ function classifyRunningInstall() {
149855
150296
  function findDeclaringProjectRoot(startDir) {
149856
150297
  let dir;
149857
150298
  try {
149858
- dir = fs52.realpathSync(startDir);
150299
+ dir = fs53.realpathSync(startDir);
149859
150300
  } catch {
149860
150301
  return null;
149861
150302
  }
149862
150303
  while (true) {
149863
- if (fs52.existsSync(path37.join(dir, ".argent", "install.json"))) return dir;
150304
+ if (fs53.existsSync(path37.join(dir, ".argent", "install.json"))) return dir;
149864
150305
  try {
149865
- const manifest = JSON.parse(fs52.readFileSync(path37.join(dir, "package.json"), "utf8"));
150306
+ const manifest = JSON.parse(fs53.readFileSync(path37.join(dir, "package.json"), "utf8"));
149866
150307
  if (manifest.devDependencies?.[PACKAGE_NAME2] || manifest.dependencies?.[PACKAGE_NAME2] || manifest.optionalDependencies?.[PACKAGE_NAME2]) {
149867
150308
  return dir;
149868
150309
  }
@@ -149901,7 +150342,7 @@ var updateArgentTool = {
149901
150342
  let projectRoot = null;
149902
150343
  let effectiveTarget = resolved;
149903
150344
  if (resolved === "local" || resolved === "both") {
149904
- const recordedRoot = running.projectRoot && fs52.existsSync(running.projectRoot) ? running.projectRoot : null;
150345
+ const recordedRoot = running.projectRoot && fs53.existsSync(running.projectRoot) ? running.projectRoot : null;
149905
150346
  projectRoot = recordedRoot ?? (running.kind === "local" ? findDeclaringProjectRoot(process.cwd()) : null);
149906
150347
  if (!projectRoot) {
149907
150348
  if (resolved === "local") {
@@ -149943,7 +150384,7 @@ var updateArgentTool = {
149943
150384
  if (targetsOnlyRunningInstall && installableVersion) {
149944
150385
  updateArgs.push("--version", installableVersion);
149945
150386
  }
149946
- const spawnRoot = projectRoot ?? (running.projectRoot && fs52.existsSync(running.projectRoot) ? running.projectRoot : null);
150387
+ const spawnRoot = projectRoot ?? (running.projectRoot && fs53.existsSync(running.projectRoot) ? running.projectRoot : null);
149947
150388
  if (spawnRoot) updateArgs.push("--project-root", spawnRoot);
149948
150389
  const cmd = cliEntry ? process.execPath : "argent";
149949
150390
  const args = cliEntry ? [cliEntry, ...updateArgs] : updateArgs;
@@ -150020,7 +150461,7 @@ var zodSchema70 = external_exports.object({
150020
150461
  "Directory where diff artifacts should be written. Optional \u2014 defaults to a temp directory; the diff images are returned in the result either way."
150021
150462
  )
150022
150463
  }).strict();
150023
- var capability29 = {
150464
+ var capability30 = {
150024
150465
  apple: { simulator: true, device: true },
150025
150466
  android: { emulator: true, device: true, unknown: true }
150026
150467
  };
@@ -150045,7 +150486,7 @@ Ignores the fixed top status-bar band for both pixel and OCR text comparisons.
150045
150486
  Fails if the input sources are invalid, PNG files cannot be read, outputDir cannot be written, or the simulator-server / emulator backend is not reachable.`,
150046
150487
  searchHint: "compare screenshots png diff visual UI changes UI regression visual regression screenshot diff changed regions text ocr live capture",
150047
150488
  zodSchema: zodSchema70,
150048
- capability: capability29,
150489
+ capability: capability30,
150049
150490
  fileInputs: fileInputs6,
150050
150491
  services: (params) => {
150051
150492
  if (params.captureBaseline || params.captureCurrent) {
@@ -150057,14 +150498,29 @@ Fails if the input sources are invalid, PNG files cannot be read, outputDir cann
150057
150498
  return executeScreenshotDiffTool(services, params, options);
150058
150499
  }
150059
150500
  };
150060
- async function executeScreenshotDiffTool(services, params, options, captureScreenshot2 = httpScreenshot) {
150501
+ function createScreenshotDiffTool(registry2) {
150502
+ return {
150503
+ ...screenshotDiffTool,
150504
+ async execute(services, params, options) {
150505
+ return executeScreenshotDiffTool(
150506
+ services,
150507
+ params,
150508
+ options,
150509
+ httpScreenshot,
150510
+ (device) => androidDevtoolsRotationPeek(registry2, device)
150511
+ );
150512
+ }
150513
+ };
150514
+ }
150515
+ async function executeScreenshotDiffTool(services, params, options, captureScreenshot2 = httpScreenshot, peekFor) {
150061
150516
  const outputDir = await resolveOutputDir(params, options);
150062
150517
  const { baselinePath, currentPath } = await resolveInputPaths(
150063
150518
  services,
150064
150519
  params,
150065
150520
  outputDir,
150066
150521
  options,
150067
- captureScreenshot2
150522
+ captureScreenshot2,
150523
+ peekFor
150068
150524
  );
150069
150525
  const result = await diffPngFiles({
150070
150526
  baselinePath,
@@ -150103,10 +150559,12 @@ async function resolveOutputDir(params, options) {
150103
150559
  await import_promises13.default.mkdir(dir, { recursive: true });
150104
150560
  return dir;
150105
150561
  }
150106
- async function resolveInputPaths(services, params, outputDir, options, captureScreenshot2) {
150562
+ async function resolveInputPaths(services, params, outputDir, options, captureScreenshot2, peekFor) {
150107
150563
  validateInputSources(params);
150108
150564
  const baselinePath = params.captureBaseline ? await captureLiveInput({
150109
150565
  api: requireSimulatorServer(services),
150566
+ device: resolveDevice(params.udid),
150567
+ peekFor,
150110
150568
  outputDir,
150111
150569
  name: "baseline",
150112
150570
  rotation: params.rotation,
@@ -150115,6 +150573,8 @@ async function resolveInputPaths(services, params, outputDir, options, captureSc
150115
150573
  }) : params.baselinePath;
150116
150574
  const currentPath = params.captureCurrent ? await captureLiveInput({
150117
150575
  api: requireSimulatorServer(services),
150576
+ device: resolveDevice(params.udid),
150577
+ peekFor,
150118
150578
  outputDir,
150119
150579
  name: "current",
150120
150580
  rotation: params.rotation,
@@ -150171,9 +150631,25 @@ function requireSimulatorServer(services) {
150171
150631
  async function captureLiveInput(params) {
150172
150632
  let capture;
150173
150633
  try {
150174
- capture = await params.captureScreenshot(params.api, params.rotation, params.signal, 1);
150634
+ capture = await captureScreenshotUpright(
150635
+ params.api,
150636
+ params.device,
150637
+ params.rotation,
150638
+ params.signal,
150639
+ 1,
150640
+ params.captureScreenshot,
150641
+ params.peekFor?.(params.device)
150642
+ );
150175
150643
  } catch {
150176
- capture = await params.captureScreenshot(params.api, params.rotation, params.signal);
150644
+ capture = await captureScreenshotUpright(
150645
+ params.api,
150646
+ params.device,
150647
+ params.rotation,
150648
+ params.signal,
150649
+ void 0,
150650
+ params.captureScreenshot,
150651
+ params.peekFor?.(params.device)
150652
+ );
150177
150653
  }
150178
150654
  const suffix = import_node_crypto9.default.randomBytes(4).toString("hex");
150179
150655
  const destination = import_path8.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
@@ -150444,7 +150920,7 @@ var tabAction = {
150444
150920
  failure: "close"
150445
150921
  }
150446
150922
  };
150447
- var capability30 = {
150923
+ var capability31 = {
150448
150924
  chromium: { app: true }
150449
150925
  };
150450
150926
  var chromiumTabsTool = {
@@ -150463,7 +150939,7 @@ Use when an app exposes multiple windows or tabs and you need to inspect or driv
150463
150939
  Returns { tabs: [{ tabId, targetId, title, url, active, label? }] }. Fails if the device is not a Chromium (CDP) device, or the requested tabId/label no longer matches a live tab. Chromium-only.`,
150464
150940
  searchHint: "tab tabs window windows switch select close new open multi-tab chromium electron",
150465
150941
  zodSchema: zodSchema73,
150466
- capability: capability30,
150942
+ capability: capability31,
150467
150943
  services: (params) => {
150468
150944
  const device = resolveDevice(params.udid);
150469
150945
  if (device.platform === "chromium") {
@@ -150586,7 +151062,7 @@ var cookieAction = {
150586
151062
  delete: { started: "Deleting", completed: "Deleted", failure: "delete" },
150587
151063
  clear: { started: "Clearing", completed: "Cleared", failure: "clear" }
150588
151064
  };
150589
- var capability31 = {
151065
+ var capability32 = {
150590
151066
  chromium: { app: true }
150591
151067
  };
150592
151068
  var chromiumCookiesTool = {
@@ -150605,7 +151081,7 @@ Use when seeding an authenticated session before a flow (set the session cookie,
150605
151081
  Returns { cookies, count } for get, or a small status object ({ set } / { deleted } / { cleared }) otherwise. Fails if the device is not a Chromium (CDP) device, or set is missing name/value. Chromium-only.`,
150606
151082
  searchHint: "cookies cookie get set delete clear httponly samesite session auth chromium",
150607
151083
  zodSchema: zodSchema74,
150608
- capability: capability31,
151084
+ capability: capability32,
150609
151085
  services: (params) => {
150610
151086
  const device = resolveDevice(params.udid);
150611
151087
  if (device.platform === "chromium") {
@@ -150684,7 +151160,7 @@ var storageAction = {
150684
151160
  remove: { started: "Removing from", completed: "Removed from", failure: "remove from" },
150685
151161
  clear: { started: "Clearing", completed: "Cleared", failure: "clear" }
150686
151162
  };
150687
- var capability32 = {
151163
+ var capability33 = {
150688
151164
  chromium: { app: true }
150689
151165
  };
150690
151166
  var chromiumStorageTool = {
@@ -150704,7 +151180,7 @@ Use when seeding feature flags / auth tokens before a flow or asserting persiste
150704
151180
  Returns { value } for a single key, { entries, count } for all, or a status object ({ set } / { removed } / { cleared }) otherwise. Fails if the device is not a Chromium (CDP) device, or set is missing key/value. Chromium-only.`,
150705
151181
  searchHint: "storage localstorage sessionstorage local session get set remove clear key value chromium",
150706
151182
  zodSchema: zodSchema75,
150707
- capability: capability32,
151183
+ capability: capability33,
150708
151184
  services: (params) => {
150709
151185
  const device = resolveDevice(params.udid);
150710
151186
  if (device.platform === "chromium") {
@@ -150777,7 +151253,7 @@ function createRegistry() {
150777
151253
  registry2.registerTool(settingsPermissionsTool);
150778
151254
  registry2.registerTool(openUrlTool);
150779
151255
  registry2.registerTool(createScreenshotTool(registry2));
150780
- registry2.registerTool(screenshotDiffTool);
151256
+ registry2.registerTool(createScreenshotDiffTool(registry2));
150781
151257
  registry2.registerTool(createScreenRecordingStartTool(registry2));
150782
151258
  registry2.registerTool(screenRecordingStopTool);
150783
151259
  registry2.registerTool(gestureTapTool);
@@ -150792,6 +151268,7 @@ function createRegistry() {
150792
151268
  registry2.registerTool(gestureRotateTool);
150793
151269
  registry2.registerTool(buttonTool);
150794
151270
  registry2.registerTool(createKeyboardTool(registry2));
151271
+ registry2.registerTool(createPasteTool(registry2));
150795
151272
  registry2.registerTool(rotateTool);
150796
151273
  registry2.registerTool(shakeTool);
150797
151274
  registry2.registerTool(createTvRemoteTool(registry2));
@@ -150872,7 +151349,7 @@ function probeArgentToolServer(host, port, timeoutMs = 500) {
150872
151349
  }
150873
151350
 
150874
151351
  // ../tool-server/src/utils/simulator-watcher.ts
150875
- var fs54 = __toESM(require("node:fs"));
151352
+ var fs55 = __toESM(require("node:fs"));
150876
151353
  var import_node_child_process32 = require("node:child_process");
150877
151354
  var import_node_util22 = require("node:util");
150878
151355
  var execFileAsync24 = (0, import_node_util22.promisify)(import_node_child_process32.execFile);
@@ -150899,7 +151376,7 @@ async function getBootedUdidsInSet(deviceSet) {
150899
151376
  async function getBootedUdids() {
150900
151377
  const sets = [
150901
151378
  null,
150902
- ...configuredAdditionalDeviceSets().filter((p) => fs54.existsSync(p))
151379
+ ...configuredAdditionalDeviceSets().filter((p) => fs55.existsSync(p))
150903
151380
  ];
150904
151381
  const perSet = await Promise.all(sets.map(getBootedUdidsInSet));
150905
151382
  return new Set(perSet.flatMap((s) => [...s]));
@@ -150952,7 +151429,7 @@ function startSimulatorWatcher(registry2) {
150952
151429
 
150953
151430
  // ../tool-server/src/utils/preview-window.ts
150954
151431
  var import_node_child_process33 = require("node:child_process");
150955
- var fs55 = __toESM(require("node:fs"));
151432
+ var fs56 = __toESM(require("node:fs"));
150956
151433
  var os14 = __toESM(require("node:os"));
150957
151434
  var path39 = __toESM(require("node:path"));
150958
151435
  function ensureLensAppBundle(electronBin) {
@@ -150969,18 +151446,18 @@ function ensureLensAppBundle(electronBin) {
150969
151446
  );
150970
151447
  const wrapperExec = path39.join(wrapperContents, "MacOS", "Electron");
150971
151448
  try {
150972
- if (fs55.realpathSync(wrapperExec) === fs55.realpathSync(electronBin)) return wrapperExec;
151449
+ if (fs56.realpathSync(wrapperExec) === fs56.realpathSync(electronBin)) return wrapperExec;
150973
151450
  } catch {
150974
151451
  }
150975
- fs55.rmSync(path39.dirname(wrapperContents), { recursive: true, force: true });
150976
- fs55.mkdirSync(path39.join(wrapperContents, "MacOS"), { recursive: true });
150977
- fs55.symlinkSync(path39.join(realContents, "Frameworks"), path39.join(wrapperContents, "Frameworks"));
150978
- fs55.symlinkSync(path39.join(realContents, "Resources"), path39.join(wrapperContents, "Resources"));
150979
- fs55.symlinkSync(electronBin, wrapperExec);
151452
+ fs56.rmSync(path39.dirname(wrapperContents), { recursive: true, force: true });
151453
+ fs56.mkdirSync(path39.join(wrapperContents, "MacOS"), { recursive: true });
151454
+ fs56.symlinkSync(path39.join(realContents, "Frameworks"), path39.join(wrapperContents, "Frameworks"));
151455
+ fs56.symlinkSync(path39.join(realContents, "Resources"), path39.join(wrapperContents, "Resources"));
151456
+ fs56.symlinkSync(electronBin, wrapperExec);
150980
151457
  const pkgInfo = path39.join(realContents, "PkgInfo");
150981
- if (fs55.existsSync(pkgInfo)) fs55.copyFileSync(pkgInfo, path39.join(wrapperContents, "PkgInfo"));
151458
+ if (fs56.existsSync(pkgInfo)) fs56.copyFileSync(pkgInfo, path39.join(wrapperContents, "PkgInfo"));
150982
151459
  const plist = path39.join(wrapperContents, "Info.plist");
150983
- fs55.copyFileSync(path39.join(realContents, "Info.plist"), plist);
151460
+ fs56.copyFileSync(path39.join(realContents, "Info.plist"), plist);
150984
151461
  const setPlist = (entry, value) => {
150985
151462
  try {
150986
151463
  (0, import_node_child_process33.execFileSync)("/usr/libexec/PlistBuddy", ["-c", `Set :${entry} ${value}`, plist]);
@@ -151022,7 +151499,7 @@ function createPreviewWindowManager(opts = {}) {
151022
151499
  const resolveMainScript = () => {
151023
151500
  if (opts.mainScript) return opts.mainScript;
151024
151501
  const bundled = path39.join(__dirname, "preview-window", "main.cjs");
151025
- if (fs55.existsSync(bundled)) return bundled;
151502
+ if (fs56.existsSync(bundled)) return bundled;
151026
151503
  return require.resolve("@argent/preview-window/dist/main.js");
151027
151504
  };
151028
151505
  const isAlive = (c) => c !== null && c.exitCode === null && !c.killed;