@swmansion/argent 0.20.1-next.0 → 0.20.1-next.2

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.
@@ -139038,9 +139038,17 @@ async function analyzeNativeProfilerAndroid(api) {
139038
139038
  });
139039
139039
  }
139040
139040
 
139041
+ // ../tool-server/src/utils/debugger/device-id-param.ts
139042
+ init_zod();
139043
+ function metroDeviceIdParam(description) {
139044
+ return external_exports.string().min(1, "device_id must not be empty").describe(description).transform((id) => canonicalDeviceId(id) ?? id);
139045
+ }
139046
+
139041
139047
  // ../tool-server/src/tools/profiler/native-profiler/native-profiler-start.ts
139042
139048
  var zodSchema48 = external_exports.object({
139043
- device_id: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial)."),
139049
+ device_id: metroDeviceIdParam(
139050
+ "Target device id from `list-devices` (iOS UDID or Android serial)."
139051
+ ),
139044
139052
  app_process: external_exports.string().optional().describe(
139045
139053
  "iOS: the CFBundleExecutable or display name of the app to profile. Android: the app's package name. If omitted, auto-detects the currently running foreground app. Only provide this if auto-detection picks the wrong app."
139046
139054
  ),
@@ -139089,7 +139097,9 @@ Fails if no app is running on the device, or the profiler cannot attach to the p
139089
139097
  // ../tool-server/src/tools/profiler/native-profiler/native-profiler-stop.ts
139090
139098
  init_zod();
139091
139099
  var zodSchema49 = external_exports.object({
139092
- device_id: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial).")
139100
+ device_id: metroDeviceIdParam(
139101
+ "Target device id from `list-devices` (iOS UDID or Android serial)."
139102
+ )
139093
139103
  });
