@swmansion/argent 0.34.1-next.51 → 0.34.1-next.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli-cmds.mjs CHANGED
@@ -32108,6 +32108,34 @@ function assertRequiredPresent(meta3, args) {
32108
32108
  describeParamIssues({ issues }, record2)
32109
32109
  );
32110
32110
  }
32111
+ var MAX_NON_FINITE_ISSUES = 12;
32112
+ function assertFiniteNumbers(args) {
32113
+ const issues = [];
32114
+ const seen = /* @__PURE__ */ new WeakSet();
32115
+ const pending = [{ value: args, key: "" }];
32116
+ for (let i2 = 0; i2 < pending.length && issues.length < MAX_NON_FINITE_ISSUES; i2++) {
32117
+ const visit2 = pending[i2];
32118
+ const { value } = visit2;
32119
+ if (typeof value !== "object" || value === null || seen.has(value)) continue;
32120
+ seen.add(value);
32121
+ for (const [key, item] of Array.isArray(value) ? value.entries() : Object.entries(value)) {
32122
+ if (typeof item === "object" && item !== null) {
32123
+ pending.push({ value: item, key, parent: visit2 });
32124
+ } else if (typeof item === "number" && !Number.isFinite(item)) {
32125
+ const path29 = [key];
32126
+ for (let at = visit2; at.parent; at = at.parent) path29.push(at.key);
32127
+ path29.reverse();
32128
+ issues.push({ code: "invalid_type", path: path29, message: `expected a number, got ${item}` });
32129
+ if (issues.length === MAX_NON_FINITE_ISSUES) break;
32130
+ }
32131
+ }
32132
+ }
32133
+ if (issues.length === 0) return;
32134
+ throw new ToolInvocationError(
32135
+ describeParamIssues({ issues }, args),
32136
+ { errorKind: "validation", issues }
32137
+ );
32138
+ }
32111
32139
  function fetchFailure(err) {
32112
32140
  if (!(err instanceof Error)) return String(err);
32113
32141
  return err.cause instanceof Error ? `${err.message}: ${err.cause.message}` : err.message;
@@ -32257,6 +32285,7 @@ function createToolsClient(options = {}) {
32257
32285
  }
32258
32286
  async function callTool(name, args, opts) {
32259
32287
  opts?.signal?.throwIfAborted();
32288
+ assertFiniteNumbers(args);
32260
32289
  const { url: url2, token, remote } = await route();
32261
32290
  let finalArgs = canonicalToolArgs(name, args);
32262
32291
  const { tools: tools2, uploadFormats } = await fetchToolList({ signal: opts?.signal });
@@ -36259,7 +36288,7 @@ function isCi(env = process.env) {
36259
36288
  var SESSION_ID2 = randomUUID5();
36260
36289
  function readCliVersion() {
36261
36290
  if (true) {
36262
- return "0.34.1-next.51";
36291
+ return "0.34.1-next.53";
36263
36292
  }
36264
36293
  return "0.0.0";
36265
36294
  }
package/dist/client.js CHANGED
@@ -10847,6 +10847,34 @@ function assertRequiredPresent(meta, args) {
10847
10847
  describeParamIssues({ issues }, record)
10848
10848
  );
10849
10849
  }
10850
+ var MAX_NON_FINITE_ISSUES = 12;
10851
+ function assertFiniteNumbers(args) {
10852
+ const issues = [];
10853
+ const seen = /* @__PURE__ */ new WeakSet();
10854
+ const pending = [{ value: args, key: "" }];
10855
+ for (let i = 0; i < pending.length && issues.length < MAX_NON_FINITE_ISSUES; i++) {
10856
+ const visit = pending[i];
10857
+ const { value } = visit;
10858
+ if (typeof value !== "object" || value === null || seen.has(value)) continue;
10859
+ seen.add(value);
10860
+ for (const [key, item] of Array.isArray(value) ? value.entries() : Object.entries(value)) {
10861
+ if (typeof item === "object" && item !== null) {
10862
+ pending.push({ value: item, key, parent: visit });
10863
+ } else if (typeof item === "number" && !Number.isFinite(item)) {
10864
+ const path14 = [key];
10865
+ for (let at = visit; at.parent; at = at.parent) path14.push(at.key);
10866
+ path14.reverse();
10867
+ issues.push({ code: "invalid_type", path: path14, message: `expected a number, got ${item}` });
10868
+ if (issues.length === MAX_NON_FINITE_ISSUES) break;
10869
+ }
10870
+ }
10871
+ }
10872
+ if (issues.length === 0) return;
10873
+ throw new ToolInvocationError(
10874
+ describeParamIssues({ issues }, args),
10875
+ { errorKind: "validation", issues }
10876
+ );
10877
+ }
10850
10878
  function fetchFailure(err) {
10851
10879
  if (!(err instanceof Error)) return String(err);
10852
10880
  return err.cause instanceof Error ? `${err.message}: ${err.cause.message}` : err.message;
@@ -10996,6 +11024,7 @@ function createToolsClient(options = {}) {
10996
11024
  }
10997
11025
  async function callTool(name, args, opts) {
10998
11026
  opts?.signal?.throwIfAborted();
11027
+ assertFiniteNumbers(args);
10999
11028
  const { url, token, remote } = await route();
11000
11029
  let finalArgs = canonicalToolArgs(name, args);
11001
11030
  const { tools, uploadFormats } = await fetchToolList({ signal: opts?.signal });
@@ -16945,7 +16945,7 @@ function isCi(env = process.env) {
16945
16945
  var SESSION_ID = randomUUID4();
16946
16946
  function readCliVersion() {
16947
16947
  if (true) {
16948
- return "0.34.1-next.51";
16948
+ return "0.34.1-next.53";
16949
16949
  }
16950
16950
  return "0.0.0";
16951
16951
  }
@@ -27608,6 +27608,34 @@ function assertRequiredPresent(meta2, args) {
27608
27608
  describeParamIssues({ issues }, record2)
27609
27609
  );
27610
27610
  }
27611
+ var MAX_NON_FINITE_ISSUES = 12;
27612
+ function assertFiniteNumbers(args) {
27613
+ const issues = [];
27614
+ const seen = /* @__PURE__ */ new WeakSet();
27615
+ const pending = [{ value: args, key: "" }];
27616
+ for (let i = 0; i < pending.length && issues.length < MAX_NON_FINITE_ISSUES; i++) {
27617
+ const visit = pending[i];
27618
+ const { value } = visit;
27619
+ if (typeof value !== "object" || value === null || seen.has(value)) continue;
27620
+ seen.add(value);
27621
+ for (const [key, item] of Array.isArray(value) ? value.entries() : Object.entries(value)) {
27622
+ if (typeof item === "object" && item !== null) {
27623
+ pending.push({ value: item, key, parent: visit });
27624
+ } else if (typeof item === "number" && !Number.isFinite(item)) {
27625
+ const path18 = [key];
27626
+ for (let at = visit; at.parent; at = at.parent) path18.push(at.key);
27627
+ path18.reverse();
27628
+ issues.push({ code: "invalid_type", path: path18, message: `expected a number, got ${item}` });
27629
+ if (issues.length === MAX_NON_FINITE_ISSUES) break;
27630
+ }
27631
+ }
27632
+ }
27633
+ if (issues.length === 0) return;
27634
+ throw new ToolInvocationError(
27635
+ describeParamIssues({ issues }, args),
27636
+ { errorKind: "validation", issues }
27637
+ );
27638
+ }
27611
27639
  function fetchFailure(err) {
27612
27640
  if (!(err instanceof Error)) return String(err);
27613
27641
  return err.cause instanceof Error ? `${err.message}: ${err.cause.message}` : err.message;
@@ -27757,6 +27785,7 @@ function createToolsClient(options = {}) {
27757
27785
  }
27758
27786
  async function callTool(name, args, opts) {
27759
27787
  opts?.signal?.throwIfAborted();
27788
+ assertFiniteNumbers(args);
27760
27789
  const { url, token, remote } = await route();
27761
27790
  let finalArgs = canonicalToolArgs(name, args);
27762
27791
  const { tools, uploadFormats } = await fetchToolList({ signal: opts?.signal });
@@ -101447,7 +101447,7 @@ function isCi(env = process.env) {
101447
101447
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
101448
101448
  function readCliVersion() {
101449
101449
  if (true) {
101450
- return "0.34.1-next.51";
101450
+ return "0.34.1-next.53";
101451
101451
  }
101452
101452
  return "0.0.0";
101453
101453
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.51",
3
+ "version": "0.34.1-next.53",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",