peachsim 0.1.708 → 0.1.710

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.
Files changed (84) hide show
  1. package/cli/commands/control.ts +55 -1
  2. package/cli/current-sim.ts +15 -1
  3. package/cli/drivers/playwright-sim-host.ts +14 -1
  4. package/cli/drivers/playwright.ts +36 -3
  5. package/cli/main.ts +8 -0
  6. package/cli/outbound-endpoints.ts +95 -27
  7. package/cli/parent-pid.ts +91 -15
  8. package/cli/ws-bridge.ts +5 -0
  9. package/dist-lib/agent-daemon-client.cjs +1 -1
  10. package/dist-lib/agent-events.cjs +1 -1
  11. package/dist-lib/agent-identity.cjs +1 -1
  12. package/dist-lib/agent-sessions.cjs +1 -1
  13. package/dist-lib/attached-projects.cjs +1 -1
  14. package/dist-lib/auth/shared-session.cjs +1 -1
  15. package/dist-lib/backend-origin.cjs +1 -1
  16. package/dist-lib/beta.cjs +1 -1
  17. package/dist-lib/beta.mjs +1 -1
  18. package/dist-lib/bridge-constants.cjs +1 -1
  19. package/dist-lib/bridge-contract-input.cjs +1 -1
  20. package/dist-lib/bridge-contract-input.mjs +1 -1
  21. package/dist-lib/bridge-contract.cjs +1 -1
  22. package/dist-lib/bridge-contract.mjs +1 -1
  23. package/dist-lib/capture-contract.cjs +1 -1
  24. package/dist-lib/capture-contract.mjs +1 -1
  25. package/dist-lib/cli-constants.cjs +1 -1
  26. package/dist-lib/cloud-contract.cjs +1 -1
  27. package/dist-lib/cloud-contract.mjs +1 -1
  28. package/dist-lib/cloud-test-args.cjs +1 -1
  29. package/dist-lib/cloud-test-args.mjs +1 -1
  30. package/dist-lib/cloud.cjs +1 -1
  31. package/dist-lib/cloud.mjs +1 -1
  32. package/dist-lib/config.cjs +1 -1
  33. package/dist-lib/detox/index.cjs +78 -5
  34. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +172 -30
  37. package/dist-lib/host/fetch-proxy-handler.cjs +45 -21
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +78 -5
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +1 -1
  45. package/dist-lib/kotlin-host.cjs +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +1 -1
  53. package/dist-lib/native-app-identity.cjs +1 -1
  54. package/dist-lib/native-app-identity.mjs +1 -1
  55. package/dist-lib/native-firebase-metadata.cjs +1 -1
  56. package/dist-lib/native-firebase-metadata.mjs +1 -1
  57. package/dist-lib/plist.cjs +1 -1
  58. package/dist-lib/plist.mjs +1 -1
  59. package/dist-lib/profiles.cjs +1 -1
  60. package/dist-lib/public-brand.cjs +1 -1
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/render-mode.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +333 -53
  68. package/dist-lib/swift-compile.cjs +8 -2
  69. package/dist-lib/swift-compile.mjs +8 -2
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +2 -2
  73. package/dist-lib/swift-submit.mjs +2 -2
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +9 -3
  77. package/dist-lib/vite.cjs +1 -1
  78. package/package.json +2 -1
  79. package/src/host/bridge-host.ts +65 -0
  80. package/src/host/fetch-proxy-handler.ts +52 -23
  81. package/src/host/fetch-proxy-overrides.ts +5 -1
  82. package/src/host/fetch-proxy-transport.ts +82 -0
  83. package/src/swift-compile.ts +8 -2
  84. package/src/swift-submit.ts +2 -1
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -663,6 +663,7 @@ var import_fs = require("fs");
663
663
  var import_module = require("module");
664
664
  var cached = null;
665
665
  var cachedComm = null;
