peachsim 0.1.2935 → 0.1.2937

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 (345) hide show
  1. package/LICENSE +6 -8
  2. package/cli/account-gate.ts +20 -3
  3. package/cli/app-bundle-resources.ts +66 -19
  4. package/cli/catalog/meta.ts +2 -106
  5. package/cli/command-agent.ts +7 -0
  6. package/cli/command-registry.ts +0 -1
  7. package/cli/commands/control.ts +13 -5
  8. package/cli/commands/daemon.ts +4 -2
  9. package/cli/commands/device.ts +78 -8
  10. package/cli/commands/do-chain.ts +11 -8
  11. package/cli/commands/inspect/core.ts +4 -9
  12. package/cli/commands/inspect/settling.ts +1 -0
  13. package/cli/commands/logout.ts +6 -1
  14. package/cli/commands/map.ts +2 -6
  15. package/cli/commands/package.ts +112 -57
  16. package/cli/commands/shell-url.ts +0 -1
  17. package/cli/download-auth.ts +2 -0
  18. package/cli/drivers/playwright-provisioning.ts +10 -38
  19. package/cli/github-workflow-identity.ts +8 -0
  20. package/cli/internal-child-contract.ts +1 -0
  21. package/cli/internal-child.ts +5 -0
  22. package/cli/main.ts +2 -10
  23. package/cli/outbound-endpoints.ts +26 -0
  24. package/detox/index.ts +227 -131
  25. package/dist-lib/agent-daemon-client.cjs +1 -1
  26. package/dist-lib/agent-events.cjs +1 -1
  27. package/dist-lib/attached-projects.cjs +1 -1
  28. package/dist-lib/auth/shared-session.cjs +1 -1
  29. package/dist-lib/backend-origin.cjs +1 -1
  30. package/dist-lib/beta.cjs +1 -1
  31. package/dist-lib/beta.mjs +2 -2
  32. package/dist-lib/bridge-constants.cjs +1 -1
  33. package/dist-lib/bridge-contract-input.cjs +47 -3
  34. package/dist-lib/bridge-contract-input.mjs +6 -6
  35. package/dist-lib/bridge-contract.cjs +10 -1
  36. package/dist-lib/bridge-contract.mjs +3 -3
  37. package/dist-lib/bundle-channel.cjs +12779 -9515
  38. package/dist-lib/capture-contract.cjs +39 -17
  39. package/dist-lib/capture-contract.mjs +3 -3
  40. package/dist-lib/cloud-contract.cjs +1 -1
  41. package/dist-lib/cloud-contract.mjs +3 -3
  42. package/dist-lib/cloud-test-args.cjs +1 -1
  43. package/dist-lib/cloud-test-args.mjs +2 -2
  44. package/dist-lib/cloud.cjs +1 -1
  45. package/dist-lib/cloud.mjs +8 -8
  46. package/dist-lib/config.cjs +1 -1
  47. package/dist-lib/config.mjs +6 -6
  48. package/dist-lib/detox/index.cjs +200 -132
  49. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  50. package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
  52. package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
  53. package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
  54. package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
  55. package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
  56. package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
  57. package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
  58. package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
  59. package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
  60. package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
  61. package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
  62. package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
  63. package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
  64. package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
  65. package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
  66. package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
  67. package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
  68. package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
  69. package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
  70. package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
  71. package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
  72. package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
  73. package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
  74. package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
  75. package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
  76. package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
  77. package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
  78. package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
  79. package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
  80. package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
  81. package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
  82. package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
  83. package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
  84. package/dist-lib/expo-swift-bundle.cjs +21037 -17896
  85. package/dist-lib/expo-swift-metadata.cjs +8 -2
  86. package/dist-lib/expo-swift-metadata.mjs +9 -8
  87. package/dist-lib/home-paths.cjs +1 -1
  88. package/dist-lib/host/bridge-host.cjs +22481 -18741
  89. package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
  90. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  91. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  92. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  93. package/dist-lib/host/websocket-proxy.cjs +1 -1
  94. package/dist-lib/index.cjs +68 -38
  95. package/dist-lib/kotlin-host.cjs +97 -21
  96. package/dist-lib/menu.cjs +1 -1
  97. package/dist-lib/menu.mjs +3 -3
  98. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  99. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  100. package/dist-lib/metro-production-bundle.cjs +23 -1
  101. package/dist-lib/metro-production-bundle.mjs +24 -4
  102. package/dist-lib/native-app-identity-project.cjs +3582 -571
  103. package/dist-lib/native-app-identity-project.mjs +1024 -398
  104. package/dist-lib/native-app-identity.cjs +1 -1
  105. package/dist-lib/native-app-identity.mjs +6 -6
  106. package/dist-lib/native-firebase-metadata.cjs +1 -1
  107. package/dist-lib/native-firebase-metadata.mjs +3 -3
  108. package/dist-lib/pdfium-raster.cjs +1 -1
  109. package/dist-lib/pdfium-raster.mjs +2 -2
  110. package/dist-lib/plist.cjs +1 -1
  111. package/dist-lib/plist.mjs +3 -3
  112. package/dist-lib/profiles.cjs +1 -1
  113. package/dist-lib/public-brand.cjs +1 -1
  114. package/dist-lib/public-origins-lib-esm.json +132 -116
  115. package/dist-lib/public-origins-lib.json +215 -173
  116. package/dist-lib/react-native-host-modules.cjs +1 -1
  117. package/dist-lib/react-native-host-modules.mjs +2 -2
  118. package/dist-lib/reap-browser.cjs +17 -1
  119. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  120. package/dist-lib/sdk.cjs +6 -7
  121. package/dist-lib/sdk.mjs +13 -14
  122. package/dist-lib/skills.cjs +23216 -19650
  123. package/dist-lib/swift-compile.cjs +4337 -2905
  124. package/dist-lib/swift-compile.mjs +15 -13
  125. package/dist-lib/swift-package.cjs +1 -1
  126. package/dist-lib/swift-package.mjs +3 -3
  127. package/dist-lib/swift-submit.cjs +1 -1
  128. package/dist-lib/swift-submit.mjs +6 -6
  129. package/dist-lib/swift-svg-raster.cjs +1 -1
  130. package/dist-lib/swift-svg-raster.mjs +2 -2
  131. package/dist-lib/swift-toolchain.cjs +19 -1
  132. package/dist-lib/swift.cjs +1 -1
  133. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  134. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  135. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  136. package/dist-lib/vendor/acorn.cjs +1 -1
  137. package/dist-lib/vendor/stream-json.cjs +1 -1
  138. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  139. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  140. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  141. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  142. package/dist-lib/vendor/sucrase.cjs +1 -1
  143. package/dist-lib/vendor/terser.cjs +1 -1
  144. package/dist-lib/vendor/valibot.cjs +1 -1
  145. package/dist-lib/vendor/ws.cjs +94 -32
  146. package/dist-lib/vendor/zod.cjs +1 -1
  147. package/dist-lib/worklet-executable.cjs +8 -5
  148. package/dist-lib/worklet-executable.mjs +9 -6
  149. package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
  150. package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
  151. package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
  152. package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
  153. package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
  154. package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
  155. package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
  156. package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
  157. package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
  158. package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
  159. package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
  160. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
  161. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
  162. package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
  163. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
  164. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
  165. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
  166. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
  167. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
  168. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
  169. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
  170. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
  171. package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
  172. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
  173. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
  174. package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
  175. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
  176. package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
  177. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
  178. package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
  179. package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
  180. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
  181. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
  182. package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
  183. package/package.json +2 -2
  184. package/runtime-companion.json +1 -1
  185. package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
  186. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
  187. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
  188. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
  189. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
  190. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
  191. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
  192. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
  193. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
  194. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
  195. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
  196. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
  197. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
  198. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
  199. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
  200. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
  201. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
  203. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
  204. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
  205. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
  206. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
  207. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
  208. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
  209. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
  210. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
  211. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
  212. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
  213. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
  214. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
  215. package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  216. package/sdk/ios/wasm/include/unistd.h +1 -0
  217. package/src/acorn-program.ts +3 -0
  218. package/src/audio-codec-archives.ts +141 -0
  219. package/src/bridge-contract-input.ts +61 -1
  220. package/src/bridge-contract.ts +45 -4
  221. package/src/bundle-channel.mjs +44 -30
  222. package/src/capture-contract.ts +57 -39
  223. package/src/conformance-comparison-contract.ts +2 -0
  224. package/src/expo-discovery-cache.ts +0 -2
  225. package/src/expo-macro-host.ts +8 -3
  226. package/src/expo-native-compiler-digest.ts +0 -1
  227. package/src/expo-native-prebuilt.ts +1 -1
  228. package/src/expo-native-workspace.ts +83 -45
  229. package/src/expo-pod-prebuilt.ts +1 -0
  230. package/src/expo-swift-host.ts +158 -77
  231. package/src/expo-swift-legacy-runtime-source.ts +12 -1
  232. package/src/expo-swift-view-source.ts +51 -20
  233. package/src/expo-workspace-exclusion.ts +7 -1
  234. package/src/expoSwiftContract.ts +10 -1
  235. package/src/ffmpeg-source-build.ts +123 -59
  236. package/src/genrule-archives.ts +7 -2
  237. package/src/genrule-library-builds.ts +101 -18
  238. package/src/host/bridge-host.ts +10 -1
  239. package/src/installed-native-libraries.ts +147 -23
  240. package/src/installed-package-versions.ts +30 -0
  241. package/src/ios-rn-bundle-request.ts +3 -1
  242. package/src/ios-rn-bundle.ts +38 -27
  243. package/src/ios-rn-compile.ts +23 -6
  244. package/src/ios-rn-startup.ts +2 -1
  245. package/src/java-module-abi.ts +4 -3
  246. package/src/kotlin-host.ts +4 -4
  247. package/src/kotlin-library-sources.ts +8 -5
  248. package/src/metro-production-bundle.ts +24 -0
  249. package/src/native-firebase-config.ts +2 -0
  250. package/src/native-framework-compiler.ts +5 -0
  251. package/src/native-package-slice-build.ts +3 -0
  252. package/src/native-package-slice.ts +15 -10
  253. package/src/native-preparation.ts +4 -1
  254. package/src/native-static-libraries.ts +107 -33
  255. package/src/nativeRuntimePackageIndex.ts +1 -4
  256. package/src/nitro-adapter.lock.json +286 -286
  257. package/src/nitro-app-providers.ts +20 -8
  258. package/src/nitro-compile.ts +131 -37
  259. package/src/nitro-dependencies.ts +42 -8
  260. package/src/nitro-source.ts +40 -36
  261. package/src/nitro-superset.lock.json +4 -4
  262. package/src/nitroAdapterContract.ts +32 -7
  263. package/src/nitroContract.ts +21 -37
  264. package/src/one-direct-host-source.ts +247 -140
  265. package/src/one-fabric.ts +129 -0
  266. package/src/one-native-controls-package.ts +95 -21
  267. package/src/one-native-controls-release.ts +147 -14
  268. package/src/one-native-source.ts +4 -1
  269. package/src/one-nitro-inputs.ts +1 -1
  270. package/src/one-nitro-source.ts +45 -1
  271. package/src/one-sdk/source.ts +10 -41
  272. package/src/one-widget-metadata.ts +2 -2
  273. package/src/one-widget-package.ts +1 -1
  274. package/src/oneSdkContract.ts +3 -0
  275. package/src/playwright-browser-paths.ts +30 -0
  276. package/src/pods-install.ts +6 -2
  277. package/src/pods-post-install.ts +2 -2
  278. package/src/pods-project.ts +10 -0
  279. package/src/podspec-ruby-stdlib.ts +73 -0
  280. package/src/podspec-ruby.ts +1 -1
  281. package/src/podspec-sources.ts +31 -13
  282. package/src/process-group.ts +135 -5
  283. package/src/published-swift-sdk.ts +25 -1
  284. package/src/react-native-bridge-modules.ts +35 -3
  285. package/src/react-native-core-build.ts +14 -2
  286. package/src/react-native-core.ts +12 -2
  287. package/src/rive-runtime-dependencies.ts +178 -40
  288. package/src/serverDiscoveryContract.ts +1 -1
  289. package/src/storageSnapshotContract.ts +1 -1
  290. package/src/swift-app-data-store.ts +35 -0
  291. package/src/swift-compile.ts +403 -121
  292. package/src/swift-compiler-digest.ts +4 -0
  293. package/src/swift-darwin-records.ts +6 -0
  294. package/src/swift-distribution-mirror.ts +10 -1
  295. package/src/swift-distribution.lock.json +19 -18
  296. package/src/swift-distribution.ts +17 -1
  297. package/src/swift-entry-module.ts +1 -0
  298. package/src/swift-guest-compile.ts +8 -1
  299. package/src/swift-host.ts +79 -23
  300. package/src/swift-installed-targets.ts +51 -20
  301. package/src/swift-objc-standin.ts +60 -8
  302. package/src/swift-packages.ts +104 -24
  303. package/src/swift-project-user.ts +2 -1
  304. package/src/swift-reproducible.ts +99 -1
  305. package/src/swift-root-lock.ts +52 -46
  306. package/src/swift-sdk-app-module.ts +65 -13
  307. package/src/swift-sdk-image-producer.ts +2 -1
  308. package/src/swift-sdk-image.ts +23 -8
  309. package/src/swift-sdk-later-data.ts +294 -44
  310. package/src/swift-sdk-surface.ts +233 -55
  311. package/src/swift-shared-sdk.ts +7 -0
  312. package/src/swift-standin-builtin-behavior.ts +18 -0
  313. package/src/swift-standin-emit.ts +242 -54
  314. package/src/swift-standins.ts +184 -38
  315. package/src/swift-startup-split.ts +19 -9
  316. package/src/swift-toolchain.ts +18 -0
  317. package/src/swift-wasm-prune.ts +179 -9
  318. package/src/swift-xcframework.ts +16 -0
  319. package/src/swiftContract.ts +4 -1
  320. package/src/swiftSdkLinkContract.ts +2 -0
  321. package/src/swiftTargetContract.ts +1 -0
  322. package/src/turbo-bundle.ts +6 -3
  323. package/src/turbo-codegen-intake.ts +106 -16
  324. package/src/turbo-compile.ts +89 -68
  325. package/src/turbo-fabric-app.ts +287 -23
  326. package/src/turbo-provider-host.ts +122 -31
  327. package/src/turbo-runtime.lock.json +26 -26
  328. package/src/turbo-source.ts +374 -157
  329. package/src/vite-plugin.ts +48 -112
  330. package/src/wasm-binary-sections.ts +40 -0
  331. package/src/wasm-code-immediates.ts +35 -5
  332. package/src/widget-extension-bundle.ts +15 -1
  333. package/src/worklet-executable.ts +2 -1
  334. package/src/worklet-kernel.ts +5 -3
  335. package/src/worklets-babel.ts +2 -1
  336. package/src/xcode-project.ts +151 -53
  337. package/src/xcode-scheme-actions.ts +104 -0
  338. package/cli/commands/canvas.ts +0 -1204
  339. package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
  340. package/dist-lib/vendor/magic-string.cjs +0 -1693
  341. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
  342. package/src/appBundleResourcesContract.ts +0 -51
  343. package/src/canvas-groups.ts +0 -28
  344. package/src/canvas-map-layout.ts +0 -161
  345. package/src/oneWidgetContract.ts +0 -134
