@swmansion/argent 0.30.2-next.13 → 0.30.2-next.15

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
@@ -9855,6 +9855,7 @@ var FAILURE_CODES = {
9855
9855
  REACT_PROFILER_DEVTOOLS_RENDERER_MISSING: "REACT_PROFILER_DEVTOOLS_RENDERER_MISSING",
9856
9856
  REACT_PROFILER_START_FAILED: "REACT_PROFILER_START_FAILED",
9857
9857
  REACT_PROFILER_START_VERIFY_FAILED: "REACT_PROFILER_START_VERIFY_FAILED",
9858
+ REACT_PROFILER_SESSION_TORN_DOWN: "REACT_PROFILER_SESSION_TORN_DOWN",
9858
9859
  REACT_PROFILER_HOOK_ERROR: "REACT_PROFILER_HOOK_ERROR",
9859
9860
  REACT_PROFILER_ANALYZE_NO_DATA: "REACT_PROFILER_ANALYZE_NO_DATA",
9860
9861
  NATIVE_PROFILER_FACTORY_OPTIONS_MISSING: "NATIVE_PROFILER_FACTORY_OPTIONS_MISSING",
@@ -30810,8 +30811,13 @@ async function consumeToolStream(name, body, onProgress, signal) {
30810
30811
  if (msg.event === "progress") {
30811
30812
  progress++;
30812
30813
  onProgress(msg.data);
30813
- } else if (msg.event === "result") final = { data: msg.data, note: msg.note };
30814
- else if (msg.event === "error") {
30814
+ } else if (msg.event === "result") {
30815
+ final = {
30816
+ data: msg.data,
30817
+ note: msg.note,
30818
+ ...msg.profiling === true ? { profiling: true } : {}
30819
+ };
30820
+ } else if (msg.event === "error") {
30815
30821
  throw new ToolInvocationError(msg.error ?? "tool invocation failed", {
30816
30822
  errorCode: msg.error_code,
30817
30823
  errorKind: msg.error_kind
@@ -30858,7 +30864,11 @@ async function consumeToolStream(name, body, onProgress, signal) {
30858
30864
  if (!final) {
30859
30865
  throw brokenStream(name, "the stream ended without a result", progress);
30860
30866
  }
30861
- return { data: final.data, note: final.note };
30867
+ return {
30868
+ data: final.data,
30869
+ note: final.note,
30870
+ ...final.profiling ? { profiling: true } : {}
30871
+ };
30862
30872
  }
30863
30873
  function errorBodyMessage(body) {
30864
30874
  if (Array.isArray(body.issues) && typeof body.message === "string") return body.message;
@@ -31031,7 +31041,8 @@ function createToolsClient(options = {}) {
31031
31041
  return {
31032
31042
  data: await settle2(streamed.data),
31033
31043
  note: streamed.note,
31034
- outputHint: meta3?.outputHint
31044
+ outputHint: meta3?.outputHint,
31045
+ ...streamed.profiling ? { profiling: true } : {}
31035
31046
  };
31036
31047
  }
31037
31048
  let json2;
@@ -31056,7 +31067,12 @@ function createToolsClient(options = {}) {
31056
31067
  });
31057
31068
  }
31058
31069
  opts?.signal?.throwIfAborted();
31059
- return { data: await settle2(json2.data), note: json2.note, outputHint: meta3?.outputHint };
31070
+ return {
31071
+ data: await settle2(json2.data),
31072
+ note: json2.note,
31073
+ outputHint: meta3?.outputHint,
31074
+ ...json2.profiling === true ? { profiling: true } : {}
31075
+ };
31060
31076
  }
31061
31077
  return { fetchTools, fetchTool, callTool, baseUrl };
31062
31078
  }
@@ -35578,7 +35594,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
35578
35594
  var SESSION_ID2 = randomUUID5();
35579
35595
  function readCliVersion() {
35580
35596
  if (true) {
35581
- return "0.30.2-next.13";
35597
+ return "0.30.2-next.15";
35582
35598
  }
35583
35599
  return "0.0.0";
35584
35600
  }
package/dist/client.js CHANGED
@@ -9059,6 +9059,7 @@ var FAILURE_CODES = {
9059
9059
  REACT_PROFILER_DEVTOOLS_RENDERER_MISSING: "REACT_PROFILER_DEVTOOLS_RENDERER_MISSING",
9060
9060
  REACT_PROFILER_START_FAILED: "REACT_PROFILER_START_FAILED",
9061
9061
  REACT_PROFILER_START_VERIFY_FAILED: "REACT_PROFILER_START_VERIFY_FAILED",
9062
+ REACT_PROFILER_SESSION_TORN_DOWN: "REACT_PROFILER_SESSION_TORN_DOWN",
9062
9063
  REACT_PROFILER_HOOK_ERROR: "REACT_PROFILER_HOOK_ERROR",
9063
9064
  REACT_PROFILER_ANALYZE_NO_DATA: "REACT_PROFILER_ANALYZE_NO_DATA",
9064
9065
  NATIVE_PROFILER_FACTORY_OPTIONS_MISSING: "NATIVE_PROFILER_FACTORY_OPTIONS_MISSING",
@@ -10190,8 +10191,13 @@ async function consumeToolStream(name, body, onProgress, signal) {
10190
10191
  if (msg.event === "progress") {
10191
10192
  progress++;
10192
10193
  onProgress(msg.data);
10193
- } else if (msg.event === "result") final = { data: msg.data, note: msg.note };
10194
- else if (msg.event === "error") {
10194
+ } else if (msg.event === "result") {
10195
+ final = {
10196
+ data: msg.data,
10197
+ note: msg.note,
10198
+ ...msg.profiling === true ? { profiling: true } : {}
10199
+ };
10200
+ } else if (msg.event === "error") {
10195
10201
  throw new ToolInvocationError(msg.error ?? "tool invocation failed", {
10196
10202
  errorCode: msg.error_code,
10197
10203
  errorKind: msg.error_kind
@@ -10238,7 +10244,11 @@ async function consumeToolStream(name, body, onProgress, signal) {
10238
10244
  if (!final) {
10239
10245
  throw brokenStream(name, "the stream ended without a result", progress);
10240
10246
  }
10241
- return { data: final.data, note: final.note };
10247
+ return {
10248
+ data: final.data,
10249
+ note: final.note,
10250
+ ...final.profiling ? { profiling: true } : {}
10251
+ };
10242
10252
  }
10243
10253
  function errorBodyMessage(body) {
10244
10254
  if (Array.isArray(body.issues) && typeof body.message === "string") return body.message;
@@ -10411,7 +10421,8 @@ function createToolsClient(options = {}) {
10411
10421
  return {
10412
10422
  data: await settle(streamed.data),
10413
10423
  note: streamed.note,
10414
- outputHint: meta?.outputHint
10424
+ outputHint: meta?.outputHint,
10425
+ ...streamed.profiling ? { profiling: true } : {}
10415
10426
  };
10416
10427
  }
10417
10428
  let json;
@@ -10436,7 +10447,12 @@ function createToolsClient(options = {}) {
10436
10447
  });
10437
10448
  }
10438
10449
  opts?.signal?.throwIfAborted();
10439
- return { data: await settle(json.data), note: json.note, outputHint: meta?.outputHint };
10450
+ return {
10451
+ data: await settle(json.data),
10452
+ note: json.note,
10453
+ outputHint: meta?.outputHint,
10454
+ ...json.profiling === true ? { profiling: true } : {}
10455
+ };
10440
10456
  }
10441
10457
  return { fetchTools, fetchTool, callTool, baseUrl };
10442
10458
  }
@@ -15962,6 +15962,7 @@ var FAILURE_CODES = {
15962
15962
  REACT_PROFILER_DEVTOOLS_RENDERER_MISSING: "REACT_PROFILER_DEVTOOLS_RENDERER_MISSING",
15963
15963
  REACT_PROFILER_START_FAILED: "REACT_PROFILER_START_FAILED",
15964
15964
  REACT_PROFILER_START_VERIFY_FAILED: "REACT_PROFILER_START_VERIFY_FAILED",
15965
+ REACT_PROFILER_SESSION_TORN_DOWN: "REACT_PROFILER_SESSION_TORN_DOWN",
15965
15966
  REACT_PROFILER_HOOK_ERROR: "REACT_PROFILER_HOOK_ERROR",
15966
15967
  REACT_PROFILER_ANALYZE_NO_DATA: "REACT_PROFILER_ANALYZE_NO_DATA",
15967
15968
  NATIVE_PROFILER_FACTORY_OPTIONS_MISSING: "NATIVE_PROFILER_FACTORY_OPTIONS_MISSING",
@@ -16899,7 +16900,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16899
16900
  var SESSION_ID = randomUUID4();
16900
16901
  function readCliVersion() {
16901
16902
  if (true) {
16902
- return "0.30.2-next.13";
16903
+ return "0.30.2-next.15";
16903
16904
  }
16904
16905
  return "0.0.0";
16905
16906
  }
@@ -25314,6 +25314,7 @@ var FAILURE_CODES = {
25314
25314
  REACT_PROFILER_DEVTOOLS_RENDERER_MISSING: "REACT_PROFILER_DEVTOOLS_RENDERER_MISSING",
25315
25315
  REACT_PROFILER_START_FAILED: "REACT_PROFILER_START_FAILED",
25316
25316
  REACT_PROFILER_START_VERIFY_FAILED: "REACT_PROFILER_START_VERIFY_FAILED",
25317
+ REACT_PROFILER_SESSION_TORN_DOWN: "REACT_PROFILER_SESSION_TORN_DOWN",
25317
25318
  REACT_PROFILER_HOOK_ERROR: "REACT_PROFILER_HOOK_ERROR",
25318
25319
  REACT_PROFILER_ANALYZE_NO_DATA: "REACT_PROFILER_ANALYZE_NO_DATA",
25319
25320
  NATIVE_PROFILER_FACTORY_OPTIONS_MISSING: "NATIVE_PROFILER_FACTORY_OPTIONS_MISSING",
@@ -26486,8 +26487,13 @@ async function consumeToolStream(name, body, onProgress, signal) {
26486
26487
  if (msg.event === "progress") {
26487
26488
  progress++;
26488
26489
  onProgress(msg.data);
26489
- } else if (msg.event === "result") final = { data: msg.data, note: msg.note };
26490
- else if (msg.event === "error") {
26490
+ } else if (msg.event === "result") {
26491
+ final = {
26492
+ data: msg.data,
26493
+ note: msg.note,
26494
+ ...msg.profiling === true ? { profiling: true } : {}
26495
+ };
26496
+ } else if (msg.event === "error") {
26491
26497
  throw new ToolInvocationError(msg.error ?? "tool invocation failed", {
26492
26498
  errorCode: msg.error_code,
26493
26499
  errorKind: msg.error_kind
@@ -26534,7 +26540,11 @@ async function consumeToolStream(name, body, onProgress, signal) {
26534
26540
  if (!final) {
26535
26541
  throw brokenStream(name, "the stream ended without a result", progress);
26536
26542
  }
26537
- return { data: final.data, note: final.note };
26543
+ return {
26544
+ data: final.data,
26545
+ note: final.note,
26546
+ ...final.profiling ? { profiling: true } : {}
26547
+ };
26538
26548
  }
26539
26549
  function errorBodyMessage(body) {
26540
26550
  if (Array.isArray(body.issues) && typeof body.message === "string") return body.message;
@@ -26707,7 +26717,8 @@ function createToolsClient(options = {}) {
26707
26717
  return {
26708
26718
  data: await settle2(streamed.data),
26709
26719
  note: streamed.note,
26710
- outputHint: meta2?.outputHint
26720
+ outputHint: meta2?.outputHint,
26721
+ ...streamed.profiling ? { profiling: true } : {}
26711
26722
  };
26712
26723
  }
26713
26724
  let json;
@@ -26732,7 +26743,12 @@ function createToolsClient(options = {}) {
26732
26743
  });
26733
26744
  }
26734
26745
  opts?.signal?.throwIfAborted();
26735
- return { data: await settle2(json.data), note: json.note, outputHint: meta2?.outputHint };
26746
+ return {
26747
+ data: await settle2(json.data),
26748
+ note: json.note,
26749
+ outputHint: meta2?.outputHint,
26750
+ ...json.profiling === true ? { profiling: true } : {}
26751
+ };
26736
26752
  }
26737
26753
  return { fetchTools, fetchTool, callTool, baseUrl };
26738
26754
  }
@@ -28540,6 +28556,7 @@ var AUTO_DESCRIBE_TOOLS = /* @__PURE__ */ new Set([
28540
28556
  function autoDescribeEnabled(options) {
28541
28557
  return !isFlagEnabled("disable-auto-describe", options);
28542
28558
  }
28559
+ var PROFILING_CAPTURE_SKIPPED_NOTE = "Auto-screenshot and element tree skipped while a profiler is recording on this device. Call screenshot or describe if you need to see the screen.";
28543
28560
  var AUTO_DESCRIBE_HEADER = "--- Elements after action (describe) ---";
28544
28561
  function shouldAutoDescribe(toolName) {
28545
28562
  return AUTO_DESCRIBE_TOOLS.has(normalizeToolName(toolName));
@@ -28595,6 +28612,7 @@ function toMcpTool(t) {
28595
28612
  name: t.name,
28596
28613
  description: t.description,
28597
28614
  inputSchema: { type: "object", ...withoutRetiredParams(t.inputSchema) },
28615
+ ...t.readOnly ? { annotations: { readOnlyHint: true } } : {},
28598
28616
  ...Object.keys(meta2).length > 0 ? { _meta: meta2 } : {}
28599
28617
  };
28600
28618
  }
@@ -28691,8 +28709,8 @@ function createToolCaller(deps) {
28691
28709
  return {
28692
28710
  fetchTools: client.fetchTools,
28693
28711
  async callTool(name, args) {
28694
- const { data, note, outputHint } = await client.callTool(name, args);
28695
- return { result: data, outputHint, note };
28712
+ const { data, note, outputHint, profiling } = await client.callTool(name, args);
28713
+ return { result: data, outputHint, note, ...profiling ? { profiling } : {} };
28696
28714
  }
28697
28715
  };
28698
28716
  }
@@ -28856,7 +28874,7 @@ ${desc}` }];
28856
28874
  args: params.arguments
28857
28875
  });
28858
28876
  try {
28859
- const { result, outputHint, note } = await callTool(params.name, params.arguments);
28877
+ const { result, outputHint, note, profiling } = await callTool(params.name, params.arguments);
28860
28878
  await spyLog({
28861
28879
  ts: (/* @__PURE__ */ new Date()).toISOString(),
28862
28880
  event: "tool_result",
@@ -28889,6 +28907,11 @@ ${desc}` }];
28889
28907
  text: "Auto-screenshot and element tree skipped: the input contains a {{secret:\u2026}} placeholder, and a capture of this screen could reveal the typed secret. The secret is already typed \u2014 do not send the typing step again, or the field will hold two copies of it. Submit or navigate away, then verify the resulting screen as usual. Only this call is covered: the next call is captured normally, and shows the secret if the field is still on screen. To cover the submit as well, put the typing and the submit in ONE `run-sequence` the next time you type a secret."
28890
28908
  }
28891
28909
  ];
28910
+ } else if (udid && (wantScreenshot || wantTree) && profiling) {
28911
+ if (params.name !== "describe") {
28912
+ await awaitScreenSettled(udid, params.name);
28913
+ content = [...content, { type: "text", text: PROFILING_CAPTURE_SKIPPED_NOTE }];
28914
+ }
28892
28915
  } else if (udid && (wantScreenshot || wantTree)) {
28893
28916
  const screenSettled = await awaitScreenSettled(udid, params.name);
28894
28917
  const screenshot = wantScreenshot ? captureScreenshotBlocks(udid) : Promise.resolve([]);