@swmansion/argent 0.26.1-next.15 → 0.26.1-next.16

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
@@ -1866,8 +1866,10 @@ async function killToolServer(bundlePath) {
1866
1866
  }
1867
1867
  var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs.existsSync(p)) ?? "ps";
1868
1868
  var PS_WIDTH_FLAGS = ["-ww"];
1869
- function readProcessCommandLine(pid, flags2 = PS_WIDTH_FLAGS) {
1869
+ var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
1870
+ function readProcessCommandLine(pid, flags2 = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
1870
1871
  return execFileSync(PS_BIN, [...flags2, "-p", String(pid), "-o", "command="], {
1872
+ env,
1871
1873
  encoding: "utf8",
1872
1874
  timeout: 2e3,
1873
1875
  // A recycled pid can sit on a process with an argv past Node's 1 MiB exec
@@ -1882,19 +1884,27 @@ function readProcessCommandLine(pid, flags2 = PS_WIDTH_FLAGS) {
1882
1884
  function couldBeOurToolServer(pid, marker) {
1883
1885
  if (!marker) return false;
1884
1886
  if (process.platform === "win32") return true;
1885
- let cmd;
1886
- try {
1887
- cmd = readProcessCommandLine(pid);
1888
- } catch (err) {
1887
+ const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1888
+ const ours = new RegExp(`(?:^|[\\t\\n\\v\\f\\r ])${escaped} start(?:[\\t\\n\\v\\f\\r ]|$)`);
1889
+ const nonAscii = [...marker].some((c2) => c2.charCodeAt(0) > 127);
1890
+ let failure;
1891
+ for (const env of [void 0, process.env]) {
1892
+ try {
1893
+ if (ours.test(readProcessCommandLine(pid, PS_WIDTH_FLAGS, env))) return true;
1894
+ failure = void 0;
1895
+ if (!nonAscii) break;
1896
+ } catch (err) {
1897
+ failure = String(err);
1898
+ if (err.code === "ETIMEDOUT") break;
1899
+ }
1900
+ }
1901
+ if (failure !== void 0) {
1889
1902
  process.stderr.write(
1890
- `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${String(err)}
1903
+ `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${failure}
1891
1904
  `
1892
1905
  );
1893
- return false;
1894
1906
  }
1895
- if (!cmd) return false;
1896
- const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1897
- return new RegExp(`(?:^|\\s)${escaped} start(?:\\s|$)`).test(cmd);
1907
+ return false;
1898
1908
  }
1899
1909
  var LOCK_WAIT_TIMEOUT_MS = 3e4;
1900
1910
  var LOCK_STALE_MS = 45e3;
@@ -21906,7 +21916,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
21906
21916
  var SESSION_ID2 = randomUUID5();
21907
21917
  function readCliVersion() {
21908
21918
  if (true) {
21909
- return "0.26.1-next.15";
21919
+ return "0.26.1-next.16";
21910
21920
  }
21911
21921
  return "0.0.0";
21912
21922
  }
package/dist/client.js CHANGED
@@ -1069,8 +1069,10 @@ async function killToolServer(bundlePath) {
1069
1069
  }
1070
1070
  var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs4.existsSync(p)) ?? "ps";
1071
1071
  var PS_WIDTH_FLAGS = ["-ww"];
1072
- function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS) {
1072
+ var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
1073
+ function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
1073
1074
  return execFileSync(PS_BIN, [...flags, "-p", String(pid), "-o", "command="], {
1075
+ env,
1074
1076
  encoding: "utf8",
1075
1077
  timeout: 2e3,
1076
1078
  // A recycled pid can sit on a process with an argv past Node's 1 MiB exec
@@ -1085,19 +1087,27 @@ function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS) {
1085
1087
  function couldBeOurToolServer(pid, marker) {
1086
1088
  if (!marker) return false;
1087
1089
  if (process.platform === "win32") return true;
1088
- let cmd;
1089
- try {
1090
- cmd = readProcessCommandLine(pid);
1091
- } catch (err) {
1090
+ const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1091
+ const ours = new RegExp(`(?:^|[\\t\\n\\v\\f\\r ])${escaped} start(?:[\\t\\n\\v\\f\\r ]|$)`);
1092
+ const nonAscii = [...marker].some((c) => c.charCodeAt(0) > 127);
1093
+ let failure;
1094
+ for (const env of [void 0, process.env]) {
1095
+ try {
1096
+ if (ours.test(readProcessCommandLine(pid, PS_WIDTH_FLAGS, env))) return true;
1097
+ failure = void 0;
1098
+ if (!nonAscii) break;
1099
+ } catch (err) {
1100
+ failure = String(err);
1101
+ if (err.code === "ETIMEDOUT") break;
1102
+ }
1103
+ }
1104
+ if (failure !== void 0) {
1092
1105
  process.stderr.write(
1093
- `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${String(err)}
1106
+ `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${failure}
1094
1107
  `
1095
1108
  );
1096
- return false;
1097
1109
  }
1098
- if (!cmd) return false;
1099
- const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1100
- return new RegExp(`(?:^|\\s)${escaped} start(?:\\s|$)`).test(cmd);
1110
+ return false;
1101
1111
  }
1102
1112
  var LOCK_WAIT_TIMEOUT_MS = 3e4;
1103
1113
  var LOCK_STALE_MS = 45e3;
@@ -16730,7 +16730,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16730
16730
  var SESSION_ID = randomUUID4();
16731
16731
  function readCliVersion() {
16732
16732
  if (true) {
16733
- return "0.26.1-next.15";
16733
+ return "0.26.1-next.16";
16734
16734
  }
16735
16735
  return "0.0.0";
16736
16736
  }
@@ -23267,8 +23267,10 @@ async function killToolServerForInstallDir(packageDir) {
23267
23267
  }
23268
23268
  var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs17.existsSync(p)) ?? "ps";
23269
23269
  var PS_WIDTH_FLAGS = ["-ww"];
23270
- function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS) {
23270
+ var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
23271
+ function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
23271
23272
  return execFileSync5(PS_BIN, [...flags, "-p", String(pid), "-o", "command="], {
23273
+ env,
23272
23274
  encoding: "utf8",
23273
23275
  timeout: 2e3,
23274
23276
  // A recycled pid can sit on a process with an argv past Node's 1 MiB exec
@@ -23283,19 +23285,27 @@ function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS) {
23283
23285
  function couldBeOurToolServer(pid, marker) {
23284
23286
  if (!marker) return false;
23285
23287
  if (process.platform === "win32") return true;
23286
- let cmd;
23287
- try {
23288
- cmd = readProcessCommandLine(pid);
23289
- } catch (err) {
23288
+ const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
23289
+ const ours = new RegExp(`(?:^|[\\t\\n\\v\\f\\r ])${escaped} start(?:[\\t\\n\\v\\f\\r ]|$)`);
23290
+ const nonAscii = [...marker].some((c2) => c2.charCodeAt(0) > 127);
23291
+ let failure;
23292
+ for (const env of [void 0, process.env]) {
23293
+ try {
23294
+ if (ours.test(readProcessCommandLine(pid, PS_WIDTH_FLAGS, env))) return true;
23295
+ failure = void 0;
23296
+ if (!nonAscii) break;
23297
+ } catch (err) {
23298
+ failure = String(err);
23299
+ if (err.code === "ETIMEDOUT") break;
23300
+ }
23301
+ }
23302
+ if (failure !== void 0) {
23290
23303
  process.stderr.write(
23291
- `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${String(err)}
23304
+ `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${failure}
23292
23305
  `
23293
23306
  );
23294
- return false;
23295
23307
  }
23296
- if (!cmd) return false;
23297
- const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
23298
- return new RegExp(`(?:^|\\s)${escaped} start(?:\\s|$)`).test(cmd);
23308
+ return false;
23299
23309
  }
23300
23310
 
23301
23311
  // ../argent-tools-client/src/link-config.ts
@@ -16104,8 +16104,10 @@ async function terminatePid(pid, stillOurs) {
16104
16104
  }
16105
16105
  var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs.existsSync(p)) ?? "ps";
16106
16106
  var PS_WIDTH_FLAGS = ["-ww"];
16107
- function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS) {
16107
+ var PS_LOCALE = process.platform === "darwin" ? "en_US.UTF-8" : "C.UTF-8";
16108
+ function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS, env = { ...process.env, LC_ALL: PS_LOCALE }) {
16108
16109
  return execFileSync(PS_BIN, [...flags, "-p", String(pid), "-o", "command="], {
16110
+ env,
16109
16111
  encoding: "utf8",
16110
16112
  timeout: 2e3,
16111
16113
  // A recycled pid can sit on a process with an argv past Node's 1 MiB exec
@@ -16120,19 +16122,27 @@ function readProcessCommandLine(pid, flags = PS_WIDTH_FLAGS) {
16120
16122
  function couldBeOurToolServer(pid, marker) {
16121
16123
  if (!marker) return false;
16122
16124
  if (process.platform === "win32") return true;
16123
- let cmd;
16124
- try {
16125
- cmd = readProcessCommandLine(pid);
16126
- } catch (err) {
16125
+ const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16126
+ const ours = new RegExp(`(?:^|[\\t\\n\\v\\f\\r ])${escaped} start(?:[\\t\\n\\v\\f\\r ]|$)`);
16127
+ const nonAscii = [...marker].some((c) => c.charCodeAt(0) > 127);
16128
+ let failure;
16129
+ for (const env of [void 0, process.env]) {
16130
+ try {
16131
+ if (ours.test(readProcessCommandLine(pid, PS_WIDTH_FLAGS, env))) return true;
16132
+ failure = void 0;
16133
+ if (!nonAscii) break;
16134
+ } catch (err) {
16135
+ failure = String(err);
16136
+ if (err.code === "ETIMEDOUT") break;
16137
+ }
16138
+ }
16139
+ if (failure !== void 0) {
16127
16140
  process.stderr.write(
16128
- `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${String(err)}
16141
+ `[launcher] ps could not read pid ${pid}'s command line; leaving it alone: ${failure}
16129
16142
  `
16130
16143
  );
16131
- return false;
16132
16144
  }
16133
- if (!cmd) return false;
16134
- const escaped = marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16135
- return new RegExp(`(?:^|\\s)${escaped} start(?:\\s|$)`).test(cmd);
16145
+ return false;
16136
16146
  }
16137
16147
  var LOCK_WAIT_TIMEOUT_MS = 3e4;
16138
16148
  var LOCK_STALE_MS = 45e3;
@@ -94814,7 +94814,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
94814
94814
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
94815
94815
  function readCliVersion() {
94816
94816
  if (true) {
94817
- return "0.26.1-next.15";
94817
+ return "0.26.1-next.16";
94818
94818
  }
94819
94819
  return "0.0.0";
94820
94820
  }
@@ -96174,7 +96174,7 @@ var import_node_path6 = __toESM(require("node:path"));
96174
96174
  var import_semver2 = __toESM(require_semver2());
96175
96175
 
96176
96176
  // ../tool-server/package.json
96177
- var version2 = "0.26.0";
96177
+ var version2 = "0.27.0";
96178
96178
 
96179
96179
  // ../tool-server/src/utils/update-checker.ts
96180
96180
  var import_update_core = __toESM(require_dist4());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.26.1-next.15",
3
+ "version": "0.26.1-next.16",
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",