@swmansion/argent 0.18.1-next.16 → 0.18.1-next.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tool-server.cjs +207 -127
  2. package/package.json +1 -1
@@ -4746,8 +4746,8 @@ var init_az = __esm({
4746
4746
  });
4747
4747
 
4748
4748
  // ../../node_modules/zod/v4/locales/be.js
4749
- function getBelarusianPlural(count, one, few, many) {
4750
- const absCount = Math.abs(count);
4749
+ function getBelarusianPlural(count2, one, few, many) {
4750
+ const absCount = Math.abs(count2);
4751
4751
  const lastDigit = absCount % 10;
4752
4752
  const lastTwoDigits = absCount % 100;
4753
4753
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -6927,8 +6927,8 @@ var init_hu = __esm({
6927
6927
  });
6928
6928
 
6929
6929
  // ../../node_modules/zod/v4/locales/hy.js
6930
- function getArmenianPlural(count, one, many) {
6931
- return Math.abs(count) === 1 ? one : many;
6930
+ function getArmenianPlural(count2, one, many) {
6931
+ return Math.abs(count2) === 1 ? one : many;
6932
6932
  }
6933
6933
  function withDefiniteArticle(word) {
6934
6934
  if (!word)
@@ -9169,8 +9169,8 @@ var init_ro = __esm({
9169
9169
  });
9170
9170
 
9171
9171
  // ../../node_modules/zod/v4/locales/ru.js
9172
- function getRussianPlural(count, one, few, many) {
9173
- const absCount = Math.abs(count);
9172
+ function getRussianPlural(count2, one, few, many) {
9173
+ const absCount = Math.abs(count2);
9174
9174
  const lastDigit = absCount % 10;
9175
9175
  const lastTwoDigits = absCount % 100;
9176
9176
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -16840,8 +16840,8 @@ var require_depd = __commonJS({
16840
16840
  return deprecate;
16841
16841
  }
16842
16842
  function eehaslisteners(emitter, type) {
16843
- var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type);
16844
- return count > 0;
16843
+ var count2 = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type);
16844
+ return count2 > 0;
16845
16845
  }
16846
16846
  function isignored(namespace) {
16847
16847
  if (process.noDeprecation) {
@@ -34606,14 +34606,14 @@ var require_urlencoded = __commonJS({
34606
34606
  };
34607
34607
  }
34608
34608
  function parameterCount(body, limit) {
34609
- let count = 0;
34609
+ let count2 = 0;
34610
34610
  let index = -1;
34611
34611
  do {
34612
- count++;
34613
- if (count > limit) return void 0;
34612
+ count2++;
34613
+ if (count2 > limit) return void 0;
34614
34614
  index = body.indexOf("&", index + 1);
34615
34615
  } while (index !== -1);
34616
- return count;
34616
+ return count2;
34617
34617
  }
34618
34618
  }
34619
34619
  });
@@ -47419,13 +47419,13 @@ var require_mediaType = __commonJS({
47419
47419
  return spec.q > 0;
47420
47420
  }
47421
47421
  function quoteCount(string4) {
47422
- var count = 0;
47422
+ var count2 = 0;
47423
47423
  var index = 0;
47424
47424
  while ((index = string4.indexOf('"', index)) !== -1) {
47425
- count++;
47425
+ count2++;
47426
47426
  index++;
47427
47427
  }
47428
- return count;
47428
+ return count2;
47429
47429
  }
47430
47430
  function splitKeyValuePair(str) {
47431
47431
  var index = str.indexOf("=");
@@ -67740,8 +67740,8 @@ var require_send = __commonJS({
67740
67740
  }
67741
67741
  }
67742
67742
  function hasListeners(emitter, type) {
67743
- var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type);
67744
- return count > 0;
67743
+ var count2 = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type);
67744
+ return count2 > 0;
67745
67745
  }
67746
67746
  function normalizeList(val, name) {
67747
67747
  var list = [].concat(val || []);
@@ -71526,8 +71526,8 @@ async function encode4(w, namespace) {
71526
71526
  }
71527
71527
  async function decode4(r) {
71528
71528
  const parts = [];
71529
- const count = await r.u53();
71530
- for (let i = 0; i < count; i++) {
71529
+ const count2 = await r.u53();
71530
+ for (let i = 0; i < count2; i++) {
71531
71531
  parts.push(await r.string());
71532
71532
  }
71533
71533
  return from(...parts);
@@ -71709,9 +71709,9 @@ var init_parameters = __esm({
71709
71709
  }
71710
71710
  }
71711
71711
  } else {
71712
- const count = await r.u53();
71712
+ const count2 = await r.u53();
71713
71713
  let prevType = 0n;
71714
- for (let i = 0; i < count; i++) {
71714
+ for (let i = 0; i < count2; i++) {
71715
71715
  let id;
71716
71716
  if (version4 === Version.DRAFT_16) {
71717
71717
  const delta = await r.u62();
@@ -71864,10 +71864,10 @@ var init_parameters = __esm({
71864
71864
  }
71865
71865
  }
71866
71866
  static async decode(r, version4) {
71867
- const count = await r.u53();
71867
+ const count2 = await r.u53();
71868
71868
  const params = new _Parameters();
71869
71869
  let prevType = 0n;
71870
- for (let i = 0; i < count; i++) {
71870
+ for (let i = 0; i < count2; i++) {
71871
71871
  let id;
71872
71872
  if (version4 === Version.DRAFT_14 || version4 === Version.DRAFT_15) {
71873
71873
  id = await r.u62();
@@ -89110,19 +89110,19 @@ var require_chunkstream = __commonJS({
89110
89110
  ChunkStream.prototype._processRead = function(read) {
89111
89111
  this._reads.shift();
89112
89112
  let pos = 0;
89113
- let count = 0;
89113
+ let count2 = 0;
89114
89114
  let data = Buffer.alloc(read.length);
89115
89115
  while (pos < read.length) {
89116
- let buf = this._buffers[count++];
89116
+ let buf = this._buffers[count2++];
89117
89117
  let len = Math.min(buf.length, read.length - pos);
89118
89118
  buf.copy(data, pos, 0, len);
89119
89119
  pos += len;
89120
89120
  if (len !== buf.length) {
89121
- this._buffers[--count] = buf.slice(len);
89121
+ this._buffers[--count2] = buf.slice(len);
89122
89122
  }
89123
89123
  }
89124
- if (count > 0) {
89125
- this._buffers.splice(0, count);
89124
+ if (count2 > 0) {
89125
+ this._buffers.splice(0, count2);
89126
89126
  }
89127
89127
  this._buffered -= read.length;
89128
89128
  read.func.call(this, data);
@@ -89854,12 +89854,12 @@ var require_bitmapper = __commonJS({
89854
89854
  }
89855
89855
  }
89856
89856
  return {
89857
- get: function(count) {
89858
- while (leftOver.length < count) {
89857
+ get: function(count2) {
89858
+ while (leftOver.length < count2) {
89859
89859
  split();
89860
89860
  }
89861
- let returner = leftOver.slice(0, count);
89862
- leftOver = leftOver.slice(count);
89861
+ let returner = leftOver.slice(0, count2);
89862
+ leftOver = leftOver.slice(count2);
89863
89863
  return returner;
89864
89864
  },
89865
89865
  resetAfterLine: function() {
@@ -91667,8 +91667,8 @@ var require_Node = __commonJS({
91667
91667
  };
91668
91668
  const res = toJS.toJS(this, "", ctx);
91669
91669
  if (typeof onAnchor === "function")
91670
- for (const { count, res: res2 } of ctx.anchors.values())
91671
- onAnchor(res2, count);
91670
+ for (const { count: count2, res: res2 } of ctx.anchors.values())
91671
+ onAnchor(res2, count2);
91672
91672
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
91673
91673
  }
91674
91674
  };
@@ -91774,13 +91774,13 @@ var require_Alias = __commonJS({
91774
91774
  const anchor = anchors2 && source && anchors2.get(source);
91775
91775
  return anchor ? anchor.count * anchor.aliasCount : 0;
91776
91776
  } else if (identity.isCollection(node)) {
91777
- let count = 0;
91777
+ let count2 = 0;
91778
91778
  for (const item of node.items) {
91779
91779
  const c = getAliasCount(doc, item, anchors2);
91780
- if (c > count)
91781
- count = c;
91780
+ if (c > count2)
91781
+ count2 = c;
91782
91782
  }
91783
- return count;
91783
+ return count2;
91784
91784
  } else if (identity.isPair(node)) {
91785
91785
  const kc = getAliasCount(doc, node.key, anchors2);
91786
91786
  const vc = getAliasCount(doc, node.value, anchors2);
@@ -94733,8 +94733,8 @@ var require_Document = __commonJS({
94733
94733
  };
94734
94734
  const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
94735
94735
  if (typeof onAnchor === "function")
94736
- for (const { count, res: res2 } of ctx.anchors.values())
94737
- onAnchor(res2, count);
94736
+ for (const { count: count2, res: res2 } of ctx.anchors.values())
94737
+ onAnchor(res2, count2);
94738
94738
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
94739
94739
  }
94740
94740
  /**
@@ -94811,12 +94811,12 @@ var require_errors = __commonJS({
94811
94811
  lineStr = prev + lineStr;
94812
94812
  }
94813
94813
  if (/[^ ]/.test(lineStr)) {
94814
- let count = 1;
94814
+ let count2 = 1;
94815
94815
  const end = error52.linePos[1];
94816
94816
  if (end?.line === line && end.col > col) {
94817
- count = Math.max(1, Math.min(end.col - col, 80 - ci));
94817
+ count2 = Math.max(1, Math.min(end.col - col, 80 - ci));
94818
94818
  }
94819
- const pointer = " ".repeat(ci) + "^".repeat(count);
94819
+ const pointer = " ".repeat(ci) + "^".repeat(count2);
94820
94820
  error52.message += `:
94821
94821
 
94822
94822
  ${lineStr}
@@ -102890,8 +102890,8 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
102890
102890
  onError: (err) => {
102891
102891
  this._events.emit("error", err);
102892
102892
  },
102893
- onLoad: (count) => {
102894
- this._events.emit("localEvaluationFlagsLoaded", count);
102893
+ onLoad: (count2) => {
102894
+ this._events.emit("localEvaluationFlagsLoaded", count2);
102895
102895
  },
102896
102896
  customHeaders: this.getCustomHeaders(),
102897
102897
  cacheProvider: normalizedOptions.flagDefinitionCacheProvider,
@@ -103086,10 +103086,10 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
103086
103086
  cleanup();
103087
103087
  resolve8(false);
103088
103088
  }, timeoutMs);
103089
- const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
103089
+ const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
103090
103090
  clearTimeout(timeout);
103091
103091
  cleanup();
103092
- resolve8(count > 0);
103092
+ resolve8(count2 > 0);
103093
103093
  });
103094
103094
  });
103095
103095
  }
@@ -110842,19 +110842,19 @@ var Announce = class _Announce {
110842
110842
  case Version2.DRAFT_02:
110843
110843
  break;
110844
110844
  case Version2.DRAFT_03: {
110845
- const count = await r.u53();
110846
- if (count > MAX_HOPS)
110847
- throw new Error(`hop count ${count} exceeds maximum ${MAX_HOPS}`);
110845
+ const count2 = await r.u53();
110846
+ if (count2 > MAX_HOPS)
110847
+ throw new Error(`hop count ${count2} exceeds maximum ${MAX_HOPS}`);
110848
110848
  const placeholder = OriginSchema.parse(0n);
110849
- hops = new Array(count).fill(placeholder);
110849
+ hops = new Array(count2).fill(placeholder);
110850
110850
  break;
110851
110851
  }
110852
110852
  default: {
110853
- const count = await r.u53();
110854
- if (count > MAX_HOPS)
110855
- throw new Error(`hop count ${count} exceeds maximum ${MAX_HOPS}`);
110853
+ const count2 = await r.u53();
110854
+ if (count2 > MAX_HOPS)
110855
+ throw new Error(`hop count ${count2} exceeds maximum ${MAX_HOPS}`);
110856
110856
  hops = [];
110857
- for (let i = 0; i < count; i++) {
110857
+ for (let i = 0; i < count2; i++) {
110858
110858
  hops.push(OriginSchema.parse(await r.u62()));
110859
110859
  }
110860
110860
  break;
@@ -110935,9 +110935,9 @@ var AnnounceInit = class _AnnounceInit {
110935
110935
  }
110936
110936
  }
110937
110937
  static async #decode(r) {
110938
- const count = await r.u53();
110938
+ const count2 = await r.u53();
110939
110939
  const suffixes = [];
110940
- for (let i = 0; i < count; i++) {
110940
+ for (let i = 0; i < count2; i++) {
110941
110941
  suffixes.push(from(await r.string()));
110942
110942
  }
110943
110943
  return new _AnnounceInit(suffixes);
@@ -122232,8 +122232,8 @@ var nativeFindViewsTool = {
122232
122232
  interaction: {
122233
122233
  startedMsg: ({ params }) => `Searching native views in ${params.bundleId}`,
122234
122234
  completedMsg: ({ params, result }) => {
122235
- const count = result.status === "ok" ? result.matches.length : 0;
122236
- return `Found ${count} native ${count === 1 ? "view" : "views"} in ${params.bundleId}`;
122235
+ const count2 = result.status === "ok" ? result.matches.length : 0;
122236
+ return `Found ${count2} native ${count2 === 1 ? "view" : "views"} in ${params.bundleId}`;
122237
122237
  },
122238
122238
  failedMsg: ({ params, failureSignal: failureSignal2 }) => `Failed to search native views in ${params.bundleId}: ${failureSignal2.error_code}`
122239
122239
  },
@@ -126858,8 +126858,8 @@ var zodSchema16 = external_exports.object({
126858
126858
  )
126859
126859
  });
126860
126860
  function tapDescription(params, tense) {
126861
- const count = params.clickCount ?? 1;
126862
- const action = count === 1 ? tense === "present" ? "Tapping" : "Tapped" : count === 2 ? tense === "present" ? "Double-tapping" : "Double-tapped" : `${tense === "present" ? "Tapping" : "Tapped"} ${count} times`;
126861
+ const count2 = params.clickCount ?? 1;
126862
+ const action = count2 === 1 ? tense === "present" ? "Tapping" : "Tapped" : count2 === 2 ? tense === "present" ? "Double-tapping" : "Double-tapped" : `${tense === "present" ? "Tapping" : "Tapped"} ${count2} times`;
126863
126863
  return `${action} at (${Math.round(params.x * 100)}%, ${Math.round(params.y * 100)}%)`;
126864
126864
  }
126865
126865
  var capability8 = {
@@ -129235,9 +129235,9 @@ function validateAmpersand(xmlData, i) {
129235
129235
  i++;
129236
129236
  return validateNumberAmpersand(xmlData, i);
129237
129237
  }
129238
- let count = 0;
129239
- for (; i < xmlData.length; i++, count++) {
129240
- if (xmlData[i].match(/\w/) && count < 20)
129238
+ let count2 = 0;
129239
+ for (; i < xmlData.length; i++, count2++) {
129240
+ if (xmlData[i].match(/\w/) && count2 < 20)
129241
129241
  continue;
129242
129242
  if (xmlData[i] === ";")
129243
129243
  break;
@@ -132122,8 +132122,8 @@ var Matcher = class {
132122
132122
  const siblingKey = namespace ? `${namespace}:${tagName}` : tagName;
132123
132123
  const counter = siblings.get(siblingKey) || 0;
132124
132124
  let position = 0;
132125
- for (const count of siblings.values()) {
132126
- position += count;
132125
+ for (const count2 of siblings.values()) {
132126
+ position += count2;
132127
132127
  }
132128
132128
  siblings.set(siblingKey, counter + 1);
132129
132129
  const node = {
@@ -134341,16 +134341,16 @@ function fullConsumptionRegex(selector) {
134341
134341
  return selector.textMatches === void 0 ? void 0 : uiTreeMatchInternals.createRegExp(`^(?:${selector.textMatches})$`);
134342
134342
  }
134343
134343
  function exactFieldCount(node, selector, fullTextRegex) {
134344
- let count = 0;
134344
+ let count2 = 0;
134345
134345
  if (selector.text !== void 0 && (equalsCI(node.label, selector.text) || equalsCI(node.value, selector.text))) {
134346
- count++;
134346
+ count2++;
134347
134347
  }
134348
134348
  if (fullTextRegex !== void 0 && (regexMatchesNonEmpty(fullTextRegex, node.label) || regexMatchesNonEmpty(fullTextRegex, node.value))) {
134349
- count++;
134349
+ count2++;
134350
134350
  }
134351
- if (selector.identifier !== void 0 && equalsCI(node.identifier, selector.identifier)) count++;
134352
- if (selector.role !== void 0 && equalsCI(node.role, selector.role)) count++;
134353
- return count;
134351
+ if (selector.identifier !== void 0 && equalsCI(node.identifier, selector.identifier)) count2++;
134352
+ if (selector.role !== void 0 && equalsCI(node.role, selector.role)) count2++;
134353
+ return count2;
134354
134354
  }
134355
134355
  function selectorToFrame(root2, selector) {
134356
134356
  const visible = findAll(root2, selector).filter(isVisible);
@@ -135718,13 +135718,13 @@ function buildTextTree(data, opts) {
135718
135718
  }
135719
135719
  if (data.skippedCounts && Object.keys(data.skippedCounts).length > 0) {
135720
135720
  const jsTotal = Object.values(data.skippedCounts).reduce((a, b) => a + b, 0);
135721
- const top = Object.entries(data.skippedCounts).sort((a, b) => b[1] - a[1]).slice(0, 10).map(([name, count]) => `${name}: ${count}`).join(", ");
135721
+ const top = Object.entries(data.skippedCounts).sort((a, b) => b[1] - a[1]).slice(0, 10).map(([name, count2]) => `${name}: ${count2}`).join(", ");
135722
135722
  lines.push(`JS-side skipped: ${jsTotal} (${top})`);
135723
135723
  }
135724
135724
  if (tsTotal > 0) {
135725
135725
  lines.push(`TS-side removed: ${tsTotal}`);
135726
135726
  if (filterStats.sameNameDedup.count > 0) {
135727
- const detail = Array.from(filterStats.sameNameDedup.names.entries()).map(([name, count]) => `${name} x${count}`).join(", ");
135727
+ const detail = Array.from(filterStats.sameNameDedup.names.entries()).map(([name, count2]) => `${name} x${count2}`).join(", ");
135728
135728
  lines.push(` Same-name dedup: ${filterStats.sameNameDedup.count} (${detail})`);
135729
135729
  }
135730
135730
  if (filterStats.offScreen.count > 0) {
@@ -137784,8 +137784,8 @@ Fails if no active profiling session exists or the CDP connection was lost durin
137784
137784
  if (unattributedByCommit.length > 0) {
137785
137785
  let totalMs = 0;
137786
137786
  let totalFibers = 0;
137787
- for (const [, count, ms] of unattributedByCommit) {
137788
- totalFibers += count;
137787
+ for (const [, count2, ms] of unattributedByCommit) {
137788
+ totalFibers += count2;
137789
137789
  totalMs += ms;
137790
137790
  }
137791
137791
  response["unattributed_ms"] = Math.round(totalMs * 100) / 100;
@@ -138094,8 +138094,8 @@ function buildHotCommitSummaries(commits, hotCommitIndices, unattributedByCommit
138094
138094
  const hotSet = new Set(hotCommitIndices);
138095
138095
  const unattributedMap = /* @__PURE__ */ new Map();
138096
138096
  if (unattributedByCommit) {
138097
- for (const [commitIndex, count, ms] of unattributedByCommit) {
138098
- unattributedMap.set(commitIndex, { count, ms });
138097
+ for (const [commitIndex, count2, ms] of unattributedByCommit) {
138098
+ unattributedMap.set(commitIndex, { count: count2, ms });
138099
138099
  }
138100
138100
  }
138101
138101
  const byCommit = /* @__PURE__ */ new Map();
@@ -138139,7 +138139,7 @@ function buildHotCommitSummaries(commits, hotCommitIndices, unattributedByCommit
138139
138139
  }
138140
138140
  }
138141
138141
  const totalComponentCount = componentMap.size;
138142
- const componentEntries = Array.from(componentMap.entries()).sort((a, b) => b[1].totalSelf - a[1].totalSelf).slice(0, MAX_COMPONENT_ENTRIES).map(([name, { totalSelf, totalActual, count, firstEntry, isFirstMount }]) => {
138142
+ const componentEntries = Array.from(componentMap.entries()).sort((a, b) => b[1].totalSelf - a[1].totalSelf).slice(0, MAX_COMPONENT_ENTRIES).map(([name, { totalSelf, totalActual, count: count2, firstEntry, isFirstMount }]) => {
138143
138143
  const cd = firstEntry.changeDescription;
138144
138144
  const reason = !isFirstMount && cd ? deriveReason(cd, firstEntry.hookTypes) : void 0;
138145
138145
  let topChangedHookNames;
@@ -138159,7 +138159,7 @@ function buildHotCommitSummaries(commits, hotCommitIndices, unattributedByCommit
138159
138159
  name,
138160
138160
  selfDurationMs: Math.round(totalSelf * 100) / 100,
138161
138161
  actualDurationMs: Math.round(totalActual * 100) / 100,
138162
- count,
138162
+ count: count2,
138163
138163
  ...isFirstMount && { isFirstMount: true },
138164
138164
  ...reason !== void 0 && { reason },
138165
138165
  ...!isFirstMount && cd?.props && cd.props.length > 0 && { topChangedProps: cd.props.slice(0, 3) },
@@ -138471,9 +138471,9 @@ function topN(freq, n) {
138471
138471
  function dominantReason(histogram) {
138472
138472
  let best = "unknown";
138473
138473
  let bestCount = -1;
138474
- for (const [reason, count] of Object.entries(histogram)) {
138475
- if (count > bestCount) {
138476
- bestCount = count;
138474
+ for (const [reason, count2] of Object.entries(histogram)) {
138475
+ if (count2 > bestCount) {
138476
+ bestCount = count2;
138477
138477
  best = reason;
138478
138478
  }
138479
138479
  }
@@ -138482,9 +138482,9 @@ function dominantReason(histogram) {
138482
138482
  function topParent(parentFreq) {
138483
138483
  let best;
138484
138484
  let bestCount = -1;
138485
- for (const [name, count] of parentFreq) {
138486
- if (count > bestCount) {
138487
- bestCount = count;
138485
+ for (const [name, count2] of parentFreq) {
138486
+ if (count2 > bestCount) {
138487
+ bestCount = count2;
138488
138488
  best = name;
138489
138489
  }
138490
138490
  }
@@ -140716,13 +140716,13 @@ function parseLeaksXml(xml) {
140716
140716
  const responsibleFrame = attr(rm6[0], "responsible-frame") ?? "Unknown";
140717
140717
  const responsibleLibrary = attr(rm6[0], "responsible-library") ?? "";
140718
140718
  const countStr = attr(rm6[0], "count");
140719
- const count = countStr ? parseInt(countStr, 10) : 1;
140719
+ const count2 = countStr ? parseInt(countStr, 10) : 1;
140720
140720
  leaks.push({
140721
140721
  objectType,
140722
140722
  sizeBytes,
140723
140723
  responsibleFrame,
140724
140724
  responsibleLibrary,
140725
- count
140725
+ count: count2
140726
140726
  });
140727
140727
  }
140728
140728
  return leaks;
@@ -140779,19 +140779,19 @@ function aggregateCpuHotspots(rows, options) {
140779
140779
  existing.sampleCount += row.timestampsNs.length;
140780
140780
  existing.timestamps.push(...row.timestampsNs);
140781
140781
  }
140782
- for (const { chain, count } of row.callChains) {
140782
+ for (const { chain, count: count2 } of row.callChains) {
140783
140783
  const chainKey = chain.join(" > ");
140784
140784
  const cc = existing.chainCounts.get(chainKey);
140785
140785
  if (cc) {
140786
- cc.count += count;
140786
+ cc.count += count2;
140787
140787
  } else {
140788
- existing.chainCounts.set(chainKey, { chain, count });
140788
+ existing.chainCounts.set(chainKey, { chain, count: count2 });
140789
140789
  }
140790
140790
  }
140791
140791
  } else {
140792
140792
  const chainCounts = /* @__PURE__ */ new Map();
140793
- for (const { chain, count } of row.callChains) {
140794
- chainCounts.set(chain.join(" > "), { chain, count });
140793
+ for (const { chain, count: count2 } of row.callChains) {
140794
+ chainCounts.set(chain.join(" > "), { chain, count: count2 });
140795
140795
  }
140796
140796
  groups.set(key, {
140797
140797
  sampleCount: isPre ? row.sampleCount ?? 0 : row.timestampsNs.length,
@@ -140816,7 +140816,7 @@ function aggregateCpuHotspots(rows, options) {
140816
140816
  const [dominantFunction] = key.split("|||");
140817
140817
  const sortedChains = [...acc.chainCounts.values()].sort((a, b) => b.count - a.count).slice(0, 3);
140818
140818
  const topCallChain = sortedChains[0]?.chain ?? [];
140819
- const topCallChains = sortedChains.map(({ chain, count }) => ({ chain, count }));
140819
+ const topCallChains = sortedChains.map(({ chain, count: count2 }) => ({ chain, count: count2 }));
140820
140820
  const duringHang = hangSampleTimestamps.size > 0 && acc.timestamps.some((ts) => hangSampleTimestamps.has(ts));
140821
140821
  let firstMs;
140822
140822
  let lastMs;
@@ -140969,7 +140969,7 @@ function correlateHangsWithCpu(hangs, cpuSamples) {
140969
140969
  }
140970
140970
  }
140971
140971
  const suspectedFunctions = [...funcCounts.entries()].sort((a, b) => b[1] - a[1]).slice(0, TOP_N_FUNCTIONS).map(([fn]) => fn);
140972
- const appCallChains = [...chainCounts.values()].sort((a, b) => b.count - a.count).slice(0, TOP_N_CHAINS).map(({ chain, count }) => ({ chain, sampleCount: count }));
140972
+ const appCallChains = [...chainCounts.values()].sort((a, b) => b.count - a.count).slice(0, TOP_N_CHAINS).map(({ chain, count: count2 }) => ({ chain, sampleCount: count2 }));
140973
140973
  const durationMs = Math.round(hang.durationNs / 1e6);
140974
140974
  const severity = classifyHangSeverity(hang.hangType);
140975
140975
  const totalMs = Math.round(hang.startNs / 1e6);
@@ -141503,8 +141503,8 @@ function renderFullReport(payload, exportErrors, cap = { hotspotLimit: Infinity,
141503
141503
  lines.push(``);
141504
141504
  if (b.topCallChains && b.topCallChains.length > 0) {
141505
141505
  lines.push(`**Call chains:**`);
141506
- for (const { chain, count } of b.topCallChains) {
141507
- lines.push(`- (${count}\xD7) \`${chain.map(demangleSymbol).join(" > ")}\``);
141506
+ for (const { chain, count: count2 } of b.topCallChains) {
141507
+ lines.push(`- (${count2}\xD7) \`${chain.map(demangleSymbol).join(" > ")}\``);
141508
141508
  }
141509
141509
  lines.push(``);
141510
141510
  } else if (b.topCallChain.length > 0) {
@@ -143158,9 +143158,9 @@ async function renderHangStacksAndroid(opts, target) {
143158
143158
  if (uniqueStacks.size > 0) {
143159
143159
  lines.push("### Main-thread Samples During Hang", "");
143160
143160
  const sorted = [...uniqueStacks.values()].sort((a, b) => b.count - a.count).slice(0, opts.topN);
143161
- for (const { stack, count } of sorted) {
143161
+ for (const { stack, count: count2 } of sorted) {
143162
143162
  lines.push("```");
143163
- lines.push(`(${count}\xD7)`);
143163
+ lines.push(`(${count2}\xD7)`);
143164
143164
  lines.push(stack);
143165
143165
  lines.push("```");
143166
143166
  }
@@ -145416,10 +145416,10 @@ function renderCascadeTree(commits, commitIndex) {
145416
145416
  rendered.add(`${name}:${depth}`);
145417
145417
  const instances = matching.filter((c) => c.componentName === name);
145418
145418
  const totalSelf = instances.reduce((s, c) => s + c.selfDuration, 0);
145419
- const count = instances.length;
145419
+ const count2 = instances.length;
145420
145420
  const reason = instances[0] ? formatReason2(instances[0]) : "";
145421
145421
  const indent = " ".repeat(depth);
145422
- const countStr = count > 1 ? ` \xD7${count}` : "";
145422
+ const countStr = count2 > 1 ? ` \xD7${count2}` : "";
145423
145423
  lines.push(`${indent}- \`${name}\`${countStr} self=${totalSelf.toFixed(1)}ms \u2014 ${reason}`);
145424
145424
  const childCommits = children.get(name) ?? [];
145425
145425
  const childNames = new Set(childCommits.map((c) => c.componentName));
@@ -145444,9 +145444,9 @@ function getTopComponents(entries, topN2) {
145444
145444
  byName.set(e.componentName, { count: 1, totalDuration: e.actualDuration, first: e });
145445
145445
  }
145446
145446
  }
145447
- return [...byName.entries()].sort((a, b) => b[1].totalDuration - a[1].totalDuration).slice(0, topN2).map(([name, { count, totalDuration, first }]) => ({
145447
+ return [...byName.entries()].sort((a, b) => b[1].totalDuration - a[1].totalDuration).slice(0, topN2).map(([name, { count: count2, totalDuration, first }]) => ({
145448
145448
  name,
145449
- count,
145449
+ count: count2,
145450
145450
  totalDuration,
145451
145451
  reason: formatReason2(first)
145452
145452
  }));
@@ -145620,8 +145620,8 @@ function renderHangStacksIos(cpuSamples, uiHangs, hangIndex, topN2) {
145620
145620
  }
145621
145621
  }
145622
145622
  const sorted = [...uniqueStacks.values()].sort((a, b) => b.count - a.count).slice(0, topN2);
145623
- for (const { stack, count } of sorted) {
145624
- lines.push(`- (${count}\xD7) ${stack.map((f) => `\`${demangleSymbol(f)}\``).join(" \u2192 ")}`);
145623
+ for (const { stack, count: count2 } of sorted) {
145624
+ lines.push(`- (${count2}\xD7) ${stack.map((f) => `\`${demangleSymbol(f)}\``).join(" \u2192 ")}`);
145625
145625
  }
145626
145626
  }
145627
145627
  return lines.join("\n");
@@ -145661,8 +145661,8 @@ function renderFunctionCallersIos(cpuSamples, functionName, topN2) {
145661
145661
  lines.push("");
145662
145662
  lines.push("| Function | Samples |");
145663
145663
  lines.push("|---|---|");
145664
- for (const [name, count] of sortedCallers) {
145665
- lines.push(`| \`${escapeMarkdownTableCell(demangleSymbol(name))}\` | ${count} |`);
145664
+ for (const [name, count2] of sortedCallers) {
145665
+ lines.push(`| \`${escapeMarkdownTableCell(demangleSymbol(name))}\` | ${count2} |`);
145666
145666
  }
145667
145667
  lines.push("");
145668
145668
  }
@@ -145672,8 +145672,8 @@ function renderFunctionCallersIos(cpuSamples, functionName, topN2) {
145672
145672
  lines.push("");
145673
145673
  lines.push("| Function | Samples |");
145674
145674
  lines.push("|---|---|");
145675
- for (const [name, count] of sortedCallees) {
145676
- lines.push(`| \`${escapeMarkdownTableCell(demangleSymbol(name))}\` | ${count} |`);
145675
+ for (const [name, count2] of sortedCallees) {
145676
+ lines.push(`| \`${escapeMarkdownTableCell(demangleSymbol(name))}\` | ${count2} |`);
145677
145677
  }
145678
145678
  lines.push("");
145679
145679
  }
@@ -148169,7 +148169,7 @@ var path31 = __toESM(require("node:path"));
148169
148169
 
148170
148170
  // ../tool-server/src/tools/flows/flow-device.ts
148171
148171
  init_src();
148172
- var DEVICE_BIND_KEYS = ["udid", "device_id"];
148172
+ var DEVICE_BIND_KEYS = ["udid", "device_id", "device"];
148173
148173
  var DEVICE_ARG_KEYS = [...DEVICE_BIND_KEYS, "device"];
148174
148174
  function deviceEntryId(d) {
148175
148175
  if (d.platform === "ios") return d.udid;
@@ -148924,8 +148924,8 @@ You can still edit the .yaml file directly afterwards to remove or reorder steps
148924
148924
  step.condition.expectedText,
148925
148925
  step.condition.textMatch
148926
148926
  ) : `${step.condition.condition} ${selectorLabel(step.condition.selector)}`;
148927
- const count = step.steps.length;
148928
- return `${n}. when: ${cond} (${count} step${count === 1 ? "" : "s"})`;
148927
+ const count2 = step.steps.length;
148928
+ return `${n}. when: ${cond} (${count2} step${count2 === 1 ? "" : "s"})`;
148929
148929
  }
148930
148930
  case "scroll-to":
148931
148931
  return `${n}. scroll-to: ${selectorLabel(step.target)} (${step.direction})`;
@@ -148959,6 +148959,74 @@ var fs48 = __toESM(require("node:fs/promises"));
148959
148959
  var path34 = __toESM(require("node:path"));
148960
148960
  init_src();
148961
148961
 
148962
+ // ../tool-server/src/tools/flows/flow-nested-outcome.ts
148963
+ var FLOW_EXECUTE_TOOL_ID = "flow-execute";
148964
+ var RUN_SEQUENCE_TOOL_ID = "run-sequence";
148965
+ function isRecord(value) {
148966
+ return typeof value === "object" && value !== null;
148967
+ }
148968
+ function firstFailingStep(steps) {
148969
+ if (!Array.isArray(steps)) return void 0;
148970
+ for (const entry of steps) {
148971
+ if (!isRecord(entry)) continue;
148972
+ if (entry.status !== "fail" && entry.status !== "error") continue;
148973
+ const what = typeof entry.tool === "string" ? entry.tool : typeof entry.kind === "string" ? entry.kind : "step";
148974
+ const why = typeof entry.reason === "string" ? entry.reason : "no reason given";
148975
+ return `${what}: ${why}`;
148976
+ }
148977
+ return void 0;
148978
+ }
148979
+ function count(value) {
148980
+ return typeof value === "number" ? value : 0;
148981
+ }
148982
+ function flowExecuteOutcome(result) {
148983
+ const flow = typeof result.flow === "string" ? result.flow : "the composed flow";
148984
+ if (!("steps" in result) && typeof result.notice === "string") {
148985
+ const prerequisite = typeof result.executionPrerequisite === "string" && result.executionPrerequisite ? `: ${result.executionPrerequisite}` : "";
148986
+ return {
148987
+ status: "error",
148988
+ reason: `flow "${flow}" did not run \u2014 its execution prerequisite was not acknowledged${prerequisite}. Add prerequisiteAcknowledged: true to the step's args, or compose with run: instead.`
148989
+ };
148990
+ }
148991
+ if (result.aborted === true) {
148992
+ return { status: "skip", reason: `flow "${flow}" was aborted` };
148993
+ }
148994
+ if (result.ok === false) {
148995
+ const detail = firstFailingStep(result.steps);
148996
+ return {
148997
+ status: "fail",
148998
+ reason: `flow "${flow}" failed: ${count(result.passed)} passed, ${count(result.failed)} failed, ${count(result.errored)} errored${detail ? ` (${detail})` : ""}`
148999
+ };
149000
+ }
149001
+ return void 0;
149002
+ }
149003
+ function runSequenceOutcome(result) {
149004
+ const steps = result.steps;
149005
+ if (!Array.isArray(steps)) return void 0;
149006
+ const failed = steps.find((s) => isRecord(s) && typeof s.error === "string");
149007
+ if (failed && isRecord(failed)) {
149008
+ const tool = typeof failed.tool === "string" ? failed.tool : "step";
149009
+ return {
149010
+ status: "fail",
149011
+ reason: `run-sequence stopped at ${tool} after ${count(result.completed)} of ${count(result.total)} steps: ${String(failed.error)}`
149012
+ };
149013
+ }
149014
+ const total = count(result.total);
149015
+ if (total > 0 && steps.length < total) {
149016
+ return {
149017
+ status: "skip",
149018
+ reason: `run-sequence was aborted after ${count(result.completed)} of ${total} steps`
149019
+ };
149020
+ }
149021
+ return void 0;
149022
+ }
149023
+ function nestedOrchestratorOutcome(tool, result) {
149024
+ if (!isRecord(result)) return void 0;
149025
+ if (tool === FLOW_EXECUTE_TOOL_ID) return flowExecuteOutcome(result);
149026
+ if (tool === RUN_SEQUENCE_TOOL_ID) return runSequenceOutcome(result);
149027
+ return void 0;
149028
+ }
149029
+
148962
149030
  // ../tool-server/src/tools/flows/flow-actions.ts
148963
149031
  var ABORTED_OUTCOME = {
148964
149032
  ok: false,
@@ -150127,7 +150195,7 @@ function bilinearSampleColor(colors, width, height, x, y, channel) {
150127
150195
  }
150128
150196
  function averageStrokeWidth(mask, width, height) {
150129
150197
  let total = 0;
150130
- let count = 0;
150198
+ let count2 = 0;
150131
150199
  for (let y = 0; y < height; y++) {
150132
150200
  for (let x = 0; x < width; x++) {
150133
150201
  const index = y * width + x;
@@ -150136,27 +150204,27 @@ function averageStrokeWidth(mask, width, height) {
150136
150204
  runLength(mask, width, height, x, y, 1, 0),
150137
150205
  runLength(mask, width, height, x, y, 0, 1)
150138
150206
  );
150139
- count++;
150207
+ count2++;
150140
150208
  }
150141
150209
  }
150142
- return count === 0 ? 0 : total / count;
150210
+ return count2 === 0 ? 0 : total / count2;
150143
150211
  }
150144
150212
  function averageInkColor(crop) {
150145
150213
  const sum = { r: 0, g: 0, b: 0 };
150146
- let count = 0;
150214
+ let count2 = 0;
150147
150215
  for (let index = 0; index < crop.mask.length; index++) {
150148
150216
  if (!crop.mask[index]) continue;
150149
150217
  const colorOffset = index * 3;
150150
150218
  sum.r += crop.colors[colorOffset];
150151
150219
  sum.g += crop.colors[colorOffset + 1];
150152
150220
  sum.b += crop.colors[colorOffset + 2];
150153
- count++;
150221
+ count2++;
150154
150222
  }
150155
- if (count === 0) return { r: 0, g: 0, b: 0 };
150223
+ if (count2 === 0) return { r: 0, g: 0, b: 0 };
150156
150224
  return {
150157
- r: Math.round(sum.r / count),
150158
- g: Math.round(sum.g / count),
150159
- b: Math.round(sum.b / count)
150225
+ r: Math.round(sum.r / count2),
150226
+ g: Math.round(sum.g / count2),
150227
+ b: Math.round(sum.b / count2)
150160
150228
  };
150161
150229
  }
150162
150230
  function textContrast(crop) {
@@ -150203,7 +150271,7 @@ function connectedComponentStats(mask, width, height) {
150203
150271
  const visited = new Uint8Array(mask.length);
150204
150272
  const queue = new Int32Array(mask.length);
150205
150273
  const minComponentArea = Math.max(2, Math.floor(mask.length * 5e-4));
150206
- let count = 0;
150274
+ let count2 = 0;
150207
150275
  let totalArea = 0;
150208
150276
  for (let start2 = 0; start2 < mask.length; start2++) {
150209
150277
  if (!mask[start2] || visited[start2]) continue;
@@ -150237,11 +150305,11 @@ function connectedComponentStats(mask, width, height) {
150237
150305
  }
150238
150306
  }
150239
150307
  if (area >= minComponentArea) {
150240
- count++;
150308
+ count2++;
150241
150309
  totalArea += area;
150242
150310
  }
150243
150311
  }
150244
- return { count, averageArea: count === 0 ? 0 : totalArea / count };
150312
+ return { count: count2, averageArea: count2 === 0 ? 0 : totalArea / count2 };
150245
150313
  }
150246
150314
  function maskBounds(mask, width, height) {
150247
150315
  let minX = Number.POSITIVE_INFINITY;
@@ -150280,9 +150348,9 @@ function normalizeWordForAspect(text) {
150280
150348
  return text.trim().normalize("NFKC").toLowerCase();
150281
150349
  }
150282
150350
  function countMask(mask) {
150283
- let count = 0;
150284
- for (const value of mask) count += value;
150285
- return count;
150351
+ let count2 = 0;
150352
+ for (const value of mask) count2 += value;
150353
+ return count2;
150286
150354
  }
150287
150355
  function relativeDelta(left, right) {
150288
150356
  const denominator = Math.max(Math.abs(left), Math.abs(right), 1);
@@ -152410,6 +152478,18 @@ async function execLeafStep(state3, step, index, scope) {
152410
152478
  reason: `await-ui-element condition not met${note ? `: ${note}` : ""}`
152411
152479
  };
152412
152480
  }
152481
+ const nested = nestedOrchestratorOutcome(step.name, result);
152482
+ if (nested) {
152483
+ return {
152484
+ ...base,
152485
+ status: nested.status,
152486
+ tool: step.name,
152487
+ reason: nested.reason,
152488
+ result,
152489
+ outputHint,
152490
+ args
152491
+ };
152492
+ }
152413
152493
  return { ...base, status: "pass", tool: step.name, result, outputHint, args };
152414
152494
  } catch (err) {
152415
152495
  return { ...base, status: "error", tool: step.name, reason: errMsg2(err) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.18.1-next.16",
3
+ "version": "0.18.1-next.18",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",