package/LICENSE CHANGED
@@ -5,14 +5,12 @@ Copyright (c) Tamagui LLC. All rights reserved.
5
5
  This package (peachsim) is proprietary software of Tamagui LLC, licensed under
6
6
  the Peach Software License Agreement: https://peachsim.com/legal/license
7
7
 
8
- In summary (the agreement governs): Seed is free for individuals and companies
9
- under 10 people and under $1M yearly revenue, including commercial desktop and
10
- local use. A company at or above either limit needs Team while it has under
11
- 50 people and under $10M yearly revenue, or Enterprise at or above either of
12
- those limits. Members, agents, API keys and local simulators are unlimited.
13
- Company size is self-reported and enforced through the license terms only.
14
- Embedding or redistributing the software requires a separate written agreement
15
- with Tamagui LLC.
8
+ In summary (the agreement governs): any individual or organization with an
9
+ admitted Peach account may use it for desktop and local internal use,
10
+ including commercial work and CI, at any company size. Local simulators are
11
+ free during beta. Members, agents and API keys are unlimited. Embedding or
12
+ redistributing the software requires a separate written agreement with
13
+ Tamagui LLC.
16
14
 
17
15
  Versions of this package published before this license change remain under
18
16
  the license they were published with.
@@ -20,6 +20,7 @@ import {
20
20
  } from './auth'
