@swmansion/argent 0.34.1-next.102 → 0.34.1-next.104

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.
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -38575,7 +38575,7 @@ function isCi(env = process.env) {
38575
38575
  var SESSION_ID2 = randomUUID5();
38576
38576
  function readCliVersion() {
38577
38577
  if (true) {
38578
- return "0.34.1-next.102";
38578
+ return "0.34.1-next.104";
38579
38579
  }
38580
38580
  return "0.0.0";
38581
38581
  }
@@ -16998,7 +16998,7 @@ function isCi(env = process.env) {
16998
16998
  var SESSION_ID = randomUUID4();
16999
16999
  function readCliVersion() {
17000
17000
  if (true) {
17001
- return "0.34.1-next.102";
17001
+ return "0.34.1-next.104";
17002
17002
  }
17003
17003
  return "0.0.0";
17004
17004
  }
@@ -72948,7 +72948,7 @@ function isCi(env = process.env) {
72948
72948
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
72949
72949
  function readCliVersion() {
72950
72950
  if (true) {
72951
- return "0.34.1-next.102";
72951
+ return "0.34.1-next.104";
72952
72952
  }
72953
72953
  return "0.0.0";
72954
72954
  }
@@ -126758,6 +126758,8 @@ function createConsoleLogServer2(consoleEvents, logWriter) {
126758
126758
  server.on("error", reject);
126759
126759
  });
126760
126760
  }
126761
+ var BEFORE_THAT = " Before that: ";
126762
+ var KEPT_AT = " is kept at ";
126761
126763
  function cdpDisconnectedError() {
126762
126764
  return new FailureError("CDP disconnected", {
126763
126765
  error_code: FAILURE_CODES.JS_RUNTIME_CDP_DISCONNECTED,
@@ -126859,7 +126861,7 @@ var jsRuntimeDebuggerBlueprint = {
126859
126861
  const logWriter = new LogFileWriter(port);
126860
126862
  const consoleEvents = new TypedEventEmitter();
126861
126863
  let nextLogId = 0;
126862
- cdp.events.on("consoleAPICalled", (params) => {
126864
+ const onConsoleAPI = (params) => {
126863
126865
  const entry = {
126864
126866
  id: nextLogId++,
126865
126867
  level: params.type,
@@ -126880,9 +126882,11 @@ var jsRuntimeDebuggerBlueprint = {
126880
126882
  stackTrace: entry.stackTrace
126881
126883
  });
126882
126884
  consoleEvents.emit("log", entry);
126883
- });
126885
+ };
126886
+ cdp.events.on("consoleAPICalled", onConsoleAPI);
126884
126887
  const logicalDeviceId = selected.target.reactNative?.logicalDeviceId;
126885
126888
  const closeLog = ({ breadcrumb }) => {
126889
+ cdp.events.off("consoleAPICalled", onConsoleAPI);
126886
126890
  const captured = logWriter.getStats().totalEntries;
126887
126891
  const connectionLost = !cdp.isConnected();
126888
126892
  const inFile = logWriter.getFileEntryCount();
@@ -126891,14 +126895,15 @@ var jsRuntimeDebuggerBlueprint = {
126891
126895
  if (breadcrumb && captured > 0) {
126892
126896
  const entries = `${captured} captured console ${captured === 1 ? "entry" : "entries"}`;
126893
126897
  const since = "This registry holds only what the runtime replayed or logged since, so earlier entries may be missing.";
126894
- const salvage = keepFile ? `The log file with ${inFile < captured ? `${inFile} of its` : "its"} ${entries} is kept at ${logWriter.getFilePath()}. If the app kept running, the current registry may repeat these entries, replayed by the runtime.` : stored ? `The ${entries} went with it: the log file is deleted on teardown. ${since}` : `The ${entries} went with it: no log file held them. ${since}`;
126898
+ const salvage = keepFile ? `The log file with ${inFile < captured ? `${inFile} of its` : "its"} ${entries}${KEPT_AT}${logWriter.getFilePath()}. If the app kept running, the current registry may repeat these entries, replayed by the runtime.` : stored ? `The ${entries} went with it: the log file is deleted on teardown. ${since}` : `The ${entries} went with it: no log file held them. ${since}`;
126895
126899
  const kind = `js-runtime-debugger:${port}`;
126896
126900
  const ids = [deviceId, logicalDeviceId];
126897
- const earlier = takeReapedSessionAnyId(kind, ids)?.salvage;
126901
+ const earlier = takeReapedSessionAnyId(kind, ids)?.salvage?.split(BEFORE_THAT);
126902
+ const before = earlier?.findLast((note) => note.includes(KEPT_AT)) ?? earlier?.at(-1);
126898
126903
  recordReapedSession(
126899
126904
  kind,
126900
126905
  ids,
126901
- earlier ? `${salvage} Before that: ${earlier}` : salvage,
126906
+ before ? `${salvage}${BEFORE_THAT}${before}` : salvage,
126902
126907
  connectionLost
126903
126908
  );
126904
126909
  }
@@ -126941,9 +126946,12 @@ var jsRuntimeDebuggerBlueprint = {
126941
126946
  await cdp.addBinding("__argent_callback", { legacyInspector: selected.legacyInspector });
126942
126947
  await cdp.evaluate(DISABLE_LOGBOX_SCRIPT).catch(warnOnError("DISABLE_LOGBOX_SCRIPT"));
126943
126948
  await sourceMaps.waitForPending();
126944
- if (!cdp.isConnected()) throw cdpDisconnectedError();
126945
126949
  const sourceResolver = createSourceResolver(port, metro.projectRoot);
126946
126950
  const consoleServer = await createConsoleLogServer2(consoleEvents, logWriter);
126951
+ if (!cdp.isConnected()) {
126952
+ await consoleServer.close();
126953
+ throw cdpDisconnectedError();
126954
+ }
126947
126955
  const api = {
126948
126956
  port,
126949
126957
  projectRoot: metro.projectRoot,
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.102",
3
+ "version": "0.34.1-next.104",
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",
@@ -98,5 +98,5 @@
98
98
  "vitest": "^5.0.5",
99
99
  "yaml": "^2.9.1"
100
100
  },
101
- "gitHead": "972a772e111c127f5c72be85a3a0452e7f961b59"
101
+ "gitHead": "6dee8b2e1a6c4f9f149a42157b884eb30039c06d"
102
102
  }