sootsim 0.1.235 → 0.1.236

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 (142) hide show
  1. package/dist-cli/bin.js +4 -4
  2. package/dist-cli/chunks/{agent-VY6XJQDL.js → agent-CU7Q5K22.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-NSBHSS3Y.js → agent-wrapper-FCUDUV52.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-BRTQV44M.js → app-fonts-SPA6U6OA.js} +2 -2
  5. package/dist-cli/chunks/{assert-WOOZQZ67.js → assert-MZVVW7DV.js} +2 -2
  6. package/dist-cli/chunks/{auth-7J7WDEFG.js → auth-FV3CIFG6.js} +2 -2
  7. package/dist-cli/chunks/beta-7X7N2CB2.js +2 -0
  8. package/dist-cli/chunks/{camera-KWI4FUYT.js → camera-ALWQVYHU.js} +2 -2
  9. package/dist-cli/chunks/{chunk-UMRMWSAM.js → chunk-3PLNSSEF.js} +1 -1
  10. package/dist-cli/chunks/{chunk-TR25YKVI.js → chunk-4Z3JQFES.js} +1 -1
  11. package/dist-cli/chunks/{chunk-JPXFE6M4.js → chunk-54UQB2TW.js} +2 -2
  12. package/dist-cli/chunks/{chunk-VZQLOXV4.js → chunk-5E24H5Z5.js} +2 -2
  13. package/dist-cli/chunks/{chunk-EB52ZQ3B.js → chunk-6ALJUG36.js} +2 -2
  14. package/dist-cli/chunks/chunk-6NWVRY7I.js +1 -0
  15. package/dist-cli/chunks/{chunk-AQ6HSRGZ.js → chunk-7KGIZCO3.js} +2 -2
  16. package/dist-cli/chunks/{chunk-HVKLAOZM.js → chunk-7NCUVJSZ.js} +3 -3
  17. package/dist-cli/chunks/{chunk-YAX25DGN.js → chunk-APQFVJDK.js} +1 -1
  18. package/dist-cli/chunks/{chunk-BZPJSFSP.js → chunk-BA4Q3KRH.js} +2 -2
  19. package/dist-cli/chunks/{chunk-APBFMXMM.js → chunk-BDL6UO36.js} +1 -1
  20. package/dist-cli/chunks/{chunk-XUJDCVTH.js → chunk-BGW73A3C.js} +2 -2
  21. package/dist-cli/chunks/{chunk-ZVVEXBEJ.js → chunk-DKGKL6KP.js} +2 -2
  22. package/dist-cli/chunks/{chunk-YYW4JGGL.js → chunk-DUCTVOTV.js} +1 -1
  23. package/dist-cli/chunks/{chunk-TEEK6DLL.js → chunk-EURBYQXU.js} +2 -2
  24. package/dist-cli/chunks/{chunk-K3Q4FEMG.js → chunk-FK57ISRW.js} +1 -1
  25. package/dist-cli/chunks/{chunk-R7RUIOMK.js → chunk-G3EZ5KVE.js} +1 -1
  26. package/dist-cli/chunks/{chunk-YXP22OFA.js → chunk-G3MVPZBK.js} +2 -2
  27. package/dist-cli/chunks/{chunk-Z7TEEXRM.js → chunk-GB3IT6AN.js} +1 -1
  28. package/dist-cli/chunks/{chunk-RJ5ZTFTF.js → chunk-HBQ7CCHG.js} +1 -1
  29. package/dist-cli/chunks/{chunk-ITU3SFQX.js → chunk-I664RIMB.js} +2 -2
  30. package/dist-cli/chunks/{chunk-WQ5DQ5X7.js → chunk-IQ2IFKZ4.js} +2 -2
  31. package/dist-cli/chunks/{chunk-CFIAG2RO.js → chunk-KWNVZ2LX.js} +1 -1
  32. package/dist-cli/chunks/chunk-LBXFCH5I.js +118 -0
  33. package/dist-cli/chunks/{chunk-4IGHCZBZ.js → chunk-NX4NOT7Z.js} +1 -1
  34. package/dist-cli/chunks/{chunk-YLSEQMQK.js → chunk-ORSIJ76W.js} +1 -1
  35. package/dist-cli/chunks/{chunk-2NTPCZNI.js → chunk-PEFAS7Q4.js} +2 -2
  36. package/dist-cli/chunks/{chunk-XWRHHNOK.js → chunk-PGLRJ4GA.js} +1 -1
  37. package/dist-cli/chunks/{chunk-TZJ6V6E3.js → chunk-PUH4S4CC.js} +2 -2
  38. package/dist-cli/chunks/{chunk-P3IXWUXV.js → chunk-Q2X3WO5X.js} +2 -2
  39. package/dist-cli/chunks/{chunk-6EZX7YXZ.js → chunk-QPZYFSTW.js} +1 -1
  40. package/dist-cli/chunks/{chunk-PULCBYY6.js → chunk-RBDWTH6O.js} +2 -2
  41. package/dist-cli/chunks/{chunk-G4VPOKCZ.js → chunk-RGDT3EBF.js} +11 -3
  42. package/dist-cli/chunks/{chunk-OUZCXC3F.js → chunk-SACUEZZP.js} +1 -1
  43. package/dist-cli/chunks/{chunk-4WKY22WY.js → chunk-SXENH4HF.js} +3 -3
  44. package/dist-cli/chunks/{chunk-MSXVV6JQ.js → chunk-T7KUJUST.js} +3 -3
  45. package/dist-cli/chunks/{chunk-GD6LJ2CR.js → chunk-TB7CIKZ3.js} +2 -2
  46. package/dist-cli/chunks/{chunk-YQDB5ODC.js → chunk-UGRYC3HL.js} +1 -1
  47. package/dist-cli/chunks/{chunk-KEZZHUOP.js → chunk-V5LQP2JL.js} +35 -33
  48. package/dist-cli/chunks/{chunk-7DV3AEBI.js → chunk-VKJ4BFFU.js} +2 -2
  49. package/dist-cli/chunks/{chunk-IZGWQAPR.js → chunk-VQKTMX3M.js} +1 -1
  50. package/dist-cli/chunks/{chunk-6XLP5EB5.js → chunk-VRXFBWBW.js} +2 -2
  51. package/dist-cli/chunks/{chunk-EOUBCSIZ.js → chunk-W7H4OAY4.js} +2 -2
  52. package/dist-cli/chunks/chunk-ZYEIV7ZN.js +1 -0
  53. package/dist-cli/chunks/cli-version-457KT7IL.js +2 -0
  54. package/dist-cli/chunks/{compat-7NLJUPG6.js → compat-JCUMIY6N.js} +3 -3
  55. package/dist-cli/chunks/{config-LODVAH4H.js → config-3RHULBQA.js} +2 -2
  56. package/dist-cli/chunks/{control-H4RVHEDW.js → control-NZJHUGDA.js} +2 -2
  57. package/dist-cli/chunks/daemon-4WYYSXCN.js +2 -0
  58. package/dist-cli/chunks/{debug-PM3WQ2Z5.js → debug-FXTGTIA4.js} +3 -3
  59. package/dist-cli/chunks/{desktop-MF4ZQA2W.js → desktop-4Z3DFJZ3.js} +3 -3
  60. package/dist-cli/chunks/{detox-IFKFVHIT.js → detox-ZHVRCYVV.js} +2 -2
  61. package/dist-cli/chunks/{device-6EQ2R5CO.js → device-B7RJOTO2.js} +2 -2
  62. package/dist-cli/chunks/{diagnose-AKWL66RQ.js → diagnose-TWMUMITQ.js} +2 -2
  63. package/dist-cli/chunks/drivers-AK6KP6X4.js +2 -0
  64. package/dist-cli/chunks/{film-NIR3F3EQ.js → film-DGR6ALQ2.js} +3 -3
  65. package/dist-cli/chunks/flow-RYMDNC4V.js +2 -0
  66. package/dist-cli/chunks/help-JVO6L7HS.js +2 -0
  67. package/dist-cli/chunks/{hidden-runtime-alias-QT52GUMS.js → hidden-runtime-alias-XM5Z6GME.js} +2 -2
  68. package/dist-cli/chunks/{home-paths-TZFWKT7O.js → home-paths-BVXLMDUT.js} +2 -2
  69. package/dist-cli/chunks/inspect-TBOCLFLQ.js +2 -0
  70. package/dist-cli/chunks/install-desktop-N6IVQZBG.js +2 -0
  71. package/dist-cli/chunks/{login-553MMERY.js → login-CTAICT4D.js} +4 -4
  72. package/dist-cli/chunks/{logout-UX4PNMDO.js → logout-X4T57OXG.js} +2 -2
  73. package/dist-cli/chunks/{maestro-XVWZ37YC.js → maestro-ZQYSFWKY.js} +3 -3
  74. package/dist-cli/chunks/{maestro-generate-O3J2XRQD.js → maestro-generate-Y25ETFOO.js} +3 -3
  75. package/dist-cli/chunks/{mode-S7PO7F4H.js → mode-KBQ2HTV2.js} +2 -2
  76. package/dist-cli/chunks/optional-demo-registry-G6FLEREA.js +2 -0
  77. package/dist-cli/chunks/{perf-SQD72526.js → perf-MRGDCXKC.js} +2 -2
  78. package/dist-cli/chunks/{record-TFIQZHAO.js → record-6JMMR3DI.js} +8 -8
  79. package/dist-cli/chunks/runtime-3EJHJAAM.js +2 -0
  80. package/dist-cli/chunks/{screenshot-command-TCUSGETC.js → screenshot-command-SEHNB5PW.js} +3 -3
  81. package/dist-cli/chunks/{screenshots-capture-TUGNPCWG.js → screenshots-capture-GAZMPQ2T.js} +2 -2
  82. package/dist-cli/chunks/{serve-JAKYFLDC.js → serve-HQAJCUJP.js} +2 -2
  83. package/dist-cli/chunks/{setup-WBQ5PYMM.js → setup-A3PIKOJA.js} +3 -3
  84. package/dist-cli/chunks/{skills-U5NQ6Y2O.js → skills-4522XNAV.js} +2 -2
  85. package/dist-cli/chunks/{storage-X6CEYBPL.js → storage-VC4FO3X4.js} +2 -2
  86. package/dist-cli/chunks/store-Y6DYP7EA.js +2 -0
  87. package/dist-cli/chunks/telemetry-3M5Y7GDR.js +2 -0
  88. package/dist-cli/chunks/{timeline-RUVDOAYG.js → timeline-AU6ZXEJY.js} +2 -2
  89. package/dist-cli/chunks/{upgrade-X52FGN22.js → upgrade-M5V7P7HI.js} +2 -2
  90. package/dist-cli/chunks/upload-F47SYC4Y.js +2 -0
  91. package/dist-cli/chunks/{version-SMQW5VNI.js → version-BIWUB3OU.js} +2 -2
  92. package/dist-cli/chunks/{web-2NTSSKPW.js → web-Y2HUWQL6.js} +2 -2
  93. package/dist-cli/chunks/{what-happened-3AXYUGTU.js → what-happened-TTM4T2XG.js} +2 -2
  94. package/dist-lib/agent-daemon-client.cjs +1 -1
  95. package/dist-lib/agent-events.cjs +1 -1
  96. package/dist-lib/agent-identity.cjs +1 -1
  97. package/dist-lib/agent-sessions.cjs +1 -1
  98. package/dist-lib/attached-projects.cjs +1 -1
  99. package/dist-lib/auth/shared-session.cjs +1 -1
  100. package/dist-lib/backend-origin.cjs +1 -1
  101. package/dist-lib/beta.cjs +1 -1
  102. package/dist-lib/beta.mjs +1 -1
  103. package/dist-lib/bridge-constants.cjs +1 -1
  104. package/dist-lib/cli-constants.cjs +1 -1
  105. package/dist-lib/config.cjs +1 -1
  106. package/dist-lib/detox/index.cjs +1 -1
  107. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  108. package/dist-lib/home-paths.cjs +1 -1
  109. package/dist-lib/host/bridge-host.cjs +1 -1
  110. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  112. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  113. package/dist-lib/host/websocket-proxy.cjs +1 -1
  114. package/dist-lib/index.cjs +1 -1
  115. package/dist-lib/jump-to-source-babel.cjs +1 -1
  116. package/dist-lib/menu.cjs +1 -1
  117. package/dist-lib/menu.mjs +1 -1
  118. package/dist-lib/metro.cjs +1 -1
  119. package/dist-lib/profiles.cjs +1 -1
  120. package/dist-lib/render-mode.cjs +1 -1
  121. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  122. package/dist-lib/sdk.cjs +1 -1
  123. package/dist-lib/sdk.mjs +1 -1
  124. package/dist-lib/skills.cjs +1 -1
  125. package/dist-lib/vite.cjs +1 -1
  126. package/package.json +1 -1
  127. package/dist-cli/chunks/beta-E3A3FN5N.js +0 -2
  128. package/dist-cli/chunks/chunk-ANOU6P4R.js +0 -1
  129. package/dist-cli/chunks/chunk-TA6OIGXV.js +0 -118
  130. package/dist-cli/chunks/chunk-Z3BORSD4.js +0 -1
  131. package/dist-cli/chunks/cli-version-YYFAD5AQ.js +0 -2
  132. package/dist-cli/chunks/daemon-NQ5RDWC4.js +0 -2
  133. package/dist-cli/chunks/drivers-5NKXLGOH.js +0 -2
  134. package/dist-cli/chunks/flow-DYOXMN3T.js +0 -2
  135. package/dist-cli/chunks/help-ZEEVDVCV.js +0 -2
  136. package/dist-cli/chunks/inspect-KSPWBUAB.js +0 -2
  137. package/dist-cli/chunks/install-desktop-4GT67C5I.js +0 -2
  138. package/dist-cli/chunks/optional-demo-registry-BVQUDY4V.js +0 -2
  139. package/dist-cli/chunks/runtime-XCEDZMMB.js +0 -2
  140. package/dist-cli/chunks/store-Z2X4OFEM.js +0 -2
  141. package/dist-cli/chunks/telemetry-NWD6GLRC.js +0 -2
  142. package/dist-cli/chunks/upload-ZUHYO36E.js +0 -2
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as K,b as V,c as Ne}from"./chunk-ZVVEXBEJ.js";import{c as Pe}from"./chunk-YAX25DGN.js";import{d as _e}from"./chunk-YQDB5ODC.js";import{d as Oe}from"./chunk-TR25YKVI.js";import{g as $e,i as Fe,k as B}from"./chunk-XUJDCVTH.js";import{a as Ue,b as E}from"./chunk-TZJ6V6E3.js";import{a as Ae}from"./chunk-P3IXWUXV.js";import{createHash as St}from"crypto";import{readFileSync as M}from"fs";import je from"path";import{gzipSync as ge,gunzipSync as vt}from"zlib";function Ce(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ut,constants as ct}from"node:zlib";var dt=9;function Le(e){return ut(e,{params:{[ct.BROTLI_PARAM_QUALITY]:dt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function pt(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await pt(l),o++,r?.(o,i)}}))}function ft(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function gt(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function ze(e){let t=gt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=ft(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let m=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:m.signal})}finally{m.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function ht(e){return e!==null&&typeof e=="object"?e:null}function De(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=ht(e);return t?t.schemaVersion===1&&De(t.t)!==void 0&&De(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function yt(e,t){let r=[];for(let s of e.split(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as K,b as V,c as Ne}from"./chunk-DKGKL6KP.js";import{c as Pe}from"./chunk-APQFVJDK.js";import{d as _e}from"./chunk-UGRYC3HL.js";import{d as Oe}from"./chunk-4Z3JQFES.js";import{g as $e,i as Fe,k as B}from"./chunk-BGW73A3C.js";import{a as Ue,b as E}from"./chunk-PUH4S4CC.js";import{a as Ae}from"./chunk-Q2X3WO5X.js";import{createHash as St}from"crypto";import{readFileSync as M}from"fs";import je from"path";import{gzipSync as ge,gunzipSync as vt}from"zlib";function Ce(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ut,constants as ct}from"node:zlib";var dt=9;function Le(e){return ut(e,{params:{[ct.BROTLI_PARAM_QUALITY]:dt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function pt(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await pt(l),o++,r?.(o,i)}}))}function ft(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function gt(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function ze(e){let t=gt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=ft(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let m=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:m.signal})}finally{m.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function ht(e){return e!==null&&typeof e=="object"?e:null}function De(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=ht(e);return t?t.schemaVersion===1&&De(t.t)!==void 0&&De(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function yt(e,t){let r=[];for(let s of e.split(`
3
3
  `)){let o=s.trim();if(o)try{let i=JSON.parse(o);t(i)&&r.push(i)}catch{}}return r}function He(e){return yt(e,de)}import{execSync as bt}from"child_process";function me(e){try{return bt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function pe(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function wt(){let e=me("git remote get-url origin");if(!e)return null;let t=e.match(/github\.com[/:]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i);return t?{owner:t[1],repo:t[2]}:null}function fe(){let e=process.env.GITHUB_ACTIONS==="true",t=process.env.CONTRAST_BRANCH?.trim()||null,r=process.env.CONTRAST_SHA?.trim()||null,s=process.env.CONTRAST_PR_TITLE?.trim()||null,o=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim(),[i,l]=o.includes("/")?o.split("/",2):[null,null];if(e){let h=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//)?.[1];return{owner:i,repo:l,branch:t||process.env.GITHUB_HEAD_REF?.trim()||process.env.GITHUB_REF_NAME?.trim()||null,commitSha:r||process.env.GITHUB_SHA?.trim()||null,githubUsername:process.env.GITHUB_ACTOR?.trim()||null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER)??pe(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let m=t??me("git rev-parse --abbrev-ref HEAD"),c=i?null:wt();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:m==="HEAD"?null:m,commitSha:r??me("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Yt(e){if(e.length===0)return{stepCount:null,failedStepIndex:null};let t=e.find(r=>r.status==="failure");return{stepCount:e.length,failedStepIndex:t?t.stepIndex:null}}function Qt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Xt(e){let t=e.auth??K();if(!t)return null;let r=fe(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:V(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let m=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${m?`: ${m.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Rt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}function xt(e){let t=JSON.parse(M(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),m=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof m!="string"||!m)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=M(m);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var Ve=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",We=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",ye="http://localhost:3000",kt=2e3;async function Et(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${ye}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(kt)});if(t.ok||t.status===204||t.status===405)return ye}catch{}return Ve}function N(e){return e.replace(/\/$/,"")}function Bt(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function It(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function At(e,t){return t?N(t):process.env.SOOTSIM_PREVIEW_ORIGIN?N(process.env.SOOTSIM_PREVIEW_ORIGIN):Bt(e)?N(e):It(e)?N(We):N(e)}function Ut(){console.log(`
4
4
  sootsim record upload \u2014 publish the current recorded bundle as a /preview/<id> link
5
5
 
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  function H(t,e){let r=["--max-ms","--maxMs","--maxms","--max_ms"];for(let n of r){let s=t.indexOf(n);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var S=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function v(t){return typeof t=="string"&&S.has(t)}async function T(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function W(t,e){if(!v(e))return!1;try{return await T(t)}catch{return!1}}async function B(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function F(t,e=5,r){let n=r?.format?`, ${JSON.stringify(r)}`:"",s=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}${n}))()`});if(r?.format==="boxes"&&typeof s=="string")try{return{depth:e,tree:JSON.parse(s)}}catch{return{depth:e,tree:s}}return{depth:e,tree:s}}async function j(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function z(t,e){let r=`(async () => {
3
3
  const t = window.__sootsimTest
4
4
  const mainShell = window.SootSim?.bridges?.mainShell
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as l}from"./chunk-P3IXWUXV.js";import{A as o,B as s}from"./chunk-CFIAG2RO.js";function c(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!o()}function p(){if(c())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let t=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:t.replace(/\/+$/,"")}}function u(){try{return s()}catch{return"anonymous-cli"}}function d(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:u():u()}function f(e){let t=e.identity??{},n={$lib:"sootsim-cli",source:t.source??"cli",...e.properties};return t.userId&&(n.userId=t.userId),t.repoId&&(n.repoId=t.repoId),t.installationId!=null&&(n.installationId=String(t.installationId)),t.shareId&&(n.shareId=t.shareId),t.plan&&(n.plan=t.plan),{event:e.event,distinct_id:d(t),properties:n,timestamp:new Date().toISOString()}}var r=[],a=!1;async function i(){if(r.length===0)return;let e=p();if(!e){r.length=0;return}let t=r.splice(0,r.length).map(f);try{await fetch(`${e.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:e.apiKey,batch:t}),signal:AbortSignal.timeout(2e3)})}catch{}}function I(){a||(a=!0,process.on("beforeExit",()=>void i()),process.on("exit",()=>void i()))}function y(e){if(c())return;I();let t=null;try{t=l()?.user?.id??null}catch{t=null}r.push({...e,identity:{source:"cli",userId:t,...e.identity}})}async function m(){await i()}export{y as a,m as b};
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as l}from"./chunk-Q2X3WO5X.js";import{A as o,B as s}from"./chunk-KWNVZ2LX.js";function c(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!o()}function p(){if(c())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let t=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:t.replace(/\/+$/,"")}}function u(){try{return s()}catch{return"anonymous-cli"}}function d(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:u():u()}function f(e){let t=e.identity??{},n={$lib:"sootsim-cli",source:t.source??"cli",...e.properties};return t.userId&&(n.userId=t.userId),t.repoId&&(n.repoId=t.repoId),t.installationId!=null&&(n.installationId=String(t.installationId)),t.shareId&&(n.shareId=t.shareId),t.plan&&(n.plan=t.plan),{event:e.event,distinct_id:d(t),properties:n,timestamp:new Date().toISOString()}}var r=[],a=!1;async function i(){if(r.length===0)return;let e=p();if(!e){r.length=0;return}let t=r.splice(0,r.length).map(f);try{await fetch(`${e.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:e.apiKey,batch:t}),signal:AbortSignal.timeout(2e3)})}catch{}}function I(){a||(a=!0,process.on("beforeExit",()=>void i()),process.on("exit",()=>void i()))}function y(e){if(c())return;I();let t=null;try{t=l()?.user?.id??null}catch{t=null}r.push({...e,identity:{source:"cli",userId:t,...e.identity}})}async function m(){await i()}export{y as a,m as b};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{o as d}from"./chunk-CFIAG2RO.js";import{chmodSync as S,existsSync as f,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as m}from"node:path";var s=1,p="SOOTSIM_SHARED_AUTH_FILE",u="https://contrast.dev";function w(){let t=process.env[p];return t?.trim()?c(m(t)):d()}function a(){let t=process.env[p];return t?.trim()?m(t):D(w(),"desktop-auth.json")}function g(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,githubUsername:typeof e.githubUsername=="string"?e.githubUsername:void 0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:g(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function O(){let t=a();if(!f(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=v(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function b(t){let e=a();k(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?g(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{o as d}from"./chunk-KWNVZ2LX.js";import{chmodSync as S,existsSync as f,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as m}from"node:path";var s=1,p="SOOTSIM_SHARED_AUTH_FILE",u="https://contrast.dev";function w(){let t=process.env[p];return t?.trim()?c(m(t)):d()}function a(){let t=process.env[p];return t?.trim()?m(t):D(w(),"desktop-auth.json")}function g(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,githubUsername:typeof e.githubUsername=="string"?e.githubUsername:void 0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:g(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function O(){let t=a();if(!f(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=v(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function b(t){let e=a();k(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?g(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
3
3
  `);try{S(e,384)}catch{}return r}function l(){i(a(),{force:!0})}async function E(t){let e=O();if(!e?.token)return null;let r=t||e.origin||u;try{let n=await fetch(`${r.replace(/\/$/,"")}/api/auth/me`,{headers:{authorization:`Bearer ${e.token}`}});if(n.status===401)return l(),null;if(!n.ok)return e;let o=await n.json();return o.user?.id?b({token:e.token,user:o.user,origin:r,source:e.source,validatedAt:new Date().toISOString()}):(l(),null)}catch{return e}}export{O as a,b,l as c,E as d};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
3
3
  ${o}
4
4
  `);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{H as t,N as n,P as l,j as r}from"./chunk-CFIAG2RO.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{H as t,N as n,P as l,j as r}from"./chunk-KWNVZ2LX.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as m,b as E}from"./chunk-Z7TEEXRM.js";import{a as w,b as T,c as A}from"./chunk-TR25YKVI.js";import{a as _,d as I}from"./chunk-YLSEQMQK.js";import{G as k,o as O,q as f}from"./chunk-CFIAG2RO.js";import h from"fs";import v from"path";var c="default",q="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),q)}function j(e){return`sootsim-profile-${s(e)}`}function H(e){return v.join(O(),"Partitions",j(e))}function b(e){return v.join(f(),"playwright",s(e))}function y(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function C(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:C(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:C([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){k();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as m,b as E}from"./chunk-GB3IT6AN.js";import{a as w,b as T,c as A}from"./chunk-4Z3JQFES.js";import{a as _,d as I}from"./chunk-ORSIJ76W.js";import{G as O,o as k,q as f}from"./chunk-KWNVZ2LX.js";import h from"fs";import v from"path";var c="default",q="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),q)}function j(e){return`sootsim-profile-${s(e)}`}function H(e){return v.join(k(),"Partitions",j(e))}function b(e){return v.join(f(),"playwright",s(e))}function y(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function C(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:C(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:C([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
3
3
  `,"utf8"),h.renameSync(t,g()),r}function z(){return S(y()).profiles}function K(e){let r=s(e);return z().find(t=>t.id===r)??null}function M(e=c){let r=s(e),t=K(r);return t||Y(r)}function Y(e){let r=s(e),t=P(y());if(t.profiles.some(i=>i.id===r))throw new Error(`profile already exists: ${r}`);let o=new Date().toISOString(),n={id:r,createdAt:o,updatedAt:o};return S({version:a,profiles:[...t.profiles,n]}),n}function we(e){let r=s(e);if(r===c)throw new Error("the default profile cannot be deleted; clear it instead");let t=P(y()),o=t.profiles.find(n=>n.id===r);if(!o)throw new Error(`profile not found: ${r}`);return S({version:a,profiles:t.profiles.filter(n=>n.id!==r)}),V(r),o}function V(e){let r=s(e);for(let t of[H(r),b(r)])try{h.rmSync(t,{recursive:!0,force:!0})}catch{}}function J(){let e=w();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function X(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=w();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await A(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var L={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:J,launch:X};function Z(){let e=m();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim desktop install`)"}}async function Q(e){let r=m();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await E(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var R={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:Z,launch:Q};import{spawn as ee}from"child_process";import{closeSync as re,mkdtempSync as te,openSync as oe,readFileSync as ie}from"fs";import{createRequire as ne}from"module";import{tmpdir as W}from"os";import{join as N}from"path";var se=`
4
4
  const modulePath = process.env.SOOTSIM_PW_MODULE;
5
5
  const url = process.env.SOOTSIM_PW_URL;
@@ -365,6 +365,14 @@ const cleanupProfile = () => {
365
365
  process.stderr.write('[playwright-driver] launched ' + launchedChannel + '\\n');
366
366
  }
367
367
  }
368
+ // grant camera up front so the sim's Camera app reaches the host webcam
369
+ // through getUserMedia, mirroring a real iOS simulator where the camera just
370
+ // works. without this the unhandled chrome permission prompt auto-denies and
371
+ // CameraApp renders its "Camera Access Required" placeholder. webkit does not
372
+ // support the camera grant, so scope it to chromium.
373
+ if (browserEngine === 'chromium') {
374
+ await context.grantPermissions(['camera']);
375
+ }
368
376
  const hostMeta = {
369
377
  sootsimHostDriver: 'playwright',
370
378
  sootsimHostPid: process.pid,
@@ -464,4 +472,4 @@ const cleanupProfile = () => {
464
472
  });
465
473
  `;function $(){let e=[process.cwd()+"/"];try{process.argv[1]&&e.push(process.argv[1])}catch{}for(let r of e)try{let t=ne(r);for(let o of["playwright","playwright-chromium","playwright-core"])try{return{spec:o,modulePath:t.resolve(o)}}catch{}}catch{}return null}function ae(){let e=$();return e?{available:!0,reason:null,detail:`resolved via ${e.spec}`}:{available:!1,reason:"playwright not installed in the current workspace"}}function le(e,r){return process.platform!=="linux"||e.headless||process.env.DISPLAY||process.env.WAYLAND_DISPLAY||!/missing x server|cannot open display|x server|x11/i.test(r)?null:" hint: linux without DISPLAY/WAYLAND_DISPLAY \u2014 rerun without --headed (or add --headless) to run playwright headless."}function ce(e){return e.profileId?b(M(e.profileId).id):e.ephemeralProfile?te(N(W(),"sootsim-playwright-profile-")):""}async function de(e){let r=$();if(!r)return{launched:!1,message:"playwright not installed \u2014 run `bun add -D playwright` first"};if(!e.url)return{launched:!1,message:"playwright driver requires a target url"};let t=N(W(),`sootsim-playwright-host-${Date.now().toString(36)}-${process.pid}.log`),o=`${t}.connected`,n=oe(t,"a");try{let i=I(),p=ee(process.execPath,["-e",se],{detached:!0,stdio:["ignore","ignore",n],env:{...process.env,SOOTSIM_PW_MODULE:r.modulePath,SOOTSIM_PW_URL:e.url,SOOTSIM_PW_BRIDGE_PORT:e.bridgePort?String(e.bridgePort):"",SOOTSIM_PW_HEADLESS:e.headless??!0?"1":"0",SOOTSIM_PW_USERDATADIR:ce(e),SOOTSIM_PW_CDP_PORT:e.cdpPort?String(e.cdpPort):"",SOOTSIM_PW_BROWSER:e.browser??"",SOOTSIM_PW_VIEWPORT:e.viewport?`${e.viewport.width}x${e.viewport.height}`:"",SOOTSIM_PW_CONNECTED_ACK_FILE:o,SOOTSIM_PW_CONNECT_TIMEOUT_MS:String(e.connectTimeoutMs??12e4),SOOTSIM_PW_OWNER_PID:i&&i>1?String(i):""}});p.unref();let x=await new Promise(l=>{let u=setTimeout(()=>l(null),4e3);p.once("exit",B=>{clearTimeout(u),l(B??0)})});if(x!==null){let l=ie(t,"utf8").trim(),u=le(e,l);return{launched:!1,message:`playwright host exited early (code ${x}) \u2014 host log ${t}${l?`:
466
474
  ${l}`:""}${u?`
467
- ${u}`:""}`}}let D=i&&i>1?_(i):null,G=i&&i>1?` \u2014 browser closes when pid ${i}${D?` (${D})`:""} exits`:"";return{launched:!0,message:`playwright chrome launched \u2192 ${e.url}${G}`,pid:p.pid,target:r.spec,attachUrl:e.url,connectAckFile:o,diagnosticLogPath:t}}catch(i){return{launched:!1,message:`playwright launch failed: ${i instanceof Error?i.message:String(i)}`}}finally{re(n)}}var F={id:"playwright",name:"playwright",description:"programmatic chromium via the playwright package \u2014 headless default",kind:"automation",availability:ae,launch:de};function ue(){return process.platform!=="darwin"&&process.platform!=="linux"&&process.platform!=="win32"?{available:!1,reason:`unsupported platform: ${process.platform}`}:{available:!0,reason:null,detail:process.platform==="darwin"?"open(1)":process.platform==="win32"?"cmd /c start":"xdg-open(1)"}}async function he(e){if(e.headless)return{launched:!1,message:"system driver does not support --headless; use chromium or playwright"};if(!e.url)return{launched:!1,message:"system driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current browser profile"};try{let r=await T(e.url,{detached:e.detached??!0,newWindow:e.newWindow});return{launched:!0,message:`${r.via} launch \u2192 ${e.url}`,pid:r.pid,target:r.target,attachUrl:e.url}}catch(r){return{launched:!1,message:`system launch failed: ${r instanceof Error?r.message:String(r)}`}}}var U={id:"system",name:"system",description:"shared browser launcher \u2014 system default or chromium window",kind:"delegate",availability:ue,launch:he};var d=[L,R,F,U];function Ne(){return d}function $e(e){return d.find(r=>r.id===e)??null}function Fe(e,r){if(e)return d.find(o=>o.id===e)??null;for(let t of r){let o=d.find(n=>n.id===t);if(o&&o.availability().available)return o}return null}function Ue(){return d.map(e=>{let r=e.availability();return{id:e.id,name:e.name,kind:e.kind,description:e.description,available:r.available,reason:r.reason,detail:r.detail??null}})}export{z as a,M as b,Y as c,we as d,V as e,L as f,R as g,F as h,U as i,d as j,Ne as k,$e as l,Fe as m,Ue as n};
475
+ ${u}`:""}`}}let D=i&&i>1?_(i):null,G=i&&i>1?` \u2014 browser closes when pid ${i}${D?` (${D})`:""} exits`:"";return{launched:!0,message:`playwright chrome launched \u2192 ${e.url}${G}`,pid:p.pid,target:r.spec,attachUrl:e.url,connectAckFile:o,diagnosticLogPath:t}}catch(i){return{launched:!1,message:`playwright launch failed: ${i instanceof Error?i.message:String(i)}`}}finally{re(n)}}var U={id:"playwright",name:"playwright",description:"programmatic chromium via the playwright package \u2014 headless default",kind:"automation",availability:ae,launch:de};function ue(){return process.platform!=="darwin"&&process.platform!=="linux"&&process.platform!=="win32"?{available:!1,reason:`unsupported platform: ${process.platform}`}:{available:!0,reason:null,detail:process.platform==="darwin"?"open(1)":process.platform==="win32"?"cmd /c start":"xdg-open(1)"}}async function he(e){if(e.headless)return{launched:!1,message:"system driver does not support --headless; use chromium or playwright"};if(!e.url)return{launched:!1,message:"system driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current browser profile"};try{let r=await T(e.url,{detached:e.detached??!0,newWindow:e.newWindow});return{launched:!0,message:`${r.via} launch \u2192 ${e.url}`,pid:r.pid,target:r.target,attachUrl:e.url}}catch(r){return{launched:!1,message:`system launch failed: ${r instanceof Error?r.message:String(r)}`}}}var F={id:"system",name:"system",description:"shared browser launcher \u2014 system default or chromium window",kind:"delegate",availability:ue,launch:he};var d=[L,R,U,F];function Ne(){return d}function $e(e){return d.find(r=>r.id===e)??null}function Ue(e,r){if(e)return d.find(o=>o.id===e)??null;for(let t of r){let o=d.find(n=>n.id===t);if(o&&o.availability().available)return o}return null}function Fe(){return d.map(e=>{let r=e.availability();return{id:e.id,name:e.name,kind:e.kind,description:e.description,available:r.available,reason:r.reason,detail:r.detail??null}})}export{z as a,M as b,Y as c,we as d,V as e,L as f,R as g,U as h,F as i,d as j,Ne as k,$e as l,Ue as m,Fe as n};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var m={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},p=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),b=new Set(["do","get","wait","shell","debug"]),d=new Set(["detox","maestro","record","film","storage","perf","screenshot","mode","inspect","debug","timeline","what-happened","shell","assert","device","open","list","use","claim","close","compat","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","version","skill","config","app-fonts","agent-wrapper","agent",...p]);function h(c){let r=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<r.length;){let o=r[s];if(o==="--"){e.commandArgs.push(...r.slice(s+1));break}let i=Object.entries(m).find(([l,t])=>l===o||t.short===o);if(i){let[l,t]=i,a=l.replace(/^--/,"");if(t.type==="boolean")e.globalFlags[a]=!0,s++;else{let n=r[s+1];if(n===void 0||n.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(t.type==="number"){let g=Number(n);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${n}"`),s+=2;continue}e.globalFlags[a]=g}else e.globalFlags[a]=n;s+=2}continue}if(!e.command&&!o.startsWith("-")){let l=o.indexOf("-");if(l>0){let t=o.slice(0,l),a=o.slice(l+1);if(b.has(t)&&a.length>0){e.command=t;let n=r.slice(s+1);e.commandArgs=[a,...n[0]==="--"?n.slice(1):n];break}}if(d.has(o)){e.command=o;let t=r.slice(s+1);e.commandArgs=t[0]==="--"?t.slice(1):t;break}e.commandArgs=r.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{p as a,h as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as k,b as O,c as x,e as m,f as I,g as h}from"./chunk-ITU3SFQX.js";import{d as R}from"./chunk-XUJDCVTH.js";import{G as v,H as a,I as y,J as u,K as b,l as w,z as d}from"./chunk-CFIAG2RO.js";import S from"fs";import{WebSocket as N}from"ws";async function J(t,e={}){let[s,...n]=t;if(!s||s==="--help"||s==="-h"){A();return}switch(s){case"install":return T(n,e);case"list":case"ls":return _(n);case"use":return C(n);case"remove":case"rm":return U(n);case"which":case"active":return E();case"pin":return F(n);case"unpin":return P();case"notes":case"changelog":return G(n);default:console.error(` unknown runtime subcommand: ${s}`),A(),process.exit(1)}}function A(){console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as k,b as O,c as x,e as m,f as I,g as h}from"./chunk-I664RIMB.js";import{d as R}from"./chunk-BGW73A3C.js";import{G as v,H as a,I as y,J as u,K as b,l as w,z as d}from"./chunk-KWNVZ2LX.js";import S from"fs";import{WebSocket as N}from"ws";async function J(t,e={}){let[s,...n]=t;if(!s||s==="--help"||s==="-h"){A();return}switch(s){case"install":return T(n,e);case"list":case"ls":return _(n);case"use":return C(n);case"remove":case"rm":return U(n);case"which":case"active":return E();case"pin":return F(n);case"unpin":return P();case"notes":case"changelog":return G(n);default:console.error(` unknown runtime subcommand: ${s}`),A(),process.exit(1)}}function A(){console.log(`
3
3
  sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
4
4
 
5
5
  usage:
@@ -26,4 +26,4 @@ examples:
26
26
  sootsim runtime install --channel beta
27
27
  sootsim runtime use 1.2.3
28
28
  sootsim runtime notes
29
- `)}async function T(t,e){let{version:s,flags:n}=M(t),o=n.channel??e.channel??"stable",l=n.force===!0,r=n.setActive!==!1;v(),console.log("sootsim runtime install"),console.log(` cdn: ${x()}`);try{let i=await h({version:s,channel:o,force:l,setActive:r});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),r&&await f(i.version)}catch(i){console.error(` ${p(i)}`),process.exit(1)}}async function f(t){y(t),console.log(` active: ${t}`),await L(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function L(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-TZFWKT7O.js"),n=s();if(!e(n))return!1;let o=R();return new Promise(l=>{let r=!1,i=!1,g=D=>{r||(r=!0,l(D))},c=new N(`ws://127.0.0.1:${o}`,{handshakeTimeout:800}),$=setTimeout(()=>{try{c.close()}catch{}g(i)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),i=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout($),g(i)}),c.on("error",()=>{clearTimeout($),g(!1)})})}async function _(t){v();let e=u(),s=a(),n=m();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let o of e)console.log(` ${o===s?"*":" "} ${o}${o===n?" (pinned)":""}`);n&&!e.includes(n)&&console.log(`pinned: ${n} (not installed \u2014 run \`sootsim runtime install\`)`);try{let o=await I();console.log("available (latest per channel):");for(let[r,i]of Object.entries(o.channels))console.log(` ${r.padEnd(8)} ${i.latest}`);let l=Object.keys(o.versions).sort(b).reverse();if(l.length>1){console.log("hosted versions:");for(let r of l)console.log(` ${r}`)}}catch(o){console.log(`available: (could not fetch manifest: ${p(o)})`)}}async function C(t){let e=t[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=u();s.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await f(e)}async function U(t){let e=t[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),a()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=w(e);if(!S.existsSync(n)){console.error(` ${e} is not installed`);return}S.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function E(){let t=a();if(!t){console.log(" no active runtime");return}console.log(t)}async function F(t){let e=t[0];if(!e){let n=m();n?console.log(` runtime pinned to ${n}`):(console.log(" no pin \u2014 runtime follows channel latest"),console.log(" usage: sootsim runtime pin <version>"));return}if(d({runtimeVersion:e}),console.log(` pinned runtime to ${e}`),u().includes(e)){a()!==e&&await f(e);return}try{let n=await h({version:e,setActive:!1});console.log(n.installed?` installed ${n.version}`:` already installed at ${n.runtimeDir}`),await f(e)}catch(n){console.error(` ${p(n)}`),console.error(` pin saved, but ${e} could not be installed \u2014 check \`sootsim runtime list\` for hosted versions`),process.exit(1)}}async function P(){let t=m();if(!t){console.log(" no pin set");return}d({runtimeVersion:void 0}),console.log(` unpinned (was ${t}) \u2014 runtime follows channel latest again`),console.log(" run `sootsim upgrade` to move to the latest now")}async function G(t){t.length>0&&(console.error(" usage: sootsim runtime notes"),process.exit(1));let e=a();e&&console.log(` active runtime: v${e}`),console.log(` release notes: ${O}`)}function M(t){let e={},s=[];for(let n=0;n<t.length;n++){let o=t[n];if(o==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(o.startsWith("--channel=")){e.channel=o.slice(10);continue}if(o==="--force"){e.force=!0;continue}if(o==="--set-active=false"||o==="--no-set-active"){e.setActive=!1;continue}s.push(o)}return{version:s[0]??null,flags:e}}function p(t){return t instanceof Error?t.message:String(t)}export{J as a};
29
+ `)}async function T(t,e){let{version:s,flags:n}=M(t),o=n.channel??e.channel??"stable",l=n.force===!0,r=n.setActive!==!1;v(),console.log("sootsim runtime install"),console.log(` cdn: ${x()}`);try{let i=await h({version:s,channel:o,force:l,setActive:r});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),r&&await f(i.version)}catch(i){console.error(` ${p(i)}`),process.exit(1)}}async function f(t){y(t),console.log(` active: ${t}`),await L(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function L(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:s}=await import("./home-paths-BVXLMDUT.js"),n=s();if(!e(n))return!1;let o=R();return new Promise(l=>{let r=!1,i=!1,g=D=>{r||(r=!0,l(D))},c=new N(`ws://127.0.0.1:${o}`,{handshakeTimeout:800}),$=setTimeout(()=>{try{c.close()}catch{}g(i)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),i=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout($),g(i)}),c.on("error",()=>{clearTimeout($),g(!1)})})}async function _(t){v();let e=u(),s=a(),n=m();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let o of e)console.log(` ${o===s?"*":" "} ${o}${o===n?" (pinned)":""}`);n&&!e.includes(n)&&console.log(`pinned: ${n} (not installed \u2014 run \`sootsim runtime install\`)`);try{let o=await I();console.log("available (latest per channel):");for(let[r,i]of Object.entries(o.channels))console.log(` ${r.padEnd(8)} ${i.latest}`);let l=Object.keys(o.versions).sort(b).reverse();if(l.length>1){console.log("hosted versions:");for(let r of l)console.log(` ${r}`)}}catch(o){console.log(`available: (could not fetch manifest: ${p(o)})`)}}async function C(t){let e=t[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=u();s.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await f(e)}async function U(t){let e=t[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),a()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=w(e);if(!S.existsSync(n)){console.error(` ${e} is not installed`);return}S.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function E(){let t=a();if(!t){console.log(" no active runtime");return}console.log(t)}async function F(t){let e=t[0];if(!e){let n=m();n?console.log(` runtime pinned to ${n}`):(console.log(" no pin \u2014 runtime follows channel latest"),console.log(" usage: sootsim runtime pin <version>"));return}if(d({runtimeVersion:e}),console.log(` pinned runtime to ${e}`),u().includes(e)){a()!==e&&await f(e);return}try{let n=await h({version:e,setActive:!1});console.log(n.installed?` installed ${n.version}`:` already installed at ${n.runtimeDir}`),await f(e)}catch(n){console.error(` ${p(n)}`),console.error(` pin saved, but ${e} could not be installed \u2014 check \`sootsim runtime list\` for hosted versions`),process.exit(1)}}async function P(){let t=m();if(!t){console.log(" no pin set");return}d({runtimeVersion:void 0}),console.log(` unpinned (was ${t}) \u2014 runtime follows channel latest again`),console.log(" run `sootsim upgrade` to move to the latest now")}async function G(t){t.length>0&&(console.error(" usage: sootsim runtime notes"),process.exit(1));let e=a();e&&console.log(` active runtime: v${e}`),console.log(` release notes: ${O}`)}function M(t){let e={},s=[];for(let n=0;n<t.length;n++){let o=t[n];if(o==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(o.startsWith("--channel=")){e.channel=o.slice(10);continue}if(o==="--force"){e.force=!0;continue}if(o==="--set-active=false"||o==="--no-set-active"){e.setActive=!1;continue}s.push(o)}return{version:s[0]??null,flags:e}}function p(t){return t instanceof Error?t.message:String(t)}export{J as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as k}from"./chunk-Z7TEEXRM.js";import{a as x}from"./chunk-6EZX7YXZ.js";import{spawn as v,spawnSync as u}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as b}from"path";var h="https://contrast.dev/api/electron-release";function O(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${o}.dmg`;return{platform:o,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let o=r==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${o}.AppImage`;return{platform:o,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:B}}return null}async function I({url:r,dest:o,onProgress:e}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${r})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error(`empty response body (${r})`);y(A(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(n=>n?p(n):l())})}}function _(r,o){let e=(r/1048576).toFixed(1);if(!o)return` ${e} MB`;let s=Math.min(100,Math.round(r/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${t} MB`}async function L(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let e=o.stdout.trim().split(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as k}from"./chunk-GB3IT6AN.js";import{a as x}from"./chunk-QPZYFSTW.js";import{spawn as v,spawnSync as u}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as b}from"path";var h="https://contrast.dev/api/electron-release";function O(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${o}.dmg`;return{platform:o,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let o=r==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${o}.AppImage`;return{platform:o,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:B}}return null}async function I({url:r,dest:o,onProgress:e}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${r})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error(`empty response body (${r})`);y(A(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(n=>n?p(n):l())})}}function _(r,o){let e=(r/1048576).toFixed(1);if(!o)return` ${e} MB`;let s=Math.min(100,Math.round(r/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${t} MB`}async function L(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let e=o.stdout.trim().split(`
3
3
  `),t=e[e.length-1].split(" ").pop()?.trim();if(!t||!w(t))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=f(t,"sootsim.app");if(!w(a))throw u("hdiutil",["detach","-force",t]),new Error(`sootsim.app not found inside ${t}`);let i="/Applications",d=b(process.env.HOME||"","Applications"),c=i;try{let m=f(i,`.sootsim-write-probe-${process.pid}`);u("touch",[m]),w(m)?g(m,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=u("cp",["-R",a,l]),n=u("hdiutil",["detach","-force",t]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return n.status!==0&&console.warn(` warning: failed to unmount ${t} (${n.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",l]),l}async function C(r){let o=b(process.env.HOME||"","Applications");y(o,{recursive:!0});let e=f(o,"sootsim.AppImage");return w(e)&&g(e,{force:!0}),T(r,e),D(r),S(e,493),e}async function B(r){return await new Promise((o,e)=>{let s=v("cmd",["/c","start",'""',"/wait",r],{stdio:"inherit"});s.once("error",e),s.once("exit",t=>{t===0?o():e(new Error(`installer exited with code ${t}`))})}),r}async function q(r){(r.includes("--help")||r.includes("-h"))&&(console.log(`
4
4
  sootsim desktop install \u2014 download and install the optional desktop GUI
5
5
 
@@ -20,4 +20,4 @@ examples:
20
20
  `),process.exit(0));let o=r.includes("--yes")||r.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,e=r.includes("--force"),s=k();if(s&&!e){console.log(` sootsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let t=O();if(t||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64"),process.exit(1)),console.log(` platform: ${t.platform}`),console.log(` download: ${t.url}`),console.log(),!o){if(!await x("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(M(),`sootsim-install-${Date.now()}`),i=f(a,t.filename),d=0;process.stdout.write(` downloading ${t.filename}...
21
21
  `);try{await I({url:t.url,dest:i,onProgress:(n,m)=>{let $=Date.now();$-d<100&&n<(m??1/0)||(d=$,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${_(n,m)}`))}})}catch(n){g(a,{recursive:!0,force:!0});let m=n instanceof Error?n.message:String(n);console.error(`
22
22
  download failed: ${m}`),console.error(` the ${t.platform} desktop build may not be published yet, or your`),console.error(" network blocked the request. check your connection and try again later;"),console.error(" the CLI + daemon work without the desktop app (run: sootsim --help)."),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
23
- `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-NWD6GLRC.js");try{let n=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${n}`)}catch(n){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:n instanceof Error?n.message:String(n)}}),await p(),console.error(` install failed: ${n instanceof Error?n.message:String(n)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim desktop launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{q as a};
23
+ `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-3M5Y7GDR.js");try{let n=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${n}`)}catch(n){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:n instanceof Error?n.message:String(n)}}),await p(),console.error(` install failed: ${n instanceof Error?n.message:String(n)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim desktop launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{q as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as j,b as ne,c as re,d as xe,e as ke,g as Pe}from"./chunk-BZPJSFSP.js";import{b as Ie,l as ce}from"./chunk-G4VPOKCZ.js";import{a as U,b as ae}from"./chunk-Z7TEEXRM.js";import{a as Te,b as _e}from"./chunk-YAX25DGN.js";import{a as Ce,b as se,c as Ee}from"./chunk-YQDB5ODC.js";import{d as le}from"./chunk-TR25YKVI.js";import{m as R}from"./chunk-WQ5DQ5X7.js";import{m as Me,o as Re}from"./chunk-XWRHHNOK.js";import{a as Ue,b as Oe,c as ie,e as Be,f as De,g as C,h as v,i as E}from"./chunk-XUJDCVTH.js";import{e as _,f as b,g as M}from"./chunk-YLSEQMQK.js";import{H as Se,M as te,O as W,l as ve}from"./chunk-CFIAG2RO.js";import{g as oe,i as $e}from"./chunk-APBFMXMM.js";import{spawn as je,spawnSync as Ke}from"node:child_process";import D from"node:fs";import pt from"node:os";import T from"node:path";import{WebSocket as ft}from"ws";function st(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function K(e){let t=st(e);return t==="localhost"||t.endsWith(".localhost")||t==="0.0.0.0"||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function Le(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function it(e,t){return e?.includes("/one/metro-entry.bundle")?"one":typeof t=="string"&&t?"expo":"unknown"}function Ne(e,t,o){return`${e}//${t}:${o}`}function at(e){if(typeof window>"u")return!1;try{let t=new URL(e);return K(t.hostname)&&K(window.location.hostname)&&t.origin!==window.location.origin}catch{return!1}}async function Ae(e,t){let o={...t,cache:t?.cache??"no-store"};return at(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,o):fetch(e,o)}function lt(e){return e==="https:"?443:80}function ct(e){let t=e.pathname||"/";return(t==="/"||t==="")&&!e.search&&!e.hash}async function dt(e){try{let t=await fetch("/__server-scan",{cache:"no-store"});if(!t.ok||!(t.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let o=await t.json();if(!Array.isArray(o))return null;let n=o.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:re(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Fe(e,t){let o=e.replace(/\/+$/,"");try{if(K(new URL(o).hostname)){let n=await dt(t);if(n)return n}}catch{}try{let n=await Ae(`${o}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:re(i||`${o}${ne}`),port:t,framework:it(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ae(`${o}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${o}${ne}`,port:t,framework:"metro"}}catch{}return null}async function mt(e){return Fe(Ne("http:","localhost",e),e)}async function He(e){let t=e.trim();if(/^\d+$/.test(t)){let a=parseInt(t,10),l=await mt(a);if(l)return l;throw Le(`localhost:${a}`)}let o=t.startsWith("http")?t:`http://${t}`,n;try{n=new URL(o)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):lt(r),i=Ne(r,n.hostname,s);if(ct(n)){let a=await Fe(i,s);if(a)return a;throw Le(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function lo(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function We(e){let t=U();if(console.log(` note: no sootsim bridge detected on port ${e}`),t){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function ut(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function co(e,t,o){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){ut(t);return}console.error(` no sim with id "${o}" is connected to the bridge on port ${t}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var ht=12e4,ze=100,gt=5e3,qe=1e4,wt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(t=>setTimeout(t,e))}function Ge(e){let t=process.env[e]?.trim();if(!t)return null;let o=Number(t);return Number.isInteger(o)&&o>0?o:null}function bt(){let e=Ge("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??Ge("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??ht;return{timeoutMs:e,hostTimeoutMs:e+gt,intervalMs:ze,attempts:Math.max(1,Math.ceil(e/ze))}}function yt(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function vt(e,t){return e.includes("--headless")?!0:e.includes("--headed")?!1:t==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function G(e){return e.trim()}var Ye=/^[A-Za-z][A-Za-z0-9+.-]*:/;function St(e){let t=e.trim();if(!t)throw new Error("expected <url-or-route>");return Ye.test(t)||t.startsWith("/")?t:`/${t}`}function $t(e){return e!==null&&typeof e=="object"}function xt(e){let t=e.trim();return t?t.startsWith("/")?!0:Ye.test(t)?!/^https?:\/\//i.test(t):!1:!1}async function kt(e){if(await z(e,250))return e;let t=te();if(t&&W(t)&&await z(t.bridgePort,500))return t.bridgePort;if(t&&W(t))throw new Error(`sootsim bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await It();let o=Pt(["serve","--quiet","--port",String(e)]),n=null;o.once("exit",(s,i)=>{n=String(s??i??"unknown")}),o.unref();let r=Date.now()+qe;for(;Date.now()<r;){let s=te();if(s&&W(s)&&await z(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await z(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(qe/1e3)}s`)}async function It(){let e=Se();if(e&&D.existsSync(ve(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:t}=await import("./runtime-XCEDZMMB.js");await t(["install"],{})}function Pt(e){let t=process.argv[1];return t&&D.existsSync(t)?je(process.execPath,[t,...e],{detached:!0,stdio:"ignore",env:process.env}):je("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function z(e,t){return new Promise(o=>{let n=new ft(`ws://127.0.0.1:${e}`,{handshakeTimeout:t}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}o(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),t)})}function ue(e){try{let t=new URL(e),o=t.pathname.replace(/\/+$/,"")||"/";return t.searchParams.has("open")||t.searchParams.has("port")||t.searchParams.has("bundle")||t.searchParams.has("demo")||t.pathname.includes("/sootsim/index.html")||o==="/sootsim"||t.pathname==="/__soot"||t.pathname==="/__soot/"||o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}function Ct(e){try{let t=new URL(e,"http://sootsim.local");if(t.origin!=="http://sootsim.local")return!1;let o=t.pathname.replace(/\/+$/,"")||"/";return o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}function Et(e,t){let o=new URL(e,"http://sootsim.local"),n=new URL(t),r=V(n.pathname),s=o.pathname.startsWith("/__soot/")?o.pathname.slice(7):o.pathname;return n.pathname=`${r}${s}`,n.search=o.search,n.hash=o.hash,n.toString()}function Tt(e){try{let t=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(t)||/^\/build\/.+/.test(t)}catch{return!1}}async function Bo(e){let t=G(e);return(await Ze(t)).bundleUrl}function _t(e){try{let t=new URL(e.startsWith("http")?e:`http://${e}`),o=t.pathname||"/";if(o!=="/"&&o!==""||t.search||t.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(t.hostname))return null;let n=t.port?Number(t.port):t.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Ze(e){let t=G(e),o=/^\d+$/.test(t)?Number(t):_t(t);if(o&&o>0){let n=await ke(o);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return He(t)}function V(e){let t=e.replace(/\/+$/,"")||"/";return t==="/__soot"||t.startsWith("/__soot/")?"/__soot":""}function Mt(e,t){let o=G(e),n=new URL(t),r=V(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(o)?n.pathname=`${r}/rn/${o}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",o)),n.toString()}function Rt(e){let t=G(e);return/^\d+$/.test(t)||/^https?:\/\//i.test(t)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(t)}async function Ut(e,t,o={}){let n=await Ze(e),r=new URL(t),s=V(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=o.hot===void 0?n.bundleUrl:xe(n.bundleUrl,o.hot);return r.searchParams.set("bundle",i),r.toString()}function Ot(e){return e.startsWith("~/")?T.join(pt.homedir(),e.slice(2)):T.isAbsolute(e)?e:T.resolve(process.cwd(),e)}function Bt(e){let t={},o={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=Ot(s.slice(i+1).trim());D.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),t[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),o[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(t).length>0&&(n.modules=t),Object.keys(o).length>0&&(n.network={remap:o}),n.modules||n.network?n:void 0}function Xe(){return Ue().shellBaseUrl}async function Dt(e){try{let t=new URL(e),o=t.searchParams.get("bundle")||"";if(!o)return e;let n=process.env.CONTRAST_REPO_DIR||await se(o)||void 0,r=Ce({bundleUrl:o,repoDir:n});if(r.length===0)return e;let s=await Lt(r);return s.length===0?e:(t.searchParams.set("appFonts",Ee(s)),t.toString())}catch{return e}}async function Lt(e){let t=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),o=[];for(let n of t)n!==null&&o.push(n);return o}async function At(e,t,o={}){if(!e)return new URL(t).toString();if(ue(e))return new URL(e).toString();if(Ct(e))return Et(e,t);let n=wt[e.toLowerCase()];if(n){let r=new URL(t),s=V(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return Rt(e)?Ut(e,t,o):Mt(e,t)}async function Nt(e){try{let t=new URL(e),o=t.searchParams.get("bundle")||"";if(!o)return e;let n=process.env.CONTRAST_REPO_DIR||await se(o)||void 0,r=Te({bundleUrl:o,repoDir:n});return!r||r.imageUrl&&!await Ft(r.imageUrl)?e:(t.searchParams.set("appSplash",_e(r)),t.toString())}catch{return e}}async function Ft(e){let t=new AbortController,o=setTimeout(()=>t.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:t.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(o)}}async function q(e,t=Xe(),o={}){let n=await At(e,t,o),r=await Nt(await Dt(n));if(!o.device)return r;let s=new URL(r);return s.searchParams.set("device",o.device),s.toString()}function Ve(e,t){let o=e?.url||e?.origin||t;try{let n=new URL(o);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return t}}async function Ht(e,t,o,n={}){let r=new URL(await q(e,t,n));return r.searchParams.set("inspectOpen",o),r.toString()}async function Wt(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:t,simId:o,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function jt(e){if(!e)return null;try{let t=new URL(e);if(t.searchParams.has("bundle")){let o=t.searchParams.get("bundle")||"";try{let n=new URL(o),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return t.searchParams.has("port")?`connect :${t.searchParams.get("port")||""}`:t.searchParams.has("open")?`connect ${t.searchParams.get("open")||""}`:t.searchParams.has("demo")?`demo ${t.searchParams.get("demo")||"default"}`:t.pathname.includes("/sootsim/index.html")||t.pathname==="/sootsim/"||t.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function Kt(e){let t=e.indexOf(":");if(t<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let o=e.slice(0,t),n=e.slice(t+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return o==="AGENTBUS_SESSION"||o==="CLAUDE_CODE_SESSION_ID"||o==="CODEX_THREAD_ID"?`agent ${r}`:`${o} ${r}`}function Do(e,t){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as j,b as ne,c as re,d as xe,e as ke,g as Pe}from"./chunk-BA4Q3KRH.js";import{b as Ie,l as ce}from"./chunk-RGDT3EBF.js";import{a as U,b as ae}from"./chunk-GB3IT6AN.js";import{a as Te,b as _e}from"./chunk-APQFVJDK.js";import{a as Ce,b as se,c as Ee}from"./chunk-UGRYC3HL.js";import{d as le}from"./chunk-4Z3JQFES.js";import{m as R}from"./chunk-IQ2IFKZ4.js";import{m as Me,o as Re}from"./chunk-PGLRJ4GA.js";import{a as Ue,b as Oe,c as ie,e as Be,f as De,g as C,h as v,i as E}from"./chunk-BGW73A3C.js";import{e as _,f as b,g as M}from"./chunk-ORSIJ76W.js";import{H as Se,M as te,O as W,l as ve}from"./chunk-KWNVZ2LX.js";import{g as oe,i as $e}from"./chunk-BDL6UO36.js";import{spawn as je,spawnSync as Ke}from"node:child_process";import D from"node:fs";import pt from"node:os";import T from"node:path";import{WebSocket as ft}from"ws";function st(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function K(e){let t=st(e);return t==="localhost"||t.endsWith(".localhost")||t==="0.0.0.0"||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function Le(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function it(e,t){return e?.includes("/one/metro-entry.bundle")?"one":typeof t=="string"&&t?"expo":"unknown"}function Ne(e,t,o){return`${e}//${t}:${o}`}function at(e){if(typeof window>"u")return!1;try{let t=new URL(e);return K(t.hostname)&&K(window.location.hostname)&&t.origin!==window.location.origin}catch{return!1}}async function Ae(e,t){let o={...t,cache:t?.cache??"no-store"};return at(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,o):fetch(e,o)}function lt(e){return e==="https:"?443:80}function ct(e){let t=e.pathname||"/";return(t==="/"||t==="")&&!e.search&&!e.hash}async function dt(e){try{let t=await fetch("/__server-scan",{cache:"no-store"});if(!t.ok||!(t.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let o=await t.json();if(!Array.isArray(o))return null;let n=o.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:re(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Fe(e,t){let o=e.replace(/\/+$/,"");try{if(K(new URL(o).hostname)){let n=await dt(t);if(n)return n}}catch{}try{let n=await Ae(`${o}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:re(i||`${o}${ne}`),port:t,framework:it(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ae(`${o}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${o}${ne}`,port:t,framework:"metro"}}catch{}return null}async function mt(e){return Fe(Ne("http:","localhost",e),e)}async function He(e){let t=e.trim();if(/^\d+$/.test(t)){let a=parseInt(t,10),l=await mt(a);if(l)return l;throw Le(`localhost:${a}`)}let o=t.startsWith("http")?t:`http://${t}`,n;try{n=new URL(o)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):lt(r),i=Ne(r,n.hostname,s);if(ct(n)){let a=await Fe(i,s);if(a)return a;throw Le(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function lo(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function We(e){let t=U();if(console.log(` note: no sootsim bridge detected on port ${e}`),t){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function ut(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function co(e,t,o){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){ut(t);return}console.error(` no sim with id "${o}" is connected to the bridge on port ${t}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var ht=12e4,ze=100,gt=5e3,qe=1e4,wt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(t=>setTimeout(t,e))}function Ge(e){let t=process.env[e]?.trim();if(!t)return null;let o=Number(t);return Number.isInteger(o)&&o>0?o:null}function bt(){let e=Ge("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??Ge("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??ht;return{timeoutMs:e,hostTimeoutMs:e+gt,intervalMs:ze,attempts:Math.max(1,Math.ceil(e/ze))}}function yt(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function vt(e,t){return e.includes("--headless")?!0:e.includes("--headed")?!1:t==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function G(e){return e.trim()}var Ye=/^[A-Za-z][A-Za-z0-9+.-]*:/;function St(e){let t=e.trim();if(!t)throw new Error("expected <url-or-route>");return Ye.test(t)||t.startsWith("/")?t:`/${t}`}function $t(e){return e!==null&&typeof e=="object"}function xt(e){let t=e.trim();return t?t.startsWith("/")?!0:Ye.test(t)?!/^https?:\/\//i.test(t):!1:!1}async function kt(e){if(await z(e,250))return e;let t=te();if(t&&W(t)&&await z(t.bridgePort,500))return t.bridgePort;if(t&&W(t))throw new Error(`sootsim bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await It();let o=Pt(["serve","--quiet","--port",String(e)]),n=null;o.once("exit",(s,i)=>{n=String(s??i??"unknown")}),o.unref();let r=Date.now()+qe;for(;Date.now()<r;){let s=te();if(s&&W(s)&&await z(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await z(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(qe/1e3)}s`)}async function It(){let e=Se();if(e&&D.existsSync(ve(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:t}=await import("./runtime-3EJHJAAM.js");await t(["install"],{})}function Pt(e){let t=process.argv[1];return t&&D.existsSync(t)?je(process.execPath,[t,...e],{detached:!0,stdio:"ignore",env:process.env}):je("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function z(e,t){return new Promise(o=>{let n=new ft(`ws://127.0.0.1:${e}`,{handshakeTimeout:t}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}o(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),t)})}function ue(e){try{let t=new URL(e),o=t.pathname.replace(/\/+$/,"")||"/";return t.searchParams.has("open")||t.searchParams.has("port")||t.searchParams.has("bundle")||t.searchParams.has("demo")||t.pathname.includes("/sootsim/index.html")||o==="/sootsim"||t.pathname==="/__soot"||t.pathname==="/__soot/"||o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}function Ct(e){try{let t=new URL(e,"http://sootsim.local");if(t.origin!=="http://sootsim.local")return!1;let o=t.pathname.replace(/\/+$/,"")||"/";return o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}function Et(e,t){let o=new URL(e,"http://sootsim.local"),n=new URL(t),r=V(n.pathname),s=o.pathname.startsWith("/__soot/")?o.pathname.slice(7):o.pathname;return n.pathname=`${r}${s}`,n.search=o.search,n.hash=o.hash,n.toString()}function Tt(e){try{let t=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(t)||/^\/build\/.+/.test(t)}catch{return!1}}async function Bo(e){let t=G(e);return(await Ze(t)).bundleUrl}function _t(e){try{let t=new URL(e.startsWith("http")?e:`http://${e}`),o=t.pathname||"/";if(o!=="/"&&o!==""||t.search||t.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(t.hostname))return null;let n=t.port?Number(t.port):t.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Ze(e){let t=G(e),o=/^\d+$/.test(t)?Number(t):_t(t);if(o&&o>0){let n=await ke(o);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return He(t)}function V(e){let t=e.replace(/\/+$/,"")||"/";return t==="/__soot"||t.startsWith("/__soot/")?"/__soot":""}function Mt(e,t){let o=G(e),n=new URL(t),r=V(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(o)?n.pathname=`${r}/rn/${o}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",o)),n.toString()}function Rt(e){let t=G(e);return/^\d+$/.test(t)||/^https?:\/\//i.test(t)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(t)}async function Ut(e,t,o={}){let n=await Ze(e),r=new URL(t),s=V(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=o.hot===void 0?n.bundleUrl:xe(n.bundleUrl,o.hot);return r.searchParams.set("bundle",i),r.toString()}function Ot(e){return e.startsWith("~/")?T.join(pt.homedir(),e.slice(2)):T.isAbsolute(e)?e:T.resolve(process.cwd(),e)}function Bt(e){let t={},o={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=Ot(s.slice(i+1).trim());D.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),t[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),o[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(t).length>0&&(n.modules=t),Object.keys(o).length>0&&(n.network={remap:o}),n.modules||n.network?n:void 0}function Xe(){return Ue().shellBaseUrl}async function Dt(e){try{let t=new URL(e),o=t.searchParams.get("bundle")||"";if(!o)return e;let n=process.env.CONTRAST_REPO_DIR||await se(o)||void 0,r=Ce({bundleUrl:o,repoDir:n});if(r.length===0)return e;let s=await Lt(r);return s.length===0?e:(t.searchParams.set("appFonts",Ee(s)),t.toString())}catch{return e}}async function Lt(e){let t=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),o=[];for(let n of t)n!==null&&o.push(n);return o}async function At(e,t,o={}){if(!e)return new URL(t).toString();if(ue(e))return new URL(e).toString();if(Ct(e))return Et(e,t);let n=wt[e.toLowerCase()];if(n){let r=new URL(t),s=V(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return Rt(e)?Ut(e,t,o):Mt(e,t)}async function Nt(e){try{let t=new URL(e),o=t.searchParams.get("bundle")||"";if(!o)return e;let n=process.env.CONTRAST_REPO_DIR||await se(o)||void 0,r=Te({bundleUrl:o,repoDir:n});return!r||r.imageUrl&&!await Ft(r.imageUrl)?e:(t.searchParams.set("appSplash",_e(r)),t.toString())}catch{return e}}async function Ft(e){let t=new AbortController,o=setTimeout(()=>t.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:t.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(o)}}async function q(e,t=Xe(),o={}){let n=await At(e,t,o),r=await Nt(await Dt(n));if(!o.device)return r;let s=new URL(r);return s.searchParams.set("device",o.device),s.toString()}function Ve(e,t){let o=e?.url||e?.origin||t;try{let n=new URL(o);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return t}}async function Ht(e,t,o,n={}){let r=new URL(await q(e,t,n));return r.searchParams.set("inspectOpen",o),r.toString()}async function Wt(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:t,simId:o,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function jt(e){if(!e)return null;try{let t=new URL(e);if(t.searchParams.has("bundle")){let o=t.searchParams.get("bundle")||"";try{let n=new URL(o),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return t.searchParams.has("port")?`connect :${t.searchParams.get("port")||""}`:t.searchParams.has("open")?`connect ${t.searchParams.get("open")||""}`:t.searchParams.has("demo")?`demo ${t.searchParams.get("demo")||"default"}`:t.pathname.includes("/sootsim/index.html")||t.pathname==="/sootsim/"||t.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function Kt(e){let t=e.indexOf(":");if(t<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let o=e.slice(0,t),n=e.slice(t+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return o==="AGENTBUS_SESSION"||o==="CLAUDE_CODE_SESSION_ID"||o==="CODEX_THREAD_ID"?`agent ${r}`:`${o} ${r}`}function Do(e,t){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
3
3
  `);for(let o of e){let n=o.lockedBy&&o.lockExpiresAt?`locked by ${Kt(o.lockedBy)} (${Math.max(0,Math.round((o.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[o.isPrimary?"primary":"",o.id===t?"selected":"",o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":"",o.attachedCliCount&&o.attachedCliCount>0?"in use":"",o.userFocused?"focused":"",n].filter(Boolean);console.log(` ${o.id}${r.length?` [${r.join(", ")}]`:""}`);let s=jt(o.url);if(s)console.log(` loaded: ${s}`);else if(o.url){let a=o.url.length>96?`${o.url.slice(0,93)}\u2026`:o.url;console.log(` url: ${a}`)}else o.origin&&console.log(` origin: ${o.origin}`);let i=zt(o);i&&console.log(` engine: ${i}`),o.title&&console.log(` title: ${o.title}`),o.visibilityState&&o.visibilityState!=="visible"&&console.log(` visibility: ${o.visibilityState}`),console.log(` connected: ${Je(Date.now()-o.connectedAt)}`),o.lastActiveAt&&o.lastActiveAt>0&&console.log(` last active: ${Je(Date.now()-o.lastActiveAt)}`)}}function zt(e){let t=e.url||e.origin||"";if(!t)return null;try{let o=new URL(t).port;return o==="5173"?"dev \u2014 local source (:5173)":o==="3000"?"Contrast app embedded (:3000)":Pe()?`dev \u2014 local build (:${o||"?"})`:`runtime \u2014 published engine (:${o||"?"})`}catch{return null}}function Je(e){let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s ago`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}async function de(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:t});try{let d=(await a.listSims()).find(o);if(d)return d}catch{}finally{a.close()}await $(s)}return null}async function qt(e,t,o,n,r={}){let s=r.attempts??30,i=r.intervalMs??500,a=!!n&&Number.isInteger(n)&&n>1,l=()=>a&&n!==void 0&&!pe(n);for(let d=0;d<s;d++){if(l())return{kind:"host-exit"};let m=v(e,{commandTimeoutMs:t});try{let g=(await m.listSims()).find(o);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{m.close()}if(l())return{kind:"host-exit"};await $(i)}return{kind:"timeout"}}async function Gt(e,t,o,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:t});try{let d=(await a.listSims()).find(m=>m.id===o);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await $(s)}return!1}function Vt(e){let t=e.meta;if(!t||t.sootsimHostDriver!=="playwright")return null;let o=Number(t.sootsimHostPid);return!Number.isInteger(o)||o<=1||o===process.pid?null:o}function Jt(e){if(!e.connectAckFile)return!1;try{return D.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
4
4
  `,{flag:"w"}),!0}catch{return!1}}function Qe(e){if(e.diagnosticLogPath)try{let t=D.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!t){console.error(` ${T.basename(e.diagnosticLogPath)} was empty`);return}let o=t.length>4e3?`\u2026
5
5
  ${t.slice(-4e3)}`:t;console.error(` ${T.basename(e.diagnosticLogPath)}:`),console.error(o)}catch(t){let o=t instanceof Error?t.message:String(t);console.error(` failed to read ${T.basename(e.diagnosticLogPath)}: ${o}`)}}function pe(e){try{return process.kill(e,0),!0}catch(t){return t?.code==="EPERM"}}async function Qt(e,t=2500){let o=Date.now()+t;for(;Date.now()<o;){if(!pe(e))return!0;await $(100)}return!pe(e)}function Yt(e){let t=Ke("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),o=Ke("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(t.status!==0||o.status!==0)return!1;let n=(t.stdout||"").trimEnd(),r=(o.stdout||"").trimEnd();return(r.startsWith(n)?r.slice(n.length):r).includes("SOOTSIM_PW_URL=")}async function me(e,t){let o=new Set(t),n=new Set;for(let r of e){if(!o.has(r.id))continue;let s=Vt(r);s&&n.add(s)}for(let r of n){if(!Yt(r)){console.log(` skipped pid ${r}: not a sootsim playwright host (stale sim record)`);continue}try{process.kill(r,"SIGTERM")}catch{}if(await Qt(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function J(e,t){if(t){let r=t.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let o=e.find(r=>r.isPrimary&&r.readyState==="open");if(o)return o;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function O(e,t,o){console.log(` ${o==="current sim"?"loaded":"opened"}: ${e} [${o}]`),console.log(` current sim: ${t.id}`),console.log(JSON.stringify({simId:t.id,url:t.url},null,2))}async function B(e,t,o){if(o.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await Zt(e,t,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:t,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:Me})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&Re(s))){let m=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${m} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{createHash as b}from"node:crypto";import g from"node:fs";import{createRequire as R}from"node:module";import u from"node:path";var y=/\.(ttf|otf|woff|woff2)$/i;function P(t,n,r){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&r.push(i);let e=t[n];if(!e||typeof e!="object")return;let s=e.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){r.push(i);continue}if(!i||typeof i!="object")continue;let c=i.fontDefinitions;if(Array.isArray(c))for(let a of c){if(!a||typeof a!="object")continue;let p=a.path;typeof p=="string"&&r.push(p)}}}function m(t,n){if(!Array.isArray(t))return[];let r=[];for(let o of t){let e=Array.isArray(o)?o[0]:o;if(typeof e!="string"||!/(^|\/)expo-font$/.test(e))continue;let s=Array.isArray(o)?o[1]??{}:{};P(s,n,r)}return r}function C(t){return t.slice(t.lastIndexOf("/")+1).replace(y,"")}function h(t,n){let r=n.replace(/\/+$/,""),o=new Set,e=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),y.test(i)&&e.push({family:C(i),url:`${r}/assets/${i}`}))}return e}var d=R(import.meta.url);function x(t){try{let n=new URL(t),r=n.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return n.origin}catch{}return null}var S=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"];function w(t){for(let n of S)try{if(g.statSync(u.join(t,n)).isFile())return!0}catch{}return!1}var j=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","examples","example"]);function A(t,n){w(t)&&n.push(t);let r;try{r=g.readdirSync(t,{withFileTypes:!0})}catch{return}for(let o of r)o.isDirectory()&&(o.name.startsWith(".")||j.has(o.name)||A(u.join(t,o.name),n))}function _(t){try{return g.statSync(u.join(t,"package.json")).isFile()}catch{return!1}}function I(t){let n=x(t.bundleUrl);if(!n)return[];let r=t.repoDir||process.env.CONTRAST_REPO_DIR,o=r?u.resolve(r):process.cwd();if(!r&&!_(o))return[];let e=[];if(r)A(o,e),e.includes(o)||e.push(o);else{if(!w(o))return[];e.push(o)}if(e.length===0)return[];let s=(t.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),i=null;try{let l=d.resolve("@expo/config",{paths:[...e,o]}),f=d(l);typeof f.getConfig=="function"&&(i=f.getConfig)}catch{}if(!i)return[];let c;for(let l of e)try{let f=i(l,{skipSDKVersionRequirement:!0});if(f?.exp&&typeof f.exp=="object"){let F=f.exp.plugins;if(Array.isArray(F)){c=f.exp;break}}}catch{}if(!c||typeof c!="object")return[];let a=c.plugins;if(!Array.isArray(a))return[];let p=m(a,s==="android"?"android":"ios");return h(p,n)}async function L(t,n){let r=x(t);if(!r)return null;let o=new AbortController,e=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${r}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let c=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof c=="string"&&c.length>0?c:null}catch{return null}finally{clearTimeout(e)}}function M(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function k(t){let n=[];for(let r of t.split(",")){let o=r.trim();if(!o)continue;let e=o.indexOf("::"),s=e===-1?o:o.slice(0,e);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function D(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function N(t,n){let r=[],o=new Set;for(let e of k(t)){let s=b("sha256").update(e).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(e);if(!i.ok){n?.onError?.(e,new Error(`${i.status} ${i.statusText}`));continue}let c=new Uint8Array(await i.arrayBuffer());r.push({url:e,urlhash:s,contentType:D(e),bytes:c}),n?.onStaged?.({url:e,byteLength:c.byteLength})}catch(i){n?.onError?.(e,i)}}}return r}export{I as a,L as b,M as c,N as d};