21
21
  import { isAgentEnv } from './commands/inspect/env'
22
22
  import { resolveDefaultAuthOrigin, signIn } from './commands/login'
23
+ import { grantedGithubWorkflowIdentityHeaders } from './github-workflow-identity'
23
24
  import { openUrl } from './open-url'
24
25
  import { billingOriginFor } from './recording-access'
25
26
  import { peachExit } from './run-rnx'
@@ -65,6 +66,8 @@ export const ACCOUNT_REQUIRED_HINT =
65
66
  const waitlistedSchema = z.object({
66
67
  error: z.literal('waitlisted'),
67
68
  email: z.string().optional(),
69
+ // local simulators are open to waiting accounts; Peach Cloud is not yet
70
+ reason: z.literal('local').optional(),
68
71
  })
69
72
 
70
73
  type GateOptions = {
@@ -142,7 +145,10 @@ export async function requireAccount(
142
145
  const response = await fetch(
143
146
  `${origin}/api/github/agent/config?repo=${encodeURIComponent(auth.repoId)}`,
144
147
  {
145
- headers: { authorization: header },
148
+ headers: {
149
+ authorization: header,
150
+ ...(await grantedGithubWorkflowIdentityHeaders()),
151
+ },
146
152
  signal: AbortSignal.timeout(VERIFY_TIMEOUT_MS),
147
153
  },
148
154
  )
@@ -177,7 +183,7 @@ export async function requireAccount(
177
183
  if (age < REFRESH_AFTER_MS) return
178
184
 
179
185
  let status: number | null = null
180
- let waitlisted: { email?: string } | null = null
186
+ let waitlisted: z.infer<typeof waitlistedSchema> | null = null
181
187
  try {
182
188
  const response = await fetch(`${origin}/api/sootsim/billing/subscription`, {
183
189
  headers: { authorization: header },
@@ -191,11 +197,22 @@ export async function requireAccount(
191
197
  } catch {
192
198
  // unreachable: a recent check carries the run
193
199
  }
200
+ if (waitlisted?.reason === 'local') {
201
+ process.stderr.write(
202
+ 'You’re signed up for the Peach beta: local simulators are ready, and Peach Cloud opens when it’s your turn.\n',
203
+ )
204
+ writeSecureJsonAtomic(checkFile(), {
205
+ credential,
206
+ origin,
207
+ verifiedAt: Date.now(),
208
+ } satisfies AccountCheck)
209
+ return
210
+ }
194
211
  if (waitlisted) {
195
212
  // the signed-in site shows the desktop's person the same waitlist page
196
213
  if (options.desktop) await openUrl(origin).catch(() => {})
197
214
  stop(
198
- `You’re on the list. We’ll email ${waitlisted.email ?? 'you'} when it’s your turn. Have an invite link? Open it, then run this command again.`,
215
+ `You’re signed up for the Peach beta. We’ll email ${waitlisted.email ?? 'you'} when it’s your turn; run this command again then.`,
199
216
  )
200
217
  }
201
218
  if (status === 200) {
@@ -1,16 +1,16 @@
1
1
  import { createHash } from 'node:crypto'
2
2
  import fs from 'node:fs'
3
3
  import path from 'node:path'
4
- import { preferredMimeType } from '../../peach-kit/src/uttype-mime'
5
- import { enumerateBundleResources } from '../../sootsim-swift/src/bundleAssets'
6
4
  import {
7
5
  isAppBundleResourcePath,
8
6
  type AppBundleResources,
9
- } from '../src/appBundleResourcesContract'
7
+ } from '@peach/globals/app-bundle-resources'
8
+ import { preferredMimeType } from '../../peach-kit/src/uttype-mime'
9
+ import { enumerateBundleResources } from '../../sootsim-swift/src/bundleAssets'
10
10
  import { stageHostByteFiles } from '../src/host/staged-host-files'
11
- import { readIosAppTarget } from '../src/native-app-identity-project'
12
11
  import { readPackageFile } from '../src/swift-source-file'
13
12
  import { findWorkspaceRoot } from '../src/workspace-root'
13
+ import { readXcodeAppTarget, selectIosAppTarget } from '../src/xcode-project'
14
14
 
15
15
  export function stageAppBundleResources(
16
16
  appDir: string,
@@ -18,8 +18,64 @@ export function stageAppBundleResources(
18
18
  iosTarget?: string,
19
19
  environment?: Record<string, string>,
20
20
  ): AppBundleResources {
21
- const app = readIosAppTarget(appDir, iosTarget, environment)
22
- if (!app) return {}
21
+ const files = readAppBundleResourceFiles(appDir, iosTarget, environment)
22
+ return describeAppBundleResources(
23
+ files,
24
+ stageHostByteFiles(
25
+ files.map(({ bytes }) => bytes),
26
+ origin,
27
+ ),
28
+ )
29
+ }
30
+
31
+ // a bundle shipped without its dev server carries these files itself: served
32
+ // beside a release, or inline in a stored bundle.
33
+ export function inlineAppBundleResources(
34
+ appDir: string,
35
+ iosTarget?: string,
36
+ ): AppBundleResources {
37
+ const files = readAppBundleResourceFiles(appDir, iosTarget)
38
+ return describeAppBundleResources(
39
+ files,
40
+ files.map(
41
+ ({ bytes, contentType }) =>
42
+ `data:${contentType};base64,${bytes.toString('base64')}`,
43
+ ),
44
+ )
45
+ }
46
+
47
+ export function describeAppBundleResources(
48
+ files: readonly AppBundleResourceFile[],
49
+ urls: readonly string[],
50
+ ): AppBundleResources {
51
+ const result: AppBundleResources = Object.create(null)
52
+ files.forEach(({ base, bytes, contentType }, index) => {
53
+ result[base] = {
54
+ uri: urls[index]!,
55
+ sha256: createHash('sha256').update(bytes).digest('hex'),
56
+ contentType,
57
+ byteLength: bytes.byteLength,
58
+ }
59
+ })
60
+ return result
61
+ }
62
+
63
+ export type AppBundleResourceFile = { base: string; bytes: Buffer; contentType: string }
64
+
65
+ /** the files the app's Xcode target copies into its bundle, at their bundle paths */
66
+ export function readAppBundleResourceFiles(
67
+ appDir: string,
68
+ iosTarget?: string,
69
+ environment?: Record<string, string>,
70
+ ): AppBundleResourceFile[] {
71
+ const selected = selectIosAppTarget(appDir, iosTarget)
72
+ if (!selected) return []
73
+ const app = readXcodeAppTarget(selected.xcodeproj, selected.target, 'Release', {
74
+ requireSources: false,
75
+ prepareGeneratedSources: true,
76
+ compileInterfaceResources: true,
77
+ environment,
78
+ })
23
79
  // a monorepo app's font and asset resources live in the workspace root.
24
80
  // a stale nested lockfile can pin that root at the app while the Xcode
25
81
  // target reaches sibling workspace packages, so widen to the enclosing
@@ -51,23 +107,14 @@ export function stageAppBundleResources(
51
107
  const name = `Resources/${lexical.split(path.sep).join('/')}`
52
108
  members.set(name, file)
53
109
  }
54
- const resources = enumerateBundleResources([...members.keys()])
55
- const bytes = resources.map(({ base, file }) => {
110
+ return enumerateBundleResources([...members.keys()]).map(({ base, file }) => {
56
111
  if (!isAppBundleResourcePath(base)) throw new Error('invalid native resource path')
57
112
  const source = members.get(file)
58
113
  if (!source) throw new Error('native resource is not an Xcode target member')
59
- return readPackageFile(root, source, Infinity)
60
- })
61
- const urls = stageHostByteFiles(bytes, origin)
62
- const result: AppBundleResources = Object.create(null)
63
- resources.forEach(({ base }, index) => {
64
- const content = bytes[index]!
65
- result[base] = {
66
- uri: urls[index]!,
67
- sha256: createHash('sha256').update(content).digest('hex'),
114
+ return {
115
+ base,
116
+ bytes: readPackageFile(root, source, Infinity),
68
117
  contentType: preferredMimeType(base) ?? 'application/octet-stream',
69
- byteLength: content.byteLength,
70
118
  }
71
119
  })
72
- return result
73
120
  }
@@ -302,7 +302,7 @@ export const cliCommandMetas: CliCommandMeta[] = [
302
302
  title: 'peach location',
303
303
  description: "control the simulator's simulated device location",
304
304
  summary:
305
- "Read, set, or clear the device's one simulated location, the `simctl location` equivalent. It feeds every app through the host-service geolocation seam and never reads the host Mac's real position. `clear` returns the device to iOS's own default location; `set` is read immediately by `getCurrentPosition` and by every active `watchPosition` subscriber.",
305
+ "Read, set, or clear the device's one simulated location, the `simctl location` equivalent. Every app reads it through the simulated location service, which never reads the host Mac's real position. `clear` returns the device to iOS's own default location; `set` is read immediately by `getCurrentPosition` and by every active `watchPosition` subscriber.",
306
306
  order: 65.6,
307
307
  usage: [
308
308
  'peach location get [--json]',
@@ -1374,110 +1374,6 @@ export const cliCommandMetas: CliCommandMeta[] = [
1374
1374
  ],
1375
1375
  related: ['screenshot', 'preview', 'record'],
1376
1376
  },
1377
- {
1378
- id: 'canvas',
1379
- slug: 'canvas',
1380
- navTitle: 'canvas',
1381
- title: 'peach canvas',
1382
- description: 'lay out live apps and maps of an app on one canvas',
1383
- hidden: true,
1384
- summary:
1385
- 'Runs many apps live on one canvas, each on its own device, with pinch and scroll to move around it. A click selects an item and a double click enters it: the view fits it and its app takes the pointer and the scroll wheel until you click outside it or press Escape. `peach canvas enter <id>` points peach commands at an item’s app without entering it on screen, so a person can still inspect it; without an id they return to the canvas. Dragging an item moves it, and the next command that changes the canvas saves where it was dropped. `peach canvas open` opens a canvas sim that fills its window. `peach canvas place` puts a built-in app, or a Metro bundle with `--bundle`, on the canvas. It joins its group on a grouped board, or goes right of the last item. Use `--at` to place it at a specific corner. Every change rewrites the working file, peach-canvas.json, and posts the whole canvas to the canvas sim; `peach canvas push` posts it again after the sim reloads. `peach canvas describe` returns the saved groups, items, focus and links as JSON. `peach canvas freeze` holds an item on its last frame with its app state until `peach canvas live` resumes it. `peach canvas map` puts a map made with `peach map` on the canvas beside whatever is already there: every mapped route is a live app launched by its deep link, linked by the taps between screens and laid out as the published map is. A route shows its capture until you zoom in far enough for its app to start, and running the command again replaces that map where it sat. `peach canvas group` and `peach canvas arrange` fit the layout to the current window. `peach canvas agent` puts the caller on an item and tags that item with the agent’s name and machine, so a board grouped by agent or machine moves the item into its agent’s group. Arrange can sort items with `--by`, set a fixed column count with `--columns`, or lay each map out along its links with `--flow`. An item drawn at a quarter of its size or smaller holds its last frame until you zoom in.',
1386
- order: 103,
1387
- usage: [
1388
- 'peach canvas open',
1389
- 'peach canvas place <app> [--device <model>] [--at x,y] [--id <id>] [--radius <pt>]',
1390
- 'peach canvas place --bundle <url|file> [--app-fonts-dir <dir>] [--url <link>] [--device <model>] [--at x,y] [--id <id>]',
1391
- 'peach canvas map --bundle <url|file> [--app-fonts-dir <dir>] [--map <file>] [--scheme <myapp://>] [--device <model>] [--at x,y] [--id <name>]',
1392
- 'peach canvas move <id> --at x,y',
1393
- 'peach canvas group --by project|person|agent|machine|label',
1394
- 'peach canvas move-group <name> --at x,y',
1395
- 'peach canvas tag <id> [--project <name>] [--person <name>] [--agent <name>] [--machine <name>] [--label <name>]',
1396
- 'peach canvas resize <id> --size width,height',
1397
- 'peach canvas arrange [--by title|device|app] [--columns <n>] [--gap <pt>]',
1398
- 'peach canvas arrange --flow',
1399
- 'peach canvas focus [id]',
1400
- 'peach canvas enter [id]',
1401
- 'peach canvas freeze <id>',
1402
- 'peach canvas live <id>',
1403
- 'peach canvas camera --at x,y --scale <n>',
1404
- 'peach canvas camera --path <file>',
1405
- 'peach canvas agent <item> --name <name> --step <step> [--id <agent>] [--machine <name>] [--action <json>]',
1406
- 'peach canvas agent remove --id <agent>',
1407
- 'peach canvas follow <agent|off>',
1408
- 'peach canvas remove <id | map name>',
1409
- 'peach canvas list',
1410
- 'peach canvas describe',
1411
- 'peach canvas push',
1412
- 'peach canvas view fit | <id> | --center x,y [--scale <n>]',
1413
- ],
1414
- options: [
1415
- option('--device <model>', "the item's device, defaults to iphone-17-pro"),
1416
- option('--at x,y', "the item's top left corner in canvas points"),
1417
- option(
1418
- '--id <id>',
1419
- 'item id, defaults to the app id; for map, its name, defaults to the scheme',
1420
- ),
1421
- option(
1422
- '--bundle <url>',
1423
- 'a Metro bundle url or a built bundle file the item, or every route of a map, runs',
1424
- ),
1425
- option(
1426
- '--app-fonts-dir <dir>',
1427
- "the project holding the fonts a built bundle's app links natively",
1428
- ),
1429
- option('--map <file>', 'map: the map working file, defaults to peach-map.json'),
1430
- option(
1431
- '--scheme <url>',
1432
- 'map: deep link scheme, defaults to the one the map was crawled with',
1433
- ),
1434
- option('--url <link>', 'the deep link the item launches with'),
1435
- option('--radius <pt>', "corner radius, defaults to the device's display"),
1436
- option('--size width,height', 'custom item size in points'),
1437
- option(
1438
- '--by <key>',
1439
- "arrange: order items by title, device or app, defaults to the canvas's order",
1440
- ),
1441
- option('--columns <n>', 'arrange: items per row within each group'),
1442
- option('--gap <pt>', 'arrange: space between items in points'),
1443
- option(
1444
- '--flow',
1445
- 'arrange: lay each map out along its links and leave other items in place',
1446
- ),
1447
- option('--center x,y', 'view: the canvas point to center'),
1448
- option('--scale <n>', 'zoom for view --center or camera'),
1449
- option(
1450
- '--path <file>',
1451
- 'camera keyframes as a JSON array of {ms,x,y,scale}, starting at 0 ms',
1452
- ),
1453
- option('--file <path>', 'working file, defaults to peach-canvas.json'),
1454
- ],
1455
- examples: [
1456
- example('peach canvas open', 'open a canvas sim'),
1457
- example('peach canvas place photos', 'run Photos live on the canvas'),
1458
- example(
1459
- 'peach canvas enter photos',
1460
- 'inspect with peach describe or tap with peach do',
1461
- ),
1462
- example('peach canvas place notes --device iphone-se', 'Notes on an iPhone SE'),
1463
- example(
1464
- 'peach canvas place --bundle "http://localhost:8081/index.bundle?platform=ios"',
1465
- 'run your app beside them',
1466
- ),
1467
- example(
1468
- 'peach canvas map --bundle "http://localhost:8081/index.bundle?platform=ios"',
1469
- 'put a map on the canvas, every route live',
1470
- ),
1471
- example('peach canvas resize notes --size 320,640', 'resize Notes in place'),
1472
- example('peach canvas freeze notes', 'hold Notes on its last frame'),
1473
- example(
1474
- 'peach canvas arrange --by device --columns 4',
1475
- 'sort the canvas into rows of four',
1476
- ),
1477
- example('peach canvas view fit', 'fit every item in view'),
1478
- ],
1479
- related: ['open', 'map'],
1480
- },
1481
1377
  {
1482
1378
  id: 'box',
1483
1379
  slug: 'box',
@@ -1628,7 +1524,7 @@ export const cliCommandMetas: CliCommandMeta[] = [
1628
1524
  description:
1629
1525
  'attach a running Xcode iOS Simulator or Android Emulator to Peach Canvas',
1630
1526
  summary:
1631
- 'Discover booted Xcode iOS Simulators (xcrun simctl) and running Android Emulators (adb) and attach them live onto your Peach Canvas alongside Peach simulators. Streams dynamic-resolution H.264 frames over the live-raster channel at zero simulator-minute cost, forwards touch and keyboard input from Canvas and /sim/<id>, and supports local MP4 and Cloud Recordings.',
1527
+ 'Discover booted Xcode iOS Simulators (xcrun simctl) and running Android Emulators (adb) and attach them live onto your Peach Canvas alongside Peach simulators. Streams H.264 video that scales with your Canvas zoom at no per-minute cost, forwards touch and keyboard input from Canvas and the simulator page, and supports local MP4 and Cloud Recordings.',
1632
1528
  order: 98,
1633
1529
  usage: [
1634
1530
  'peach attach [ios|android|<target>] [options]',
@@ -62,6 +62,8 @@ function describeStep(step: PerformStep): string | null {
62
62
  return step.action === 'shake' ? 'Shaking the device' : 'Setting ring mode'
63
63
  case 'setOrientation':
64
64
  return `Rotating to ${step.orientation}`
65
+ case 'setPosture':
66
+ return `Folding to ${step.rest ?? step.posture ?? 'open'}`
65
67
  case 'incrementElement':
66
68
  case 'decrementElement':
67
69
  return verb('Adjusting', step.id)
@@ -70,6 +72,11 @@ function describeStep(step: PerformStep): string | null {
70
72
  case 'wait':
71
73
  case 'waitFor':
72
74
  case 'deviceInfo':
75
+ case 'stepFrame':
76
+ case 'releaseClock':
77
+ case 'screenshot':
78
+ case 'describe':
79
+ case 'scrollStateAt':
73
80
  case 'discoverStoreKitConfig':
74
81
  case 'clearStoreKitConfig':
75
82
  return null
@@ -25,7 +25,6 @@ const NODE_COMMAND_NAMES = [
25
25
  'permissions',
26
26
  'perf',
27
27
  'map',
28
- 'canvas',
29
28
  'screenshot',
30
29
  'state',
31
30
  'reset',
@@ -1121,14 +1121,22 @@ export function printDriverDiagnosticLogTail(result: DriverLaunchResult) {
1121
1121
  console.error(` ${path.basename(result.diagnosticLogPath)} was empty`)
1122
1122
  return
1123
1123
  }
1124
- const shown = detail.length > 4_000 ? `…\n${detail.slice(-4_000)}` : detail
1125
- console.error(` ${path.basename(result.diagnosticLogPath)}:`)
1126
- console.error(shown)
1127
- if (/No usable sandbox/i.test(detail)) {
1124
+ if (/No usable sandbox/.test(detail)) {
1125
+ const browser = detail.match(/<launching> (\S+)/)?.[1] ?? '<path to chromium>'
1128
1126
  console.error(
1129
- ' this container blocks the user namespaces Chromium sandboxes with. on a locked-down CI runner set PEACH_CHROMIUM_SANDBOX=0 to launch it unsandboxed (the default stays sandboxed).',
1127
+ [
1128
+ ' Chromium could not start its sandbox: this Linux restricts unprivileged user namespaces (the default since Ubuntu 23.10).',
1129
+ ' allow them for this browser once, keeping the sandbox:',
1130
+ ` printf 'abi <abi/4.0>,\\ninclude <tunables/global>\\nprofile peach-chromium "${browser}" flags=(unconfined) {\\n userns,\\n}\\n' | sudo tee /etc/apparmor.d/peach-chromium && sudo apparmor_parser -r /etc/apparmor.d/peach-chromium`,
1131
+ ' or, in a throwaway container or CI runner, set PEACH_CHROMIUM_SANDBOX=0 to run it unsandboxed.',
1132
+ ` full log: ${result.diagnosticLogPath}`,
1133
+ ].join('\n'),
1130
1134
  )
1135
+ return
1131
1136
  }
1137
+ const shown = detail.length > 4_000 ? `…\n${detail.slice(-4_000)}` : detail
1138
+ console.error(` ${path.basename(result.diagnosticLogPath)}:`)
1139
+ console.error(shown)
1132
1140
  } catch (err) {
1133
1141
  const message = err instanceof Error ? err.message : String(err)
1134
1142
  console.error(
@@ -397,15 +397,17 @@ function runLaunchctl(args: string[]): void {
397
397
  }
398
398
 
399
399
  function macBridgeHasListener(pid: number, port: number): boolean {
400
+ // -b skips the stat calls that block on a slow or network mount; a socket
401
+ // lookup needs none of them. -w drops the warning -b prints.
400
402
  const result = spawnSync(
401
403
  LSOF,
402
- ['-nP', '-a', '-p', String(pid), `-iTCP:${port}`, '-sTCP:LISTEN', '-t'],
404
+ ['-nPbw', '-a', '-p', String(pid), `-iTCP:${port}`, '-sTCP:LISTEN', '-t'],
403
405
  { encoding: 'utf8' },
404
406
  )
405
407
  if (result.status === 1 && !result.stderr.trim()) return false
406
408
  if (result.status !== 0) {
407
409
  throw new Error(
408
- `cannot inspect bridge pid ${pid}: ${result.error?.message ?? result.stderr.trim()}`,
410
+ `cannot inspect bridge pid ${pid} (lsof exit ${result.status}, signal ${result.signal ?? 'none'}): ${result.error?.message ?? result.stderr.trim()}`,
409
411
  )
410
412
  }
411
413
  return result.stdout.trim() === String(pid)
@@ -67,6 +67,28 @@ function printDevice(model: DeviceModel, modelWidth: number) {
67
67
  )
68
68
  }
69
69
 
70
+ function isDeviceModel(value: string): value is DeviceModel {
71
+ return Object.hasOwn(devices, value)
72
+ }
73
+
74
+ function isRecord(value: unknown): value is Record<string, unknown> {
75
+ return typeof value === 'object' && value !== null
76
+ }
77
+
78
+ function firstPerformStep(
79
+ value: unknown,
80
+ ): { ok: boolean; value?: Record<string, unknown> } | null {
81
+ if (!isRecord(value) || !Array.isArray(value.steps) || value.steps.length === 0) {
82
+ return null
83
+ }
84
+ const first: unknown = value.steps[0]
85
+ if (!isRecord(first)) return null
86
+ return {
87
+ ok: first.ok === true,
88
+ value: isRecord(first.value) ? first.value : undefined,
89
+ }
90
+ }
91
+
70
92
  async function readCurrentDevice(
71
93
  parsed: ParsedBridgeCliArgs,
72
94
  ): Promise<CurrentDeviceSnapshot> {
@@ -74,7 +96,7 @@ async function readCurrentDevice(
74
96
  try {
75
97
  // the foreground scene owns its viewport. a portrait-only app can retain
76
98
  // portrait while the body turns, and a host can supply a custom window size.
77
- return await evalInBridge<CurrentDeviceSnapshot>(
99
+ const fromEval = await evalInBridge<CurrentDeviceSnapshot>(
78
100
  bridge,
79
101
  `(() => {
80
102
  const spec = globalThis.__sootsimDeviceSpec
@@ -82,7 +104,28 @@ async function readCurrentDevice(
82
104
  const { model, width, height, scale, name } = spec
83
105
  return { model, width, height, scale, name }
84
106
  })()`,
107
+ ).catch(() => null)
108
+ if (fromEval) return fromEval
109
+ const step = firstPerformStep(
110
+ await bridge.send({ type: 'perform', steps: [{ type: 'deviceInfo' }] }),
85
111
  )
112
+ const info = step?.ok ? step.value : undefined
113
+ if (
114
+ info &&
115
+ typeof info.model === 'string' &&
116
+ typeof info.width === 'number' &&
117
+ typeof info.height === 'number' &&
118
+ typeof info.scale === 'number'
119
+ ) {
120
+ return {
121
+ model: info.model,
122
+ width: info.width,
123
+ height: info.height,
124
+ scale: info.scale,
125
+ name: typeof info.name === 'string' ? info.name : info.model,
126
+ }
127
+ }
128
+ return null
86
129
  } finally {
87
130
  bridge.close()
88
131
  }
@@ -106,20 +149,33 @@ type CurrentPostureSnapshot = {
106
149
  } | null
107
150
 
108
151
  // the binary display posture cannot name laptop, book, or tent. only the fold
109
- // bus names the rest; it is null while a drag holds the hinge between rests.
152
+ // bus (browser) or native Mac deviceInfo perform step names the rest; it is null
153
+ // while a drag holds the hinge between rests.
110
154
  async function readCurrentPosture(
111
155
  parsed: ParsedBridgeCliArgs,
112
156
  ): Promise<CurrentPostureSnapshot> {
113
157
  const bridge = createBridgeFromParsed(parsed)
114
158
  try {
115
- const settings = (await callInBridge<Record<string, unknown> | null>(
159
+ const settings = await callInBridge<Record<string, unknown> | null>(
116
160
  bridge,
117
161
  'SootSim.bridges.settings.get',
118
- )) ?? { deviceModel: null }
119
- const model = typeof settings.deviceModel === 'string' ? settings.deviceModel : null
120
- if (!model || !(model in devices)) return null
121
- const rest = await evalInBridge(bridge, 'globalThis.__sootsimDuoFold?.rest ?? null')
122
- return { model: model as DeviceModel, rest: isDuoRest(rest) ? rest : null }
162
+ ).catch(() => null)
163
+ const browserModel =
164
+ settings && typeof settings.deviceModel === 'string' ? settings.deviceModel : null
165
+ if (browserModel && isDeviceModel(browserModel)) {
166
+ const rest = await evalInBridge(bridge, 'globalThis.__sootsimDuoFold?.rest ?? null')
167
+ return { model: browserModel, rest: isDuoRest(rest) ? rest : null }
168
+ }
169
+ const step = firstPerformStep(
170
+ await bridge.send({
171
+ type: 'perform',
172
+ steps: [{ type: 'deviceInfo' }],
173
+ }),
174
+ )
175
+ const info = step?.ok ? step.value : undefined
176
+ const model = typeof info?.model === 'string' ? info.model : null
177
+ if (!model || !isDeviceModel(model)) return null
178
+ return { model, rest: isDuoRest(info?.rest) ? info.rest : null }
123
179
  } finally {
124
180
  bridge.close()
125
181
  }
@@ -256,6 +312,20 @@ export async function runDeviceCommand(args: string[], opts: DeviceCommandOption
256
312
  }
257
313
  const bridge = createBridgeFromParsed(parsed)
258
314
  try {
315
+ // native Mac Duo hosts apply postures directly through perform(setPosture)
316
+ const step = firstPerformStep(
317
+ await bridge
318
+ .send({
319
+ type: 'perform',
320
+ steps: [{ type: 'setPosture', rest: target }],
321
+ acquireLock: true,
322
+ })
323
+ .catch(() => null),
324
+ )
325
+ if (step?.ok) {
326
+ console.log(` set posture: ${target} (${current.model})`)
327
+ return
328
+ }
259
329
  // the typed command the duo's pose buttons dispatch: the fold engine
260
330
  // sweeps the hinge there, turning the body for laptop and tent, so the
261
331
  // app sees the same fold and reserved regions as from the rail. the
@@ -260,9 +260,11 @@ export function parseDoChainActions(args: string[]): DoChainAction[] {
260
260
  }
261
261
 
262
262
  case 'touch': {
263
- const usage = 'touch <down|move|up|cancel> <x> <y> [pointerId]'
264
- if (values.length < 3 || values.length > 4) invalidAction(index, usage)
265
- const phase = values[0]
263
+ const usage = 'touch <down|move|up|cancel> <x> <y> [pointerId] [--gate]'
264
+ const gate = values.includes('--gate')
265
+ const pos = values.filter((v) => v !== '--gate')
266
+ if (pos.length < 3 || pos.length > 4) invalidAction(index, usage)
267
+ const phase = pos[0]
266
268
  if (
267
269
  phase !== 'down' &&
268
270
  phase !== 'move' &&
@@ -272,17 +274,18 @@ export function parseDoChainActions(args: string[]): DoChainAction[] {
272
274
  invalidAction(index, usage)
273
275
  }
274
276
  const pointerId =
275
- values.length === 4
276
- ? Math.max(1, Math.round(finiteNumber(values[3], index, usage)))
277
+ pos.length === 4
278
+ ? Math.max(1, Math.round(finiteNumber(pos[3], index, usage)))
277
279
  : 999
278
280
  if (phase === 'cancel') return [{ type: 'touchCancel', pointerId }]
279
281
  return [
280
282
  {
281
283
  type:
282
284
  phase === 'down' ? 'touchDown' : phase === 'move' ? 'touchMove' : 'touchUp',
283
- x: finiteNumber(values[1], index, usage),
284
- y: finiteNumber(values[2], index, usage),
285
+ x: finiteNumber(pos[1], index, usage),
286
+ y: finiteNumber(pos[2], index, usage),
285
287
  pointerId,
288
+ ...(gate ? { gate: true } : {}),
286
289
  },
287
290
  ]
288
291
  }
@@ -292,7 +295,7 @@ export function parseDoChainActions(args: string[]): DoChainAction[] {
292
295
  if (values.length > 1) invalidAction(index, usage)
293
296
  const seconds = values.length === 1 ? finiteNumber(values[0], index, usage) : 0.5
294
297
  if (seconds < 0) invalidAction(index, usage)
295
- return [{ type: 'wait', ms: Math.round(seconds * 1000) }]
298
+ return [{ type: 'wait', ms: seconds * 1000 }]
296
299
  }
297
300
 
298
301
  default:
@@ -1446,18 +1446,12 @@ function waitReadyFromResult(result: SemanticWaitResult): WaitReadyStatus {
1446
1446
  return waitReadyStatus(result, result.matched && !result.probe?.externalError)
1447
1447
  }
1448
1448
 
1449
- // readiness for a capture: a capture records the screen as it is now, so an
1450
- // app showing content or a launch error answers from one probe. errors stay
1451
- // not ready so callers can label failure evidence or refuse it. only a booting,
1452
- // loading or reloading app waits for the stable ready state. waiting out the
1453
- // stability window on a settled app delayed every screenshot by most of a second.
1449
+ // a capture waits for the current surface to paint, with no tree stability window.
1454
1450
  export async function inspectCaptureReady(
1455
1451
  bridge: InspectBridge,
1456
1452
  timeoutMs: number,
1457
1453
  ): Promise<WaitReadyStatus> {
1458
- const snapshot = await inspectReadySnapshot(bridge, 0)
1459
- if (snapshot.ready || snapshot.externalError) return snapshot
1460
- return inspectWaitReady(bridge, timeoutMs)
1454
+ return inspectWaitReady(bridge, timeoutMs, { stableMs: 0 })
1461
1455
  }
1462
1456
 
1463
1457
  // how long one snapshot request may take to cross the bridge and read once
@@ -1474,6 +1468,7 @@ export async function inspectReadySnapshot(
1474
1468
  bridge: InspectBridge,
1475
1469
  budgetMs: number,
1476
1470
  simId?: string,
1471
+ stableMs?: number,
1477
1472
  ): Promise<WaitReadyStatus> {
1478
1473
  const deadline = Date.now() + budgetMs
1479
1474
  let result: SemanticWaitResult
@@ -1483,7 +1478,7 @@ export async function inspectReadySnapshot(
1483
1478
  READY_SNAPSHOT_SEND_TIMEOUT_MS,
1484
1479
  Math.min(remaining, 60_000),
1485
1480
  )
1486
- result = await sendReadyWait(bridge, 1, simId, transportMs)
1481
+ result = await sendReadyWait(bridge, 1, simId, transportMs, stableMs)
1487
1482
  } while (
1488
1483
  result.polls !== 1 &&
1489
1484
  !result.error?.startsWith('sim disconnected') &&
@@ -190,6 +190,7 @@ export async function waitForSootsimIdle({
190
190
  type: 'settle',
191
191
  simId,
192
192
  maxFrames: Math.min(600, Math.max(4, Math.ceil(maxMs / 16))),
193
+ timeoutMs: Math.max(1, maxMs),
193
194
  })
194
195
  return { elapsed: Date.now() - started, settled: true, blockedBy: '' }
195
196
  } catch (error) {
@@ -3,8 +3,13 @@ import {
3
3
  readSharedDesktopAuthSession,
4
4
  } from '../../src/auth/shared-session'
5
5
  import { forgetApiKey } from '../auth'
6
+ import { CliUsageError } from '../usage-error'
6
7
 
7
- export async function runLogout() {
8
+ export async function runLogout(args: string[]) {
9
+ if (args.length > 0)
10
+ throw new CliUsageError(
11
+ `peach logout takes no arguments, got: ${args[0]}; it signs out of every account`,
12
+ )
8
13
  const forgot = forgetApiKey()
9
14
  const current = readSharedDesktopAuthSession()
10
15
  if (!current?.token) {