666
+ var cachedPgid = null;
666
667
  function getParentPid(pid) {
667
668
  if (!cached) cached = build();
668
669
  try {
@@ -679,6 +680,14 @@ function getProcessComm(pid) {
679
680
  return null;
680
681
  }
681
682
  }
683
+ function getProcessPgid(pid) {
684
+ if (!cachedPgid) cachedPgid = buildPgid();
685
+ try {
686
+ return cachedPgid(pid);
687
+ } catch {
688
+ return null;
689
+ }
690
+ }
682
691
  function buildComm() {
683
692
  if (process.platform === "linux") {
684
693
  return (pid) => {
@@ -712,6 +721,31 @@ function build() {
712
721
  }
713
722
  return () => null;
714
723
  }
724
+ function buildPgid() {
725
+ if (process.platform === "linux") {
726
+ return (pid) => {
727
+ try {
728
+ const raw = (0, import_fs.readFileSync)(`/proc/${pid}/stat`, "utf8");
729
+ const end = raw.lastIndexOf(")");
730
+ if (end < 0) return null;
731
+ const rest = raw.slice(end + 1).trim().split(/\s+/);
732
+ const pgid = Number(rest[2]);
733
+ return Number.isFinite(pgid) && pgid > 0 ? pgid : null;
734
+ } catch {
735
+ return null;
736
+ }
737
+ };
738
+ }
739
+ if (process.platform === "darwin") {
740
+ const ffi = tryBuildDarwinPgidFfi();
741
+ if (ffi) return ffi;
742
+ return (pid) => {
743
+ const pgid = readProcessTable().get(pid)?.pgid;
744
+ return pgid !== void 0 && pgid > 0 ? pgid : null;
745
+ };
746
+ }
747
+ return () => null;
748
+ }
715
749
  var PROCESS_TABLE_TTL_MS = 2e3;
716
750
  var processTable = { readAt: 0, rows: /* @__PURE__ */ new Map() };
717
751
  function readProcessTable() {
@@ -721,18 +755,19 @@ function readProcessTable() {
721
755
  }
722
756
  const rows = /* @__PURE__ */ new Map();
723
757
  try {
724
- const out = (0, import_child_process.execFileSync)("ps", ["-eo", "pid=,ppid=,comm="], {
758
+ const out = (0, import_child_process.execFileSync)("ps", ["-eo", "pid=,ppid=,pgid=,comm="], {
725
759
  encoding: "utf8",
726
760
  timeout: 5e3,
727
761
  maxBuffer: 8 * 1024 * 1024,
728
762
  stdio: ["ignore", "pipe", "ignore"]
729
763
  });
730
764
  for (const line of out.split("\n")) {
731
- const parsed = line.trim().match(/^(\d+)\s+(\d+)\s+(.*)$/);
765
+ const parsed = line.trim().match(/^(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/);
732
766
  if (!parsed) continue;
733
767
  rows.set(Number(parsed[1]), {
734
768
  ppid: Number(parsed[2]),
735
- comm: (parsed[3].split("/").at(-1) ?? "").slice(0, PBI_COMM_LEN)
769
+ pgid: Number(parsed[3]),
770
+ comm: (parsed[4].split("/").at(-1) ?? "").slice(0, PBI_COMM_LEN)
736
771
  });
737
772
  }
738
773
  } catch {
@@ -809,6 +844,31 @@ function tryBuildDarwinCommFfi() {
809
844
  return null;
810
845
  }
811
846
  }
847
+ var PBI_PGID_OFFSET = 100;
848
+ function tryBuildDarwinPgidFfi() {
849
+ if (!process.versions?.bun) return null;
850
+ try {
851
+ const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
852
+ const { dlopen, FFIType } = r("bun:ffi");
853
+ const lib = dlopen("/usr/lib/libproc.dylib", {
854
+ proc_pidinfo: {
855
+ args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
856
+ returns: FFIType.i32
857
+ }
858
+ });
859
+ const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
860
+ return (pid) => {
861
+ const ret = Number(
862
+ lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
863
+ );
864
+ if (ret <= 0) return null;
865
+ const pgid = buf.readUInt32LE(PBI_PGID_OFFSET);
866
+ return pgid > 0 ? pgid : null;
867
+ };
868
+ } catch {
869
+ return null;
870
+ }
871
+ }
812
872
 
813
873
  // cli/secure-file.ts
814
874
  var import_node_crypto2 = require("node:crypto");
@@ -903,6 +963,15 @@ function getCliIdentity() {
903
963
  function getCliIdentityKey() {
904
964
  return getCliIdentity().key;
905
965
  }
966
+ function getStableOwnerPid() {
967
+ return findTopAncestor(process.ppid);
968
+ }
969
+ function getOwnerProcessGroupId() {
970
+ const owner = getStableOwnerPid();
971
+ if (!owner || owner <= 1) return null;
972
+ const pgid = getProcessPgid(owner);
973
+ return pgid !== null && pgid > 1 ? pgid : null;
974
+ }
906
975
  function getCurrentSimPath() {
907
976
  if (process.env[CURRENT_SIM_PATH_ENV]) {
908
977
  return (0, import_path.resolve)(process.env[CURRENT_SIM_PATH_ENV]);
@@ -1136,7 +1205,11 @@ function createBridge(wsPort, opts = {}) {
1136
1205
  id: 0,
1137
1206
  cliIdentityKey: identity.key,
1138
1207
  cliIdentitySource: identity.source,
1139
- cliLabel: opts.cliLabel
1208
+ cliLabel: opts.cliLabel,
1209
+ // lets the bridge free this cli's leases once its owning
1210
+ // session is entirely gone, instead of blocking others
1211
+ // until the TTL burns out. null when ancestry is unreadable.
1212
+ cliOwnerPgid: getOwnerProcessGroupId()
1140
1213
  })
1141
1214
  );
1142
1215
  } catch {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
package/dist-lib/menu.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/menu.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/public-brand.ts
4
4
  var name = "Peach";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/metro-production-bundle.ts
4
4
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-app-identity.ts
4
4
  var NATIVE_APP_IDENTITY_PREFIX = "globalThis.__sootsimNativeAppIdentity=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-firebase-metadata.ts
4
4
  var PREFIX = "globalThis.__peachNativeFirebaseConfig=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/plist.ts
4
4
  import plistModule from "@expo/plist";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/react-native-host-modules.ts
4
4
  var REACT_NATIVE_PASSTHROUGH_SPECIFIERS = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
package/dist-lib/sdk.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/sdk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.708 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.710 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);