@swmansion/argent 0.16.1-next.3 → 0.16.1-next.5

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.
@@ -121584,6 +121584,10 @@ var zodSchema2 = external_exports.object({
121584
121584
  var nativeDevtoolsStatusTool = {
121585
121585
  id: "native-devtools-status",
121586
121586
  capability: { apple: { simulator: true, device: true }, appleRemote: { simulator: true } },
121587
+ // The "injectable is false" recovery sentence inlines NON_INJECTABLE_RECOVERY
121588
+ // verbatim: the description must stay a plain literal so scripts/extract-tools.mjs
121589
+ // can read it statically for the spidershield scan. The verbatim match is pinned
121590
+ // by native-devtools-status.test.ts.
121587
121591
  description: `Check whether native devtools are connected to a specific app and whether the next launch is prepared for injection.
121588
121592
  Use when you need to verify native devtools readiness before calling native-full-hierarchy, native-describe-screen, or native-network-logs.
121589
121593
 
@@ -121596,7 +121600,7 @@ Returns { envSetup, appRunning, connected, requiresRestart, nextLaunchWillBeInje
121596
121600
  - injectable: whether native devtools can ever be injected into this app. Apple system apps (bundle ids under com.apple.) are platform binaries with library validation, so the dylib can never load into them.
121597
121601
 
121598
121602
  Call this before using app-scoped native hierarchy tools or native-network-logs.
121599
- If injectable is false: this is a TERMINAL state \u2014 the app can never be injected. Do NOT restart/retry. ${NON_INJECTABLE_RECOVERY}
121603
+ If injectable is false: this is a TERMINAL state \u2014 the app can never be injected. Do NOT restart/retry. Use the standard \`describe\` tool (its accessibility path reads the screen without injection) or \`screenshot\` (then interact by coordinate). Do not fall back to the native-devtools feature tools (native-describe-screen, native-find-views, native-full-hierarchy, native-network-logs, native-view-at-point, native-user-interactable-view-at-point) \u2014 they run the same injection precheck and fail with the same non-injectable error.
121600
121604
  If appRunning is false and nextLaunchWillBeInjected is true: use launch-app normally.
121601
121605
  If requiresRestart is true: call restart-app, then proceed with the native feature.
121602
121606
  Returns { status: "init_failed", message, attempts } instead when the simulator's native-devtools environment failed to initialize.
@@ -122119,6 +122123,20 @@ function normalizeWsUrl(wsUrl, port) {
122119
122123
  return url2.toString();
122120
122124
  }
122121
122125
 
122126
+ // ../tool-server/src/utils/debugger/device-alias.ts
122127
+ var logicalIdToConnectId = /* @__PURE__ */ new Map();
122128
+ function rememberDeviceAlias(logicalDeviceId, connectDeviceId) {
122129
+ if (!logicalDeviceId || logicalDeviceId === connectDeviceId) return;
122130
+ logicalIdToConnectId.set(logicalDeviceId, connectDeviceId);
122131
+ }
122132
+ function canonicalDeviceId(deviceId) {
122133
+ if (!deviceId) return deviceId;
122134
+ return logicalIdToConnectId.get(deviceId) ?? deviceId;
122135
+ }
122136
+ function forgetDeviceAlias(logicalDeviceId) {
122137
+ if (logicalDeviceId) logicalIdToConnectId.delete(logicalDeviceId);
122138
+ }
122139
+
122122
122140
  // ../tool-server/src/utils/debugger/source-resolver.ts
122123
122141
  var fs18 = __toESM(require("node:fs/promises"));
122124
122142
  var path17 = __toESM(require("node:path"));
@@ -122537,6 +122555,7 @@ var jsRuntimeDebuggerBlueprint = {
122537
122555
  consoleEvents,
122538
122556
  consoleSocketUrl: consoleServer.url
122539
122557
  };
122558
+ rememberDeviceAlias(api.logicalDeviceId, deviceId);
122540
122559
  const events = new TypedEventEmitter();
122541
122560
  cdp.events.on("disconnected", (error52) => {
122542
122561
  events.emit(
@@ -122552,6 +122571,7 @@ var jsRuntimeDebuggerBlueprint = {
122552
122571
  return {
122553
122572
  api,
122554
122573
  dispose: async () => {
122574
+ forgetDeviceAlias(api.logicalDeviceId);
122555
122575
  await consoleServer.close();
122556
122576
  logWriter.close();
122557
122577
  await cdp.disconnect();
@@ -133854,18 +133874,19 @@ var RN_ONLY_TOOL_CAPABILITY = {
133854
133874
  android: { emulator: true, device: true, unknown: true }
133855
133875
  };
133856
133876
  function debuggerServiceRef(params) {
133857
- if (params.device_id && params.device_id.startsWith(CHROMIUM_ID_PREFIX)) {
133858
- const device = resolveDevice(params.device_id);
133877
+ const deviceId = canonicalDeviceId(params.device_id);
133878
+ if (deviceId && deviceId.startsWith(CHROMIUM_ID_PREFIX)) {
133879
+ const device = resolveDevice(deviceId);
133859
133880
  return chromiumJsRuntimeDebuggerRef(device);
133860
133881
  }
133861
- return `JsRuntimeDebugger:${params.port}:${params.device_id}`;
133882
+ return `JsRuntimeDebugger:${params.port}:${deviceId}`;
133862
133883
  }
133863
133884
 
133864
133885
  // ../tool-server/src/tools/debugger/debugger-connect.ts
133865
133886
  var zodSchema29 = external_exports.object({
133866
133887
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium \u2014 its CDP port is encoded in device_id)"),
133867
133888
  device_id: external_exports.string().describe(
133868
- "Device id: iOS simulator UDID, Android logicalDeviceId returned by Metro, Vega serial (amazon-...), or Chromium device id (chromium-cdp-<port>) from list-devices. When a logicalDeviceId is returned, forward it as device_id to all subsequent debugger-* calls to pin them to this device; when none is returned (Vega), keep passing the id you connected with."
133889
+ "Device id from list-devices: iOS simulator UDID, Android serial, Vega serial (amazon-...), or Chromium device id (chromium-cdp-<port>). Pass this SAME id as device_id to every subsequent debugger-* call to pin them to this device. The returned logicalDeviceId is informational (Metro's own per-connection handle, absent on Vega); you do not switch to it \u2014 forwarding it still resolves here, but the list-devices id is the stable one."
133869
133890
  )
133870
133891
  });
133871
133892
  var debuggerConnectTool = {
@@ -133898,7 +133919,7 @@ init_zod();
133898
133919
  var zodSchema30 = external_exports.object({
133899
133920
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium)"),
133900
133921
  device_id: external_exports.string().describe(
133901
- "Device id from debugger-connect (iOS simulator UDID, Android logicalDeviceId, Vega serial, or Chromium device id)."
133922
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID, Android serial, Vega serial, or Chromium device id). The logicalDeviceId debugger-connect returns also resolves here, but prefer the stable list-devices id."
133902
133923
  )
133903
133924
  });
133904
133925
  var debuggerStatusTool = {
@@ -133933,7 +133954,7 @@ init_zod();
133933
133954
  var zodSchema31 = external_exports.object({
133934
133955
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium)"),
133935
133956
  device_id: external_exports.string().describe(
133936
- "Device id from debugger-connect (iOS simulator UDID, Android logicalDeviceId, Vega serial, or Chromium device id)."
133957
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID, Android serial, Vega serial, or Chromium device id). The logicalDeviceId debugger-connect returns also resolves here, but prefer the stable list-devices id."
133937
133958
  ),
133938
133959
  expression: external_exports.string().describe("JavaScript expression to evaluate in the app runtime")
133939
133960
  });
@@ -133964,7 +133985,7 @@ init_src();
133964
133985
  var zodSchema32 = external_exports.object({
133965
133986
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
133966
133987
  device_id: external_exports.string().describe(
133967
- "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
133988
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
133968
133989
  )
133969
133990
  });
133970
133991
  var debuggerReloadMetroTool = {
@@ -133979,7 +134000,7 @@ Use when you want to apply code changes or reset JS state. Returns { reloaded, p
133979
134000
  // want that on Chromium later, it deserves its own tool.
133980
134001
  capability: RN_ONLY_TOOL_CAPABILITY,
133981
134002
  services: (params) => ({
133982
- debugger: `JsRuntimeDebugger:${params.port}:${params.device_id}`
134003
+ debugger: `JsRuntimeDebugger:${params.port}:${canonicalDeviceId(params.device_id)}`
133983
134004
  }),
133984
134005
  async execute(services, _params) {
133985
134006
  const api = services.debugger;
@@ -134782,7 +134803,7 @@ function buildTextTree(data, opts) {
134782
134803
  var zodSchema33 = external_exports.object({
134783
134804
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
134784
134805
  device_id: external_exports.string().describe(
134785
- "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
134806
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
134786
134807
  ),
134787
134808
  onScreenOnly: external_exports.boolean().default(true).describe(
134788
134809
  "When true (default), only components visible on screen are returned. Set to false to include all mounted components including those scrolled off-screen. Useful when you need to understand the full page structure."
@@ -134821,7 +134842,7 @@ Use when you need tap coordinates for a React Native UI element. Returns a compa
134821
134842
  // for DOM-tree discovery on Chromium.
134822
134843
  capability: RN_ONLY_TOOL_CAPABILITY,
134823
134844
  services: (params) => ({
134824
- debugger: `JsRuntimeDebugger:${params.port}:${params.device_id}`
134845
+ debugger: `JsRuntimeDebugger:${params.port}:${canonicalDeviceId(params.device_id)}`
134825
134846
  }),
134826
134847
  async execute(services, params) {
134827
134848
  const api = services.debugger;
@@ -134849,7 +134870,7 @@ Use when you need tap coordinates for a React Native UI element. Returns a compa
134849
134870
  const deviceLine = [
134850
134871
  `device: ${api.deviceName}`,
134851
134872
  `app: ${api.appName}`,
134852
- ...api.logicalDeviceId ? [`udid: ${api.logicalDeviceId}`] : []
134873
+ ...api.logicalDeviceId ? [`logicalDeviceId: ${api.logicalDeviceId}`] : []
134853
134874
  ].join(" | ");
134854
134875
  return `[${deviceLine}]
134855
134876
  ${tree}`;
@@ -135289,7 +135310,7 @@ function filterInspectItems(items, includeSkipped = false) {
135289
135310
  var zodSchema34 = external_exports.object({
135290
135311
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
135291
135312
  device_id: external_exports.string().describe(
135292
- "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
135313
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
135293
135314
  ),
135294
135315
  x: external_exports.coerce.number().describe("Logical X coordinate on device screen"),
135295
135316
  y: external_exports.coerce.number().describe("Logical Y coordinate on device screen"),
@@ -135326,7 +135347,7 @@ Use when you need the source file and line for a component at a tap coordinate.
135326
135347
  // out of scope for this port.
135327
135348
  capability: RN_ONLY_TOOL_CAPABILITY,
135328
135349
  services: (params) => ({
135329
- debugger: `JsRuntimeDebugger:${params.port}:${params.device_id}`
135350
+ debugger: `JsRuntimeDebugger:${params.port}:${canonicalDeviceId(params.device_id)}`
135330
135351
  }),
135331
135352
  async execute(services, params) {
135332
135353
  const api = services.debugger;
@@ -135423,7 +135444,7 @@ init_zod();
135423
135444
  var zodSchema35 = external_exports.object({
135424
135445
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium)"),
135425
135446
  device_id: external_exports.string().describe(
135426
- "Device id from debugger-connect (iOS simulator UDID, Android logicalDeviceId, Vega serial, or Chromium device id)."
135447
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID, Android serial, Vega serial, or Chromium device id). The logicalDeviceId debugger-connect returns also resolves here, but prefer the stable list-devices id."
135427
135448
  )
135428
135449
  });
135429
135450
  var debuggerLogRegistryTool = {
@@ -135511,7 +135532,9 @@ ${lines.join("\n")}`;
135511
135532
  }
135512
135533
  var zodSchema36 = external_exports.object({
135513
135534
  port: external_exports.coerce.number().default(8081).describe("Metro server port (RN only; ignored on Chromium)"),
135514
- device_id: external_exports.string().describe("Device UDID (logicalDeviceId)."),
135535
+ device_id: external_exports.string().describe(
135536
+ "Device id from list-devices (iOS simulator UDID or Android serial) \u2014 the same id used with debugger-connect."
135537
+ ),
135515
135538
  pageIndex: external_exports.union([external_exports.coerce.number().int().nonnegative(), external_exports.literal("latest")]).default("latest").describe(
135516
135539
  'Page index (0-based) or "latest" for the most recent page. Each page contains up to 50 entries.'
135517
135540
  )
@@ -135533,7 +135556,7 @@ Fails if the app is not connected (RN) or the device is not reachable (Chromium)
135533
135556
  if (device.platform === "chromium") {
135534
135557
  return { chromium: chromiumCdpRef(device) };
135535
135558
  }
135536
- return { inspector: `NetworkInspector:${params.port}:${params.device_id}` };
135559
+ return { inspector: `NetworkInspector:${params.port}:${canonicalDeviceId(params.device_id)}` };
135537
135560
  },
135538
135561
  async execute(services, params) {
135539
135562
  if (resolveDevice(params.device_id).platform === "chromium") {
@@ -135597,7 +135620,9 @@ function redactHeaders(headers) {
135597
135620
  var MAX_BODY_SIZE = 1e3;
135598
135621
  var zodSchema37 = external_exports.object({
135599
135622
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
135600
- device_id: external_exports.string().describe("Device UDID (logicalDeviceId)."),
135623
+ device_id: external_exports.string().describe(
135624
+ "Device id from list-devices (iOS simulator UDID or Android serial) \u2014 the same id used with debugger-connect."
135625
+ ),
135601
135626
  requestId: external_exports.string().describe("The requestId from view-network-logs to get full details for"),
135602
135627
  includeBody: external_exports.coerce.boolean().default(true).describe("Whether to include the response body (if captured). Defaults to true.")
135603
135628
  });
@@ -135616,7 +135641,7 @@ Returns an error message string if the requestId is not found \u2014 use view-ne
135616
135641
  if (device.platform === "chromium") {
135617
135642
  return { chromium: chromiumCdpRef(device) };
135618
135643
  }
135619
- return { inspector: `NetworkInspector:${params.port}:${params.device_id}` };
135644
+ return { inspector: `NetworkInspector:${params.port}:${canonicalDeviceId(params.device_id)}` };
135620
135645
  },
135621
135646
  async execute(services, params) {
135622
135647
  if (resolveDevice(params.device_id).platform === "chromium") {
@@ -136175,7 +136200,7 @@ var NO_RENDERERS_ATTACHED_ERROR = "React DevTools hook is present but no React r
136175
136200
  var zodSchema40 = external_exports.object({
136176
136201
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
136177
136202
  device_id: external_exports.string().describe(
136178
- "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
136203
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
136179
136204
  ),
136180
136205
  sample_interval_us: external_exports.coerce.number().int().positive().default(100).describe("CPU sampling interval in microseconds (default 100)"),
136181
136206
  force: external_exports.boolean().default(false).describe(
@@ -136206,8 +136231,9 @@ Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot
136206
136231
  capability: RN_ONLY_TOOL_CAPABILITY,
136207
136232
  services: () => ({}),
136208
136233
  async execute(_services, params) {
136209
- const jsdUrn = `${JS_RUNTIME_DEBUGGER_NAMESPACE}:${params.port}:${params.device_id}`;
136210
- const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${params.device_id}`;
136234
+ const deviceId = canonicalDeviceId(params.device_id);
136235
+ const jsdUrn = `${JS_RUNTIME_DEBUGGER_NAMESPACE}:${params.port}:${deviceId}`;
136236
+ const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${deviceId}`;
136211
136237
  const ignore = () => {
136212
136238
  };
136213
136239
  async function disposeAndWait() {
@@ -136474,7 +136500,7 @@ async function readCommitTree(path36) {
136474
136500
  var zodSchema41 = external_exports.object({
136475
136501
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
136476
136502
  device_id: external_exports.string().describe(
136477
- "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
136503
+ "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
136478
136504
  )
136479
136505
  });
136480
136506
  function normalizeChangeDescription(raw) {
@@ -136560,7 +136586,7 @@ Fails if no active profiling session exists or the CDP connection was lost durin
136560
136586
  capability: RN_ONLY_TOOL_CAPABILITY,
136561
136587
  services: () => ({}),
136562
136588
  async execute(_services, params) {
136563
- const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${params.device_id}`;
136589
+ const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${canonicalDeviceId(params.device_id)}`;
136564
136590
  const snapshot = registry2.getSnapshot();
136565
136591
  const entry = snapshot.services.get(psUrn);
136566
136592
  if (!entry || entry.state !== "RUNNING" /* RUNNING */) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.16.1-next.3",
3
+ "version": "0.16.1-next.5",
4
4
  "description": "MCP server for iOS Simulator and Android Emulator control",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {