sootsim 0.1.163 → 0.1.164

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 (153) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-2UJH7NLM.js → agent-5PVW4KHZ.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-IARGRXXC.js → agent-wrapper-REXQODXV.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-4JHC6FEJ.js → app-fonts-XAXAUEB5.js} +2 -2
  5. package/dist-cli/chunks/{assert-ETPPYEZL.js → assert-QDOO5I6J.js} +2 -2
  6. package/dist-cli/chunks/auto-bootstrap-PAA3FSVB.js +2 -0
  7. package/dist-cli/chunks/beta-5ICQFWFG.js +2 -0
  8. package/dist-cli/chunks/{camera-MT3JIJW5.js → camera-VUJYI6SX.js} +2 -2
  9. package/dist-cli/chunks/{chunk-H5PWNDJX.js → chunk-2QMMSZ4Z.js} +2 -2
  10. package/dist-cli/chunks/{chunk-YKRDJEXB.js → chunk-2U5VK6PG.js} +2 -2
  11. package/dist-cli/chunks/{chunk-YDOTSYCN.js → chunk-36HXTKWO.js} +2 -2
  12. package/dist-cli/chunks/{chunk-XEL4ZT7P.js → chunk-3C3MA5ZZ.js} +2 -2
  13. package/dist-cli/chunks/{chunk-RAFS3IF4.js → chunk-3VE6THTL.js} +1 -1
  14. package/dist-cli/chunks/{chunk-C4AIMLRI.js → chunk-422J3RDX.js} +2 -2
  15. package/dist-cli/chunks/{chunk-SLH7AMG2.js → chunk-46J7FLJB.js} +2 -2
  16. package/dist-cli/chunks/{chunk-76AZBX3S.js → chunk-4PJLRB36.js} +2 -2
  17. package/dist-cli/chunks/{chunk-ATMMZFJE.js → chunk-4V6DKD5E.js} +1 -1
  18. package/dist-cli/chunks/{chunk-K6OWYKCH.js → chunk-53DOSJFQ.js} +1 -1
  19. package/dist-cli/chunks/{chunk-NURFX6AZ.js → chunk-6RAT7QRJ.js} +1 -1
  20. package/dist-cli/chunks/{chunk-XA54L6E7.js → chunk-7UZSNS5H.js} +2 -2
  21. package/dist-cli/chunks/{chunk-I2BWZNCX.js → chunk-AXSNLS34.js} +1 -1
  22. package/dist-cli/chunks/{chunk-GL7XIITU.js → chunk-AZMD3HP3.js} +2 -2
  23. package/dist-cli/chunks/{chunk-HWBJB3EE.js → chunk-CBKH2EZL.js} +2 -2
  24. package/dist-cli/chunks/{chunk-U3JJW7K3.js → chunk-E5KU4NBO.js} +2 -2
  25. package/dist-cli/chunks/{chunk-HHKHMWRR.js → chunk-EOQBPXIN.js} +2 -2
  26. package/dist-cli/chunks/{chunk-WEUFC7SG.js → chunk-FUD4ZCJ2.js} +1 -1
  27. package/dist-cli/chunks/{chunk-Z76N3LVQ.js → chunk-HAP45V4J.js} +2 -2
  28. package/dist-cli/chunks/{chunk-7FLA4A4M.js → chunk-J6TNRMST.js} +2 -2
  29. package/dist-cli/chunks/{chunk-S723QE3J.js → chunk-JNC5ZO7K.js} +1 -1
  30. package/dist-cli/chunks/chunk-JTWMHYRS.js +1 -0
  31. package/dist-cli/chunks/{chunk-N2RYSVRC.js → chunk-LJUGD5H3.js} +2 -2
  32. package/dist-cli/chunks/{chunk-UJWRFH4F.js → chunk-LN5AJIPO.js} +3 -3
  33. package/dist-cli/chunks/{chunk-OJKEKN6J.js → chunk-NKAWHNJR.js} +1 -1
  34. package/dist-cli/chunks/{chunk-MFTSL5T7.js → chunk-PGN2263R.js} +2 -2
  35. package/dist-cli/chunks/{chunk-NPS6GG4R.js → chunk-PQMXEPA5.js} +1 -1
  36. package/dist-cli/chunks/{chunk-2DAZ32M2.js → chunk-PYX7POQN.js} +3 -3
  37. package/dist-cli/chunks/chunk-Q2IYU4KK.js +2 -0
  38. package/dist-cli/chunks/{chunk-LIFPDHVG.js → chunk-R4K3EZQP.js} +1 -1
  39. package/dist-cli/chunks/{chunk-DDAGD5DR.js → chunk-RHWMAYGO.js} +2 -2
  40. package/dist-cli/chunks/{chunk-OJIOSOSI.js → chunk-SG5ONZJA.js} +1 -1
  41. package/dist-cli/chunks/{chunk-6RY6L5JR.js → chunk-SSTIFD3Y.js} +1 -1
  42. package/dist-cli/chunks/{chunk-QD3SYTZB.js → chunk-T6VPZ5ES.js} +2 -2
  43. package/dist-cli/chunks/{chunk-T56IURYQ.js → chunk-TDPLTM27.js} +1 -1
  44. package/dist-cli/chunks/{chunk-EETYYBYZ.js → chunk-TFB7NU6N.js} +1 -1
  45. package/dist-cli/chunks/chunk-U2Z32HGJ.js +1 -0
  46. package/dist-cli/chunks/chunk-VEQNMRGS.js +1 -0
  47. package/dist-cli/chunks/{chunk-VC6LECEG.js → chunk-XFJGEFTK.js} +3 -3
  48. package/dist-cli/chunks/{chunk-CMH5RKUR.js → chunk-XHNXDUYR.js} +2 -2
  49. package/dist-cli/chunks/{chunk-ERENNF6M.js → chunk-YBO4Z43H.js} +1 -1
  50. package/dist-cli/chunks/{chunk-BH7P5BRG.js → chunk-YDZJR4M3.js} +1 -1
  51. package/dist-cli/chunks/{chunk-SNIJMEQV.js → chunk-YJ3CJUUU.js} +2 -2
  52. package/dist-cli/chunks/{chunk-FLZXWNIH.js → chunk-ZCPGEUMM.js} +2 -2
  53. package/dist-cli/chunks/{chunk-3PVLSJHL.js → chunk-ZE2PAAZW.js} +1 -1
  54. package/dist-cli/chunks/{chunk-AEDFOOYN.js → chunk-ZUYTGVNA.js} +1 -1
  55. package/dist-cli/chunks/cli-version-4TLMMPH2.js +2 -0
  56. package/dist-cli/chunks/{compat-PVZQRLJ6.js → compat-UKAJB7JZ.js} +3 -3
  57. package/dist-cli/chunks/{config-KO3JTNDD.js → config-MTGWPMUR.js} +2 -2
  58. package/dist-cli/chunks/{control-KSMUT3S3.js → control-5FU4OLTE.js} +2 -2
  59. package/dist-cli/chunks/{cpu-profile-XAZP7XUR.js → cpu-profile-4GAXCXJO.js} +2 -2
  60. package/dist-cli/chunks/{daemon-4NBH5C6S.js → daemon-VYP6PWR2.js} +2 -2
  61. package/dist-cli/chunks/{debug-22DO3PBO.js → debug-MKV3W32U.js} +3 -3
  62. package/dist-cli/chunks/{detox-EBPXAOAO.js → detox-PHFTGHRM.js} +2 -2
  63. package/dist-cli/chunks/{device-JOVGQXTD.js → device-ACKEFGW6.js} +2 -2
  64. package/dist-cli/chunks/{diagnose-LY65X3IJ.js → diagnose-TSP4DCH2.js} +2 -2
  65. package/dist-cli/chunks/drivers-SDO5XDCT.js +2 -0
  66. package/dist-cli/chunks/{electron-X4EV5RDR.js → electron-N7KR775O.js} +3 -3
  67. package/dist-cli/chunks/flow-3NGH6OZO.js +2 -0
  68. package/dist-cli/chunks/help-ZKCJG65K.js +2 -0
  69. package/dist-cli/chunks/{hints-5WYSEJRG.js → hints-6IYSDQA3.js} +2 -2
  70. package/dist-cli/chunks/{home-paths-4OM2SXFV.js → home-paths-5P4PDEPL.js} +2 -2
  71. package/dist-cli/chunks/{inspect-FQCH4VYC.js → inspect-F6KLATMN.js} +3 -3
  72. package/dist-cli/chunks/install-6EKDNJOM.js +2 -0
  73. package/dist-cli/chunks/{install-desktop-ZK6OM5BF.js → install-desktop-65COOWJC.js} +3 -3
  74. package/dist-cli/chunks/{keys-YVIHIHM6.js → keys-2RI5OCTX.js} +2 -2
  75. package/dist-cli/chunks/{launch-SZM2GUG3.js → launch-JKAX6AOP.js} +3 -3
  76. package/dist-cli/chunks/{login-3THHYZHX.js → login-CD2MYGGF.js} +4 -4
  77. package/dist-cli/chunks/{logout-KIL255SD.js → logout-2SPZSYJD.js} +2 -2
  78. package/dist-cli/chunks/{maestro-H3RCJ7LM.js → maestro-B4XYYVZV.js} +2 -2
  79. package/dist-cli/chunks/optional-demo-registry-OBP5WLPI.js +2 -0
  80. package/dist-cli/chunks/{preview-FFCTIVNR.js → preview-YWXGWAZR.js} +2 -2
  81. package/dist-cli/chunks/{profile-5PXB4YSX.js → profile-YPKBHJOK.js} +2 -2
  82. package/dist-cli/chunks/{react-VUGPLZXV.js → react-NNFPIW6R.js} +2 -2
  83. package/dist-cli/chunks/{record-V65T5C5M.js → record-JGTPXRTW.js} +2 -2
  84. package/dist-cli/chunks/runtime-D4T7CD4H.js +2 -0
  85. package/dist-cli/chunks/{runtime-delivery-AAOS2QLP.js → runtime-delivery-DN7LYYY6.js} +2 -2
  86. package/dist-cli/chunks/{screenshot-UMGAKH23.js → screenshot-RF55R7LF.js} +2 -2
  87. package/dist-cli/chunks/{screenshot-mode-D6TMSRFV.js → screenshot-mode-X76SGXYB.js} +2 -2
  88. package/dist-cli/chunks/{screenshots-FF3ZUERE.js → screenshots-FVO7MYFJ.js} +2 -2
  89. package/dist-cli/chunks/{server-K7XHAKC3.js → server-BGZ2S4NF.js} +3 -3
  90. package/dist-cli/chunks/setup-repo-FNIP3MNA.js +2 -0
  91. package/dist-cli/chunks/{skills-RL3Y6UA4.js → skills-DH5NOT3N.js} +2 -2
  92. package/dist-cli/chunks/{slides-ZT63RJ4N.js → slides-CXQMYD3P.js} +2 -2
  93. package/dist-cli/chunks/{start-6Q4AH3SE.js → start-6AZUCGBI.js} +4 -4
  94. package/dist-cli/chunks/store-VWLWKCQT.js +2 -0
  95. package/dist-cli/chunks/telemetry-7C5WB6PU.js +2 -0
  96. package/dist-cli/chunks/{test-LQ6BIRWA.js → test-WEATIZNI.js} +3 -3
  97. package/dist-cli/chunks/{three-mode-IU2M4YBF.js → three-mode-ZPRCTDNM.js} +2 -2
  98. package/dist-cli/chunks/{timeline-HIBVAHPT.js → timeline-AA7E4QQF.js} +2 -2
  99. package/dist-cli/chunks/{upgrade-FI4K2DGQ.js → upgrade-O3HVW3U3.js} +2 -2
  100. package/dist-cli/chunks/upload-DQBOMRID.js +2 -0
  101. package/dist-cli/chunks/{version-CU4X5HHD.js → version-M2DLT2IX.js} +2 -2
  102. package/dist-cli/chunks/{web-TNVHBB2J.js → web-VODHXXG7.js} +2 -2
  103. package/dist-cli/chunks/{what-happened-B6PDCO7H.js → what-happened-6KGU7OQL.js} +2 -2
  104. package/dist-cli/chunks/{whoami-QI7BT4PM.js → whoami-4FBBNV5W.js} +2 -2
  105. package/dist-lib/agent-daemon-client.cjs +1 -1
  106. package/dist-lib/agent-events.cjs +1 -1
  107. package/dist-lib/agent-sessions.cjs +1 -1
  108. package/dist-lib/attached-projects.cjs +1 -1
  109. package/dist-lib/auth/shared-session.cjs +1 -1
  110. package/dist-lib/backend-origin.cjs +1 -1
  111. package/dist-lib/beta.cjs +1 -1
  112. package/dist-lib/beta.mjs +1 -1
  113. package/dist-lib/bridge-constants.cjs +1 -1
  114. package/dist-lib/cli-constants.cjs +1 -1
  115. package/dist-lib/config.cjs +1 -1
  116. package/dist-lib/detox/index.cjs +1 -1
  117. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  118. package/dist-lib/home-paths.cjs +1 -1
  119. package/dist-lib/host/bridge-host.cjs +1 -1
  120. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  121. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  122. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  123. package/dist-lib/host/websocket-proxy.cjs +1 -1
  124. package/dist-lib/index.cjs +1 -1
  125. package/dist-lib/menu.cjs +1 -1
  126. package/dist-lib/menu.mjs +1 -1
  127. package/dist-lib/metro.cjs +1 -1
  128. package/dist-lib/profiles.cjs +1 -1
  129. package/dist-lib/render-mode.cjs +1 -1
  130. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  131. package/dist-lib/sdk.cjs +1 -1
  132. package/dist-lib/sdk.mjs +1 -1
  133. package/dist-lib/skills.cjs +1 -1
  134. package/dist-lib/vite.cjs +1 -1
  135. package/package.json +1 -1
  136. package/src/vite-plugin.ts +2 -0
  137. package/dist-cli/chunks/auto-bootstrap-RUXZLYLL.js +0 -2
  138. package/dist-cli/chunks/beta-WQIEGEVM.js +0 -2
  139. package/dist-cli/chunks/chunk-24UV32LK.js +0 -1
  140. package/dist-cli/chunks/chunk-7QFEXS62.js +0 -2
  141. package/dist-cli/chunks/chunk-KMLULXMX.js +0 -1
  142. package/dist-cli/chunks/chunk-SCIZLBBI.js +0 -1
  143. package/dist-cli/chunks/cli-version-JOMTNDB5.js +0 -2
  144. package/dist-cli/chunks/drivers-CVMCFSMA.js +0 -2
  145. package/dist-cli/chunks/flow-6XTWYTV2.js +0 -2
  146. package/dist-cli/chunks/help-RJKPD5OO.js +0 -2
  147. package/dist-cli/chunks/install-36CBFFVW.js +0 -2
  148. package/dist-cli/chunks/optional-demo-registry-PYWPXAHB.js +0 -2
  149. package/dist-cli/chunks/runtime-A4PZC73P.js +0 -2
  150. package/dist-cli/chunks/setup-repo-VMRRSQNQ.js +0 -2
  151. package/dist-cli/chunks/store-G7ATTZYC.js +0 -2
  152. package/dist-cli/chunks/telemetry-2PKRXSHN.js +0 -2
  153. package/dist-cli/chunks/upload-H5BBABDO.js +0 -2
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as B,b as V,c as me,d as ue}from"./chunk-YDOTSYCN.js";import{m as D}from"./chunk-H5PWNDJX.js";import{m as ce,o as de}from"./chunk-BH7P5BRG.js";import{a as he,b as we}from"./chunk-ERENNF6M.js";import{a as fe,b as G,c as ge}from"./chunk-I2BWZNCX.js";import{b as le,c as I,d as v,e as P}from"./chunk-QD3SYTZB.js";import{g as Q}from"./chunk-SLH7AMG2.js";import{a as M,b as J}from"./chunk-S723QE3J.js";import{c as pe}from"./chunk-SNIJMEQV.js";import{d as q}from"./chunk-3PVLSJHL.js";import{d as C,e as w,f as T}from"./chunk-RAFS3IF4.js";import{a as ae}from"./chunk-7QFEXS62.js";import{G as se,H as ie}from"./chunk-ATMMZFJE.js";import Z from"node:fs";import He from"node:os";import x from"node:path";function Oe(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function L(e){let o=Oe(e);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}function be(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 De(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Se(e,o,t){return`${e}//${o}:${t}`}function Be(e){if(typeof window>"u")return!1;try{let o=new URL(e);return L(o.hostname)&&L(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function ye(e,o){let t={...o,cache:o?.cache??"no-store"};return Be(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Le(e){return e==="https:"?443:80}function Ae(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function Ne(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl: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 $e(e,o){let t=e.replace(/\/+$/,"");try{if(L(new URL(t).hostname)){let n=await Ne(o);if(n)return n}}catch{}try{let n=await ye(`${t}/`,{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:me(i||`${t}${V}`),port:o,framework:De(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await ye(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${V}`,port:o,framework:"metro"}}catch{}return null}async function ve(e){return $e(Se("http:","localhost",e),e)}async function Ie(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await ve(a);if(l)return l;let c=3;for(let d=1;d<=c;d++){let m=await ve(a+d);if(m)return m}throw be(`localhost:${a} (also scanned +1..+${c})`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}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):Le(r),i=Se(r,n.hostname,s);if(Ae(n)){let a=await $e(i,s);if(a)return a;throw be(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function xt(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim install-desktop"),console.error(""),console.error(" or wire sootsim into your own project so your dev server hosts the bridge:"),console.error(" sootsim setup-repo"),console.error("")}function Pe(e){let o=M();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim electron");return}console.log(""),console.log(" to get a bridge running, either:"),console.log(" sootsim install-desktop # download the electron app"),console.log(" sootsim setup-repo # wire sootsim into your own project")}function Fe(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 kt(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){Fe(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),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 je=12e4,xe=500,Ke=5e3,We={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 S(e){return new Promise(o=>setTimeout(o,e))}function ke(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function ze(){let e=ke("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??ke("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??je;return{timeoutMs:e,hostTimeoutMs:e+Ke,intervalMs:xe,attempts:Math.max(1,Math.ceil(e/xe))}}function qe(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function F(e){return e.trim()}function Y(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ve(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Vt(e){let o=F(e);return(await Re(o)).bundleUrl}function Ge(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Re(e){let o=F(e),t=/^\d+$/.test(o)?Number(o):Ge(o);if(t&&t>0){let n=await ue(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return Ie(o)}function ee(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Je(e,o){let t=F(e),n=new URL(o),r=ee(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(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function Qe(e){let o=F(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Xe(e,o){let t=await Re(e),n=new URL(o),r=ee(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.set("bundle",t.bundleUrl),n.toString()}function Ye(e){return e.startsWith("~/")?x.join(He.homedir(),e.slice(2)):x.isAbsolute(e)?e:x.resolve(process.cwd(),e)}function Ze(e){let o={},t={};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=Ye(s.slice(i+1).trim());Z.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[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)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}function _e(){let e=se();return ie(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:ae}async function et(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await G(t)||void 0,r=fe({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await tt(r);return s.length===0?e:(o.searchParams.set("appFonts",ge(s)),o.toString())}catch{return e}}async function tt(e){let o=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)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function ot(e,o){if(!e)return new URL(o).toString();if(Y(e))return new URL(e).toString();let t=We[e.toLowerCase()];if(t){let n=new URL(o),r=ee(n.pathname);return n.pathname=`${r}${t}`,n.toString()}return Qe(e)?Xe(e,o):Je(e,o)}async function nt(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await G(t)||void 0,r=he({bundleUrl:t,repoDir:n});return!r||r.imageUrl&&!await rt(r.imageUrl)?e:(o.searchParams.set("appSplash",we(r)),o.toString())}catch{return e}}async function rt(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function N(e,o=_e()){let t=await ot(e,o);return nt(await et(t))}function Ce(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);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 o}}async function st(e,o,t){let n=new URL(await N(e,o));return n.searchParams.set("inspectOpen",t),n.toString()}async function it(e,o,t,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:o,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>i)return{bridge:l,count:c}}catch{}l.close(),await S(s)}return null}function at(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function lt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function ct(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as B,b as V,c as me,d as ue}from"./chunk-36HXTKWO.js";import{m as D}from"./chunk-2QMMSZ4Z.js";import{m as ce,o as de}from"./chunk-YDZJR4M3.js";import{a as he,b as we}from"./chunk-YBO4Z43H.js";import{a as fe,b as G,c as ge}from"./chunk-AXSNLS34.js";import{b as le,c as I,d as v,e as P}from"./chunk-T6VPZ5ES.js";import{g as Q}from"./chunk-46J7FLJB.js";import{a as M,b as J}from"./chunk-JNC5ZO7K.js";import{c as pe}from"./chunk-YJ3CJUUU.js";import{d as q}from"./chunk-ZE2PAAZW.js";import{d as C,e as w,f as T}from"./chunk-3VE6THTL.js";import{a as ae}from"./chunk-Q2IYU4KK.js";import{G as se,H as ie}from"./chunk-4V6DKD5E.js";import Z from"node:fs";import He from"node:os";import x from"node:path";function Oe(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function L(e){let o=Oe(e);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}function be(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 De(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Se(e,o,t){return`${e}//${o}:${t}`}function Be(e){if(typeof window>"u")return!1;try{let o=new URL(e);return L(o.hostname)&&L(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function ye(e,o){let t={...o,cache:o?.cache??"no-store"};return Be(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Le(e){return e==="https:"?443:80}function Ae(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function Ne(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl: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 $e(e,o){let t=e.replace(/\/+$/,"");try{if(L(new URL(t).hostname)){let n=await Ne(o);if(n)return n}}catch{}try{let n=await ye(`${t}/`,{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:me(i||`${t}${V}`),port:o,framework:De(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await ye(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${V}`,port:o,framework:"metro"}}catch{}return null}async function ve(e){return $e(Se("http:","localhost",e),e)}async function Ie(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await ve(a);if(l)return l;let c=3;for(let d=1;d<=c;d++){let m=await ve(a+d);if(m)return m}throw be(`localhost:${a} (also scanned +1..+${c})`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}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):Le(r),i=Se(r,n.hostname,s);if(Ae(n)){let a=await $e(i,s);if(a)return a;throw be(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function xt(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim install-desktop"),console.error(""),console.error(" or wire sootsim into your own project so your dev server hosts the bridge:"),console.error(" sootsim setup-repo"),console.error("")}function Pe(e){let o=M();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim electron");return}console.log(""),console.log(" to get a bridge running, either:"),console.log(" sootsim install-desktop # download the electron app"),console.log(" sootsim setup-repo # wire sootsim into your own project")}function Fe(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 kt(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){Fe(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),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 je=12e4,xe=500,Ke=5e3,We={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 S(e){return new Promise(o=>setTimeout(o,e))}function ke(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function ze(){let e=ke("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??ke("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??je;return{timeoutMs:e,hostTimeoutMs:e+Ke,intervalMs:xe,attempts:Math.max(1,Math.ceil(e/xe))}}function qe(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function F(e){return e.trim()}function Y(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ve(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Vt(e){let o=F(e);return(await Re(o)).bundleUrl}function Ge(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Re(e){let o=F(e),t=/^\d+$/.test(o)?Number(o):Ge(o);if(t&&t>0){let n=await ue(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return Ie(o)}function ee(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Je(e,o){let t=F(e),n=new URL(o),r=ee(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(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function Qe(e){let o=F(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Xe(e,o){let t=await Re(e),n=new URL(o),r=ee(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.set("bundle",t.bundleUrl),n.toString()}function Ye(e){return e.startsWith("~/")?x.join(He.homedir(),e.slice(2)):x.isAbsolute(e)?e:x.resolve(process.cwd(),e)}function Ze(e){let o={},t={};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=Ye(s.slice(i+1).trim());Z.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[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)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}function _e(){let e=se();return ie(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:ae}async function et(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await G(t)||void 0,r=fe({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await tt(r);return s.length===0?e:(o.searchParams.set("appFonts",ge(s)),o.toString())}catch{return e}}async function tt(e){let o=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)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function ot(e,o){if(!e)return new URL(o).toString();if(Y(e))return new URL(e).toString();let t=We[e.toLowerCase()];if(t){let n=new URL(o),r=ee(n.pathname);return n.pathname=`${r}${t}`,n.toString()}return Qe(e)?Xe(e,o):Je(e,o)}async function nt(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await G(t)||void 0,r=he({bundleUrl:t,repoDir:n});return!r||r.imageUrl&&!await rt(r.imageUrl)?e:(o.searchParams.set("appSplash",we(r)),o.toString())}catch{return e}}async function rt(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function N(e,o=_e()){let t=await ot(e,o);return nt(await et(t))}function Ce(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);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 o}}async function st(e,o,t){let n=new URL(await N(e,o));return n.searchParams.set("inspectOpen",t),n.toString()}async function it(e,o,t,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:o,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>i)return{bridge:l,count:c}}catch{}l.close(),await S(s)}return null}function at(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function lt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function ct(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
3
3
  `);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${lt(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[t.isPrimary?"primary":"",t.id===o?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",n].filter(Boolean);console.log(` ${t.id}${r.length?` [${r.join(", ")}]`:""}`);let s=at(t.url);if(s)console.log(` loaded: ${s}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let i=dt(t);i&&console.log(` engine: ${i}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${Te(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${Te(Date.now()-t.lastActiveAt)}`)}}function dt(e){let o=e.url||e.origin||"";if(!o)return null;try{let t=new URL(o).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"soot app embedded (:3000)":`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function Te(e){let o=Math.max(0,Math.round(e/1e3));return o<60?`${o}s ago`:o<3600?`${Math.round(o/60)}m ago`:o<86400?`${Math.round(o/3600)}h ago`:`${Math.round(o/86400)}d ago`}async function A(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let c=(await a.listSims()).find(t);if(c)return c}catch{}finally{a.close()}await S(s)}return null}async function mt(e,o,t,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let c=(await a.listSims()).find(d=>d.id===t);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{a.close()}await S(s)}return!1}function ut(e){let o=e.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let t=Number(o.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function pt(e){if(!e.connectAckFile)return!1;try{return Z.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
4
4
  `,{flag:"w"}),!0}catch{return!1}}function ft(e){if(e.diagnosticLogPath)try{let o=Z.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${x.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
5
5
  ${o.slice(-4e3)}`:o;console.error(` ${x.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${x.basename(e.diagnosticLogPath)}: ${t}`)}}function Me(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function gt(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!Me(e))return!0;await S(100)}return!Me(e)}async function X(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=ut(r);s&&n.add(s)}for(let r of n){try{process.kill(r,"SIGTERM")}catch{}if(await gt(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function H(e,o){if(o){let r=o.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let t=e.find(r=>r.isPrimary&&r.readyState==="open");if(t)return t;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function R(e,o,t){console.log(` ${t==="current sim"?"loaded":"opened"}: ${e} [${t}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function _(e,o,t){if(t.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await ht(e,o,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:ce})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&de(s))){let d=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: ${d} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as s}from"./chunk-HHKHMWRR.js";import{n as o}from"./chunk-ATMMZFJE.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as y,join as h,resolve as k}from"node:path";function i(){return h(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(y(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s}from"./chunk-EOQBPXIN.js";import{n as o}from"./chunk-4V6DKD5E.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as y,join as h,resolve as k}from"node:path";function i(){return h(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(y(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
3
3
  `);try{p(t,384)}catch{}}function E(){f(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function O(n){return!!(n&&n.length>=20&&m.some(t=>n.startsWith(t)))}function A(){let n=process.env.SOOT_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),r=n||t;if(!O(r))return null;let e=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!e)return null;let[l,u]=e.includes("/")?e.split("/",2):[null,null],c=(process.env.SOOT_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),a=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:e,repositoryId:c||null,owner:l||null,repo:u||null,installationId:a||null,source:n?"soot-runner":"github-actions"}}function x(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=A();if(t)return t;let r=S();if(r)return{kind:"api-key",secret:r,source:"file"};let e=s();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function H(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function N(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{S as a,w as b,E as c,x as d,H as e,N as f};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{execFileSync as h,spawn as g}from"child_process";import{existsSync as s,readdirSync as k}from"fs";import{dirname as m,join as l,resolve as a}from"path";import{fileURLToPath as v}from"url";var c;function p(){if(c!==void 0)return c;try{c=m(v(import.meta.resolve("sootsim-engine/package.json")))}catch{c=null}return c}var I="dev.sootsim.simulator";function x(){let n=p();if(!n)return null;let e=l(n,"dist-electron/main.cjs");if(!s(e))return null;let i=D(n);return i?{path:i,platform:process.platform,kind:"dev-electron",engineDir:n}:null}function b(){let n=p();return n?s(l(n,"src-electron/main.ts")):!1}function D(n){let e=n;for(let i=0;i<6;i++){let t=l(e,"node_modules/.bin/electron");if(s(t))return t;let r=m(e);if(r===e)break;e=r}return null}function C(){let n=p(),i=["/Applications/sootsim.app",a(process.env.HOME||"","Applications/sootsim.app"),...n?[a(n,"app/sootsim.app")]:[]].find(t=>s(t));if(i)return{path:i,platform:"darwin",kind:"mac-app"};try{let t=h("mdfind",[`kMDItemCFBundleIdentifier == "${I}"`],{encoding:"utf8",timeout:3e3}).trim();if(t)return{path:t.split(`
3
3
  `)[0],platform:"darwin",kind:"mac-app"}}catch{}return null}function f(n){if(!s(n))return null;let e=k(n).filter(i=>i.startsWith("sootsim")&&i.endsWith(".AppImage")).sort().reverse()[0];return e?l(n,e):null}function w(){let n=p(),i=[a(process.env.HOME||"","Applications/sootsim.AppImage"),a(process.env.HOME||"",".local/bin/sootsim.AppImage"),"/opt/sootsim/sootsim.AppImage","/opt/sootsim/sootsim",...n?[a(n,"app/sootsim.AppImage"),a(n,"release/linux-unpacked/sootsim")]:[]].find(r=>s(r));if(i)return{path:i,platform:"linux",kind:i.endsWith(".AppImage")?"linux-appimage":"linux-binary"};let t=n?f(a(n,"app"))||f(a(n,"release")):null;return t?{path:t,platform:"linux",kind:"linux-appimage"}:null}function A(){let n=x();if(n)return n;if(b()){let e=p(),i=l(e,"dist-electron/main.cjs");return s(i)?console.error(` no node_modules/.bin/electron found near ${e}. run \`bun install\`.`):console.error(` dist-electron/main.cjs missing in ${e}.
4
4
  run: bun run --cwd packages/sootsim-engine build:electron-main
@@ -0,0 +1 @@
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as fe,e as ge,f as he}from"./chunk-7FLA4A4M.js";import{c as pe}from"./chunk-ERENNF6M.js";import{d as de}from"./chunk-I2BWZNCX.js";import{c as ce,e as ue,g as P}from"./chunk-QD3SYTZB.js";import{d as le}from"./chunk-3PVLSJHL.js";import{a as ae,b}from"./chunk-MFTSL5T7.js";import{a as ie}from"./chunk-HHKHMWRR.js";import{createHash as We}from"crypto";import{readFileSync as j}from"fs";import{gzipSync as Ve}from"zlib";function ye(e){let n=(e||"").toLowerCase().split(";")[0].trim();return n?!(n.startsWith("image/")||n.startsWith("video/")||n.startsWith("audio/")||n==="font/woff2"||n==="application/font-woff2"||n==="application/zip"||n==="application/gzip"):!0}import{brotliCompressSync as ke,constants as Ae}from"node:zlib";var ze=9;function me(e){return ke(e,{params:{[Ae.BROTLI_PARAM_QUALITY]:ze}})}function K(e,n){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${n} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function He(e){let n=K(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:n.signal})}finally{n.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 Me(e,n=8,r){let s=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(n,a)},async()=>{for(;s<a;){let c=e[s++];await He(c),i++,r?.(i,a)}}))}function Ce(e,n,r,s){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:n});for(let a of e.files){let c=r.get(a.urlhash);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}e.events&&s?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.flowVideo&&s?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes});for(let a of e.snapshots??[]){let c=s?.snapshotBytes?.get(a.id);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}return i}function Ne(e){return e.replace(/\/+$/,"")}var z=class extends Error{constructor(r,s,i,a=""){super(r);this.status=s;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function we(e){let n=Ne(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let s=K(3e4,"init"),i;try{i=await fetch(`${n}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!i.ok){let f=await i.text().catch(()=>"");throw new z(`init failed: ${i.status} ${f.slice(0,200)}`,i.status,"init",f)}let a=await i.json(),c=Ce(a,e.bundleBytes,e.filesByHash,e.extras);await Me(c,e.concurrency??8,e.onPutProgress);let y=K(3e4,"finalize"),d;try{d=await fetch(`${n}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:y.signal})}finally{y.cancel()}if(!d.ok){let f=await d.text().catch(()=>"");throw new z(`finalize failed: ${d.status} ${f.slice(0,200)}`,d.status,"finalize",f)}let $=await d.json();return{init:a,finalize:$}}function qe(e){if(!e)return null;try{let n=JSON.parse(e);return typeof n.message=="string"&&n.message?n.message:null}catch{return null}}var Be=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",Te=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootbean.com",Y="http://localhost:3000",De=2e3;async function Ge(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let n=await fetch(`${Y}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(De)});if(n.ok||n.status===204||n.status===405)return Y}catch{}return Be}function x(e){return e.replace(/\/$/,"")}function Ke(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 je(e){try{let n=new URL(e).hostname.toLowerCase();return n==="sootbean.com"||n.endsWith(".sootbean.com")}catch{return!1}}function Je(e,n){return n?x(n):process.env.SOOTSIM_PREVIEW_ORIGIN?x(process.env.SOOTSIM_PREVIEW_ORIGIN):Ke(e)?x(e):je(e)?x(Te):x(e)}function Ye(){console.log(`
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as fe,e as ge,f as he}from"./chunk-J6TNRMST.js";import{c as pe}from"./chunk-YBO4Z43H.js";import{d as de}from"./chunk-AXSNLS34.js";import{c as ce,e as ue,g as P}from"./chunk-T6VPZ5ES.js";import{d as le}from"./chunk-ZE2PAAZW.js";import{a as ae,b}from"./chunk-PGN2263R.js";import{a as ie}from"./chunk-EOQBPXIN.js";import{createHash as We}from"crypto";import{readFileSync as j}from"fs";import{gzipSync as Ve}from"zlib";function ye(e){let n=(e||"").toLowerCase().split(";")[0].trim();return n?!(n.startsWith("image/")||n.startsWith("video/")||n.startsWith("audio/")||n==="font/woff2"||n==="application/font-woff2"||n==="application/zip"||n==="application/gzip"):!0}import{brotliCompressSync as ke,constants as Ae}from"node:zlib";var ze=9;function me(e){return ke(e,{params:{[Ae.BROTLI_PARAM_QUALITY]:ze}})}function K(e,n){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${n} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function He(e){let n=K(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:n.signal})}finally{n.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 Me(e,n=8,r){let s=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(n,a)},async()=>{for(;s<a;){let c=e[s++];await He(c),i++,r?.(i,a)}}))}function Ce(e,n,r,s){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:n});for(let a of e.files){let c=r.get(a.urlhash);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}e.events&&s?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.flowVideo&&s?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes});for(let a of e.snapshots??[]){let c=s?.snapshotBytes?.get(a.id);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}return i}function Ne(e){return e.replace(/\/+$/,"")}var z=class extends Error{constructor(r,s,i,a=""){super(r);this.status=s;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function we(e){let n=Ne(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let s=K(3e4,"init"),i;try{i=await fetch(`${n}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!i.ok){let f=await i.text().catch(()=>"");throw new z(`init failed: ${i.status} ${f.slice(0,200)}`,i.status,"init",f)}let a=await i.json(),c=Ce(a,e.bundleBytes,e.filesByHash,e.extras);await Me(c,e.concurrency??8,e.onPutProgress);let y=K(3e4,"finalize"),d;try{d=await fetch(`${n}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:y.signal})}finally{y.cancel()}if(!d.ok){let f=await d.text().catch(()=>"");throw new z(`finalize failed: ${d.status} ${f.slice(0,200)}`,d.status,"finalize",f)}let $=await d.json();return{init:a,finalize:$}}function qe(e){if(!e)return null;try{let n=JSON.parse(e);return typeof n.message=="string"&&n.message?n.message:null}catch{return null}}var Be=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",Te=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootbean.com",Y="http://localhost:3000",De=2e3;async function Ge(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let n=await fetch(`${Y}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(De)});if(n.ok||n.status===204||n.status===405)return Y}catch{}return Be}function x(e){return e.replace(/\/$/,"")}function Ke(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 je(e){try{let n=new URL(e).hostname.toLowerCase();return n==="sootbean.com"||n.endsWith(".sootbean.com")}catch{return!1}}function Je(e,n){return n?x(n):process.env.SOOTSIM_PREVIEW_ORIGIN?x(process.env.SOOTSIM_PREVIEW_ORIGIN):Ke(e)?x(e):je(e)?x(Te):x(e)}function Ye(){console.log(`
3
3
  sootsim upload \u2014 publish the current recorded bundle as a /preview/<id> link
4
4
 
5
5
  usage:
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as u}from"./chunk-QD3SYTZB.js";import{B as g,G as l,H as m,h as p,i as h,k as w}from"./chunk-ATMMZFJE.js";import{closeSync as k,existsSync as f,openSync as P,readSync as S,statSync as b}from"fs";import{homedir as T}from"os";import{resolve as D}from"path";import{WebSocket as $}from"ws";var L=6e4;async function E(){let e=g();if(e&&f(w(e)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:t}=await import("./runtime-A4PZC73P.js");await t(["install"],{})}function W(e,t){return B(e)??t??u()}async function x(e=u(),t=L){if(await c(e,250)||await c(e,1500))return;let n=l();if(n&&m(n)){if(n.bootstrapping===!0&&(await v(t),await c(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}if(h()){let r=p()?"dev workstations":"dev checkouts";throw new Error(`sootsim bridge daemon is not running on port ${e}.
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as u}from"./chunk-T6VPZ5ES.js";import{B as g,G as l,H as m,h as p,i as h,k as w}from"./chunk-4V6DKD5E.js";import{closeSync as k,existsSync as f,openSync as P,readSync as S,statSync as b}from"fs";import{homedir as T}from"os";import{resolve as D}from"path";import{WebSocket as $}from"ws";var L=6e4;async function E(){let e=g();if(e&&f(w(e)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:t}=await import("./runtime-D4T7CD4H.js");await t(["install"],{})}function W(e,t){return B(e)??t??u()}async function x(e=u(),t=L){if(await c(e,250)||await c(e,1500))return;let n=l();if(n&&m(n)){if(n.bootstrapping===!0&&(await v(t),await c(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}if(h()){let r=p()?"dev workstations":"dev checkouts";throw new Error(`sootsim bridge daemon is not running on port ${e}.
3
3
  ${r} don't run a standalone daemon \u2014 the live \`bun dev\` stack hosts the
4
4
  bridge in-process on :${e}. start the dev stack (\`bun dev\`) so the CLI can
5
5
  reach it, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to run \`bun sootsim server\`
6
- standalone here on purpose.`)}console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-4NBH5C6S.js");try{await o({port:e,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
6
+ standalone here on purpose.`)}console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-VYP6PWR2.js");try{await o({port:e,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
7
7
  if this keeps failing, run \`sootsim daemon uninstall\` and retry, or run \`sootsim server\` in a persistent shell as a workaround.`)}console.log(" waiting for runtime to come online...");let i=process.platform==="darwin"?O():null;try{await v(t);let r=Date.now()+5e3;for(;Date.now()<r;){if(await c(e,500))return;await new Promise(s=>setTimeout(s,200))}throw new Error(`daemon registered but the bridge never bound on port ${e} \u2014 see ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}finally{i?.stop()}}async function C(e=u()){await E(),await x(e)}function B(e){for(let t=0;t<e.length;t++){let n=e[t];if((n==="--port"||n==="-p")&&e[t+1]){let o=Number(e[t+1]);return Number.isFinite(o)?o:void 0}if(n.startsWith("--port=")){let o=Number(n.slice(7));return Number.isFinite(o)?o:void 0}}}function c(e,t){return new Promise(n=>{let o=new $(`ws://127.0.0.1:${e}`,{handshakeTimeout:t}),i=!1,r=s=>{if(!i){i=!0;try{o.close()}catch{}n(s)}};o.once("open",()=>r(!0)),o.once("error",()=>r(!1)),setTimeout(()=>r(!1),t)})}async function v(e){let t=Date.now()+e,n;for(;Date.now()<t;){let o=l();if(o&&m(o)){if(o.bootstrapping!==!0)return;o.bootstrapping!==n&&(n=o.bootstrapping)}await new Promise(i=>setTimeout(i,250))}throw new Error(`daemon did not finish bootstrapping within ${Math.round(e/1e3)}s \u2014 check ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}function d(){return D(T(),"Library/Logs/sootsim/server.err.log")}function O(){let e=d(),t=0;try{f(e)&&(t=b(e).size)}catch{}let n=!1,o=()=>{if(!n){try{if(f(e)){let i=b(e).size;if(i>t){let r=Buffer.alloc(i-t),s=P(e,"r");try{S(s,r,0,r.length,t)}finally{k(s)}t=i;for(let y of r.toString("utf8").split(/\r?\n/)){let a=y.trim();a&&(a.startsWith("sootsim:")||a.startsWith("sootsim "))&&console.log(` ${a}`)}}else i<t&&(t=i)}}catch{}setTimeout(o,250)}};return o(),{stop:()=>{n=!0}}}export{E as a,W as b,x as c,C as d};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.164 | (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.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as s}from"./chunk-HHKHMWRR.js";import{y as o}from"./chunk-ATMMZFJE.js";function u(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!o()}function a(){if(u())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let t=process.env.SOOT_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:t.replace(/\/+$/,"")}}function c(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:"anonymous-cli":"anonymous-cli"}function p(e){let t=e.identity??{},n={$lib:"soot-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:c(t),properties:n,timestamp:new Date().toISOString()}}var r=[],l=!1;async function i(){if(r.length===0)return;let e=a();if(!e){r.length=0;return}let t=r.splice(0,r.length).map(p);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 d(){l||(l=!0,process.on("beforeExit",()=>void i()),process.on("exit",()=>void i()))}function h(e){if(u())return;d();let t=null;try{t=s()?.user?.id??null}catch{t=null}r.push({...e,identity:{source:"cli",userId:t,...e.identity}})}async function g(){await i()}export{h as a,g as b};
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s}from"./chunk-EOQBPXIN.js";import{y as o}from"./chunk-4V6DKD5E.js";function u(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!o()}function a(){if(u())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let t=process.env.SOOT_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:t.replace(/\/+$/,"")}}function c(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:"anonymous-cli":"anonymous-cli"}function p(e){let t=e.identity??{},n={$lib:"soot-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:c(t),properties:n,timestamp:new Date().toISOString()}}var r=[],l=!1;async function i(){if(r.length===0)return;let e=a();if(!e){r.length=0;return}let t=r.splice(0,r.length).map(p);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 d(){l||(l=!0,process.on("beforeExit",()=>void i()),process.on("exit",()=>void i()))}function h(e){if(u())return;d();let t=null;try{t=s()?.user?.id??null}catch{t=null}r.push({...e,identity:{source:"cli",userId:t,...e.identity}})}async function g(){await i()}export{h as a,g as b};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var o={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},f={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},c={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},p={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},r=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var h={"iphone-se":t({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:f}),"iphone-14":t({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:55,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15":t({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-plus":t({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-16":t({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-plus":t({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17":t({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-air":t({name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"ipad-pro-13":t({name:'iPad Pro 13"',width:1032,height:1376,scale:2,statusBarHeight:24,homeIndicatorHeight:20,cornerRadius:18,dynamicIsland:null,safeAreaInsets:{top:24,bottom:20,left:0,right:0},iosVersion:"18.2",physicalPPI:264,hardwareButtons:o}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:c},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:p},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:p}},u="iphone-17-pro";function w(e){return h[e]}function g(){return Object.keys(h)}var i={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},s={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},v={color:"#25c3ec",blur:120,spread:52,opacity:.34},x="iphone-17-pro";var b=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],m=Object.fromEntries(b.map(e=>[e.name,e.value]));function B(e){return m[e]??m.gray}function I(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function y(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(n=>({...n}))}}function T(e){return Object.prototype.hasOwnProperty.call(s,e)?y(s[e]):null}var d={deviceModel:{type:"enum",default:u,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:g(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(i),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(s),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function S(){if(typeof window>"u")return{};let e={};try{let n=new URLSearchParams(window.location.search),a=n.get("device");a&&d.deviceModel.options?.includes(a)&&(e.deviceModel=a);let l=n.get("colorScheme")??n.get("theme");l&&d.colorScheme.options?.includes(l)&&(e.colorScheme=l)}catch{}return e}function N(){let e={};for(let[n,a]of Object.entries(d))e[n]=a.default;return Object.assign(e,S()),e}export{v as a,x as b,B as c,I as d,y as e,T as f,h as g,w as h,g as i,d as j,S as k,N as l};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as $}from"./chunk-QD3SYTZB.js";import{a as w,d as y,h as R,j as b,l as k}from"./chunk-HWBJB3EE.js";import{A as h,B as u,C as p,D as g,k as d}from"./chunk-ATMMZFJE.js";import x from"fs";import{WebSocket as D}from"ws";async function G(e,t={}){let[s,...n]=e;if(!s||s==="--help"||s==="-h"){A();return}switch(s){case"install":return O(n,t);case"list":case"ls":return N(n);case"use":return S(n);case"remove":case"rm":return T(n);case"which":case"active":return F();case"notes":case"changelog":return _(n);default:console.error(` unknown runtime subcommand: ${s}`),A(),process.exit(1)}}function A(){console.log(`
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as $}from"./chunk-T6VPZ5ES.js";import{a as w,d as y,h as R,j as b,l as k}from"./chunk-CBKH2EZL.js";import{A as h,B as u,C as p,D as g,k as d}from"./chunk-4V6DKD5E.js";import x from"fs";import{WebSocket as D}from"ws";async function G(e,t={}){let[s,...n]=e;if(!s||s==="--help"||s==="-h"){A();return}switch(s){case"install":return O(n,t);case"list":case"ls":return N(n);case"use":return S(n);case"remove":case"rm":return T(n);case"which":case"active":return F();case"notes":case"changelog":return _(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,7 +26,7 @@ examples:
26
26
  sootsim runtime notes
27
27
  sootsim runtime notes 1.2.3
28
28
  sootsim runtime notes --all
29
- `)}async function O(e,t){let{version:s,flags:n}=C(e),i=n.channel??t.channel??"stable",l=n.force===!0,r=n.setActive!==!1;h(),console.log("sootsim runtime install"),console.log(` cdn: ${y()}`);try{let o=await k({version:s,channel:i,force:l,setActive:r});console.log(` version: ${o.version} (channel: ${o.channel})`),o.installed?console.log(` installed ${o.version}`):console.log(` already installed at ${o.runtimeDir}`),r&&await I(o.version)}catch(o){console.error(` ${v(o)}`),process.exit(1)}}async function I(e){p(e),console.log(` active: ${e}`),await E(e)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${e})`)}async function E(e){let{isDaemonLockfileFresh:t,readDaemonLockfile:s}=await import("./home-paths-4OM2SXFV.js"),n=s();if(!t(n))return!1;let i=$();return new Promise(l=>{let r=!1,o=!1,a=f=>{r||(r=!0,l(f))},c=new D(`ws://127.0.0.1:${i}`,{handshakeTimeout:800}),m=setTimeout(()=>{try{c.close()}catch{}a(o)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:e,id:0})),o=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(m),a(o)}),c.on("error",()=>{clearTimeout(m),a(!1)})})}async function N(e){h();let t=g(),s=u();if(console.log("installed:"),t.length===0)console.log(" (none)");else for(let n of t)console.log(` ${n===s?"*":" "} ${n}`);try{let n=await R();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`)}catch(n){console.log(`available: (could not fetch manifest: ${v(n)})`)}}async function S(e){let t=e[0];t||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=g();s.includes(t)||(console.error(` version ${t} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${t}\` first`),process.exit(1)),await I(t)}async function T(e){let t=e[0];t||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),u()===t&&(console.error(` cannot remove active runtime ${t}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=d(t);if(!x.existsSync(n)){console.error(` ${t} is not installed`);return}x.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${t}`)}async function F(){let e=u();if(!e){console.log(" no active runtime");return}console.log(e)}async function _(e){let t=e.includes("--all"),s=e.find(o=>!o.startsWith("-"))||null,n;try{n=await b()}catch(o){console.error(` could not fetch release notes: ${v(o)}`),process.exit(1)}if(n.length===0){console.log(" no release notes published yet");return}if(t){console.log(`sootsim runtime releases:
29
+ `)}async function O(e,t){let{version:s,flags:n}=C(e),i=n.channel??t.channel??"stable",l=n.force===!0,r=n.setActive!==!1;h(),console.log("sootsim runtime install"),console.log(` cdn: ${y()}`);try{let o=await k({version:s,channel:i,force:l,setActive:r});console.log(` version: ${o.version} (channel: ${o.channel})`),o.installed?console.log(` installed ${o.version}`):console.log(` already installed at ${o.runtimeDir}`),r&&await I(o.version)}catch(o){console.error(` ${v(o)}`),process.exit(1)}}async function I(e){p(e),console.log(` active: ${e}`),await E(e)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${e})`)}async function E(e){let{isDaemonLockfileFresh:t,readDaemonLockfile:s}=await import("./home-paths-5P4PDEPL.js"),n=s();if(!t(n))return!1;let i=$();return new Promise(l=>{let r=!1,o=!1,a=f=>{r||(r=!0,l(f))},c=new D(`ws://127.0.0.1:${i}`,{handshakeTimeout:800}),m=setTimeout(()=>{try{c.close()}catch{}a(o)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:e,id:0})),o=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(m),a(o)}),c.on("error",()=>{clearTimeout(m),a(!1)})})}async function N(e){h();let t=g(),s=u();if(console.log("installed:"),t.length===0)console.log(" (none)");else for(let n of t)console.log(` ${n===s?"*":" "} ${n}`);try{let n=await R();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`)}catch(n){console.log(`available: (could not fetch manifest: ${v(n)})`)}}async function S(e){let t=e[0];t||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=g();s.includes(t)||(console.error(` version ${t} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${t}\` first`),process.exit(1)),await I(t)}async function T(e){let t=e[0];t||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),u()===t&&(console.error(` cannot remove active runtime ${t}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=d(t);if(!x.existsSync(n)){console.error(` ${t} is not installed`);return}x.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${t}`)}async function F(){let e=u();if(!e){console.log(" no active runtime");return}console.log(e)}async function _(e){let t=e.includes("--all"),s=e.find(o=>!o.startsWith("-"))||null,n;try{n=await b()}catch(o){console.error(` could not fetch release notes: ${v(o)}`),process.exit(1)}if(n.length===0){console.log(" no release notes published yet");return}if(t){console.log(`sootsim runtime releases:
30
30
  `);for(let o of n){let a=o.date.slice(0,10),c=o.sections.reduce((m,f)=>m+f.items.length,0);console.log(` v${o.version} ${a} (${o.channel}, ${c} change${c===1?"":"s"})`)}console.log(`
31
31
  see one release: sootsim runtime notes <version>`);return}let i=u(),l=s||i||n[0]?.version,r=n.find(o=>o.version===l);r||(console.error(` no release notes for ${l}`),console.error(` published: ${n.map(o=>o.version).slice(0,10).join(", ")}`),console.error(" list all: sootsim runtime notes --all"),process.exit(1)),console.log(j(r,{active:i}))}function j(e,t={}){let s=[],n=e.date.slice(0,10),i=t.active===e.version?" (active)":"";if(s.push(`sootsim runtime v${e.version} \xB7 ${e.channel} \xB7 ${n}${i}`),e.sections.length===0)return s.push(" no notable changes"),s.join(`
32
32
  `);for(let l of e.sections){s.push(""),s.push(` ${l.title}`);for(let r of l.items){let o=r.scope?`(${r.scope}) `:"",a=r.breaking?"\u26A0 ":"";s.push(` \u2022 ${a}${o}${r.summary} ${r.hash}`)}}return s.join(`
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var t="http://localhost:5173/";export{t as a};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var t=!0,e="1.0.0",o="public beta",n=`${o} \xB7 free until ${e}`,r="free for everyone until 1.0 \u2014 we send anonymous error and dependency data while you use it";export{t as a,e as b,o as c,n as d,r as e};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as Ns}from"./chunk-T56IURYQ.js";function hi(s){return`(async () => {
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as Ns}from"./chunk-TDPLTM27.js";function hi(s){return`(async () => {
3
3
  const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
4
4
  if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
5
5
  await bridge.reloadExternalApp({ resetStorage: ${s?"true":"false"} })
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.163 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.164 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};