sootsim 0.1.310 → 0.1.311

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 (151) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-CPD4GIXP.js → agent-KOPVOZ7G.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-JZTNUUZE.js → agent-wrapper-KVAIIK7K.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-CFIBFEVF.js → app-fonts-5ZX2IRBS.js} +2 -2
  5. package/dist-cli/chunks/{assert-C5WAWJ6I.js → assert-NRKM4ZIK.js} +2 -2
  6. package/dist-cli/chunks/{auth-UY7RPLPH.js → auth-MSLDV5HR.js} +2 -2
  7. package/dist-cli/chunks/{beta-NM7T7MDN.js → beta-L5QKFHWI.js} +2 -2
  8. package/dist-cli/chunks/{camera-4YUYYYJI.js → camera-5JUNQPSI.js} +2 -2
  9. package/dist-cli/chunks/{chunk-RYPPRVBM.js → chunk-3Y6476ZM.js} +2 -2
  10. package/dist-cli/chunks/{chunk-GQVBLBUJ.js → chunk-5V5MOREL.js} +2 -2
  11. package/dist-cli/chunks/{chunk-FT2XATWO.js → chunk-6JYTKF5O.js} +1 -1
  12. package/dist-cli/chunks/{chunk-LKAAQBT6.js → chunk-6QZY6YO2.js} +1 -1
  13. package/dist-cli/chunks/{chunk-TAQV44LZ.js → chunk-6SICKWPQ.js} +3 -3
  14. package/dist-cli/chunks/{chunk-Z6H5FR3U.js → chunk-75KNNHMR.js} +2 -2
  15. package/dist-cli/chunks/{chunk-YRRUK3EK.js → chunk-75YOUNTE.js} +1 -1
  16. package/dist-cli/chunks/chunk-7PHOEBKV.js +4 -0
  17. package/dist-cli/chunks/{chunk-S7WXPIOY.js → chunk-7W63IKAP.js} +2 -2
  18. package/dist-cli/chunks/chunk-CJKSD5BZ.js +5 -0
  19. package/dist-cli/chunks/{chunk-SY7E43UY.js → chunk-CKMQ2YXQ.js} +3 -3
  20. package/dist-cli/chunks/{chunk-QPZVGHRV.js → chunk-CUVLXG63.js} +1 -1
  21. package/dist-cli/chunks/{chunk-7RJEULWN.js → chunk-EHBHUE6S.js} +2 -2
  22. package/dist-cli/chunks/{chunk-NLTJE335.js → chunk-F2WH6XM7.js} +2 -2
  23. package/dist-cli/chunks/{chunk-63JWRDM6.js → chunk-GEUU2WIL.js} +2 -2
  24. package/dist-cli/chunks/{chunk-ZNK3ZAA5.js → chunk-GFKP5JIA.js} +2 -2
  25. package/dist-cli/chunks/{chunk-6UXXOG6P.js → chunk-GLECQIGB.js} +2 -2
  26. package/dist-cli/chunks/{chunk-3S7UEXZW.js → chunk-HI5MWY32.js} +1 -1
  27. package/dist-cli/chunks/{chunk-GH2OE6F6.js → chunk-J6ZKDIRN.js} +2 -2
  28. package/dist-cli/chunks/{chunk-PJKCYUT3.js → chunk-JGFIT5X5.js} +2 -2
  29. package/dist-cli/chunks/{chunk-3EO5JEG7.js → chunk-KGIXNUUM.js} +2 -2
  30. package/dist-cli/chunks/{chunk-BFNAFH27.js → chunk-KKXSWEYS.js} +1 -1
  31. package/dist-cli/chunks/{chunk-EPMLSKSB.js → chunk-NBNEISXX.js} +2 -2
  32. package/dist-cli/chunks/{chunk-EWRPLFYI.js → chunk-P7MI3VFY.js} +1 -1
  33. package/dist-cli/chunks/{chunk-YIJFCR5T.js → chunk-PHFRI2QF.js} +1 -1
  34. package/dist-cli/chunks/{chunk-RMIKUUCO.js → chunk-PJ27D3WO.js} +1 -1
  35. package/dist-cli/chunks/{chunk-MUQDPJUP.js → chunk-QCEMDWL4.js} +1 -1
  36. package/dist-cli/chunks/{chunk-2TRPGEZE.js → chunk-QILKSUH6.js} +2 -2
  37. package/dist-cli/chunks/{chunk-WWIQEYHT.js → chunk-QMHUIADD.js} +1 -1
  38. package/dist-cli/chunks/{chunk-66Z2ADUQ.js → chunk-QUAY5AZB.js} +2 -2
  39. package/dist-cli/chunks/{chunk-C3GMSIRT.js → chunk-RATCQLQA.js} +2 -2
  40. package/dist-cli/chunks/{chunk-C3O6UUPY.js → chunk-RHGVZJIY.js} +3 -3
  41. package/dist-cli/chunks/{chunk-BMIIHY6K.js → chunk-RIT4KI4Y.js} +3 -3
  42. package/dist-cli/chunks/{chunk-4XMPRQGE.js → chunk-S5U22PVL.js} +1 -1
  43. package/dist-cli/chunks/{chunk-XBBNRESY.js → chunk-SKGITCWL.js} +1 -1
  44. package/dist-cli/chunks/{chunk-RX4CFOVV.js → chunk-ULJT3HDO.js} +1 -1
  45. package/dist-cli/chunks/{chunk-XMOULANJ.js → chunk-VAFDFOE6.js} +2 -2
  46. package/dist-cli/chunks/{chunk-M2LP2VYQ.js → chunk-VJMY2MX6.js} +2 -2
  47. package/dist-cli/chunks/{chunk-IS5OOCN5.js → chunk-VNS6KYRJ.js} +1 -1
  48. package/dist-cli/chunks/{chunk-R7AS52NA.js → chunk-W4S7GGPG.js} +3 -3
  49. package/dist-cli/chunks/{chunk-YMD6WWI7.js → chunk-WIYIQQQS.js} +2 -2
  50. package/dist-cli/chunks/{chunk-VAGUPECL.js → chunk-WTNKX7QD.js} +2 -2
  51. package/dist-cli/chunks/{chunk-STWCCIBA.js → chunk-Y5O5GK2Q.js} +11 -11
  52. package/dist-cli/chunks/{chunk-YZPSUNTO.js → chunk-Y7RQGSZD.js} +2 -2
  53. package/dist-cli/chunks/{chunk-XKAXZ4DS.js → chunk-YOIHAHR5.js} +1 -1
  54. package/dist-cli/chunks/{chunk-ZS7OXPHR.js → chunk-YS7YDOGW.js} +1 -1
  55. package/dist-cli/chunks/{chunk-CORSX7M5.js → chunk-YTP5VCDL.js} +1 -1
  56. package/dist-cli/chunks/{chunk-2KSLGBIU.js → chunk-ZB3UAYJ4.js} +2 -2
  57. package/dist-cli/chunks/{chunk-EPZUFQMX.js → chunk-ZDQO6TJQ.js} +2 -2
  58. package/dist-cli/chunks/{chunk-C4O4VRN5.js → chunk-ZHPLBK34.js} +2 -2
  59. package/dist-cli/chunks/{cleanup-2ZM4QSDV.js → cleanup-436GW67Y.js} +2 -2
  60. package/dist-cli/chunks/{cli-version-WXOEWZDA.js → cli-version-BY3A3SBN.js} +2 -2
  61. package/dist-cli/chunks/{compat-MGY3FZSI.js → compat-DDJSQ3WI.js} +2 -2
  62. package/dist-cli/chunks/{config-3W5VNME6.js → config-XFLK4XZN.js} +2 -2
  63. package/dist-cli/chunks/{control-7LNRM2BK.js → control-W6KUVHYU.js} +2 -2
  64. package/dist-cli/chunks/daemon-E5MGIR55.js +4 -0
  65. package/dist-cli/chunks/{debug-4CMFC2CO.js → debug-PHSYXSNH.js} +3 -3
  66. package/dist-cli/chunks/{desktop-Q6CZSS4R.js → desktop-6V5ALYCZ.js} +3 -3
  67. package/dist-cli/chunks/{detox-2AF4MXXN.js → detox-SA27XGTO.js} +2 -2
  68. package/dist-cli/chunks/{device-E2WCI2N2.js → device-XURVFXBT.js} +2 -2
  69. package/dist-cli/chunks/{diagnose-CZGCKNVY.js → diagnose-HMUQWQOK.js} +2 -2
  70. package/dist-cli/chunks/disk-cleanup-KYAFCV6S.js +4 -0
  71. package/dist-cli/chunks/drivers-INII4IWR.js +4 -0
  72. package/dist-cli/chunks/{film-UDSAJZXL.js → film-3UM6EUYF.js} +3 -3
  73. package/dist-cli/chunks/flow-RP4UVYUA.js +4 -0
  74. package/dist-cli/chunks/help-STHBZD6I.js +4 -0
  75. package/dist-cli/chunks/{hidden-runtime-alias-CHAB56GM.js → hidden-runtime-alias-DVVAGM4I.js} +2 -2
  76. package/dist-cli/chunks/{home-paths-WFCI5ORX.js → home-paths-LVGGR4AJ.js} +2 -2
  77. package/dist-cli/chunks/inspect-5W52ZHKD.js +4 -0
  78. package/dist-cli/chunks/install-desktop-H4HLLT7K.js +4 -0
  79. package/dist-cli/chunks/{login-57UP2EKB.js → login-2QTBTTGJ.js} +4 -4
  80. package/dist-cli/chunks/{logout-UYNCJTOC.js → logout-PUBLDHVY.js} +2 -2
  81. package/dist-cli/chunks/{maestro-QMAPXPZ7.js → maestro-2UJ27MKD.js} +3 -3
  82. package/dist-cli/chunks/{maestro-generate-N2BJXJDH.js → maestro-generate-P4MDFYMV.js} +3 -3
  83. package/dist-cli/chunks/{mode-SY5G7WQD.js → mode-RRHPX23W.js} +2 -2
  84. package/dist-cli/chunks/{optional-demo-registry-DH3L6FFX.js → optional-demo-registry-5IRF7M7Z.js} +2 -2
  85. package/dist-cli/chunks/{perf-NZ6VEDLA.js → perf-BOLWOAKV.js} +2 -2
  86. package/dist-cli/chunks/{permissions-EMH2K5LX.js → permissions-ZIOTIBPV.js} +2 -2
  87. package/dist-cli/chunks/{record-44PMWGYY.js → record-DU2IKPFK.js} +3 -3
  88. package/dist-cli/chunks/{report-issue-PLGMRWXG.js → report-issue-4CQDUWT2.js} +2 -2
  89. package/dist-cli/chunks/runtime-QWPQ3M7H.js +4 -0
  90. package/dist-cli/chunks/{screenshot-command-GJT5XS7P.js → screenshot-command-XEN26NJV.js} +3 -3
  91. package/dist-cli/chunks/{screenshot-layers-4JSTS5VY.js → screenshot-layers-CRCQ4CEF.js} +2 -2
  92. package/dist-cli/chunks/{screenshots-capture-AQQISSQD.js → screenshots-capture-XGQFYINL.js} +2 -2
  93. package/dist-cli/chunks/{serve-TJMO4KGX.js → serve-UBSRDYA3.js} +2 -2
  94. package/dist-cli/chunks/{setup-7ZSYCUX6.js → setup-AKYIOBVO.js} +2 -2
  95. package/dist-cli/chunks/{skills-GRQPAAD5.js → skills-V5WV4LWH.js} +2 -2
  96. package/dist-cli/chunks/{storage-GWRZNBAU.js → storage-3PJPIHNM.js} +2 -2
  97. package/dist-cli/chunks/store-A27JYIGF.js +4 -0
  98. package/dist-cli/chunks/telemetry-LLD24AVX.js +4 -0
  99. package/dist-cli/chunks/{timeline-2FXM7HEU.js → timeline-OHQNHG52.js} +2 -2
  100. package/dist-cli/chunks/{upgrade-AV7UOK2X.js → upgrade-Q2TYYVIX.js} +2 -2
  101. package/dist-cli/chunks/upload-57FIDO2B.js +4 -0
  102. package/dist-cli/chunks/{version-C72O2LMS.js → version-SW6VCJVI.js} +2 -2
  103. package/dist-cli/chunks/{web-4V3YGWNC.js → web-BXVM3HJ3.js} +2 -2
  104. package/dist-cli/chunks/{what-happened-RGD2DOQI.js → what-happened-H62ASSI5.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-identity.cjs +1 -1
  108. package/dist-lib/agent-sessions.cjs +1 -1
  109. package/dist-lib/attached-projects.cjs +1 -1
  110. package/dist-lib/auth/shared-session.cjs +1 -1
  111. package/dist-lib/backend-origin.cjs +1 -1
  112. package/dist-lib/beta.cjs +1 -1
  113. package/dist-lib/beta.mjs +1 -1
  114. package/dist-lib/bridge-constants.cjs +1 -1
  115. package/dist-lib/cli-constants.cjs +1 -1
  116. package/dist-lib/config.cjs +1 -1
  117. package/dist-lib/detox/index.cjs +20 -16
  118. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  119. package/dist-lib/home-paths.cjs +1 -1
  120. package/dist-lib/host/bridge-host.cjs +164 -102
  121. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  122. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  123. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  124. package/dist-lib/host/websocket-proxy.cjs +1 -1
  125. package/dist-lib/index.cjs +1 -1
  126. package/dist-lib/jump-to-source-babel.cjs +1 -1
  127. package/dist-lib/menu.cjs +1 -1
  128. package/dist-lib/menu.mjs +1 -1
  129. package/dist-lib/metro.cjs +1 -1
  130. package/dist-lib/profiles.cjs +1 -1
  131. package/dist-lib/render-mode.cjs +1 -1
  132. package/dist-lib/scripts/dev-server-scanner.cjs +43 -23
  133. package/dist-lib/sdk.cjs +1 -1
  134. package/dist-lib/sdk.mjs +1 -1
  135. package/dist-lib/skills.cjs +277 -206
  136. package/dist-lib/vite.cjs +1 -1
  137. package/package.json +1 -1
  138. package/scripts/dev-server-scanner.ts +34 -8
  139. package/dist-cli/chunks/chunk-63EKEKDF.js +0 -4
  140. package/dist-cli/chunks/chunk-OQO3HU4Y.js +0 -5
  141. package/dist-cli/chunks/daemon-ZNCVHOWJ.js +0 -4
  142. package/dist-cli/chunks/disk-cleanup-4T6MDZBA.js +0 -4
  143. package/dist-cli/chunks/drivers-NEB27ZKQ.js +0 -4
  144. package/dist-cli/chunks/flow-GXXVEHEW.js +0 -4
  145. package/dist-cli/chunks/help-3RVUJUAN.js +0 -4
  146. package/dist-cli/chunks/inspect-4H4VNQJ4.js +0 -4
  147. package/dist-cli/chunks/install-desktop-RGCBPM4J.js +0 -4
  148. package/dist-cli/chunks/runtime-CUSKTS2J.js +0 -4
  149. package/dist-cli/chunks/store-MLODFZBM.js +0 -4
  150. package/dist-cli/chunks/telemetry-XL3UDJSE.js +0 -4
  151. package/dist-cli/chunks/upload-6DXF4DAQ.js +0 -4
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as I,b as Le,c as Ne}from"./chunk-3EO5JEG7.js";import{m as A}from"./chunk-YZPSUNTO.js";import{m as Re,p as Ue}from"./chunk-4XMPRQGE.js";import{b as Ae,j as qe}from"./chunk-XMOULANJ.js";import{a as We,b as Ke,d as ze}from"./chunk-VAGUPECL.js";import{a as Oe,b as L,c as ae,d as le,e as De,f as Be,h as je,i as z,j as He}from"./chunk-STWCCIBA.js";import{a as Fe}from"./chunk-66Z2ADUQ.js";import{a as ce}from"./chunk-YIJFCR5T.js";import{b as Ee,c as _e,d as ie,f as Te,g as Me,h as _,i as P,j as T}from"./chunk-7RJEULWN.js";import{f as Pe}from"./chunk-R7AS52NA.js";import{b as se,d as Ie}from"./chunk-GH2OE6F6.js";import{b as ke,g as Ce,h as D,i as x,j as B}from"./chunk-NLTJE335.js";import{H as $e,K as oe,M as q,O as xe,l as re}from"./chunk-XBBNRESY.js";import{spawn as Ze,spawnSync as Xe}from"node:child_process";import M from"node:fs";import kt from"node:os";import R from"node:path";import{WebSocket as Ct}from"ws";function Ve(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 yt(e,t){return e?.includes("/one/metro-entry.bundle")?"one":typeof t=="string"&&t?"expo":"unknown"}function Je(e,t,n){return`${e}//${t}:${n}`}function St(e){if(typeof window>"u")return!1;try{let t=new URL(e);return I(t.hostname)&&I(window.location.hostname)&&t.origin!==window.location.origin}catch{return!1}}async function Ge(e,t){let n={...t,cache:t?.cache??"no-store"};return St(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,n):fetch(e,n)}function $t(e){return e==="https:"?443:80}function xt(e){let t=e.pathname||"/";return(t==="/"||t==="")&&!e.search&&!e.hash}async function Pt(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 n=await t.json();if(!Array.isArray(n))return null;let r=n.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return r?{bundleUrl:le(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function Qe(e,t){let n=e.replace(/\/+$/,"");try{if(I(new URL(n).hostname)){let r=await Pt(t);if(r)return r}}catch{}try{let r=await Ge(`${n}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),s=o?.extra?.expoClient||o?.extra||{},i=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:le(i||`${n}${ae}`),port:t,framework:yt(i,s.sdkVersion),projectName:s.name}}}catch{}try{let r=await Ge(`${n}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${n}${ae}`,port:t,framework:"metro"}}catch{}return null}async function It(e){return Qe(Je("http:","localhost",e),e)}async function Ye(e){let t=e.trim();if(/^\d+$/.test(t)){let a=parseInt(t,10),l=await It(a);if(l)return l;throw Ve(`localhost:${a}`)}let n=t.startsWith("http")?t:`http://${t}`,r;try{r=new URL(n)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",s=r.port?parseInt(r.port,10):$t(o),i=Je(o,r.hostname,s);if(xt(r)){let a=await Qe(i,s);if(a)return a;throw Ve(i)}return{bundleUrl:r.toString(),port:s,framework:"unknown"}}var Rt=12e4,et=100,Ut=5e3,tt=1e4,Et={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(t=>setTimeout(t,e))}function nt(e){let t=process.env[e]?.trim();if(!t)return null;let n=Number(t);return Number.isInteger(n)&&n>0?n:null}function _t(){let e=nt("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??nt("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Rt;return{timeoutMs:e,hostTimeoutMs:e+Ut,intervalMs:et,attempts:Math.max(1,Math.ceil(e/et))}}function rt(e){return e==="electron"||e==="playwright"}function ue(e,t){return t==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function Tt(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 J(e){return e.trim()}var ct=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Mt(e){let t=e.trim();if(!t)throw new Error("expected <url-or-route>");return ct.test(t)||t.startsWith("/")?t:`/${t}`}function Ot(e){return e!==null&&typeof e=="object"}function Dt(e){let t=e.trim();return t?t.startsWith("/")?!0:ct.test(t)?!/^https?:\/\//i.test(t):!1:!1}async function Bt(e){if(await V(e,250))return e;let t=oe();if(t&&q(t)&&await V(t.bridgePort,500))return t.bridgePort;if(t&&q(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 At();let n=Lt(["serve","--quiet","--port",String(e)]),r=null;n.once("exit",(s,i)=>{r=String(s??i??"unknown")}),n.unref();let o=Date.now()+tt;for(;Date.now()<o;){let s=oe();if(s&&q(s)&&await V(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 V(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(r)throw new Error(`sootsim bridge exited before becoming ready (exit ${r})`);await S(150)}throw new Error(`sootsim bridge did not start within ${Math.round(tt/1e3)}s`)}async function At(){let e=$e();if(e&&M.existsSync(re(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:t}=await import("./runtime-CUSKTS2J.js");await t(["install"],{})}function Lt(e){let t=process.argv[1];return t&&M.existsSync(t)?Ze(process.execPath,[t,...e],{detached:!0,stdio:"ignore",env:process.env}):Ze("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function V(e,t){return new Promise(n=>{let r=new Ct(`ws://127.0.0.1:${e}`,{handshakeTimeout:t}),o=!1,s=i=>{if(!o){o=!0;try{r.close()}catch{}n(i)}};r.once("open",()=>s(!0)),r.once("error",()=>s(!1)),setTimeout(()=>s(!1),t)})}function me(e){try{let t=new URL(e),n=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")||n==="/sootsim"||t.pathname==="/__soot"||t.pathname==="/__soot/"||n==="/rn"||/^\/rn\/[^/]+$/i.test(n)||/^\/app\/[^/]+$/i.test(n)||n==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(n)||/^\/__soot\/app\/[^/]+$/i.test(n)}catch{return!1}}function Nt(e){try{let t=new URL(e,"http://sootsim.local");if(t.origin!=="http://sootsim.local")return!1;let n=t.pathname.replace(/\/+$/,"")||"/";return n==="/rn"||/^\/rn\/[^/]+$/i.test(n)||/^\/app\/[^/]+$/i.test(n)||n==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(n)||/^\/__soot\/app\/[^/]+$/i.test(n)}catch{return!1}}function Ft(e,t){let n=new URL(e,"http://sootsim.local"),r=new URL(t),o=Q(r.pathname),s=n.pathname.startsWith("/__soot/")?n.pathname.slice(7):n.pathname;return r.pathname=`${o}${s}`,r.search=n.search,r.hash=n.hash,r.toString()}function jt(e){try{let t=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(t)||/^\/build\/.+/.test(t)}catch{return!1}}async function Gn(e){let t=J(e);return(await fe(t)).bundleUrl}function Ht(e){try{let t=new URL(e.startsWith("http")?e:`http://${e}`),n=t.pathname||"/";if(n!=="/"&&n!==""||t.search||t.hash||!I(t.hostname))return null;let r=t.port?Number(t.port):t.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function fe(e){let t=J(e),n=/^\d+$/.test(t)?Number(t):Ht(t);if(n&&n>0){let r=await Be(n);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return Ye(t)}function Q(e){let t=e.replace(/\/+$/,"")||"/";return t==="/__soot"||t.startsWith("/__soot/")?"/__soot":""}function Wt(e,t){let n=J(e),r=new URL(t),o=Q(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(n)?r.pathname=`${o}/rn/${n}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",n)),r.toString()}function ut(e){let t=J(e);return/^\d+$/.test(t)||/^https?:\/\//i.test(t)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(t)}async function Kt(e,t,n={}){let r=n.resolvedBundle??await fe(e),o=new URL(t),s=Q(o.pathname);o.pathname=`${s}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let i=n.hot===void 0?r.bundleUrl:De(r.bundleUrl,n.hot);return o.searchParams.set("bundle",i),o.toString()}function qt(e){return e.startsWith("~/")?R.join(kt.homedir(),e.slice(2)):R.isAbsolute(e)?e:R.resolve(process.cwd(),e)}function zt(e){let t={},n={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let s=e[o+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=qt(s.slice(i+1).trim());M.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),t[a]={file:l},o++;continue}if(e[o]==="--remap"){let s=e[o+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)),n[s.slice(0,i).trim()]=s.slice(i+1).trim(),o++;continue}}let r={};return Object.keys(t).length>0&&(r.modules=t),Object.keys(n).length>0&&(r.network={remap:n}),r.modules||r.network?r:void 0}async function Vt(e){if(e){let t=await z(e.bundleUrl);if(t)return ce(t,{trustStart:!0})}return ce(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Gt(e){if(M.existsSync(R.join(re(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let t=await Pe.install({version:e,setActive:!1,protectVersions:xe()});console.error(` installed engine runtime ${t.version}`)}function Jt(e,t){if(!t)return e;let n=new URL(e);if(!I(n.hostname))throw new Error(`runtimeVersion ${t} requires a local SootSim host; got ${n.origin}`);return n.hostname=Ne(t),n.toString()}function dt(){return Ee().shellBaseUrl}function Qt(e){return _e(e)?.shellBaseUrl??ke(e)??dt()}async function Yt(e,t){try{let n=new URL(e),r=n.searchParams.get("bundle")||"";if(!r)return e;let o=t?.appDir??await z(r)??void 0,s=je({bundleUrl:r,repoDir:o,exactProjectDir:!!t||!!o});if(s.length===0)return e;let i=await Zt(s);return i.length===0?e:(n.searchParams.set("appFonts",He(i)),n.toString())}catch{return e}}async function Zt(e){let t=await Promise.all(e.map(async r=>{let o=new AbortController,s=setTimeout(()=>o.abort(),1500);try{let i=await fetch(r.url,{method:"HEAD",signal:o.signal});return i.status>=200&&i.status<400?r:null}catch{return null}finally{clearTimeout(s)}})),n=[];for(let r of t)r!==null&&n.push(r);return n}async function Xt(e,t,n={}){if(!e)return new URL(t).toString();if(me(e))return new URL(e).toString();if(Nt(e))return Ft(e,t);let r=Et[e.toLowerCase()];if(r){let o=new URL(t),s=Q(o.pathname);return o.pathname=`${s}${r}`,o.toString()}return ut(e)?Kt(e,t,n):Wt(e,t)}async function en(e,t){try{let n=new URL(e),r=n.searchParams.get("bundle")||"";if(!r)return e;let o=t?.appDir??await z(r)??void 0,s=We({bundleUrl:r,repoDir:o,exactProjectDir:!!t||!!o});return!s||s.imageUrl&&!await tn(s.imageUrl)?e:(n.searchParams.set("appSplash",Ke(s)),n.toString())}catch{return e}}async function tn(e){let t=new AbortController,n=setTimeout(()=>t.abort(),1500);try{let r=await fetch(e,{method:"HEAD",signal:t.signal});return r.status>=200&&r.status<400}catch{return!1}finally{clearTimeout(n)}}async function G(e,t=dt(),n={}){let r=await Xt(e,t,n),o=await en(await Yt(r,n.project),n.project);if(!n.device)return o;let s=new URL(o);return s.searchParams.set("device",n.device),s.toString()}function ot(e,t){let n=e?.url||e?.origin||t;try{let r=new URL(n);return r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("inspectOpen"),r.searchParams.delete("appFonts"),r.searchParams.delete("appSplash"),r.toString()}catch{return t}}async function nn(e,t,n,r={}){let o=new URL(await G(e,t,r));return o.searchParams.set("inspectOpen",n),o.toString()}async function rn(e,t,n,r={}){let o=r.attempts??30,s=r.intervalMs??500,i=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:t,simId:n,simIdSource:"flag"});try{let u=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof u=="number"&&u>i)return{bridge:l,count:u}}catch{}l.close(),await S(s)}return null}function on(e){if(!e)return null;try{let t=new URL(e);if(t.searchParams.has("bundle")){let n=t.searchParams.get("bundle")||"";try{let r=new URL(n),o=r.pathname.length>36?`...${r.pathname.slice(-36)}`:r.pathname;return`bundle ${r.host}${o}`}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 sn(e){let t=e.indexOf(":");if(t<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let n=e.slice(0,t),r=e.slice(t+1),o=r.length>12?`${r.slice(0,8)}\u2026`:r;return n==="TM_SESSION"||n==="CLAUDE_CODE_SESSION_ID"||n==="CODEX_THREAD_ID"?`agent ${o}`:`${n} ${o}`}function Jn(e,t){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
4
+ import{a as I,b as Le,c as Ne}from"./chunk-KGIXNUUM.js";import{m as A}from"./chunk-Y7RQGSZD.js";import{m as Re,p as Ue}from"./chunk-S5U22PVL.js";import{b as Ae,j as qe}from"./chunk-VAFDFOE6.js";import{a as We,b as Ke,d as ze}from"./chunk-WTNKX7QD.js";import{a as Oe,b as L,c as ae,d as le,e as De,f as Be,h as je,i as z,j as He}from"./chunk-Y5O5GK2Q.js";import{a as Fe}from"./chunk-QUAY5AZB.js";import{a as ce}from"./chunk-PHFRI2QF.js";import{b as Ee,c as _e,d as ie,f as Te,g as Me,h as _,i as P,j as T}from"./chunk-EHBHUE6S.js";import{f as Pe}from"./chunk-W4S7GGPG.js";import{b as se,d as Ie}from"./chunk-J6ZKDIRN.js";import{b as ke,g as Ce,h as D,i as x,j as B}from"./chunk-F2WH6XM7.js";import{H as $e,K as oe,M as q,O as xe,l as re}from"./chunk-SKGITCWL.js";import{spawn as Ze,spawnSync as Xe}from"node:child_process";import M from"node:fs";import kt from"node:os";import R from"node:path";import{WebSocket as Ct}from"ws";function Ve(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 yt(e,t){return e?.includes("/one/metro-entry.bundle")?"one":typeof t=="string"&&t?"expo":"unknown"}function Je(e,t,n){return`${e}//${t}:${n}`}function St(e){if(typeof window>"u")return!1;try{let t=new URL(e);return I(t.hostname)&&I(window.location.hostname)&&t.origin!==window.location.origin}catch{return!1}}async function Ge(e,t){let n={...t,cache:t?.cache??"no-store"};return St(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,n):fetch(e,n)}function $t(e){return e==="https:"?443:80}function xt(e){let t=e.pathname||"/";return(t==="/"||t==="")&&!e.search&&!e.hash}async function Pt(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 n=await t.json();if(!Array.isArray(n))return null;let r=n.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return r?{bundleUrl:le(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function Qe(e,t){let n=e.replace(/\/+$/,"");try{if(I(new URL(n).hostname)){let r=await Pt(t);if(r)return r}}catch{}try{let r=await Ge(`${n}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),s=o?.extra?.expoClient||o?.extra||{},i=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:le(i||`${n}${ae}`),port:t,framework:yt(i,s.sdkVersion),projectName:s.name}}}catch{}try{let r=await Ge(`${n}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${n}${ae}`,port:t,framework:"metro"}}catch{}return null}async function It(e){return Qe(Je("http:","localhost",e),e)}async function Ye(e){let t=e.trim();if(/^\d+$/.test(t)){let a=parseInt(t,10),l=await It(a);if(l)return l;throw Ve(`localhost:${a}`)}let n=t.startsWith("http")?t:`http://${t}`,r;try{r=new URL(n)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",s=r.port?parseInt(r.port,10):$t(o),i=Je(o,r.hostname,s);if(xt(r)){let a=await Qe(i,s);if(a)return a;throw Ve(i)}return{bundleUrl:r.toString(),port:s,framework:"unknown"}}var Rt=12e4,et=100,Ut=5e3,tt=1e4,Et={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(t=>setTimeout(t,e))}function nt(e){let t=process.env[e]?.trim();if(!t)return null;let n=Number(t);return Number.isInteger(n)&&n>0?n:null}function _t(){let e=nt("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??nt("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Rt;return{timeoutMs:e,hostTimeoutMs:e+Ut,intervalMs:et,attempts:Math.max(1,Math.ceil(e/et))}}function rt(e){return e==="electron"||e==="playwright"}function ue(e,t){return t==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function Tt(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 J(e){return e.trim()}var ct=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Mt(e){let t=e.trim();if(!t)throw new Error("expected <url-or-route>");return ct.test(t)||t.startsWith("/")?t:`/${t}`}function Ot(e){return e!==null&&typeof e=="object"}function Dt(e){let t=e.trim();return t?t.startsWith("/")?!0:ct.test(t)?!/^https?:\/\//i.test(t):!1:!1}async function Bt(e){if(await V(e,250))return e;let t=oe();if(t&&q(t)&&await V(t.bridgePort,500))return t.bridgePort;if(t&&q(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 At();let n=Lt(["serve","--quiet","--port",String(e)]),r=null;n.once("exit",(s,i)=>{r=String(s??i??"unknown")}),n.unref();let o=Date.now()+tt;for(;Date.now()<o;){let s=oe();if(s&&q(s)&&await V(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 V(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(r)throw new Error(`sootsim bridge exited before becoming ready (exit ${r})`);await S(150)}throw new Error(`sootsim bridge did not start within ${Math.round(tt/1e3)}s`)}async function At(){let e=$e();if(e&&M.existsSync(re(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:t}=await import("./runtime-QWPQ3M7H.js");await t(["install"],{})}function Lt(e){let t=process.argv[1];return t&&M.existsSync(t)?Ze(process.execPath,[t,...e],{detached:!0,stdio:"ignore",env:process.env}):Ze("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function V(e,t){return new Promise(n=>{let r=new Ct(`ws://127.0.0.1:${e}`,{handshakeTimeout:t}),o=!1,s=i=>{if(!o){o=!0;try{r.close()}catch{}n(i)}};r.once("open",()=>s(!0)),r.once("error",()=>s(!1)),setTimeout(()=>s(!1),t)})}function me(e){try{let t=new URL(e),n=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")||n==="/sootsim"||t.pathname==="/__soot"||t.pathname==="/__soot/"||n==="/rn"||/^\/rn\/[^/]+$/i.test(n)||/^\/app\/[^/]+$/i.test(n)||n==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(n)||/^\/__soot\/app\/[^/]+$/i.test(n)}catch{return!1}}function Nt(e){try{let t=new URL(e,"http://sootsim.local");if(t.origin!=="http://sootsim.local")return!1;let n=t.pathname.replace(/\/+$/,"")||"/";return n==="/rn"||/^\/rn\/[^/]+$/i.test(n)||/^\/app\/[^/]+$/i.test(n)||n==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(n)||/^\/__soot\/app\/[^/]+$/i.test(n)}catch{return!1}}function Ft(e,t){let n=new URL(e,"http://sootsim.local"),r=new URL(t),o=Q(r.pathname),s=n.pathname.startsWith("/__soot/")?n.pathname.slice(7):n.pathname;return r.pathname=`${o}${s}`,r.search=n.search,r.hash=n.hash,r.toString()}function jt(e){try{let t=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(t)||/^\/build\/.+/.test(t)}catch{return!1}}async function Gn(e){let t=J(e);return(await fe(t)).bundleUrl}function Ht(e){try{let t=new URL(e.startsWith("http")?e:`http://${e}`),n=t.pathname||"/";if(n!=="/"&&n!==""||t.search||t.hash||!I(t.hostname))return null;let r=t.port?Number(t.port):t.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function fe(e){let t=J(e),n=/^\d+$/.test(t)?Number(t):Ht(t);if(n&&n>0){let r=await Be(n);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return Ye(t)}function Q(e){let t=e.replace(/\/+$/,"")||"/";return t==="/__soot"||t.startsWith("/__soot/")?"/__soot":""}function Wt(e,t){let n=J(e),r=new URL(t),o=Q(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(n)?r.pathname=`${o}/rn/${n}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",n)),r.toString()}function ut(e){let t=J(e);return/^\d+$/.test(t)||/^https?:\/\//i.test(t)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(t)}async function Kt(e,t,n={}){let r=n.resolvedBundle??await fe(e),o=new URL(t),s=Q(o.pathname);o.pathname=`${s}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let i=n.hot===void 0?r.bundleUrl:De(r.bundleUrl,n.hot);return o.searchParams.set("bundle",i),o.toString()}function qt(e){return e.startsWith("~/")?R.join(kt.homedir(),e.slice(2)):R.isAbsolute(e)?e:R.resolve(process.cwd(),e)}function zt(e){let t={},n={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let s=e[o+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=qt(s.slice(i+1).trim());M.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),t[a]={file:l},o++;continue}if(e[o]==="--remap"){let s=e[o+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)),n[s.slice(0,i).trim()]=s.slice(i+1).trim(),o++;continue}}let r={};return Object.keys(t).length>0&&(r.modules=t),Object.keys(n).length>0&&(r.network={remap:n}),r.modules||r.network?r:void 0}async function Vt(e){if(e){let t=await z(e.bundleUrl);if(t)return ce(t,{trustStart:!0})}return ce(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Gt(e){if(M.existsSync(R.join(re(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let t=await Pe.install({version:e,setActive:!1,protectVersions:xe()});console.error(` installed engine runtime ${t.version}`)}function Jt(e,t){if(!t)return e;let n=new URL(e);if(!I(n.hostname))throw new Error(`runtimeVersion ${t} requires a local SootSim host; got ${n.origin}`);return n.hostname=Ne(t),n.toString()}function dt(){return Ee().shellBaseUrl}function Qt(e){return _e(e)?.shellBaseUrl??ke(e)??dt()}async function Yt(e,t){try{let n=new URL(e),r=n.searchParams.get("bundle")||"";if(!r)return e;let o=t?.appDir??await z(r)??void 0,s=je({bundleUrl:r,repoDir:o,exactProjectDir:!!t||!!o});if(s.length===0)return e;let i=await Zt(s);return i.length===0?e:(n.searchParams.set("appFonts",He(i)),n.toString())}catch{return e}}async function Zt(e){let t=await Promise.all(e.map(async r=>{let o=new AbortController,s=setTimeout(()=>o.abort(),1500);try{let i=await fetch(r.url,{method:"HEAD",signal:o.signal});return i.status>=200&&i.status<400?r:null}catch{return null}finally{clearTimeout(s)}})),n=[];for(let r of t)r!==null&&n.push(r);return n}async function Xt(e,t,n={}){if(!e)return new URL(t).toString();if(me(e))return new URL(e).toString();if(Nt(e))return Ft(e,t);let r=Et[e.toLowerCase()];if(r){let o=new URL(t),s=Q(o.pathname);return o.pathname=`${s}${r}`,o.toString()}return ut(e)?Kt(e,t,n):Wt(e,t)}async function en(e,t){try{let n=new URL(e),r=n.searchParams.get("bundle")||"";if(!r)return e;let o=t?.appDir??await z(r)??void 0,s=We({bundleUrl:r,repoDir:o,exactProjectDir:!!t||!!o});return!s||s.imageUrl&&!await tn(s.imageUrl)?e:(n.searchParams.set("appSplash",Ke(s)),n.toString())}catch{return e}}async function tn(e){let t=new AbortController,n=setTimeout(()=>t.abort(),1500);try{let r=await fetch(e,{method:"HEAD",signal:t.signal});return r.status>=200&&r.status<400}catch{return!1}finally{clearTimeout(n)}}async function G(e,t=dt(),n={}){let r=await Xt(e,t,n),o=await en(await Yt(r,n.project),n.project);if(!n.device)return o;let s=new URL(o);return s.searchParams.set("device",n.device),s.toString()}function ot(e,t){let n=e?.url||e?.origin||t;try{let r=new URL(n);return r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("inspectOpen"),r.searchParams.delete("appFonts"),r.searchParams.delete("appSplash"),r.toString()}catch{return t}}async function nn(e,t,n,r={}){let o=new URL(await G(e,t,r));return o.searchParams.set("inspectOpen",n),o.toString()}async function rn(e,t,n,r={}){let o=r.attempts??30,s=r.intervalMs??500,i=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:t,simId:n,simIdSource:"flag"});try{let u=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof u=="number"&&u>i)return{bridge:l,count:u}}catch{}l.close(),await S(s)}return null}function on(e){if(!e)return null;try{let t=new URL(e);if(t.searchParams.has("bundle")){let n=t.searchParams.get("bundle")||"";try{let r=new URL(n),o=r.pathname.length>36?`...${r.pathname.slice(-36)}`:r.pathname;return`bundle ${r.host}${o}`}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 sn(e){let t=e.indexOf(":");if(t<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let n=e.slice(0,t),r=e.slice(t+1),o=r.length>12?`${r.slice(0,8)}\u2026`:r;return n==="TM_SESSION"||n==="CLAUDE_CODE_SESSION_ID"||n==="CODEX_THREAD_ID"?`agent ${o}`:`${n} ${o}`}function Jn(e,t){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
5
5
  `);for(let n of e){let r=n.lockedBy&&n.lockExpiresAt?`locked by ${sn(n.lockedBy)} (${Math.max(0,Math.round((n.lockExpiresAt-Date.now())/1e3))}s)`:"",o=[n.isPrimary?"primary":"",n.id===t?"selected":"",n.readyState,n.userVisible===!1?"hidden":n.userVisible===!0?"visible":"",n.attachedCliCount&&n.attachedCliCount>0?"in use":"",n.userFocused?"focused":"",r].filter(Boolean);console.log(` ${n.id}${o.length?` [${o.join(", ")}]`:""}`);let s=on(n.url);if(s)console.log(` loaded: ${s}`);else if(n.url){let a=n.url.length>96?`${n.url.slice(0,93)}\u2026`:n.url;console.log(` url: ${a}`)}else n.origin&&console.log(` origin: ${n.origin}`);let i=an(n);i&&console.log(` engine: ${i}`),n.title&&console.log(` title: ${n.title}`),n.visibilityState&&n.visibilityState!=="visible"&&console.log(` visibility: ${n.visibilityState}`),console.log(` connected: ${st(Date.now()-n.connectedAt)}`),n.lastActiveAt&&n.lastActiveAt>0&&console.log(` last active: ${st(Date.now()-n.lastActiveAt)}`)}}function an(e){let t=e.url||e.origin||"";if(!t)return null;try{let n=new URL(t).port;return n==="5173"?"dev \u2014 local source (:5173)":n==="3000"?"Contrast app embedded (:3000)":Le()?`dev \u2014 local build (:${n||"?"})`:`runtime \u2014 published engine (:${n||"?"})`}catch{return null}}function st(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 Qn(e,t,n,r={}){let o=r.attempts??30,s=r.intervalMs??500;for(let i=0;i<o;i++){let a=P(e,{commandTimeoutMs:t});try{let u=(await a.listSims()).find(n);if(u)return u}catch{}finally{a.close()}await S(s)}return null}async function ln(e,t,n,r,o={}){let s=o.attempts??30,i=o.intervalMs??500,a=!!r&&Number.isInteger(r)&&r>1,l=()=>a&&r!==void 0&&!pe(r);for(let u=0;u<s;u++){if(l())return{kind:"host-exit"};let c=P(e,{commandTimeoutMs:t});try{let g=(await c.listSims()).find(n);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{c.close()}if(l())return{kind:"host-exit"};await S(i)}return{kind:"timeout"}}async function cn(e,t,n,r={}){let o=r.attempts??20,s=r.intervalMs??250;for(let i=0;i<o;i++){let a=P(e,{commandTimeoutMs:t});try{let u=(await a.listSims()).find(c=>c.id===n);if(!u||u.readyState!=="open")return!0}catch{return!0}finally{a.close()}await S(s)}return!1}function un(e){let t=e.meta;if(!t||t.sootsimHostDriver!=="playwright")return null;let n=Number(t.sootsimHostPid);return!Number.isInteger(n)||n<=1||n===process.pid?null:n}function dn(e){if(!e.connectAckFile)return!1;try{return M.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
6
6
  `,{flag:"w"}),!0}catch{return!1}}function it(e){if(e.diagnosticLogPath)try{let t=M.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!t){console.error(` ${R.basename(e.diagnosticLogPath)} was empty`);return}let n=t.length>4e3?`\u2026
7
7
  ${t.slice(-4e3)}`:t;console.error(` ${R.basename(e.diagnosticLogPath)}:`),console.error(n)}catch(t){let n=t instanceof Error?t.message:String(t);console.error(` failed to read ${R.basename(e.diagnosticLogPath)}: ${n}`)}}function pe(e){try{return process.kill(e,0),!0}catch(t){return t?.code==="EPERM"}}async function mn(e,t=2500){let n=Date.now()+t;for(;Date.now()<n;){if(!pe(e))return!0;await S(100)}return!pe(e)}function pn(e){let t=Xe("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),n=Xe("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(t.status!==0||n.status!==0)return!1;let r=(t.stdout||"").trimEnd(),o=(n.stdout||"").trimEnd();return(o.startsWith(r)?o.slice(r.length):o).includes("SOOTSIM_PW_URL=")}async function de(e,t){let n=new Set(t),r=new Set;for(let o of e){if(!n.has(o.id))continue;let s=un(o);s&&r.add(s)}for(let o of r){if(!pn(o)){console.log(` skipped pid ${o}: not a sootsim playwright host (stale sim record)`);continue}try{process.kill(o,"SIGTERM")}catch{}if(await mn(o)){console.log(` closed playwright host process ${o}`);continue}try{process.kill(o,"SIGKILL"),console.log(` force-closed playwright host process ${o}`)}catch{}}}function Y(e,t){if(t){let o=t.trim(),s=e.find(i=>i.id===o);if(!s)throw new Error(`no sim connected with id ${o}`);return s}let n=e.find(o=>o.isPrimary&&o.readyState==="open");if(n)return n;let r=e.find(o=>o.readyState==="open");if(r)return r;throw new Error("no sim connected")}function at(e,t,n){console.log(` ${n==="current sim"?"loaded":"opened"}: ${e} [${n}]`),console.log(` current sim: ${t.id}`),console.log(JSON.stringify({simId:t.id,url:t.url},null,2))}async function lt(e,t,n){if(n.includes("--no-describe"))return;let r=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await fn(e,t,{stableMs:150,maxMs:400});let o=P(e,{commandTimeoutMs:3e3,simId:t,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await o.send({type:"evaluate",code:Re})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&Ue(s))){let c=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: ${c} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
@@ -0,0 +1,5 @@
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{execFileSync as S,execSync as x}from"node:child_process";var g=new WeakMap,l=new Set,b=!1;function f(){return{platform:process.platform,env:process.env}}function A(e){return S("/bin/ps",["-p",String(e),"-o","command="],{encoding:"utf8"}).trim()}function w(e=f()){return e.platform==="linux"&&e.env.GITHUB_ACTIONS==="true"&&e.env.RUNNER_OS==="Linux"}function L(e){let r=String(e);return/^--disable-gpu(?:=.*)?$/i.test(r)||/^--enable-unsafe-swiftshader(?:=.*)?$/i.test(r)||/^--use-angle=(?:swiftshader|swiftshader-webgl)$/i.test(r)||/^--use-gl=swiftshader$/i.test(r)}function I(e){return e.match(/(?:^|\s)(--disable-gpu(?:=[^\s]+)?|--enable-unsafe-swiftshader(?:=[^\s]+)?|--use-angle=(?:swiftshader|swiftshader-webgl)|--use-gl=swiftshader)(?=\s|$)/i)?.[1]??null}function k(e){return e==="darwin"?"metal":e==="linux"?"vulkan":"default"}function y(e,r=f()){if(w(r))return;let n=I(e);if(n)throw new Error(`[reap-browser] refused software-rendering Chrome process argument ${n}`);let o=k(r.platform),t=e.split(/\s+/);if(!t.includes(`--use-angle=${o}`)||!t.includes("--enable-gpu"))throw new Error(`[reap-browser] Chrome process did not retain the required ${o} GPU arguments`);if(r.platform==="darwin"&&e.includes("/Applications/Google Chrome.app/"))throw new Error("[reap-browser] refused the user's installed Google Chrome; use Playwright channel chromium")}function E(e){if(!e||typeof e!="object")return[];let n=e.gpu;if(!n||typeof n!="object")return[];let o=n,t=[],a=o.auxAttributes;if(a&&typeof a=="object")for(let s of Object.values(a))typeof s=="string"&&t.push(s);let i=o.devices;if(Array.isArray(i)){for(let s of i)if(!(!s||typeof s!="object"))for(let u of Object.values(s))typeof u=="string"&&t.push(u)}return t}function B(e){if(!e||typeof e!="object")return null;let r=e;if(!Array.isArray(r.processInfo))return null;for(let n of r.processInfo){if(!n||typeof n!="object")continue;let o=n;if(o.type==="browser"&&typeof o.id=="number"&&Number.isInteger(o.id)&&o.id>0)return o.id}return null}function N(e,r=f()){if(w(r))return;let o=E(e).join(" | ");if(!o||/swiftshader|llvmpipe|software rasterizer/i.test(o))throw new Error(`[reap-browser] Chrome reported a software renderer${o?`: ${o}`:""}`);if(r.platform==="darwin"&&!/metal/i.test(o))throw new Error(`[reap-browser] Chrome did not report an ANGLE Metal renderer: ${o}`)}function p(e){if(e&&typeof e=="object"){let n=g.get(e);if(n!==void 0)return n}let r=e;if(r&&typeof r.process=="function")try{let n=r.process();if(n&&typeof n.pid=="number"&&n.pid>0)return n.pid}catch{}if(r&&typeof r.browser=="function")try{let n=r.browser();if(n)return p(n)}catch{}return null}function h(e){let r=[];try{r=x(`pgrep -P ${e} || true`).toString().split(`
5
+ `).filter(Boolean)}catch{}for(let n of r)h(Number(n));try{process.kill(e,"SIGKILL")}catch{}}function d(e){let r=e;if(!r||typeof r!="object")return null;if(typeof r.newBrowserCDPSession=="function"||typeof r.process=="function")return r;if(typeof r.browser!="function")return null;try{let n=r.browser();return n?d(n):null}catch{return null}}function m(e,r,n){e&&typeof e=="object"&&g.set(e,n),g.set(r,n),l.add(n),C()}async function $(e){let r=p(e);if(r!==null)return r;let n=d(e);if(!n||typeof n.newBrowserCDPSession!="function")return null;let o=await n.newBrowserCDPSession();try{let t=B(await o.send("SystemInfo.getProcessInfo"));return t===null?null:(m(e,n,t),t)}finally{await o.detach?.()}}async function j(e){let r=p(e);if(r!==null){l.delete(r),h(r);return}let n=e;if(n&&typeof n.close=="function")try{await n.close()}catch{}}async function D(e,r,n,o=A){if(w(r))return;let t=p(e),a=d(e);t!==null&&a&&m(e,a,t),t!==null&&(r.platform==="darwin"||r.platform==="linux")&&y(o(t),r);let i=n?await n(e):e,s=d(i);if(s&&typeof s.newBrowserCDPSession=="function"){let u=await s.newBrowserCDPSession();try{let c=B(await u.send("SystemInfo.getProcessInfo"));if(c===null)throw new Error("[reap-browser] Chrome did not report its browser process id");m(e,s,c),i&&typeof i=="object"&&g.set(i,c),(r.platform==="darwin"||r.platform==="linux")&&y(o(c),r),N(await u.send("SystemInfo.getInfo"),r);return}finally{await u.detach?.()}}throw new Error("[reap-browser] could not validate the launched Chrome GPU renderer")}var G=!1;function C(){if(b)return;b=!0;let e=()=>{for(let r of l)h(r)};G||(process.on("SIGTERM",()=>{e(),process.exit(0)}),process.on("SIGINT",()=>{e(),process.exit(0)})),process.on("exit",e)}async function R(e){let r=await e(),n=p(r);if(n===null)try{n=await $(r)}catch{n=null}let o=new Set;n!=null&&(o.add(n),l.add(n),C());let t=d(r)??r;if(typeof t.on=="function"){let i=typeof t.newBrowserCDPSession=="function"?"disconnected":"close";t.on(i,()=>{for(let s of o)l.delete(s);o.clear()})}return{browser:r,reapNow:()=>{for(let i of o)h(i),l.delete(i);o.clear()}}}async function T(e){let{browser:r}=await R(e);return r}function W(e=process.platform){return[`--use-angle=${k(e)}`,"--enable-gpu","--enable-gpu-rasterization","--enable-zero-copy","--ignore-gpu-blocklist"]}function O(e={},r=f()){let n=Array.isArray(e.args)?e.args:[],o=n.find(L);if(o!==void 0)throw new Error(`[reap-browser] refused software-rendering Chrome launch argument ${String(o)}`);if(e.executablePath!==void 0)throw new Error("[reap-browser] executablePath bypasses Playwright Chrome for Testing and is not allowed");if(e.ignoreDefaultArgs===!0)throw new Error("[reap-browser] ignoreDefaultArgs=true bypasses required Chrome launch defaults");let t=new Set(["--enable-gpu","--enable-gpu-rasterization","--enable-zero-copy","--ignore-gpu-blocklist"]),a=n.filter(u=>{let c=String(u);return!t.has(c)&&!c.startsWith("--use-angle=")}),i=Array.isArray(e.ignoreDefaultArgs)?e.ignoreDefaultArgs:[],s=[...new Set([...i,"--disable-gpu","--enable-unsafe-swiftshader"])];return{...e,channel:"chromium",args:[...a,...W(r.platform)],ignoreDefaultArgs:s}}function v(e,r,n,o={}){return async()=>{let t=o.runtime??f();if(w(t))return e(P(r,t));let a=P(r,t),i;try{i=await e(a)}catch(s){let u=s instanceof Error?s.message:String(s);throw/not found at|not installed|Chromium distribution|Executable doesn't exist|No such file/i.test(u)?new Error("[reap-browser] Playwright Chrome for Testing is required for local GPU browser work. Run `bunx playwright install chromium`.",{cause:s}):s}try{await D(i,t,n,o.processCommand)}catch(s){throw await j(i),s}return i}}function z(e){if(e.ignoreDefaultArgs===!0)throw new Error("[reap-browser] ignoreDefaultArgs=true bypasses required Chrome launch defaults");let n=(Array.isArray(e.args)?e.args.map(String):[]).filter(t=>!t.startsWith("--use-angle=")&&t!=="--enable-gpu"&&t!=="--enable-gpu-rasterization"&&t!=="--enable-zero-copy"&&t!=="--ignore-gpu-blocklist"&&!/^--enable-unsafe-webgpu(?:=.*)?$/i.test(t)&&!/^--enable-unsafe-swiftshader(?:=.*)?$/i.test(t)),o={...e,args:[...n,"--use-angle=swiftshader","--enable-unsafe-swiftshader"]};return delete o.channel,delete o.executablePath,o}function P(e={},r=f()){return w(r)?z(e):O(e,r)}async function q(e,r={},n,o={}){return T(v(e,r,n,o))}async function J(e,r={},n,o={}){return R(v(e,r,n,o))}export{q as a,J as b};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as Dt,c as Bt}from"./chunk-QPZVGHRV.js";import{a as de}from"./chunk-63JWRDM6.js";import{a as Pt,b as _t}from"./chunk-YRRUK3EK.js";import{j as At}from"./chunk-S7WXPIOY.js";import{a as oe,b as D,c as A,d as Te,e as ae,f as X,g as pe,h as ye,i as Ot,j as Rt,k as Me,l as Et}from"./chunk-YZPSUNTO.js";import{A as wt,B as $t,C as xt,F as St,H as vt,J as ue,K as kt,Q as Le,a as ke,b as rt,c as it,d as at,e as lt,f as ct,g as dt,h as ut,i as pt,j as mt,k as Be,l as Ce,r as je,s as ft,t as gt,u as ge,v as yt,w as Ie,x as qe,y as ht,z as bt}from"./chunk-4XMPRQGE.js";import{a as nt,f as It,h as Tt,j as Mt,k as Nt,l as Ft,m as ce}from"./chunk-7RJEULWN.js";import{a as ot}from"./chunk-ZS7OXPHR.js";import{a as Q}from"./chunk-M2LP2VYQ.js";import{f as st}from"./chunk-NLTJE335.js";import{c as Ae,e as De}from"./chunk-LKAAQBT6.js";function We(e){return`(async () => {
4
+ import{b as Dt,c as Bt}from"./chunk-CUVLXG63.js";import{a as de}from"./chunk-GEUU2WIL.js";import{a as Pt,b as _t}from"./chunk-75YOUNTE.js";import{j as At}from"./chunk-7W63IKAP.js";import{a as oe,b as D,c as A,d as Te,e as ae,f as X,g as pe,h as ye,i as Ot,j as Rt,k as Me,l as Et}from"./chunk-Y7RQGSZD.js";import{A as wt,B as $t,C as xt,F as St,H as vt,J as ue,K as kt,Q as Le,a as ke,b as rt,c as it,d as at,e as lt,f as ct,g as dt,h as ut,i as pt,j as mt,k as Be,l as Ce,r as je,s as ft,t as gt,u as ge,v as yt,w as Ie,x as qe,y as ht,z as bt}from"./chunk-S5U22PVL.js";import{a as nt,f as It,h as Tt,j as Mt,k as Nt,l as Ft,m as ce}from"./chunk-EHBHUE6S.js";import{a as ot}from"./chunk-YS7YDOGW.js";import{a as Q}from"./chunk-VJMY2MX6.js";import{f as st}from"./chunk-F2WH6XM7.js";import{c as Ae,e as De}from"./chunk-6QZY6YO2.js";function We(e){return`(async () => {
5
5
  const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
6
6
  if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
7
7
  await bridge.reloadExternalApp({ resetStorage: ${e?"true":"false"} })
@@ -567,7 +567,7 @@ import{b as Dt,c as Bt}from"./chunk-QPZVGHRV.js";import{a as de}from"./chunk-63J
567
567
  `);console.log(`${o??""}
568
568
 
569
569
  ${n}
570
- `),process.exit(0)}let F=c.wsPort,N=c.simId,j=c.simIdSource,R=c.commandTimeoutMs;if(p==="get"&&f==="diagnosis"){let x=i.indexOf("diagnosis"),o=x>=0?[...i.slice(0,x),...i.slice(x+1)]:i,{runDiagnose:n}=await import("./diagnose-CZGCKNVY.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(p==="do"&&f==="scan"){let{runCamera:x}=await import("./camera-4YUYYYJI.js");await x(i,{port:t.port});return}if(f==="list"&&i.some(x=>x==="--drivers"||x==="-D")){let{buildDriverListRows:x}=await import("./drivers-NEB27ZKQ.js"),o=x();console.log(` available drivers (${o.length}):
570
+ `),process.exit(0)}let F=c.wsPort,N=c.simId,j=c.simIdSource,R=c.commandTimeoutMs;if(p==="get"&&f==="diagnosis"){let x=i.indexOf("diagnosis"),o=x>=0?[...i.slice(0,x),...i.slice(x+1)]:i,{runDiagnose:n}=await import("./diagnose-HMUQWQOK.js"),r=await n(["recent",...o],t);process.exitCode=r;return}if(p==="do"&&f==="scan"){let{runCamera:x}=await import("./camera-5JUNQPSI.js");await x(i,{port:t.port});return}if(f==="list"&&i.some(x=>x==="--drivers"||x==="-D")){let{buildDriverListRows:x}=await import("./drivers-INII4IWR.js"),o=x();console.log(` available drivers (${o.length}):
571
571
  `);let n=Math.max(...o.map(a=>a.id.length),6),r=Math.max(...o.map(a=>a.kind.length),4);for(let a of o){let u=a.available?"\u2713":"\u2717",m=a.id.padEnd(n),g=a.kind.padEnd(r);console.log(` ${u} ${m} ${g} ${a.description}`),a.available&&a.detail?console.log(` ${a.detail}`):!a.available&&a.reason&&console.log(` unavailable: ${a.reason}`)}return}let d=Mt(c),q=N||"default",E=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","storage-clear","list","wait","sleep"]),_=200;function J(x){let o=x.replace(/\s+/g," ").trim();if(!o)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(o)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(x)?.[1]?.trim(),a=/<body[^>]*>([\s\S]*?)<\//i.exec(x)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=r||a||"html error page";return`<html ${x.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return o.length<=_?o:`${o.slice(0,_)}\u2026 (+${o.length-_} more bytes)`}function U(x){let o=x.displayUrl||x.url;return x.status!=null?`${x.method} ${o} -> ${x.status}${x.statusText?` ${x.statusText}`:""}`:x.error?`${x.method} ${o} -> ${x.error}`:`${x.method} ${o}`}async function I(x){let o=fe()?400:200;try{let{settled:n,elapsed:r}=await se({bridge:x,maxMs:o,pollMs:32,stablePolls:2});n||process.stderr.write(` \u26A0 auto-wait timed out after ${r??o}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
572
572
  `)}catch{}}function O(x,o){if(o.result?.reason==="offscreen"){let{x:n,y:r,screen:a}=o.result;console.error(` tap failed: ${x} resolved to (${Math.round(n)},${Math.round(r)}), outside the ${a?.width}x${a?.height} screen`),console.error(" the node exists but is scrolled out of view \u2014 scroll it on-screen first (sootsim do scroll / swipe), then tap.");return}console.error(` tap failed: ${x} stayed visible but did not receive a hittable press after ${o.attempts} attempt${o.attempts===1?"":"s"}`),o.result&&console.error(` last result: ${JSON.stringify(o.result)}`)}async function H(){try{return await d.send({type:"evaluate",code:`(() => ({
573
573
  console: ${Ie},
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  function m(){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 t(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 p(e,n,s){let r=[];try{r=await e.listSims()}catch{}if(console.error(""),r.length===0){t(n);return}console.error(` no sim with id "${s}" is connected to the bridge on port ${n}.`),console.error(""),console.error(" connected sims:");for(let o of r){let i=[o.isPrimary?"primary":null,o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":null,o.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${o.id} (${i})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}export{m as a,t as b,p as c};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{e as A,h as T,j as E}from"./chunk-NLTJE335.js";import{K as I,L as B,M as w,N as P,g as F}from"./chunk-XBBNRESY.js";var b="http://localhost:5173/";import{WebSocket as $}from"ws";var C=null;function M(){let i=F();if(C?.homeDir===i)return C.world;let r=_();return C={homeDir:i,world:r},r}function _(){let i=B();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=I();return r&&w(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function U(i){let r=B();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=I();return e&&w(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function Q(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=B();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let o=I();return o&&w(o)&&(o.runtimePort===r||o.bridgePort===r)?o.bridgePort:null}function D(){return M().bridgePort}function z(i,r){let e=U(i),o=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${o} :${i} (${t?`shell ${t}, `:""}${l})
4
+ import{e as A,h as T,j as E}from"./chunk-F2WH6XM7.js";import{K as I,L as B,M as w,N as P,g as F}from"./chunk-SKGITCWL.js";var b="http://localhost:5173/";import{WebSocket as $}from"ws";var C=null;function M(){let i=F();if(C?.homeDir===i)return C.world;let r=_();return C={homeDir:i,world:r},r}function _(){let i=B();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=I();return r&&w(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function U(i){let r=B();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=I();return e&&w(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function Q(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=B();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let o=I();return o&&w(o)&&(o.runtimePort===r||o.bridgePort===r)?o.bridgePort:null}function D(){return M().bridgePort}function z(i,r){let e=U(i),o=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${o} :${i} (${t?`shell ${t}, `:""}${l})
5
5
  `)}var L=class extends Error{lock;constructor(r,e){super(r),this.name="BridgeSimLockedError",this.lock=e}};function N(i){return i==="flag"?"via --sim":i==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function X(i,r={}){let e=new Set,o=r.port??D(),l=r.commandTimeoutMs??15e3,t,u="none",v=new Set(r.stripBooleanFlags??[]),y=new Set(r.stripValueFlags??[]);for(let n=0;n<i.length;n++){let a=i[n];if(a==="--port"||a==="-p"){e.add(n),n+1<i.length&&(e.add(n+1),o=Number(i[n+1])),n++;continue}if(a.startsWith("--port=")){e.add(n),o=Number(a.slice(7));continue}if(a==="--timeout"){e.add(n),n+1<i.length&&(e.add(n+1),l=Number(i[n+1])),n++;continue}if(a==="--sim"||a==="--session"||a==="--tab"){e.add(n),n+1<i.length&&(e.add(n+1),t=i[n+1]?.trim()||void 0,u="flag"),n++;continue}let s=a.startsWith("--sim=")?a.slice(6):a.startsWith("--session=")?a.slice(10):a.startsWith("--tab=")?a.slice(6):void 0;if(s!==void 0){e.add(n),t=s.trim()||void 0,u="flag";continue}if(v.has(a)){e.add(n);continue}y.has(a)&&(e.add(n),n+1<i.length&&e.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,u="saved")}return{positional:i.filter((n,a)=>!e.has(a)),wsPort:o,simId:t,simIdSource:u,commandTimeoutMs:l}}function R(i,r={}){let e=1,o=r.commandTimeoutMs??15e3,l=new Map,t=new $(`ws://localhost:${i}`),u=A(),v=new Promise((s,d)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let m=c.message?`: ${c.message}`:"";d(new Error(`could not connect to ws://localhost:${i}${m}`))})}),y=!1,n=!1;function a(s,d){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=d??"primary",m=N(d?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
6
6
  `)}return t.on("message",s=>{let d;try{d=JSON.parse(s.toString())}catch{return}if(d.id===0)return;let c=l.get(d.id);c&&(l.delete(d.id),d._otherCliCount>0&&!y&&(y=!0,process.stderr.write(`
7
7
  \u26A0 ${d._otherCliCount} other CLI identity/identities are driving this sim
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as u,b as c}from"./chunk-IS5OOCN5.js";var w="http://localhost:7668/";var _=5173;var I=2e3;function y(t){let r=t-7668;return r<0||r>I?null:`http://localhost:${_+r}/`}var A=4001,C="sootsim close";import{existsSync as T,mkdirSync as O,readFileSync as d,rmSync as l,writeFileSync as P}from"fs";import{tmpdir as E}from"os";import{dirname as g,join as R,resolve as b}from"path";var p=1,S="SOOTSIM_CLI_CURRENT_SIM_PATH",h=["SOOTSIM_CLI_IDENTITY","TM_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],m=/^(?:tmux|screen)|^tm$/i;function a(t,r=20){let e=t,o=u(t);if(!o||o<=1){let n=c(t);return t>1&&n&&!m.test(n)?t:null}for(let n=0;n<r;n++){let s=c(o);if(s&&m.test(s))return e;let i=u(o);if(!i||i<=1)return s?o:e;e=o,o=i}return o}function D(){for(let r of h){let e=process.env[r];if(e&&e.trim())return{key:`${r}:${e.trim()}`,source:r,stable:!0}}let t=a(process.ppid);return t&&t>1?{key:`gppid-${t}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function x(){return D().key}function H(){return a(process.ppid)}function f(){if(process.env[S])return b(process.env[S]);let t=x();return R(E(),`sootsim-current-sim-${t}.json`)}function U(){let t=f();if(!T(t))return null;try{let r=JSON.parse(d(t,"utf8"));return r.version!==p||typeof r.simId!="string"||!r.simId.trim()||typeof r.updatedAt!="string"?(l(t,{force:!0}),null):{version:p,simId:r.simId.trim(),updatedAt:r.updatedAt}}catch{return l(t,{force:!0}),null}}function v(){return U()?.simId||null}function F(t){let r=t.trim();if(!r)return;let e=f();O(g(e),{recursive:!0}),P(e,JSON.stringify({version:p,simId:r,updatedAt:new Date().toISOString()},null,2)+`
4
+ import{a as u,b as c}from"./chunk-VNS6KYRJ.js";var w="http://localhost:7668/";var _=5173;var I=2e3;function y(t){let r=t-7668;return r<0||r>I?null:`http://localhost:${_+r}/`}var A=4001,C="sootsim close";import{existsSync as T,mkdirSync as O,readFileSync as d,rmSync as l,writeFileSync as P}from"fs";import{tmpdir as E}from"os";import{dirname as g,join as R,resolve as b}from"path";var p=1,S="SOOTSIM_CLI_CURRENT_SIM_PATH",h=["SOOTSIM_CLI_IDENTITY","TM_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],m=/^(?:tmux|screen)|^tm$/i;function a(t,r=20){let e=t,o=u(t);if(!o||o<=1){let n=c(t);return t>1&&n&&!m.test(n)?t:null}for(let n=0;n<r;n++){let s=c(o);if(s&&m.test(s))return e;let i=u(o);if(!i||i<=1)return s?o:e;e=o,o=i}return o}function D(){for(let r of h){let e=process.env[r];if(e&&e.trim())return{key:`${r}:${e.trim()}`,source:r,stable:!0}}let t=a(process.ppid);return t&&t>1?{key:`gppid-${t}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function x(){return D().key}function H(){return a(process.ppid)}function f(){if(process.env[S])return b(process.env[S]);let t=x();return R(E(),`sootsim-current-sim-${t}.json`)}function U(){let t=f();if(!T(t))return null;try{let r=JSON.parse(d(t,"utf8"));return r.version!==p||typeof r.simId!="string"||!r.simId.trim()||typeof r.updatedAt!="string"?(l(t,{force:!0}),null):{version:p,simId:r.simId.trim(),updatedAt:r.updatedAt}}catch{return l(t,{force:!0}),null}}function v(){return U()?.simId||null}function F(t){let r=t.trim();if(!r)return;let e=f();O(g(e),{recursive:!0}),P(e,JSON.stringify({version:p,simId:r,updatedAt:new Date().toISOString()},null,2)+`
5
5
  `)}function V(){l(f(),{force:!0})}export{w as a,y as b,A as c,C as d,D as e,x as f,H as g,v as h,F as i,V as j};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as ms}from"./chunk-XKAXZ4DS.js";var hs={};ms(hs,{Alias:()=>ee,CST:()=>cs,Composer:()=>be,Document:()=>se,Lexer:()=>Be,LineCounter:()=>De,Pair:()=>v,Parser:()=>we,Scalar:()=>y,Schema:()=>ve,YAMLError:()=>_e,YAMLMap:()=>$,YAMLParseError:()=>R,YAMLSeq:()=>B,YAMLWarning:()=>Pe,isAlias:()=>F,isCollection:()=>L,isDocument:()=>x,isMap:()=>U,isNode:()=>I,isPair:()=>T,isScalar:()=>E,isSeq:()=>V,parse:()=>un,parseAllDocuments:()=>fn,parseDocument:()=>us,stringify:()=>hn,visit:()=>Q,visitAsync:()=>je});var tt=Symbol.for("yaml.alias"),st=Symbol.for("yaml.document"),Y=Symbol.for("yaml.map"),qt=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),re=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),F=s=>!!s&&typeof s=="object"&&s[K]===tt,x=s=>!!s&&typeof s=="object"&&s[K]===st,U=s=>!!s&&typeof s=="object"&&s[K]===Y,T=s=>!!s&&typeof s=="object"&&s[K]===qt,E=s=>!!s&&typeof s=="object"&&s[K]===q,V=s=>!!s&&typeof s=="object"&&s[K]===re;function L(s){if(s&&typeof s=="object")switch(s[K]){case Y:case re:return!0}return!1}function I(s){if(s&&typeof s=="object")switch(s[K]){case tt:case Y:case q:case re:return!0}return!1}var nt=s=>(E(s)||L(s))&&!!s.anchor;var j=Symbol("break visit"),ds=Symbol("skip children"),z=Symbol("remove node");function Q(s,e){let t=gs(e);x(s)?ke(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):ke(null,s,t,Object.freeze([]))}Q.BREAK=j;Q.SKIP=ds;Q.REMOVE=z;function ke(s,e,t,n){let i=ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),ke(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=ke(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=ke("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=ke("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}async function je(s,e){let t=gs(e);x(s)?await Ne(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):await Ne(null,s,t,Object.freeze([]))}je.BREAK=j;je.SKIP=ds;je.REMOVE=z;async function Ne(s,e,t,n){let i=await ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),Ne(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await Ne(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=await Ne("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=await Ne("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}function gs(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function ys(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(U(e))return t.Map?.(s,e,n);if(V(e))return t.Seq?.(s,e,n);if(T(e))return t.Pair?.(s,e,n);if(E(e))return t.Scalar?.(s,e,n);if(F(e))return t.Alias?.(s,e,n)}function bs(s,e,t){let n=e[e.length-1];if(L(n))n.items[s]=t;else if(T(n))s==="key"?n.key=t:n.value=t;else if(x(n))n.contents=t;else{let i=F(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var pn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mn=s=>s.replace(/[!,[\]{}]/g,e=>pn[e]),Z=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+mn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&I(e.contents)){let r={};Q(e.contents,(o,l)=>{I(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
4
+ import{c as ms}from"./chunk-YOIHAHR5.js";var hs={};ms(hs,{Alias:()=>ee,CST:()=>cs,Composer:()=>be,Document:()=>se,Lexer:()=>Be,LineCounter:()=>De,Pair:()=>v,Parser:()=>we,Scalar:()=>y,Schema:()=>ve,YAMLError:()=>_e,YAMLMap:()=>$,YAMLParseError:()=>R,YAMLSeq:()=>B,YAMLWarning:()=>Pe,isAlias:()=>F,isCollection:()=>L,isDocument:()=>x,isMap:()=>U,isNode:()=>I,isPair:()=>T,isScalar:()=>E,isSeq:()=>V,parse:()=>un,parseAllDocuments:()=>fn,parseDocument:()=>us,stringify:()=>hn,visit:()=>Q,visitAsync:()=>je});var tt=Symbol.for("yaml.alias"),st=Symbol.for("yaml.document"),Y=Symbol.for("yaml.map"),qt=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),re=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),F=s=>!!s&&typeof s=="object"&&s[K]===tt,x=s=>!!s&&typeof s=="object"&&s[K]===st,U=s=>!!s&&typeof s=="object"&&s[K]===Y,T=s=>!!s&&typeof s=="object"&&s[K]===qt,E=s=>!!s&&typeof s=="object"&&s[K]===q,V=s=>!!s&&typeof s=="object"&&s[K]===re;function L(s){if(s&&typeof s=="object")switch(s[K]){case Y:case re:return!0}return!1}function I(s){if(s&&typeof s=="object")switch(s[K]){case tt:case Y:case q:case re:return!0}return!1}var nt=s=>(E(s)||L(s))&&!!s.anchor;var j=Symbol("break visit"),ds=Symbol("skip children"),z=Symbol("remove node");function Q(s,e){let t=gs(e);x(s)?ke(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):ke(null,s,t,Object.freeze([]))}Q.BREAK=j;Q.SKIP=ds;Q.REMOVE=z;function ke(s,e,t,n){let i=ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),ke(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=ke(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=ke("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=ke("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}async function je(s,e){let t=gs(e);x(s)?await Ne(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):await Ne(null,s,t,Object.freeze([]))}je.BREAK=j;je.SKIP=ds;je.REMOVE=z;async function Ne(s,e,t,n){let i=await ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),Ne(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await Ne(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=await Ne("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=await Ne("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}function gs(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function ys(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(U(e))return t.Map?.(s,e,n);if(V(e))return t.Seq?.(s,e,n);if(T(e))return t.Pair?.(s,e,n);if(E(e))return t.Scalar?.(s,e,n);if(F(e))return t.Alias?.(s,e,n)}function bs(s,e,t){let n=e[e.length-1];if(L(n))n.items[s]=t;else if(T(n))s==="key"?n.key=t:n.value=t;else if(x(n))n.contents=t;else{let i=F(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var pn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mn=s=>s.replace(/[!,[\]{}]/g,e=>pn[e]),Z=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+mn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&I(e.contents)){let r={};Q(e.contents,(o,l)=>{I(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
5
5
  `)}};Z.defaultYaml={explicit:!1,version:"1.2"};Z.defaultTags={"!!":"tag:yaml.org,2002:"};function it(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Rt(s){let e=new Set;return Q(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Ft(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function ws(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Rt(s));let o=Ft(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(E(o.node)||L(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:n}}function fe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],l=fe(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=fe(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=fe(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=fe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function M(s,e,t){if(Array.isArray(s))return s.map((n,i)=>M(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!nt(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}var ue=class{constructor(e){Object.defineProperty(this,K,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!x(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=M(this,"",o);if(typeof i=="function")for(let{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?fe(r,{"":l},"",l):l}};var ee=class extends ue{constructor(e){super(tt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Q(e,{Node:(r,o)=>{(F(o)||nt(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=n.get(o);if(l||(M(o,null,t),l=n.get(o)),l?.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=rt(i,o,n)),l.count*l.aliasCount>r)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(it(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function rt(s,e,t){if(F(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(L(e)){let n=0;for(let i of e.items){let r=rt(s,i,t);r>n&&(n=r)}return n}else if(T(e)){let n=rt(s,e.key,t),i=rt(s,e.value,t);return Math.max(n,i)}return 1}var ot=s=>!s||typeof s!="function"&&typeof s!="object",y=class extends ue{constructor(e){super(q),this.value=e}toJSON(e,t){return t?.keep?this.value:M(this.value,e,t)}toString(){return String(this.value)}};y.BLOCK_FOLDED="BLOCK_FOLDED";y.BLOCK_LITERAL="BLOCK_LITERAL";y.PLAIN="PLAIN";y.QUOTE_DOUBLE="QUOTE_DOUBLE";y.QUOTE_SINGLE="QUOTE_SINGLE";var dn="tag:yaml.org,2002:";function gn(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function oe(s,e,t){if(x(s)&&(s=s.contents),I(s))return s;if(T(s)){let f=t.schema[Y].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t,a;if(n&&s&&typeof s=="object"){if(a=l.get(s),a)return a.anchor??(a.anchor=i(s)),new ee(a.anchor);a={anchor:null,node:null},l.set(s,a)}e?.startsWith("!!")&&(e=dn+e.slice(2));let c=gn(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new y(s);return a&&(a.node=f),f}c=s instanceof Map?o[Y]:Symbol.iterator in Object(s)?o[re]:o[Y]}r&&(r(c),delete t.onTagObj);let p=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new y(s);return e?p.tag=e:c.default||(p.tag=c.tag),a&&(a.node=p),p}function qe(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return oe(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Ae=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,Oe=class extends ue{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>I(n)||T(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ae(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(L(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(L(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&E(r)?r.value:r:L(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!T(t))return!1;let n=t.value;return n==null||e&&E(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return L(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(L(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};var Ss=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function J(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var te=(s,e,t)=>s.endsWith(`
6
6
  `)?J(t,e):t.includes(`
7
7
  `)?`
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{H as t,L as n,N as l,j as r}from"./chunk-XBBNRESY.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};
4
+ import{H as t,L as n,N as l,j as r}from"./chunk-SKGITCWL.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,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{e as p}from"./chunk-GQVBLBUJ.js";import{a as c,b as l}from"./chunk-C4O4VRN5.js";import{a}from"./chunk-2KSLGBIU.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
4
+ import{e as p}from"./chunk-5V5MOREL.js";import{a as c,b as l}from"./chunk-ZHPLBK34.js";import{a}from"./chunk-ZB3UAYJ4.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
5
5
  sootsim ${e} needs auth before it can check recording access.
6
6
 
7
7
  pick one:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  function i(t,o,a,c){return{width:3,ringToggle:{side:"left",top:t[0],height:t[1]},volumeUp:{side:"left",top:o[0],height:o[1]},volumeDown:{side:"left",top:a[0],height:a[1]},lock:{side:"right",top:c[0],height:c[1]}}}var E={width:2.5,lock:{side:"right",top:188.7,height:68.1},ringToggle:{side:"left",top:113.2,height:36},volumeUp:{side:"left",top:188.2,height:68.1},volumeDown:{side:"left",top:269,height:68.1}},y={width:3,lock:{side:"right",top:671/2.625,height:163/2.625},ringToggle:{side:"left",top:-1e3,height:0},volumeUp:{side:"right",top:971/2.625,height:165/2.625},volumeDown:{side:"right",top:1136/2.625,height:166/2.625}},A={width:3,lock:{side:"right",top:248,height:72},ringToggle:{side:"left",top:-1e3,height:0},volumeUp:{side:"right",top:144,height:62},volumeDown:{side:"right",top:216,height:62}},s=24,d="17",u=37,T=1080/2.625,O=2400/2.625,h=132/2.625;function r(t){return{top:t,right:t,bottom:t,left:t}}function N(t){let o=(t.frameInsets.top+t.frameInsets.right+t.frameInsets.bottom+t.frameInsets.left)/4,a=Math.max(Math.abs(t.frameInsets.top-o),Math.abs(t.frameInsets.right-o),Math.abs(t.frameInsets.bottom-o),Math.abs(t.frameInsets.left-o));return{frameRadius:t.cornerRadius+o,frameRadiusApproximationError:a,screenRadius:t.cornerRadius}}function _(t){return{...N(t),frameHeight:t.frameInsets.top+t.height+t.frameInsets.bottom,frameWidth:t.frameInsets.left+t.width+t.frameInsets.right,screenBottomInset:t.frameInsets.bottom,screenLeft:t.frameInsets.left,screenRightInset:t.frameInsets.right,screenTop:t.frameInsets.top}}function n(t){return{...t,platform:"ios",navigationBarHeight:0,navigationBarMode:t.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:t.dynamicIsland?t.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:t.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:t.name}}var C={"canvas-workspace":n({name:"Canvas Workspace",width:1440,height:900,scale:1,statusBarHeight:0,homeIndicatorHeight:0,cornerRadius:0,continuousCornerRadius:0,frameInsets:r(16),dynamicIsland:null,safeAreaInsets:{top:0,bottom:0,left:0,right:0},iosVersion:"26.4",physicalPPI:110,hardwareButtons:i([185.8,41.7],[258.2,67.6],[344,67.6],[281.5,106.9]),experimental:!0}),"iphone-se":n({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,continuousCornerRadius:0,frameInsets:r(28.7),dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:E}),"iphone-14":n({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:46.2,continuousCornerRadius:67.462,frameInsets:r(19.5),dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:i([141.7,29.7],[205.9,69.6],[289.5,69.6],[228.9,114.5])}),"iphone-15":n({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:73.402,frameInsets:r(18.2),dynamicIsland:{width:126,height:37.3,top:14.1},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:i([171.7,32],[235.8,65.3],[320.5,65.3],[280.6,105.2])}),"iphone-15-plus":n({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:74.654,frameInsets:r(17.3),dynamicIsland:{width:126,height:37.3,top:11.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:i([172.1,33],[236.1,66.6],[321.2,66.6],[281,106.8])}),"iphone-15-pro":n({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:73.402,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:13.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-15-pro-max":n({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:74.654,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:13.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:i([173.3,32.2],[253.4,61.7],[343.3,61.7],[268.5,98.5])}),"iphone-16":n({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:73.402,frameInsets:r(15.3),dynamicIsland:{width:126,height:37.3,top:11},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-16-plus":n({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:74.654,frameInsets:r(15.3),dynamicIsland:{width:126,height:37.3,top:11.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([173.3,32.2],[253.4,61.7],[343.3,61.7],[268.5,98.5])}),"iphone-16-pro":n({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:61,continuousCornerRadius:84.661,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:13.5},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-16-pro-max":n({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:61.3,continuousCornerRadius:85.163,frameInsets:r(15.4),dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([178.8,32.2],[266.8,61.8],[352.7,61.8],[292.2,98.3])}),"iphone-17":n({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:61,continuousCornerRadius:84.661,frameInsets:r(15.3),dynamicIsland:{width:126,height:37.3,top:14},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-17-air":n({name:"iPhone Air",width:420,height:912,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:64.6,continuousCornerRadius:88.313,frameInsets:r(10.7),dynamicIsland:{width:126,height:38,top:20},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([178.8,32.2],[266.8,61.8],[352.7,61.8],[292.2,98.3])}),"iphone-17-pro":n({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:61,continuousCornerRadius:84.661,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-17-pro-max":n({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:61.3,continuousCornerRadius:85.163,frameInsets:r(15.4),dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([178.8,32.2],[266.8,61.8],[352.7,61.8],[292.2,98.3])}),"pixel-8":{platform:"android",name:"Pixel 8",width:T,height:O,scale:2.625,statusBarHeight:h,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:h,bottom:0,left:0,right:0},cornerRadius:39,continuousCornerRadius:39,frameInsets:{top:55/2.625,right:50/2.625,bottom:58/2.625,left:49/2.625},dynamicIsland:null,cameraCutout:{diameter:72.5/2.625},safeAreaInsets:{top:h,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:y},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:T,height:O,scale:2.625,statusBarHeight:h,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:h,bottom:0,left:0,right:0},cornerRadius:39,continuousCornerRadius:39,frameInsets:{top:55/2.625,right:50/2.625,bottom:58/2.625,left:49/2.625},dynamicIsland:null,cameraCutout:{diameter:72.5/2.625},safeAreaInsets:{top:h,bottom:48,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:y},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,continuousCornerRadius:41,frameInsets:r(12),dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:y},"pixel-10":{platform:"android",name:"Pixel 10",width:360,height:808,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:40,continuousCornerRadius:40,frameInsets:r(18),dynamicIsland:null,cameraCutout:{diameter:26},safeAreaInsets:{top:40,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 10",physicalPPI:422,hardwareButtons:y},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,continuousCornerRadius:36,frameInsets:r(8),dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:A},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:832,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,continuousCornerRadius:24,frameInsets:r(9),dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:A}},R="iphone-17-pro";function z(t){return C[t]}function v(){return Object.keys(C)}function G(){return v().filter(t=>!C[t].experimental)}var D=["off","soft","full"];function B(t){return t==="off"||t==="soft"||t==="full"}var S={"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"},"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"}},w={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"}]}},K={color:"#25c3ec",blur:120,spread:52,opacity:.34},Y="iphone-17-pro";var H=[{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"}],k=Object.fromEntries(H.map(t=>[t.name,t.value]));function X(t){return k[t]??k.gray}function $(t){return Object.prototype.hasOwnProperty.call(S,t)?S[t]:null}function L(t){return{type:t.type,color:t.color,direction:t.direction,glow:t.glow,stops:t.stops?.map(o=>({...o}))}}function q(t){return Object.prototype.hasOwnProperty.call(w,t)?L(w[t]):null}var F=[.823,.882,.941,1,1.118,1.235,1.353,1.786,2.143,2.643,3.143,3.571];function e(t,o){return Object.freeze({fontSize:t,lineHeight:o})}var Q=Object.freeze({xs:Object.freeze({largeTitle:e(31,44.408775),title1:e(25,37.128102),title2:e(19,27.816685),title3:e(17,23.807109),headline:e(14,20.161577),body:e(14,20.161577),callout:e(13,18.942243),subheadline:e(12,16.720313),footnote:e(12,16.986979),caption1:e(11,15.564453),caption2:e(11,16.126953)}),s:Object.freeze({largeTitle:e(32,45.797256),title1:e(26,38.556756),title2:e(20,29.22433),title3:e(18,25.160469),headline:e(15,21.536754),body:e(15,21.536754),callout:e(14,20.326079),subheadline:e(13,18.213672),footnote:e(12,16.986979),caption1:e(11,15.564453),caption2:e(11,16.126953)}),m:Object.freeze({largeTitle:e(33,47.185737),title1:e(27,39.985409),title2:e(21,30.631975),title3:e(19,26.513828),headline:e(16,22.911932),body:e(16,22.911932),callout:e(15,21.709914),subheadline:e(14,19.557031),footnote:e(12,16.986979),caption1:e(11,15.564453),caption2:e(11,16.126953)}),l:Object.freeze({largeTitle:e(34,48.574219),title1:e(28,41.414063),title2:e(22,32.253906),title3:e(20,27.867187),headline:e(17,24.287109),body:e(17,24.287109),callout:e(16,23.09375),subheadline:e(15,20.900391),footnote:e(13,18.513672),caption1:e(12,17.320313),caption2:e(11,16.126953)}),xl:Object.freeze({largeTitle:e(36,51.351181),title1:e(30,44.271369),title2:e(24,35.069196),title3:e(22,30.733906),headline:e(19,27.037464),body:e(19,27.037464),callout:e(18,25.861421),subheadline:e(17,23.587109),footnote:e(15,21.233724),caption1:e(14,20.269531),caption2:e(13,19.667518)}),xxl:Object.freeze({largeTitle:e(38,54.323266),title1:e(32,47.128676),title2:e(26,37.884487),title3:e(24,33.440625),headline:e(21,29.78782),body:e(21,29.78782),callout:e(20,28.629092),subheadline:e(19,26.273828),footnote:e(17,23.953776),caption1:e(16,23.03125),caption2:e(15,22.515775)}),xxxl:Object.freeze({largeTitle:e(40,57.100229),title1:e(34,50.221278),title2:e(28,40.699777),title3:e(26,36.147344),headline:e(23,32.719993),body:e(23,32.719993),callout:e(22,31.58724),subheadline:e(21,28.960547),footnote:e(19,26.673828),caption1:e(18,25.792969),caption2:e(17,25.364032)}),ax1:Object.freeze({largeTitle:e(44,62.654154),title1:e(38,56.171186),title2:e(34,49.359933),title3:e(31,43.074141),headline:e(28,39.595881),body:e(28,39.595881),callout:e(26,37.122582),subheadline:e(25,34.483984),footnote:e(23,32.280599),caption1:e(22,31.316406),caption2:e(20,29.636418)}),ax2:Object.freeze({largeTitle:e(48,68.403201),title1:e(43,63.314453),title2:e(39,56.612444),title3:e(37,51.194297),headline:e(33,46.653587),body:e(33,46.653587),callout:e(32,45.616071),subheadline:e(30,41.200781),footnote:e(27,37.720703),caption1:e(26,37.027344),caption2:e(24,35.332933)}),ax3:Object.freeze({largeTitle:e(52,73.957127),title1:e(48,70.693015),title2:e(44,63.65067),title3:e(43,59.474453),headline:e(40,56.461648),body:e(40,56.461648),callout:e(38,54.109561),subheadline:e(36,49.410937),footnote:e(33,46.047526),caption1:e(32,45.5),caption2:e(29,42.684345)}),ax4:Object.freeze({largeTitle:e(56,79.706174),title1:e(53,77.600988),title2:e(50,72.310826),title3:e(49,67.754609),headline:e(47,65.360618),body:e(47,66.269709),callout:e(44,62.412574),subheadline:e(42,57.621094),footnote:e(38,53.014323),caption1:e(37,52.404297),caption2:e(34,50.035757)}),ax5:Object.freeze({largeTitle:e(60,85.260099),title1:e(58,85.214844),title2:e(56,80.970982),title3:e(55,76.034766),headline:e(53,74.520774),body:e(53,74.520774),callout:e(51,72.2899),subheadline:e(49,67.174609),footnote:e(44,61.174479),caption1:e(43,60.876953),caption2:e(40,58.811298)})});function M(t){return F.some(o=>Object.is(o,t))}var ne=["colorScheme","reduceMotion","boldText","fontSize","largerAccessibilitySizes"],l={deviceModel:{type:"enum",default:R,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:v(),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:t=>t>=.5&&t<=4},largerAccessibilitySizes:{type:"boolean",default:!1,description:"show accessibility categories in the dynamic type size picker",group:"appearance"},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"},renderDensity:{type:"number",default:0,description:"render density override in device pixels per point for high-resolution capture (0 = device native)",group:"simulator",validate:t=>t===0||t>=1&&t<=9},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showMenuBar:{type:"boolean",default:!0,description:"keep the menu bar visible instead of revealing it at the top edge",group:"simulator"},showRail:{type:"boolean",default:!0,description:"keep the rail visible instead of revealing it on hover",group:"simulator"},solidWindow:{type:"boolean",default:!1,description:"desktop app: always use the solid, freely-resizable window instead of the device-shaped transparent one (3d mode uses it regardless)",group:"simulator"},ambientGlow:{type:"enum",default:"off",description:"bleed the app's own edge colors outward behind the device, like bias lighting behind a TV (off, soft, full)",options:D,cliFlag:"ambient-glow",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},screenshotCanvasEditing:{type:"boolean",default:!1,description:"experimental figma-style slide editing: draggable copy block, drop-in image layers (owner review pending)",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(S),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(w),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"},alwaysShowLiveWebViews:{type:"boolean",default:!1,description:"always render WebViews as live browser views",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"},productAnalytics:{type:"boolean",default:!0,description:"send bounded product usage analytics",group:"privacy"},crashReports:{type:"boolean",default:!0,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"}},ie={colorScheme:l.colorScheme.default,reduceMotion:l.reduceMotion.default,boldText:l.boldText.default,fontSize:l.fontSize.default,largerAccessibilitySizes:l.largerAccessibilitySizes.default};function V(){if(typeof window>"u")return{};let t={};try{let o=new URLSearchParams(window.location.search),a=o.get("device");a&&l.deviceModel.options?.includes(a)&&(t.deviceModel=a),o.get("ssMode")==="1"&&(t.screenshotMode=!0),o.get("filmStage")==="1"&&(t.threeMode=!0,a||(t.deviceModel="iphone-17-air"));let c=Number(o.get("renderDensity"));Number.isFinite(c)&&c>=1&&c<=9&&(t.renderDensity=c),o.get("ssEdit")==="1"&&(t.screenshotCanvasEditing=!0);let I=o.get("colorScheme")??o.get("theme");I&&l.colorScheme.options?.includes(I)&&(t.colorScheme=I);let p=o.get("reduceMotion");p==="1"||p==="true"?t.reduceMotion=!0:(p==="0"||p==="false")&&(t.reduceMotion=!1);let m=o.get("boldText");m==="1"||m==="true"?t.boldText=!0:(m==="0"||m==="false")&&(t.boldText=!1);let x=Number(o.get("fontSize"));Number.isFinite(x)&&M(x)&&(t.fontSize=x);let g=o.get("largerAccessibilitySizes");g==="1"||g==="true"?t.largerAccessibilitySizes=!0:(g==="0"||g==="false")&&(t.largerAccessibilitySizes=!1);let f=o.get("alwaysShowLiveWebViews");f==="1"||f==="true"?t.alwaysShowLiveWebViews=!0:(f==="0"||f==="false")&&(t.alwaysShowLiveWebViews=!1);let b=o.get("showFrame");b==="1"||b==="true"?t.showFrame=!0:(b==="0"||b==="false")&&(t.showFrame=!1);let P=o.get("ambientGlow");B(P)&&(t.ambientGlow=P)}catch{}return t}function ae(){let t={};for(let[o,a]of Object.entries(l))t[o]=a.default;return Object.assign(t,V()),t}export{_ as a,C as b,z as c,G as d,K as e,Y as f,X as g,$ as h,L as i,q as j,ne as k,l,ie as m,V as n,ae as o};
5
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
5
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as R}from"./chunk-WWIQEYHT.js";import{o as T}from"./chunk-XBBNRESY.js";import{a as D}from"./chunk-XKAXZ4DS.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import f from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||T()}function y(){return _()}function B(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=B(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=B();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function U(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ye(e){let t=h.resolve(e.cwd),r=U(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function Se(){return S().attachedProjects}var Q=336*60*60*1e3;function we(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-Q,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function ve(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function Ae(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function V(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=V(t.agentSessions[c],s,r))}})}function v(e,t){z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-DH3L6FFX.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=U(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as Z,spawnSync as ee}from"node:child_process";import{randomUUID as te}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import re from"node:readline";function b(e){return u.join(y(),"sessions",e)}function W(e){return u.join(b(e),"prompt.in")}function J(e){return u.join(b(e),"events.out")}function ne(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function se(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=oe();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function oe(){try{let e=ie();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ie(){try{let r=D.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=ce();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ce(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ae(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!de(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function de(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=ee("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Re(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ae(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?te():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=W(s.id),d=J(s.id),a=ne(s.id);L(c),L(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=se(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=Z(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});x.unref();let E=e.readyTimeoutMs??6e3,j=await ue(d,p=>p.type==="ready"||p.type==="error",E);if(!j||j.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function Ne(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
4
+ import{a as R}from"./chunk-QMHUIADD.js";import{o as T}from"./chunk-SKGITCWL.js";import{a as D}from"./chunk-YOIHAHR5.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import f from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||T()}function y(){return _()}function B(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=B(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=B();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function U(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ye(e){let t=h.resolve(e.cwd),r=U(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function Se(){return S().attachedProjects}var Q=336*60*60*1e3;function we(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-Q,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function ve(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function Ae(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function V(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=V(t.agentSessions[c],s,r))}})}function v(e,t){z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-5IRF7M7Z.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=U(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as Z,spawnSync as ee}from"node:child_process";import{randomUUID as te}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import re from"node:readline";function b(e){return u.join(y(),"sessions",e)}function W(e){return u.join(b(e),"prompt.in")}function J(e){return u.join(b(e),"events.out")}function ne(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function se(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=oe();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function oe(){try{let e=ie();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ie(){try{let r=D.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=ce();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ce(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ae(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!de(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function de(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=ee("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Re(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ae(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?te():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=W(s.id),d=J(s.id),a=ne(s.id);L(c),L(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=se(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=Z(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});x.unref();let E=e.readyTimeoutMs??6e3,j=await ue(d,p=>p.type==="ready"||p.type==="error",E);if(!j||j.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function Ne(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
5
5
  `)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function $e(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=b(e),n=y();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function _e(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,m.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=re.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let a=I(d);a&&t(a)});let c=!1;return()=>{if(!c){c=!0;try{i.writeSync(n,`
6
6
  `)}catch{}try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ue(e,t,r){let n=i.openSync(e,m.O_RDWR|m.O_NONBLOCK),o=Buffer.alloc(8192),s="",c=Date.now()+r;try{for(;Date.now()<c;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(a){if(a.code!=="EAGAIN")throw a;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let a;for(;(a=s.indexOf(`
7
7
  `))>=0;){let g=s.slice(0,a);s=s.slice(a+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(a=>setTimeout(a,30))}return null}finally{i.closeSync(n)}}export{I as a,y as b,ye as c,F as d,Se as e,we as f,ve as g,Ae as h,k as i,C as j,V as k,z as l,Pe as m,b as n,W as o,J as p,ne as q,O as r,se as s,l as t,Re as u,Ne as v,$e as w,_e as x};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as c}from"./chunk-R7AS52NA.js";import{H as a,l as u}from"./chunk-XBBNRESY.js";function f(t){return t.replace(/^\[|\]$/g,"").toLowerCase()}function p(t){let n=f(t);return n==="localhost"||n.endsWith(".localhost")||n==="0.0.0.0"||n==="::1"||/^127(?:\.\d{1,3}){3}$/.test(n)}import o from"fs";import e from"path";import{fileURLToPath as m}from"url";var l;function d(){if(l!==void 0)return l;let t=e.dirname(m(import.meta.url));for(let n=0;n<12&&t!==e.dirname(t);n++){if(o.existsSync(e.join(t,"packages/sootsim-engine/package.json"))&&o.existsSync(e.join(t,"public/sootsim")))return l=t,t;t=e.dirname(t)}return l=null,null}function w(){if(process.env.SOOTSIM_HOME&&a())return null;let t=d();if(!t)return null;let n=e.join(t,"public/sootsim");return o.existsSync(e.join(n,"index.html"))&&o.existsSync(e.join(n,"engine/index.html"))&&o.existsSync(e.join(n,"engine-tenant/worker.js"))?n:null}function R(t){let n=t.trim();if(!c(n))throw new Error(`invalid SootSim runtime version: ${t}`);let i=Buffer.from(n,"utf8").toString("hex").match(/.{1,60}/g);if(!i)throw new Error(`invalid SootSim runtime version: ${t}`);return`${i.join(".")}.runtime.localhost`}function y(t){let n=".runtime.localhost";if(!t.toLowerCase().endsWith(n))return null;let r=t.slice(0,-n.length).split(".");if(r.length===0||r.some(s=>!/^[0-9a-f]{1,60}$/i.test(s)))return null;let i=r.join("");if(i.length%2!==0)return null;try{let s=Buffer.from(i,"hex").toString("utf8");return c(s)?s:null}catch{return null}}function b(t){let n=u(t);return o.existsSync(e.join(n,"index.html"))?n:null}export{p as a,w as b,R as c,y as d,b as e};
4
+ import{a as c}from"./chunk-W4S7GGPG.js";import{H as a,l as u}from"./chunk-SKGITCWL.js";function f(t){return t.replace(/^\[|\]$/g,"").toLowerCase()}function p(t){let n=f(t);return n==="localhost"||n.endsWith(".localhost")||n==="0.0.0.0"||n==="::1"||/^127(?:\.\d{1,3}){3}$/.test(n)}import o from"fs";import e from"path";import{fileURLToPath as m}from"url";var l;function d(){if(l!==void 0)return l;let t=e.dirname(m(import.meta.url));for(let n=0;n<12&&t!==e.dirname(t);n++){if(o.existsSync(e.join(t,"packages/sootsim-engine/package.json"))&&o.existsSync(e.join(t,"public/sootsim")))return l=t,t;t=e.dirname(t)}return l=null,null}function w(){if(process.env.SOOTSIM_HOME&&a())return null;let t=d();if(!t)return null;let n=e.join(t,"public/sootsim");return o.existsSync(e.join(n,"index.html"))&&o.existsSync(e.join(n,"engine/index.html"))&&o.existsSync(e.join(n,"engine-tenant/worker.js"))?n:null}function R(t){let n=t.trim();if(!c(n))throw new Error(`invalid SootSim runtime version: ${t}`);let i=Buffer.from(n,"utf8").toString("hex").match(/.{1,60}/g);if(!i)throw new Error(`invalid SootSim runtime version: ${t}`);return`${i.join(".")}.runtime.localhost`}function y(t){let n=".runtime.localhost";if(!t.toLowerCase().endsWith(n))return null;let r=t.slice(0,-n.length).split(".");if(r.length===0||r.some(s=>!/^[0-9a-f]{1,60}$/i.test(s)))return null;let i=r.join("");if(i.length%2!==0)return null;try{let s=Buffer.from(i,"hex").toString("utf8");return c(s)?s:null}catch{return null}}function b(t){let n=u(t);return o.existsSync(e.join(n,"index.html"))?n:null}export{p as a,w as b,R as c,y as d,b as e};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  import{existsSync as s}from"node:fs";import{basename as a,dirname as p,join as l}from"node:path";import{fileURLToPath as m,pathToFileURL as c}from"node:url";var u="packages/sootsim/scripts/demo-app-registry.ts",f=8;function A(o){let r=o;for(let e=0;e<f;e++){if(a(r)==="node_modules")return null;let n=l(r,u);if(s(n))return n;let i=p(r);if(i===r)return null;r=i}return null}var t=null;async function S(){if(t)return t;let o=A(p(m(import.meta.url)));if(!o)return t=[],t;try{let r=await import(c(o).href);t=Array.isArray(r.APPS)?r.APPS:[]}catch{t=[]}return t}function D(){return t??[]}function O(o){let r=t;return t=o,{restore:()=>{t=r}}}export{A as a,S as b,D as c,O as d};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{h as j,j as A,m as K,n as v}from"./chunk-7RJEULWN.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as B}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,o){let n=j(t,{port:e.port}),i=H(n.positional),m=A({...n,commandTimeoutMs:5e3});try{let a=!!(await K(m,"SootSim.bridges.settings.get"))?.[o.modeKey],u=i==="on"?!0:i==="off"?!1:!a;if(a===u)return console.log(` ${o.displayName}: already ${u?"on":"off"}`),{current:a,target:u,changed:!1};if(!await m.send({type:"evaluate",acquireLock:!0,code:`(async () => {
4
+ import{h as j,j as A,m as K,n as v}from"./chunk-EHBHUE6S.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as B}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,o){let n=j(t,{port:e.port}),i=H(n.positional),m=A({...n,commandTimeoutMs:5e3});try{let a=!!(await K(m,"SootSim.bridges.settings.get"))?.[o.modeKey],u=i==="on"?!0:i==="off"?!1:!a;if(a===u)return console.log(` ${o.displayName}: already ${u?"on":"off"}`),{current:a,target:u,changed:!1};if(!await m.send({type:"evaluate",acquireLock:!0,code:`(async () => {
5
5
  const modeKey = ${JSON.stringify(o.modeKey)}
6
6
  const target = ${JSON.stringify(u)}
7
7
  window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  var o=!0,e="public beta",t=e,n="we send anonymous error and dependency data while you use it";export{o as a,e as b,t as c,n as d};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  import g from"node:fs";import f from"node:path";var D=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"],_=["sootsim.config.ts","sootsim.config.js","sootsim.config.mjs","sootsim.config.cjs"],S=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","fixtures","fixture","examples","example"]),d=256,y=4;function A(s,r){for(let t of r){let n=f.join(s,t);try{if(g.statSync(n).isFile())return n}catch{}}return null}function m(s){return A(s,D)}function h(s){return A(s,_)}function k(s){try{let r=JSON.parse(g.readFileSync(f.join(s,"package.json"),"utf8"));if(!r||typeof r!="object")return[];let t=Reflect.get(r,"workspaces");if(Array.isArray(t))return t.filter(c=>typeof c=="string");if(!t||typeof t!="object")return[];let n=Reflect.get(t,"packages");return Array.isArray(n)?n.filter(c=>typeof c=="string"):[]}catch{return[]}}function b(s){let r=new Set,t=0,n=!0;for(let c of k(s)){if(t>=d){n=!1;break}if(!c||f.isAbsolute(c))continue;let a=c.split(/[\\/]+/).filter(Boolean);if(a.length===0||a.length>y||a.some(o=>o===".."||o==="**"))continue;let i=[s];for(let o of a){let e=[];for(let l of i){if(t>=d){n=!1;break}if(t++,o==="*"){let p;try{p=g.readdirSync(l,{withFileTypes:!0})}catch{continue}for(let u of p)!u.isDirectory()||u.isSymbolicLink()||u.name.startsWith(".")||S.has(u.name)||e.push(f.join(l,u.name))}else if(!o.includes("*")){let p=f.join(l,o);try{let u=g.lstatSync(p);u.isDirectory()&&!u.isSymbolicLink()&&e.push(p)}catch{}}}i=e,i.length>d&&(i.length=d,n=!1)}for(let o of i)r.add(o)}return{directories:[...r],complete:n}}function j(s){let r=[{dir:s,depth:0}],t=[],n=0,c=0,a=!0;for(;c<r.length&&n<d;){let i=r[c++];if(!i)break;if(n++,i.depth>0&&m(i.dir)&&(t.push(i.dir),t.length>1))return{directories:t,complete:!0};if(i.depth>=y)continue;let o;try{o=g.readdirSync(i.dir,{withFileTypes:!0})}catch{continue}for(let e of o)if(!(!e.isDirectory()||e.isSymbolicLink())&&!(e.name.startsWith(".")||S.has(e.name))){if(r.length>=d){a=!1;break}r.push({dir:f.join(i.dir,e.name),depth:i.depth+1})}}return{directories:t,complete:a&&c===r.length}}function w(s,r={}){let t=f.resolve(s),n=h(t);if(m(t)||r.trustStart&&g.existsSync(t)){let e=n;if(!e&&r.trustStart){let l=f.dirname(t);for(let p=0;p<y&&l!==f.dirname(l)&&(e=h(l),!e);p++)l=f.dirname(l)}return{appDir:t,configPath:e}}let c=b(t),a=c.directories.filter(e=>m(e));if(a.length>1||!c.complete)return null;if(a.length===1){let e=a[0];return{appDir:e,configPath:n??h(e)}}let i=j(t),o=i.directories;if(o.length>1||!i.complete)return null;if(o.length===1){let e=o[0];return{appDir:e,configPath:n??h(e)}}return n?{appDir:t,configPath:n}:null}export{w as a};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  var a=["Cache","Code Cache","DawnCache","DawnGraphiteCache","DawnWebGPUCache","GPUCache","GrShaderCache","ShaderCache"],r=new Set(a);function s(e){return r.has(e)}export{a,s as b};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  var t=Object.freeze({id:"ios",displayName:"iOS",isIOS:!0,isAndroid:!1,select:e=>e.ios}),r=Object.freeze({id:"android",displayName:"Android",isIOS:!1,isAndroid:!0,select:e=>e.android}),i=Object.freeze({ios:t,android:r});
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as c}from"./chunk-ZNK3ZAA5.js";import{a}from"./chunk-M2LP2VYQ.js";import{a as e}from"./chunk-EPZUFQMX.js";import{a as n}from"./chunk-NLTJE335.js";import{c as i,d as m,e as p}from"./chunk-LKAAQBT6.js";import{a as u}from"./chunk-3S7UEXZW.js";import{a as f,c as s}from"./chunk-EWRPLFYI.js";function g(){return`sootsim CLI v${u()} \xB7 ${c().primary}`}function _(){let r=m({bridgePort:7668,defaultShellUrl:n},e()),o=`
4
+ import{a as c}from"./chunk-GFKP5JIA.js";import{a}from"./chunk-VJMY2MX6.js";import{a as e}from"./chunk-ZDQO6TJQ.js";import{a as n}from"./chunk-F2WH6XM7.js";import{c as i,d as m,e as p}from"./chunk-6QZY6YO2.js";import{a as u}from"./chunk-HI5MWY32.js";import{a as f,c as s}from"./chunk-P7MI3VFY.js";function g(){return`sootsim CLI v${u()} \xB7 ${c().primary}`}function _(){let r=m({bridgePort:7668,defaultShellUrl:n},e()),o=`
5
5
  ${s}
6
6
  `;console.log(`${g()}
7
7
  ${o}${r}
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.310 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.311 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  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};