139094
139104
  var capability24 = {
139095
139105
  apple: { simulator: true, device: true },
@@ -139157,7 +139167,9 @@ Fails if no active native-profiler-start session exists for the given device_id.
139157
139167
  // ../tool-server/src/tools/profiler/native-profiler/native-profiler-analyze.ts
139158
139168
  init_zod();
139159
139169
  var zodSchema50 = external_exports.object({
139160
- device_id: external_exports.string().describe("Target device id from `list-devices` (iOS UDID or Android serial).")
139170
+ device_id: metroDeviceIdParam(
139171
+ "Target device id from `list-devices` (iOS UDID or Android serial)."
139172
+ )
139161
139173
  });
139162
139174
  var capability25 = {
139163
139175
  apple: { simulator: true, device: true },
@@ -140326,7 +140338,7 @@ var timeWindowSchema = external_exports.object({
140326
140338
  });
140327
140339
  var zodSchema53 = external_exports.object({
140328
140340
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
140329
- device_id: external_exports.string().describe(
140341
+ device_id: metroDeviceIdParam(
140330
140342
  "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
140331
140343
  ),
140332
140344
  mode: external_exports.enum(["top_functions", "time_window", "call_tree", "component_cpu"]).describe(
@@ -140663,7 +140675,7 @@ var timeRangeSchema = external_exports.object({
140663
140675
  });
140664
140676
  var zodSchema54 = external_exports.object({
140665
140677
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
140666
- device_id: external_exports.string().describe(
140678
+ device_id: metroDeviceIdParam(
140667
140679
  "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
140668
140680
  ),
140669
140681
  mode: external_exports.enum(["by_component", "by_time_range", "by_index", "cascade_tree"]).describe(
@@ -140995,7 +141007,7 @@ Fails if react-profiler-stop has not been called or no commit data is stored.`,
140995
141007
  init_zod();
140996
141008
  init_src();
140997
141009
  var zodSchema55 = external_exports.object({
140998
- device_id: external_exports.string().describe("iOS Simulator UDID or Android serial."),
141010
+ device_id: metroDeviceIdParam("iOS Simulator UDID or Android serial."),
140999
141011
  mode: external_exports.enum(["hang_stacks", "function_callers", "thread_breakdown", "leak_stacks"]).describe(
141000
141012
  "Query mode: hang_stacks (full CPU context during a hang), function_callers (who calls a native function), thread_breakdown (CPU split by thread), leak_stacks (leak details by object type)"
141001
141013
  ),
@@ -141325,6 +141337,17 @@ Fails if native-profiler-analyze has not been run or no parsed trace data is in
141325
141337
  }),
141326
141338
  async execute(services, params) {
141327
141339
  const api = services.session;
141340
+ if (!api.traceFile && !api.exportedFiles && !api.parsedData) {
141341
+ throw new FailureError(
141342
+ `No native profiler capture is loaded for device \`${params.device_id}\`. Run native-profiler-start \u2192 native-profiler-stop \u2192 native-profiler-analyze on this device first. (If that id came from debugger-connect, pass the id from list-devices instead \u2014 the simulator UDID or adb serial \u2014 since profiler sessions are keyed by that one.)`,
141343
+ {
141344
+ error_code: FAILURE_CODES.PROFILER_DATA_NOT_LOADED,
141345
+ failure_stage: "profiler_stack_query_load_native_data",
141346
+ failure_area: "tool_server",
141347
+ error_kind: "not_found"
141348
+ }
141349
+ );
141350
+ }
141328
141351
  if (api.platform === "android") {
141329
141352
  return executeAndroid(api, params);
141330
141353
  }
@@ -141370,7 +141393,7 @@ function buildPerfettoAnchor(wallClockStartMs) {
141370
141393
  // ../tool-server/src/tools/profiler/combined/profiler-combined-report.ts
141371
141394
  var zodSchema56 = external_exports.object({
141372
141395
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
141373
- device_id: external_exports.string().describe("iOS Simulator/device UDID or Android serial")
141396
+ device_id: metroDeviceIdParam("iOS Simulator/device UDID or Android serial")
141374
141397
  });
141375
141398
  var profilerCombinedReportTool = {
141376
141399
  id: "profiler-combined-report",
@@ -141412,6 +141435,17 @@ Fails if either react-profiler-analyze or native-profiler-analyze has not been c
141412
141435
  }
141413
141436
  );
141414
141437
  }
141438
+ if (!nativeApi.traceFile && !nativeApi.exportedFiles && !nativeApi.parsedData) {
141439
+ throw new FailureError(
141440
+ `No native profiler capture is loaded for device \`${params.device_id}\`. Run native-profiler-start \u2192 native-profiler-stop \u2192 native-profiler-analyze on this device first. (If that id came from debugger-connect, pass the id from list-devices instead \u2014 the simulator UDID or adb serial \u2014 since profiler sessions are keyed by that one.)`,
141441
+ {
141442
+ error_code: FAILURE_CODES.PROFILER_DATA_NOT_LOADED,
141443
+ failure_stage: "profiler_combined_report_load_native_data",
141444
+ failure_area: "tool_server",
141445
+ error_kind: "not_found"
141446
+ }
141447
+ );
141448
+ }
141415
141449
  let uiHangs;
141416
141450
  let memoryLeaks;
141417
141451
  if (nativeApi.platform === "android") {
@@ -141704,7 +141738,7 @@ var zodSchema57 = external_exports.object({
141704
141738
  port: external_exports.coerce.number().default(8081).describe(
141705
141739
  "Metro port \u2014 the loaded React data is cached under this port for query tools (default 8081)"
141706
141740
  ),
141707
- device_id: external_exports.string().describe(
141741
+ device_id: metroDeviceIdParam(
141708
141742
  "Target device id from `list-devices`. Used to cache the loaded React session under the correct port+device key, and required to resolve the native profiler session for load_native."
141709
141743
  ),
141710
141744
  app_process: external_exports.string().optional().describe(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.20.1-next.0",
3
+ "version": "0.20.1-next.2",
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",