sootsim 0.1.304 → 0.1.305

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 (149) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-EK355OQM.js → agent-OJP4VF2K.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-LCJJWHZE.js → agent-wrapper-HMVFZKH3.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-LIPU2DLT.js → app-fonts-INFYQMIN.js} +2 -2
  5. package/dist-cli/chunks/{assert-OASKCPBX.js → assert-YSFBCP5P.js} +2 -2
  6. package/dist-cli/chunks/{auth-XYYKD33F.js → auth-M7RKDYQV.js} +2 -2
  7. package/dist-cli/chunks/{beta-TOL55XPM.js → beta-4NRMM37T.js} +2 -2
  8. package/dist-cli/chunks/{camera-PHKVEQHR.js → camera-MHLM35MB.js} +2 -2
  9. package/dist-cli/chunks/{chunk-GMILMS7P.js → chunk-2D7NF3XK.js} +2 -2
  10. package/dist-cli/chunks/{chunk-CMYVGJBQ.js → chunk-2UKSI3VX.js} +1 -1
  11. package/dist-cli/chunks/{chunk-AJYA6R3N.js → chunk-3PREBGTH.js} +2 -2
  12. package/dist-cli/chunks/{chunk-JDKWIB6V.js → chunk-43SNLCXR.js} +1 -1
  13. package/dist-cli/chunks/{chunk-3UUHIHA6.js → chunk-4Q42Y64Y.js} +2 -2
  14. package/dist-cli/chunks/{chunk-YAV6BH3A.js → chunk-54AINFEF.js} +2 -2
  15. package/dist-cli/chunks/{chunk-RT7TUHH7.js → chunk-6EXIYEOQ.js} +2 -2
  16. package/dist-cli/chunks/{chunk-ENXLKDQ6.js → chunk-6YE25EJB.js} +3 -3
  17. package/dist-cli/chunks/{chunk-5NJTX5OP.js → chunk-AJCL7DHI.js} +2 -2
  18. package/dist-cli/chunks/chunk-B65RMI7A.js +71 -0
  19. package/dist-cli/chunks/{chunk-INBBOCU4.js → chunk-BDNZULU7.js} +2 -2
  20. package/dist-cli/chunks/chunk-COD6QGS2.js +125 -0
  21. package/dist-cli/chunks/{chunk-ZONISYZ5.js → chunk-CWDEDUOZ.js} +1 -1
  22. package/dist-cli/chunks/{chunk-OSH6526H.js → chunk-DHDSGBZB.js} +1 -1
  23. package/dist-cli/chunks/{chunk-XCVSB47R.js → chunk-DTHOMSAA.js} +2 -2
  24. package/dist-cli/chunks/{chunk-7RFXZXKH.js → chunk-EBCXFB3K.js} +1 -1
  25. package/dist-cli/chunks/{chunk-LRXSLMX4.js → chunk-EPZG2F4I.js} +1 -1
  26. package/dist-cli/chunks/{chunk-2RLFUM3C.js → chunk-EWVEUNRO.js} +51 -118
  27. package/dist-cli/chunks/{chunk-ITDTSNN2.js → chunk-H5D6E3DR.js} +2 -2
  28. package/dist-cli/chunks/{chunk-RYQUO6LT.js → chunk-HHLH4TWF.js} +1 -1
  29. package/dist-cli/chunks/{chunk-SVFN66PF.js → chunk-HKPJYMJC.js} +2 -2
  30. package/dist-cli/chunks/{chunk-IWRRIQDJ.js → chunk-HMOYEM6V.js} +2 -2
  31. package/dist-cli/chunks/{chunk-NXYKNKNL.js → chunk-IJ64Z77P.js} +2 -2
  32. package/dist-cli/chunks/{chunk-GF3LDVWF.js → chunk-J653UMCU.js} +2 -2
  33. package/dist-cli/chunks/{chunk-XXS4TCOO.js → chunk-JKIPNRAK.js} +3 -3
  34. package/dist-cli/chunks/{chunk-Y5YM7XHU.js → chunk-JQRRJIMT.js} +1 -1
  35. package/dist-cli/chunks/{chunk-G4R7CPCY.js → chunk-KG2WUKD2.js} +2 -2
  36. package/dist-cli/chunks/{chunk-QWQHSUZC.js → chunk-KSZRLJPA.js} +2 -2
  37. package/dist-cli/chunks/{chunk-MSYPDBFG.js → chunk-KVLXMWV5.js} +2 -2
  38. package/dist-cli/chunks/{chunk-WNDYTKLC.js → chunk-KVOY4Z2X.js} +1 -1
  39. package/dist-cli/chunks/{chunk-XHYSASAX.js → chunk-LOF3WUKB.js} +1 -1
  40. package/dist-cli/chunks/{chunk-V6JDDX4B.js → chunk-NNR3BU5O.js} +2 -2
  41. package/dist-cli/chunks/{chunk-ABHNOM2C.js → chunk-OCRL2VU4.js} +1 -1
  42. package/dist-cli/chunks/{chunk-BPRMA4IC.js → chunk-PELXRGDN.js} +2 -2
  43. package/dist-cli/chunks/{chunk-VUR5QXVX.js → chunk-POIK3AHY.js} +2 -2
  44. package/dist-cli/chunks/{chunk-76OLOD2G.js → chunk-QJUKXBH5.js} +2 -2
  45. package/dist-cli/chunks/{chunk-UB3OWUVK.js → chunk-QVH276LI.js} +1 -1
  46. package/dist-cli/chunks/{chunk-2MEUZOSD.js → chunk-R5TBMYGH.js} +1 -1
  47. package/dist-cli/chunks/{chunk-HFA5ZACE.js → chunk-R6MBDR56.js} +1 -1
  48. package/dist-cli/chunks/{chunk-BJOT2LL6.js → chunk-SLCYXISJ.js} +2 -2
  49. package/dist-cli/chunks/{chunk-A4UYZTV7.js → chunk-SWBTXTEO.js} +2 -2
  50. package/dist-cli/chunks/{chunk-RQJDIDJ3.js → chunk-TRV5K6D2.js} +1 -1
  51. package/dist-cli/chunks/{chunk-RJWQ3VAD.js → chunk-UUKUKTV3.js} +2 -2
  52. package/dist-cli/chunks/{chunk-SN6ARNCL.js → chunk-VKBCGFOU.js} +2 -2
  53. package/dist-cli/chunks/{chunk-HFKQUS4I.js → chunk-W3M4676V.js} +3 -3
  54. package/dist-cli/chunks/{chunk-YXHO2OUL.js → chunk-WIRBJTTU.js} +1 -1
  55. package/dist-cli/chunks/{chunk-EXW6TH3O.js → chunk-WQYUHDBU.js} +2 -2
  56. package/dist-cli/chunks/{chunk-FNI75AD7.js → chunk-XI6CPN53.js} +1 -1
  57. package/dist-cli/chunks/{chunk-M3ETYVNL.js → chunk-XWMTLVCE.js} +1 -1
  58. package/dist-cli/chunks/{chunk-W3CSYOSQ.js → chunk-ZRQFYMTL.js} +1 -1
  59. package/dist-cli/chunks/{cleanup-GCTEGJMP.js → cleanup-ZJ7FQKED.js} +2 -2
  60. package/dist-cli/chunks/{cli-version-G72HUH4E.js → cli-version-5LGCFOAC.js} +2 -2
  61. package/dist-cli/chunks/{compat-IC4JHGBH.js → compat-EQACACVP.js} +2 -2
  62. package/dist-cli/chunks/{config-C65MZFU3.js → config-ADGNCDG5.js} +2 -2
  63. package/dist-cli/chunks/{control-RWLYBKQR.js → control-Y3E5IIMO.js} +2 -2
  64. package/dist-cli/chunks/daemon-A6CWUYMR.js +4 -0
  65. package/dist-cli/chunks/{debug-LEL32PDN.js → debug-PU73W33T.js} +3 -3
  66. package/dist-cli/chunks/{desktop-RDSISJH2.js → desktop-V675PYF4.js} +3 -3
  67. package/dist-cli/chunks/{detox-SCCWUIKK.js → detox-SHVVEPPX.js} +2 -2
  68. package/dist-cli/chunks/{device-MTDEKDUK.js → device-NMRUACB4.js} +2 -2
  69. package/dist-cli/chunks/{diagnose-UZJCKLPZ.js → diagnose-S2AVGABT.js} +2 -2
  70. package/dist-cli/chunks/disk-cleanup-EJEZIIT4.js +4 -0
  71. package/dist-cli/chunks/drivers-PM4PVYHY.js +4 -0
  72. package/dist-cli/chunks/{film-YBE544PG.js → film-UB7N4EKB.js} +3 -3
  73. package/dist-cli/chunks/flow-XJRNL25V.js +4 -0
  74. package/dist-cli/chunks/help-2ZJHCVUZ.js +4 -0
  75. package/dist-cli/chunks/{hidden-runtime-alias-KJYCJLSR.js → hidden-runtime-alias-M44SGZLM.js} +2 -2
  76. package/dist-cli/chunks/{home-paths-NSHWNEGK.js → home-paths-ZTEBHBUO.js} +2 -2
  77. package/dist-cli/chunks/inspect-L76RUF62.js +4 -0
  78. package/dist-cli/chunks/install-desktop-UIXKNXKF.js +4 -0
  79. package/dist-cli/chunks/{login-AEVUU72R.js → login-YQ3HRPPS.js} +4 -4
  80. package/dist-cli/chunks/{logout-72XHF6J2.js → logout-XGBDWO4J.js} +2 -2
  81. package/dist-cli/chunks/{maestro-OXSKQJ6B.js → maestro-CESBE2SF.js} +3 -3
  82. package/dist-cli/chunks/{maestro-generate-AKZFORVJ.js → maestro-generate-4IHISKJL.js} +3 -3
  83. package/dist-cli/chunks/{mode-U6KRG2PE.js → mode-BQGGZ737.js} +2 -2
  84. package/dist-cli/chunks/{optional-demo-registry-L3VIWBI2.js → optional-demo-registry-LWYRXVIE.js} +2 -2
  85. package/dist-cli/chunks/{perf-KF2BJZIN.js → perf-TUR22UTE.js} +2 -2
  86. package/dist-cli/chunks/{permissions-TRJG4QAI.js → permissions-POJIVSRV.js} +2 -2
  87. package/dist-cli/chunks/{record-TICJYZOA.js → record-Q55SGXLU.js} +3 -3
  88. package/dist-cli/chunks/{report-issue-OQPLBQMJ.js → report-issue-LRRX7VJV.js} +2 -2
  89. package/dist-cli/chunks/runtime-NHDHZJJN.js +4 -0
  90. package/dist-cli/chunks/{screenshot-command-XLERKHVW.js → screenshot-command-C7EU43J3.js} +6 -6
  91. package/dist-cli/chunks/screenshot-layers-NYVOJYUU.js +20 -0
  92. package/dist-cli/chunks/{screenshots-capture-B6OORSD4.js → screenshots-capture-AYKJKBLR.js} +2 -2
  93. package/dist-cli/chunks/{serve-5M7MIPWF.js → serve-EN3ZPJSA.js} +2 -2
  94. package/dist-cli/chunks/{setup-HJZDC4PK.js → setup-KKMKLJZE.js} +2 -2
  95. package/dist-cli/chunks/{skills-RXHLMGGL.js → skills-DR5DG2SK.js} +2 -2
  96. package/dist-cli/chunks/{storage-MMPD2XBS.js → storage-GMDBVTQ5.js} +2 -2
  97. package/dist-cli/chunks/store-QZEMKQDC.js +4 -0
  98. package/dist-cli/chunks/telemetry-TNX72J2B.js +4 -0
  99. package/dist-cli/chunks/{timeline-6PF5BZ37.js → timeline-VY3444AZ.js} +2 -2
  100. package/dist-cli/chunks/{upgrade-QSMIK3RC.js → upgrade-EUYCW55F.js} +2 -2
  101. package/dist-cli/chunks/upload-D43U7RGT.js +4 -0
  102. package/dist-cli/chunks/{version-WLTFXEDC.js → version-TEGM4WRU.js} +2 -2
  103. package/dist-cli/chunks/{web-DI73LQ7N.js → web-QF7LF4VB.js} +2 -2
  104. package/dist-cli/chunks/{what-happened-4SAMGZWR.js → what-happened-HDTJGNND.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 +1 -1
  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 +1 -1
  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 +1 -1
  133. package/dist-lib/sdk.cjs +1 -1
  134. package/dist-lib/sdk.mjs +1 -1
  135. package/dist-lib/skills.cjs +1 -1
  136. package/dist-lib/vite.cjs +1 -1
  137. package/package.json +1 -1
  138. package/dist-cli/chunks/chunk-ZDRI2LUG.js +0 -125
  139. package/dist-cli/chunks/daemon-D77E5G6Z.js +0 -4
  140. package/dist-cli/chunks/disk-cleanup-HLWRVTVW.js +0 -4
  141. package/dist-cli/chunks/drivers-Q7GMKTBM.js +0 -4
  142. package/dist-cli/chunks/flow-5VOVAVZN.js +0 -4
  143. package/dist-cli/chunks/help-2PESJ7V2.js +0 -4
  144. package/dist-cli/chunks/inspect-OIA3Q5MD.js +0 -4
  145. package/dist-cli/chunks/install-desktop-7KLACQUW.js +0 -4
  146. package/dist-cli/chunks/runtime-HDMLWNXW.js +0 -4
  147. package/dist-cli/chunks/store-APKY72ZY.js +0 -4
  148. package/dist-cli/chunks/telemetry-W3YRHE67.js +0 -4
  149. package/dist-cli/chunks/upload-HQEOYILQ.js +0 -4
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 A,e as T,g as E}from"./chunk-YXHO2OUL.js";import{K as S,L as I,M as B,N as P,g as F}from"./chunk-7RFXZXKH.js";var b="http://localhost:5173/";import{WebSocket as $}from"ws";var W=null;function M(){let i=F();if(W?.homeDir===i)return W.world;let r=_();return W={homeDir:i,world:r},r}function _(){let i=I();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=S();return r&&B(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=I();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=S();return e&&B(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=I();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=S();return d&&B(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return M().bridgePort}function z(i,r){let e=U(i),d=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 ${d} :${i} (${t?`shell ${t}, `:""}${l})
4
+ import{b as A,e as T,g as E}from"./chunk-WIRBJTTU.js";import{K as S,L as I,M as B,N as P,g as F}from"./chunk-EBCXFB3K.js";var b="http://localhost:5173/";import{WebSocket as $}from"ws";var W=null;function M(){let i=F();if(W?.homeDir===i)return W.world;let r=_();return W={homeDir:i,world:r},r}function _(){let i=I();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=S();return r&&B(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=I();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=S();return e&&B(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=I();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=S();return d&&B(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return M().bridgePort}function z(i,r){let e=U(i),d=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 ${d} :${i} (${t?`shell ${t}, `:""}${l})
5
5
  `)}var C=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,d=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),d=Number(i[n+1])),n++;continue}if(a.startsWith("--port=")){e.add(n),d=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:d,simId:t,simIdSource:u,commandTimeoutMs:l}}function R(i,r={}){let e=1,d=r.commandTimeoutMs??15e3,l=new Map,t=new $(`ws://localhost:${i}`),u=A(),v=new Promise((s,o)=>{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}`:"";o(new Error(`could not connect to ws://localhost:${i}${m}`))})}),y=!1,n=!1;function a(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",m=N(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
6
6
  `)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!y&&(y=!0,process.stderr.write(`
7
7
  \u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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="http://localhost:7668/";var r=4001,o="sootsim close";export{t as a,r as b,o as c};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 k}from"./chunk-RQJDIDJ3.js";import{createHash as j}from"node:crypto";import D from"node:fs";import{createRequire as L}from"node:module";import x from"node:path";var P=/(^|\/)expo-splash-screen$/,A=/(^|\/)react-native-bootsplash$/;function w(n,e){let r=e.replace(/\/+$/,""),s=n.replace(/^\.\//,"").replace(/^\/+/,"");if(s)return`${r}/assets/${s}`}function d(n,e,r){return r?r(n):w(n,e)}function y(n){if(n==="cover")return"cover";if(n==="contain"||n==="native")return"contain"}function p(n){return typeof n=="string"&&n.length>0?n:void 0}function m(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function R(n,e,r){if(!n||typeof n!="object")return null;let s=n,o={source:"expo-splash-screen",backgroundColor:p(s.backgroundColor)??"#ffffff"},i=p(s.image);i&&(o.imageUrl=d(i,e,r));let t=m(s.imageWidth);t!=null&&(o.imageWidthPx=t);let l=y(s.resizeMode);l&&(o.resizeMode=l);let a=s.dark;if(a&&typeof a=="object"){let u=a,g=p(u.backgroundColor),f=p(u.image);(g||f)&&(o.dark={},g&&(o.dark.backgroundColor=g),f&&(o.dark.imageUrl=d(f,e,r)))}return o}function U(n,e,r,s){let c=n[e],o=c&&typeof c=="object"?c.splash:void 0,i=n.splash,t=o&&typeof o=="object"?o:i;if(!t||typeof t!="object")return null;let a={source:"expo-legacy",backgroundColor:p(t.backgroundColor)??"#ffffff",imageWidthPx:m(t.imageWidth)??200,resizeMode:y(t.resizeMode)??"contain"},u=p(t.image);u&&(a.imageUrl=d(u,r,s));let g=t.dark;if(g&&typeof g=="object"){let f=g,h=p(f.backgroundColor),S=p(f.image);(h||S)&&(a.dark={},h&&(a.dark.backgroundColor=h),S&&(a.dark.imageUrl=d(S,r,s)))}return a}function v(n,e,r){if(!n||typeof n!="object")return null;let s=n,c=p(s.logo);if(!c)return null;let o={source:"react-native-bootsplash",backgroundColor:p(s.background)??"#fff",imageUrl:d(c,e,r),imageWidthPx:m(s.logoWidth)??100,resizeMode:"contain"},i=p(s.darkBackground),t=p(s.darkLogo);return(i||t)&&(o.dark={},i&&(o.dark.backgroundColor=i),t&&(o.dark.imageUrl=d(t,e,r))),o}function C(n,e,r,s={}){if(!n||typeof n!="object")return null;let c=n,o=c.plugins,i=null,t=null;if(Array.isArray(o))for(let l of o){let a=Array.isArray(l)?l[0]:l;if(typeof a!="string")continue;let u=Array.isArray(l)?l[1]??{}:{};!i&&P.test(a)?i=R(u,r,s.resolveAssetUrl):!t&&A.test(a)&&(t=v(u,r,s.resolveAssetUrl))}return t||i||U(c,e,r,s.resolveAssetUrl)}var b=L(import.meta.url);function E(n){try{let e=new URL(n),r=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return e.origin}catch{}return null}function I(n){try{return D.statSync(x.join(n,"package.json")).isFile()}catch{return!1}}function G(n){let e=E(n.bundleUrl);if(!e)return null;let r=n.repoDir||process.env.CONTRAST_REPO_DIR,s=r?x.resolve(r):process.cwd();if(!r&&!I(s))return null;let o=k(s,{trustStart:n.exactProjectDir})?.appDir??null;if(!o)return null;let i=(n.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),t=null;try{let a=b.resolve("@expo/config",{paths:[o,s]}),u=b(a);typeof u.getConfig=="function"&&(t=u.getConfig)}catch{}if(!t)return null;let l;try{let a=t(o,{skipSDKVersionRequirement:!0});a?.exp&&typeof a.exp=="object"&&(l=a.exp)}catch{}return!l||typeof l!="object"?null:C(l,i==="android"?"android":"ios",e)}function q(n){return encodeURIComponent(JSON.stringify(n))}function z(n){if(!n)return null;try{let e=JSON.parse(decodeURIComponent(n));if(!e||typeof e!="object")return null;let r=e;return r.source!=="expo-splash-screen"&&r.source!=="expo-legacy"&&r.source!=="react-native-bootsplash"||typeof r.backgroundColor!="string"?null:e}catch{return null}}function M(n){let e=new Set;return n.imageUrl&&e.add(n.imageUrl),n.dark?.imageUrl&&e.add(n.dark.imageUrl),[...e]}function F(n){let e=(n.split("?")[0].split(".").pop()||"").toLowerCase();return e==="png"?"image/png":e==="jpg"||e==="jpeg"?"image/jpeg":e==="webp"?"image/webp":e==="gif"?"image/gif":e==="svg"?"image/svg+xml":"application/octet-stream"}async function H(n,e){let r=z(n);if(!r)return[];let s=[],c=new Set;for(let o of M(r)){let i=j("sha256").update(o).digest("hex");if(!c.has(i)){c.add(i);try{let t=await fetch(o);if(!t.ok){e?.onError?.(o,new Error(`${t.status} ${t.statusText}`));continue}let l=new Uint8Array(await t.arrayBuffer());s.push({url:o,urlhash:i,contentType:F(o),bytes:l}),e?.onStaged?.({url:o,byteLength:l.byteLength})}catch(t){e?.onError?.(o,t)}}}return s}export{G as a,q as b,H as c};
4
+ import{a as k}from"./chunk-TRV5K6D2.js";import{createHash as j}from"node:crypto";import D from"node:fs";import{createRequire as L}from"node:module";import x from"node:path";var P=/(^|\/)expo-splash-screen$/,A=/(^|\/)react-native-bootsplash$/;function w(n,e){let r=e.replace(/\/+$/,""),s=n.replace(/^\.\//,"").replace(/^\/+/,"");if(s)return`${r}/assets/${s}`}function d(n,e,r){return r?r(n):w(n,e)}function y(n){if(n==="cover")return"cover";if(n==="contain"||n==="native")return"contain"}function p(n){return typeof n=="string"&&n.length>0?n:void 0}function m(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function R(n,e,r){if(!n||typeof n!="object")return null;let s=n,o={source:"expo-splash-screen",backgroundColor:p(s.backgroundColor)??"#ffffff"},i=p(s.image);i&&(o.imageUrl=d(i,e,r));let t=m(s.imageWidth);t!=null&&(o.imageWidthPx=t);let l=y(s.resizeMode);l&&(o.resizeMode=l);let a=s.dark;if(a&&typeof a=="object"){let u=a,g=p(u.backgroundColor),f=p(u.image);(g||f)&&(o.dark={},g&&(o.dark.backgroundColor=g),f&&(o.dark.imageUrl=d(f,e,r)))}return o}function U(n,e,r,s){let c=n[e],o=c&&typeof c=="object"?c.splash:void 0,i=n.splash,t=o&&typeof o=="object"?o:i;if(!t||typeof t!="object")return null;let a={source:"expo-legacy",backgroundColor:p(t.backgroundColor)??"#ffffff",imageWidthPx:m(t.imageWidth)??200,resizeMode:y(t.resizeMode)??"contain"},u=p(t.image);u&&(a.imageUrl=d(u,r,s));let g=t.dark;if(g&&typeof g=="object"){let f=g,h=p(f.backgroundColor),S=p(f.image);(h||S)&&(a.dark={},h&&(a.dark.backgroundColor=h),S&&(a.dark.imageUrl=d(S,r,s)))}return a}function v(n,e,r){if(!n||typeof n!="object")return null;let s=n,c=p(s.logo);if(!c)return null;let o={source:"react-native-bootsplash",backgroundColor:p(s.background)??"#fff",imageUrl:d(c,e,r),imageWidthPx:m(s.logoWidth)??100,resizeMode:"contain"},i=p(s.darkBackground),t=p(s.darkLogo);return(i||t)&&(o.dark={},i&&(o.dark.backgroundColor=i),t&&(o.dark.imageUrl=d(t,e,r))),o}function C(n,e,r,s={}){if(!n||typeof n!="object")return null;let c=n,o=c.plugins,i=null,t=null;if(Array.isArray(o))for(let l of o){let a=Array.isArray(l)?l[0]:l;if(typeof a!="string")continue;let u=Array.isArray(l)?l[1]??{}:{};!i&&P.test(a)?i=R(u,r,s.resolveAssetUrl):!t&&A.test(a)&&(t=v(u,r,s.resolveAssetUrl))}return t||i||U(c,e,r,s.resolveAssetUrl)}var b=L(import.meta.url);function E(n){try{let e=new URL(n),r=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return e.origin}catch{}return null}function I(n){try{return D.statSync(x.join(n,"package.json")).isFile()}catch{return!1}}function G(n){let e=E(n.bundleUrl);if(!e)return null;let r=n.repoDir||process.env.CONTRAST_REPO_DIR,s=r?x.resolve(r):process.cwd();if(!r&&!I(s))return null;let o=k(s,{trustStart:n.exactProjectDir})?.appDir??null;if(!o)return null;let i=(n.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),t=null;try{let a=b.resolve("@expo/config",{paths:[o,s]}),u=b(a);typeof u.getConfig=="function"&&(t=u.getConfig)}catch{}if(!t)return null;let l;try{let a=t(o,{skipSDKVersionRequirement:!0});a?.exp&&typeof a.exp=="object"&&(l=a.exp)}catch{}return!l||typeof l!="object"?null:C(l,i==="android"?"android":"ios",e)}function q(n){return encodeURIComponent(JSON.stringify(n))}function z(n){if(!n)return null;try{let e=JSON.parse(decodeURIComponent(n));if(!e||typeof e!="object")return null;let r=e;return r.source!=="expo-splash-screen"&&r.source!=="expo-legacy"&&r.source!=="react-native-bootsplash"||typeof r.backgroundColor!="string"?null:e}catch{return null}}function M(n){let e=new Set;return n.imageUrl&&e.add(n.imageUrl),n.dark?.imageUrl&&e.add(n.dark.imageUrl),[...e]}function F(n){let e=(n.split("?")[0].split(".").pop()||"").toLowerCase();return e==="png"?"image/png":e==="jpg"||e==="jpeg"?"image/jpeg":e==="webp"?"image/webp":e==="gif"?"image/gif":e==="svg"?"image/svg+xml":"application/octet-stream"}async function H(n,e){let r=z(n);if(!r)return[];let s=[],c=new Set;for(let o of M(r)){let i=j("sha256").update(o).digest("hex");if(!c.has(i)){c.add(i);try{let t=await fetch(o);if(!t.ok){e?.onError?.(o,new Error(`${t.status} ${t.statusText}`));continue}let l=new Uint8Array(await t.arrayBuffer());s.push({url:o,urlhash:i,contentType:F(o),bytes:l}),e?.onStaged?.({url:o,byteLength:l.byteLength})}catch(t){e?.onError?.(o,t)}}}return s}export{G as a,q as b,H as c};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 f}from"./chunk-YXHO2OUL.js";import{existsSync as w,mkdirSync as g,readFileSync as h,writeFileSync as S,rmSync as q}from"fs";import{tmpdir as y}from"os";import{dirname as b,join as p}from"path";var m=new Map;function o(e,t){m.set(e,t)}var s=1;function a(){return p(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return p(y(),"sootsim-cli-hints-global.json")}function u(e){if(!w(e))return{version:s,shown:{}};try{let t=JSON.parse(h(e,"utf8"));return t?.version!==s||!t?.shown?{version:s,shown:{}}:t}catch{return{version:s,shown:{}}}}function l(e,t){try{g(b(e),{recursive:!0}),S(e,JSON.stringify(t)+`
4
+ import{c as f}from"./chunk-WIRBJTTU.js";import{existsSync as w,mkdirSync as g,readFileSync as h,writeFileSync as S,rmSync as q}from"fs";import{tmpdir as y}from"os";import{dirname as b,join as p}from"path";var m=new Map;function o(e,t){m.set(e,t)}var s=1;function a(){return p(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return p(y(),"sootsim-cli-hints-global.json")}function u(e){if(!w(e))return{version:s,shown:{}};try{let t=JSON.parse(h(e,"utf8"));return t?.version!==s||!t?.shown?{version:s,shown:{}}:t}catch{return{version:s,shown:{}}}}function l(e,t){try{g(b(e),{recursive:!0}),S(e,JSON.stringify(t)+`
5
5
  `)}catch{}}function v(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function H(e,t){let i=v();if(i==="off")return!1;if(i==="always"||t==="always")return!0;let r=Date.now();if(t==="once-per-identity"){let n=u(a());return n.shown[e]?!1:(n.shown[e]=r,l(a(),n),!0)}if(t==="once-ever"){let n=u(d());return n.shown[e]?!1:(n.shown[e]=r,l(d(),n),!0)}if(typeof t=="object"&&"cooldownMs"in t){let n=u(a()),c=n.shown[e]??0;return r-c<t.cooldownMs?!1:(n.shown[e]=r,l(a(),n),!0)}return!0}function A(e,...t){let i=m.get(e);if(!i)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!H(e,i.frequency))return!1;let r=i.render(...t);if(r==null)return!1;let n=Array.isArray(r)?r:[r];for(let c of n)console.error(` hint: ${c}`);return!0}o("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});o("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`});o("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(t=>` ${t}`)]:null});o("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});o("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});o("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`});o("clean-uninstall",{frequency:"once-ever",render:()=>["to remove the background daemon and all ~/.sootsim data, run `sootsim daemon uninstall`.","the optional desktop app and its macOS preference plist are separate from the daemon."]});export{A as a};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 x,b as We,c as Ke}from"./chunk-ITDTSNN2.js";import{m as O}from"./chunk-NXYKNKNL.js";import{m as _e,p as Oe}from"./chunk-HFA5ZACE.js";import{b as He,l as he}from"./chunk-SVFN66PF.js";import{a as B,b as pe}from"./chunk-JDKWIB6V.js";import{a as Ge,b as Je}from"./chunk-BPRMA4IC.js";import{a as Ne,b as q,c as de,d as ue,e as Fe,f as je,h as qe,i as z,j as ze}from"./chunk-RJWQ3VAD.js";import{d as fe}from"./chunk-W3CSYOSQ.js";import{a as Ve}from"./chunk-SN6ARNCL.js";import{a as me}from"./chunk-RQJDIDJ3.js";import{b as Be,c as De,d as ce,f as Ae,g as Le,h as M,i as v,j as E}from"./chunk-V6JDDX4B.js";import{f as Ee}from"./chunk-A4UYZTV7.js";import{b as le,d as Ue}from"./chunk-RT7TUHH7.js";import{d as Te,e as T,f as b,g as _}from"./chunk-YXHO2OUL.js";import{H as Re,K as ae,M as V,O as Me,l as ie}from"./chunk-7RFXZXKH.js";import{spawn as ot,spawnSync as nt}from"node:child_process";import U from"node:fs";import Ct from"node:os";import C from"node:path";import{WebSocket as Rt}from"ws";function Qe(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 vt(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Ze(e,o,t){return`${e}//${o}:${t}`}function St(e){if(typeof window>"u")return!1;try{let o=new URL(e);return x(o.hostname)&&x(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Ye(e,o){let t={...o,cache:o?.cache??"no-store"};return St(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function $t(e){return e==="https:"?443:80}function xt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function Pt(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:ue(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Xe(e,o){let t=e.replace(/\/+$/,"");try{if(x(new URL(t).hostname)){let n=await Pt(o);if(n)return n}}catch{}try{let n=await Ye(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:ue(i||`${t}${de}`),port:o,framework:vt(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ye(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:o,framework:"metro"}}catch{}return null}async function kt(e){return Xe(Ze("http:","localhost",e),e)}async function et(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await kt(a);if(l)return l;throw Qe(`localhost:${a}`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):$t(r),i=Ze(r,n.hostname,s);if(xt(n)){let a=await Xe(i,s);if(a)return a;throw Qe(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function Po(){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 tt(e){let o=B();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function It(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 ko(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){It(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var Mt=12e4,rt=100,Et=5e3,st=1e4,Ut={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(o=>setTimeout(o,e))}function it(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function Tt(){let e=it("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??it("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Mt;return{timeoutMs:e,hostTimeoutMs:e+Et,intervalMs:rt,attempts:Math.max(1,Math.ceil(e/rt))}}function _t(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function Ot(e,o){return e.includes("--headless")?!0:e.includes("--headed")?!1:o==="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 Q(e){return e.trim()}var dt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Bt(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return dt.test(o)||o.startsWith("/")?o:`/${o}`}function Dt(e){return e!==null&&typeof e=="object"}function At(e){let o=e.trim();return o?o.startsWith("/")?!0:dt.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function Lt(e){if(await G(e,250))return e;let o=ae();if(o&&V(o)&&await G(o.bridgePort,500))return o.bridgePort;if(o&&V(o))throw new Error(`sootsim bridge lockfile is fresh (port ${o.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await Nt();let t=Ft(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+st;for(;Date.now()<r;){let s=ae();if(s&&V(s)&&await G(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 G(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(st/1e3)}s`)}async function Nt(){let e=Re();if(e&&U.existsSync(ie(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-HDMLWNXW.js");await o(["install"],{})}function Ft(e){let o=process.argv[1];return o&&U.existsSync(o)?ot(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):ot("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function G(e,o){return new Promise(t=>{let n=new Rt(`ws://127.0.0.1:${e}`,{handshakeTimeout:o}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}t(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),o)})}function be(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function jt(e){try{let o=new URL(e,"http://sootsim.local");if(o.origin!=="http://sootsim.local")return!1;let t=o.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ht(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=Y(n.pathname),s=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return n.pathname=`${r}${s}`,n.search=t.search,n.hash=t.hash,n.toString()}function Wt(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function en(e){let o=Q(e);return(await ve(o)).bundleUrl}function Kt(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!x(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function ve(e){let o=Q(e),t=/^\d+$/.test(o)?Number(o):Kt(o);if(t&&t>0){let n=await je(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return et(o)}function Y(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Vt(e,o){let t=Q(e),n=new URL(o),r=Y(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function ut(e){let o=Q(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function qt(e,o,t={}){let n=t.resolvedBundle??await ve(e),r=new URL(o),s=Y(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=t.hot===void 0?n.bundleUrl:Fe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function zt(e){return e.startsWith("~/")?C.join(Ct.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function Gt(e){let o={},t={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=zt(s.slice(i+1).trim());U.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}async function Jt(e){if(e){let o=await z(e.bundleUrl);if(o)return me(o,{trustStart:!0})}return me(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Qt(e){if(U.existsSync(C.join(ie(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let o=await Ee.install({version:e,setActive:!1,protectVersions:Me()});console.error(` installed engine runtime ${o.version}`)}function Yt(e,o){if(!o)return e;let t=new URL(e);if(!x(t.hostname))throw new Error(`runtimeVersion ${o} requires a local SootSim host; got ${t.origin}`);return t.hostname=Ke(o),t.toString()}function mt(){return Be().shellBaseUrl}async function Zt(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=qe({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});if(s.length===0)return e;let i=await Xt(s);return i.length===0?e:(t.searchParams.set("appFonts",ze(i)),t.toString())}catch{return e}}async function Xt(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function eo(e,o,t={}){if(!e)return new URL(o).toString();if(be(e))return new URL(e).toString();if(jt(e))return Ht(e,o);let n=Ut[e.toLowerCase()];if(n){let r=new URL(o),s=Y(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return ut(e)?qt(e,o,t):Vt(e,o)}async function to(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=Ge({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});return!s||s.imageUrl&&!await oo(s.imageUrl)?e:(t.searchParams.set("appSplash",Je(s)),t.toString())}catch{return e}}async function oo(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function J(e,o=mt(),t={}){let n=await eo(e,o,t),r=await to(await Zt(n,t.project),t.project);if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function at(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return o}}async function no(e,o,t,n={}){let r=new URL(await J(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function ro(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function so(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function io(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function tn(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
4
+ import{a as x,b as We,c as Ke}from"./chunk-H5D6E3DR.js";import{m as O}from"./chunk-IJ64Z77P.js";import{m as _e,p as Oe}from"./chunk-R6MBDR56.js";import{b as He,l as he}from"./chunk-HKPJYMJC.js";import{a as B,b as pe}from"./chunk-43SNLCXR.js";import{a as Ge,b as Je}from"./chunk-PELXRGDN.js";import{a as Ne,b as q,c as de,d as ue,e as Fe,f as je,h as qe,i as z,j as ze}from"./chunk-UUKUKTV3.js";import{d as fe}from"./chunk-ZRQFYMTL.js";import{a as Ve}from"./chunk-VKBCGFOU.js";import{a as me}from"./chunk-TRV5K6D2.js";import{b as Be,c as De,d as ce,f as Ae,g as Le,h as M,i as v,j as E}from"./chunk-NNR3BU5O.js";import{f as Ee}from"./chunk-SWBTXTEO.js";import{b as le,d as Ue}from"./chunk-6EXIYEOQ.js";import{d as Te,e as T,f as b,g as _}from"./chunk-WIRBJTTU.js";import{H as Re,K as ae,M as V,O as Me,l as ie}from"./chunk-EBCXFB3K.js";import{spawn as ot,spawnSync as nt}from"node:child_process";import U from"node:fs";import Ct from"node:os";import C from"node:path";import{WebSocket as Rt}from"ws";function Qe(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 vt(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Ze(e,o,t){return`${e}//${o}:${t}`}function St(e){if(typeof window>"u")return!1;try{let o=new URL(e);return x(o.hostname)&&x(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Ye(e,o){let t={...o,cache:o?.cache??"no-store"};return St(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function $t(e){return e==="https:"?443:80}function xt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function Pt(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:ue(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Xe(e,o){let t=e.replace(/\/+$/,"");try{if(x(new URL(t).hostname)){let n=await Pt(o);if(n)return n}}catch{}try{let n=await Ye(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:ue(i||`${t}${de}`),port:o,framework:vt(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ye(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:o,framework:"metro"}}catch{}return null}async function kt(e){return Xe(Ze("http:","localhost",e),e)}async function et(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await kt(a);if(l)return l;throw Qe(`localhost:${a}`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):$t(r),i=Ze(r,n.hostname,s);if(xt(n)){let a=await Xe(i,s);if(a)return a;throw Qe(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function Po(){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 tt(e){let o=B();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function It(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 ko(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){It(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var Mt=12e4,rt=100,Et=5e3,st=1e4,Ut={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(o=>setTimeout(o,e))}function it(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function Tt(){let e=it("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??it("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Mt;return{timeoutMs:e,hostTimeoutMs:e+Et,intervalMs:rt,attempts:Math.max(1,Math.ceil(e/rt))}}function _t(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function Ot(e,o){return e.includes("--headless")?!0:e.includes("--headed")?!1:o==="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 Q(e){return e.trim()}var dt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Bt(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return dt.test(o)||o.startsWith("/")?o:`/${o}`}function Dt(e){return e!==null&&typeof e=="object"}function At(e){let o=e.trim();return o?o.startsWith("/")?!0:dt.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function Lt(e){if(await G(e,250))return e;let o=ae();if(o&&V(o)&&await G(o.bridgePort,500))return o.bridgePort;if(o&&V(o))throw new Error(`sootsim bridge lockfile is fresh (port ${o.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await Nt();let t=Ft(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+st;for(;Date.now()<r;){let s=ae();if(s&&V(s)&&await G(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 G(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(st/1e3)}s`)}async function Nt(){let e=Re();if(e&&U.existsSync(ie(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-NHDHZJJN.js");await o(["install"],{})}function Ft(e){let o=process.argv[1];return o&&U.existsSync(o)?ot(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):ot("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function G(e,o){return new Promise(t=>{let n=new Rt(`ws://127.0.0.1:${e}`,{handshakeTimeout:o}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}t(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),o)})}function be(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function jt(e){try{let o=new URL(e,"http://sootsim.local");if(o.origin!=="http://sootsim.local")return!1;let t=o.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ht(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=Y(n.pathname),s=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return n.pathname=`${r}${s}`,n.search=t.search,n.hash=t.hash,n.toString()}function Wt(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function en(e){let o=Q(e);return(await ve(o)).bundleUrl}function Kt(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!x(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function ve(e){let o=Q(e),t=/^\d+$/.test(o)?Number(o):Kt(o);if(t&&t>0){let n=await je(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return et(o)}function Y(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Vt(e,o){let t=Q(e),n=new URL(o),r=Y(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function ut(e){let o=Q(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function qt(e,o,t={}){let n=t.resolvedBundle??await ve(e),r=new URL(o),s=Y(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=t.hot===void 0?n.bundleUrl:Fe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function zt(e){return e.startsWith("~/")?C.join(Ct.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function Gt(e){let o={},t={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=zt(s.slice(i+1).trim());U.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}async function Jt(e){if(e){let o=await z(e.bundleUrl);if(o)return me(o,{trustStart:!0})}return me(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Qt(e){if(U.existsSync(C.join(ie(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let o=await Ee.install({version:e,setActive:!1,protectVersions:Me()});console.error(` installed engine runtime ${o.version}`)}function Yt(e,o){if(!o)return e;let t=new URL(e);if(!x(t.hostname))throw new Error(`runtimeVersion ${o} requires a local SootSim host; got ${t.origin}`);return t.hostname=Ke(o),t.toString()}function mt(){return Be().shellBaseUrl}async function Zt(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=qe({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});if(s.length===0)return e;let i=await Xt(s);return i.length===0?e:(t.searchParams.set("appFonts",ze(i)),t.toString())}catch{return e}}async function Xt(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function eo(e,o,t={}){if(!e)return new URL(o).toString();if(be(e))return new URL(e).toString();if(jt(e))return Ht(e,o);let n=Ut[e.toLowerCase()];if(n){let r=new URL(o),s=Y(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return ut(e)?qt(e,o,t):Vt(e,o)}async function to(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=Ge({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});return!s||s.imageUrl&&!await oo(s.imageUrl)?e:(t.searchParams.set("appSplash",Je(s)),t.toString())}catch{return e}}async function oo(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function J(e,o=mt(),t={}){let n=await eo(e,o,t),r=await to(await Zt(n,t.project),t.project);if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function at(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return o}}async function no(e,o,t,n={}){let r=new URL(await J(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function ro(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function so(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function io(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function tn(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
5
5
  `);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${io(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[t.isPrimary?"primary":"",t.id===o?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",n].filter(Boolean);console.log(` ${t.id}${r.length?` [${r.join(", ")}]`:""}`);let s=so(t.url);if(s)console.log(` loaded: ${s}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let i=ao(t);i&&console.log(` engine: ${i}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${lt(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${lt(Date.now()-t.lastActiveAt)}`)}}function ao(e){let o=e.url||e.origin||"";if(!o)return null;try{let t=new URL(o).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"Contrast app embedded (:3000)":We()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function lt(e){let o=Math.max(0,Math.round(e/1e3));return o<60?`${o}s ago`:o<3600?`${Math.round(o/60)}m ago`:o<86400?`${Math.round(o/3600)}h ago`:`${Math.round(o/86400)}d ago`}async function ge(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let d=(await a.listSims()).find(t);if(d)return d}catch{}finally{a.close()}await $(s)}return null}async function lo(e,o,t,n,r={}){let s=r.attempts??30,i=r.intervalMs??500,a=!!n&&Number.isInteger(n)&&n>1,l=()=>a&&n!==void 0&&!ye(n);for(let d=0;d<s;d++){if(l())return{kind:"host-exit"};let p=v(e,{commandTimeoutMs:o});try{let w=(await p.listSims()).find(t);if(w)return l()?{kind:"host-exit"}:{kind:"match",sim:w}}catch{}finally{p.close()}if(l())return{kind:"host-exit"};await $(i)}return{kind:"timeout"}}async function co(e,o,t,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let d=(await a.listSims()).find(p=>p.id===t);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await $(s)}return!1}function uo(e){let o=e.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let t=Number(o.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function mo(e){if(!e.connectAckFile)return!1;try{return U.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
6
6
  `,{flag:"w"}),!0}catch{return!1}}function ct(e){if(e.diagnosticLogPath)try{let o=U.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${C.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
7
7
  ${o.slice(-4e3)}`:o;console.error(` ${C.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${C.basename(e.diagnosticLogPath)}: ${t}`)}}function ye(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function po(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!ye(e))return!0;await $(100)}return!ye(e)}function fo(e){let o=nt("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=nt("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(o.status!==0||t.status!==0)return!1;let n=(o.stdout||"").trimEnd(),r=(t.stdout||"").trimEnd();return(r.startsWith(n)?r.slice(n.length):r).includes("SOOTSIM_PW_URL=")}async function we(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=uo(r);s&&n.add(s)}for(let r of n){if(!fo(r)){console.log(` skipped pid ${r}: not a sootsim playwright host (stale sim record)`);continue}try{process.kill(r,"SIGTERM")}catch{}if(await po(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function Z(e,o){if(o){let r=o.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let t=e.find(r=>r.isPrimary&&r.readyState==="open");if(t)return t;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function D(e,o,t){console.log(` ${t==="current sim"?"loaded":"opened"}: ${e} [${t}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function A(e,o,t){if(t.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await ho(e,o,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:_e})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&Oe(s))){let p=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: ${p} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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{execFileSync as b,execSync as A}from"node:child_process";var p=new WeakMap,u=new Set,y=!1;function d(){return{platform:process.platform,env:process.env}}function g(e=d()){return e.platform==="linux"&&e.env.GITHUB_ACTIONS==="true"&&e.env.RUNNER_OS==="Linux"}function I(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 E(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 v(e){return e==="darwin"?"metal":e==="linux"?"vulkan":"default"}function P(e,r=d()){if(g(r))return;let n=E(e);if(n)throw new Error(`[reap-browser] refused software-rendering Chrome process argument ${n}`);let o=v(r.platform),s=e.split(/\s+/);if(!s.includes(`--use-angle=${o}`)||!s.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 G(e){if(!e||typeof e!="object")return[];let n=e.gpu;if(!n||typeof n!="object")return[];let o=n,s=[],a=o.auxAttributes;if(a&&typeof a=="object")for(let t of Object.values(a))typeof t=="string"&&s.push(t);let i=o.devices;if(Array.isArray(i)){for(let t of i)if(!(!t||typeof t!="object"))for(let c of Object.values(t))typeof c=="string"&&s.push(c)}return s}function C(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 L(e,r=d()){if(g(r))return;let o=G(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 w(e){if(e&&typeof e=="object"){let n=p.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 w(n)}catch{}return null}function h(e){let r=[];try{r=A(`pgrep -P ${e} || true`).toString().split(`
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 p={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},m=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),d=new Set(["do","get","wait","shell","debug"]),b=new Set(["detox","maestro","record","film","storage","permissions","perf","screenshot","mode","inspect","debug","timeline","what-happened","shell","assert","device","open","list","use","claim","close","compat","report-issue","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","update","version","skill","config","cleanup","app-fonts","agent-wrapper","agent",...m]);function u(c){let r=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<r.length;){let o=r[s];if(o==="--"){e.commandArgs.push(...r.slice(s+1));break}let i=Object.entries(p).find(([a,t])=>a===o||t.short===o);if(i){let[a,t]=i,l=a.replace(/^--/,"");if(t.type==="boolean")e.globalFlags[l]=!0,s++;else{let n=r[s+1];if(n===void 0||n.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(t.type==="number"){let g=Number(n);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${n}"`),s+=2;continue}e.globalFlags[l]=g}else e.globalFlags[l]=n;s+=2}continue}if(!e.command&&!o.startsWith("-")){let a=o.indexOf("-");if(a>0){let t=o.slice(0,a),l=o.slice(a+1);if(d.has(t)&&l.length>0){e.command=t;let n=r.slice(s+1);e.commandArgs=[l,...n[0]==="--"?n.slice(1):n];break}}if(b.has(o)){e.command=o;let t=r.slice(s+1);e.commandArgs=t[0]==="--"?t.slice(1):t;break}e.commandArgs=r.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{m as a,u as b};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 Q(t,e){let r=["--max-ms","--maxMs","--maxms","--max_ms"];for(let n of r){let o=t.indexOf(n);if(o>=0&&t[o+1]){let s=Number(t[o+1]);if(Number.isFinite(s))return Math.max(100,s)}}return e}var N=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function P(t){return typeof t=="string"&&N.has(t)}async function M(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function X(t,e){if(!P(e))return!1;try{return await M(t)}catch{return!1}}async function Z(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function ee(t,e=5,r){let n=r?.format?`, ${JSON.stringify(r)}`:"",o=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}${n}))()`});if(r?.format==="boxes"&&typeof o=="string")try{return{depth:e,tree:JSON.parse(o)}}catch{return{depth:e,tree:o}}return{depth:e,tree:o}}async function te(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function ne(t,e){let r=`(async () => {
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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 j,d as H}from"./chunk-AJYA6R3N.js";import{c as Y}from"./chunk-GF3LDVWF.js";import{K as F,M,g as R,j as E,r as O,s as x,t as U}from"./chunk-7RFXZXKH.js";import{a as V}from"./chunk-ZONISYZ5.js";import{execFileSync as Z,spawnSync as c}from"child_process";import{existsSync as n,mkdirSync as L,readFileSync as le,realpathSync as ue,rmSync as h,writeFileSync as K}from"fs";import{homedir as v}from"os";import{basename as pe,dirname as C,resolve as u,sep as X}from"path";import{execFileSync as re}from"child_process";import{chmodSync as oe,mkdirSync as A,rmSync as se,writeFileSync as I}from"fs";import{dirname as T}from"path";var ne="dev.sootsim.daemon",G="SootSim Daemon",q="0.1.36";function W(e,t,r){let s=x(),o=U(),a=T(T(o)),l=T(o),p=`${a}/Resources`;se(s,{recursive:!0,force:!0}),A(O(),{recursive:!0}),A(l,{recursive:!0}),A(p,{recursive:!0}),I(`${a}/Info.plist`,ie()),I(`${a}/PkgInfo`,"APPL????"),I(o,ae(e,t,r)),oe(o,493);try{re("codesign",["--force","--sign","-","--deep",s],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${s} failed: ${f}
4
+ import{c as j,d as H}from"./chunk-3PREBGTH.js";import{c as Y}from"./chunk-J653UMCU.js";import{K as F,M,g as R,j as E,r as O,s as x,t as U}from"./chunk-EBCXFB3K.js";import{a as V}from"./chunk-CWDEDUOZ.js";import{execFileSync as Z,spawnSync as c}from"child_process";import{existsSync as n,mkdirSync as L,readFileSync as le,realpathSync as ue,rmSync as h,writeFileSync as K}from"fs";import{homedir as v}from"os";import{basename as pe,dirname as C,resolve as u,sep as X}from"path";import{execFileSync as re}from"child_process";import{chmodSync as oe,mkdirSync as A,rmSync as se,writeFileSync as I}from"fs";import{dirname as T}from"path";var ne="dev.sootsim.daemon",G="SootSim Daemon",q="0.1.36";function W(e,t,r){let s=x(),o=U(),a=T(T(o)),l=T(o),p=`${a}/Resources`;se(s,{recursive:!0,force:!0}),A(O(),{recursive:!0}),A(l,{recursive:!0}),A(p,{recursive:!0}),I(`${a}/Info.plist`,ie()),I(`${a}/PkgInfo`,"APPL????"),I(o,ae(e,t,r)),oe(o,493);try{re("codesign",["--force","--sign","-","--deep",s],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${s} failed: ${f}
5
5
  the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:s,launcherPath:o}}function ie(){return`<?xml version="1.0" encoding="UTF-8"?>
6
6
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
7
7
  <plist version="1.0">
@@ -1,6 +1,6 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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{G as E,H as F,I as j,k as L,l as N,u as U,x as _}from"./chunk-7RFXZXKH.js";import z from"node:fs";import G from"node:path";function A(e){return e.length<=100&&/^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(e)}function M(e){try{return z.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort(k)}catch{return[]}}function T(e,c){return G.posix.basename(e.tarballPath(c))}function k(e,c){let l=f=>{let v=f.indexOf("-"),V=v>=0?f.slice(0,v):f,$=v>=0?f.slice(v+1):"",D=V.split(".").map(I=>Number.parseInt(I,10));return D.some(I=>!Number.isFinite(I))?[[Number.POSITIVE_INFINITY],f]:[D,$]},[m,u]=l(e),[R,x]=l(c);for(let f=0;f<Math.max(m.length,R.length);f++){let v=m[f]??0,V=R[f]??0;if(v!==V)return v-V}return u===x?0:u?x?u<x?-1:1:-1:1}import{spawn as Z}from"node:child_process";import J from"node:crypto";import o from"node:fs";import Y from"node:os";import y from"node:path";import{Readable as q}from"node:stream";import{pipeline as B}from"node:stream/promises";var K=2;function H(e){function c(){try{let n=JSON.parse(o.readFileSync(e.configFile(),"utf8"));return n&&typeof n=="object"?n:{}}catch{return{}}}function l(n){let t=c();return(n||process.env[e.env.cdnOrigin]||t.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(n){let t=c();return n||process.env[e.env.channel]||t.runtimeChannel||"stable"}function u(){if(!e.env.pin)return null;let n=process.env[e.env.pin];if(n&&n.trim())return n.trim();let t=c();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function R(n){let t=new URL(`${l(n)}${e.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function x(n,t){return`${l(t)}${e.tarballPath(n)}`}async function f(n){let t=R(n),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function v(n,t={}){let r=m(t.channel),i=t.version||u()||n.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);if(!A(i))throw new Error(`invalid runtime version: ${i}`);let h=n.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(n.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function V(n={}){e.ensureHome();let t=l(n.cdnOrigin),r=await f(t),{version:i,channel:h,entry:a}=v(r,n),d=e.runtimeDir(i),g=n.setActive!==!1,O=[i,...n.protectVersions??[]];if(b({protectVersions:O}),!n.force&&o.existsSync(y.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),b({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!1,activated:g,manifest:r};let P=a.tarball||x(i,t),S=o.mkdtempSync(y.join(Y.tmpdir(),`${e.id}-runtime-download-`)),w=y.join(S,T(e,i)),p=y.join(y.dirname(d),`.installing-${i}-${process.pid}`);o.rmSync(p,{recursive:!0,force:!0});try{process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
4
+ import{G as E,H as F,I as j,k as L,l as N,u as U,x as _}from"./chunk-EBCXFB3K.js";import z from"node:fs";import G from"node:path";function A(e){return e.length<=100&&/^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(e)}function M(e){try{return z.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort(k)}catch{return[]}}function T(e,c){return G.posix.basename(e.tarballPath(c))}function k(e,c){let l=f=>{let v=f.indexOf("-"),V=v>=0?f.slice(0,v):f,$=v>=0?f.slice(v+1):"",D=V.split(".").map(I=>Number.parseInt(I,10));return D.some(I=>!Number.isFinite(I))?[[Number.POSITIVE_INFINITY],f]:[D,$]},[m,u]=l(e),[R,x]=l(c);for(let f=0;f<Math.max(m.length,R.length);f++){let v=m[f]??0,V=R[f]??0;if(v!==V)return v-V}return u===x?0:u?x?u<x?-1:1:-1:1}import{spawn as Z}from"node:child_process";import J from"node:crypto";import o from"node:fs";import Y from"node:os";import y from"node:path";import{Readable as q}from"node:stream";import{pipeline as B}from"node:stream/promises";var K=2;function H(e){function c(){try{let n=JSON.parse(o.readFileSync(e.configFile(),"utf8"));return n&&typeof n=="object"?n:{}}catch{return{}}}function l(n){let t=c();return(n||process.env[e.env.cdnOrigin]||t.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(n){let t=c();return n||process.env[e.env.channel]||t.runtimeChannel||"stable"}function u(){if(!e.env.pin)return null;let n=process.env[e.env.pin];if(n&&n.trim())return n.trim();let t=c();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function R(n){let t=new URL(`${l(n)}${e.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function x(n,t){return`${l(t)}${e.tarballPath(n)}`}async function f(n){let t=R(n),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function v(n,t={}){let r=m(t.channel),i=t.version||u()||n.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);if(!A(i))throw new Error(`invalid runtime version: ${i}`);let h=n.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(n.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function V(n={}){e.ensureHome();let t=l(n.cdnOrigin),r=await f(t),{version:i,channel:h,entry:a}=v(r,n),d=e.runtimeDir(i),g=n.setActive!==!1,O=[i,...n.protectVersions??[]];if(b({protectVersions:O}),!n.force&&o.existsSync(y.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),b({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!1,activated:g,manifest:r};let P=a.tarball||x(i,t),S=o.mkdtempSync(y.join(Y.tmpdir(),`${e.id}-runtime-download-`)),w=y.join(S,T(e,i)),p=y.join(y.dirname(d),`.installing-${i}-${process.pid}`);o.rmSync(p,{recursive:!0,force:!0});try{process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
5
5
  `),await Q(P,w),process.stderr.write(`${e.id}: extracting runtime ${i}\u2026
6
6
  `);let s=await X(w);if(s!==a.sha256)throw new Error(`sha256 mismatch for runtime ${i}: expected ${a.sha256}, actual ${s}`);if(o.mkdirSync(p,{recursive:!0}),await ee(w,p),!o.existsSync(y.join(p,e.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${e.installedMarker}`);o.rmSync(d,{recursive:!0,force:!0}),o.renameSync(p,d)}catch(s){throw o.rmSync(p,{recursive:!0,force:!0}),s}finally{o.rmSync(S,{recursive:!0,force:!0})}return g&&e.writeActiveRuntime(i),b({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!0,activated:g,manifest:r}}async function $(n={}){e.ensureHome(),b({protectVersions:n.protectVersions});let t=l(n.cdnOrigin),r=m(n.channel),i=u();if(i){let p=e.readActiveRuntime(),s=o.existsSync(y.join(e.runtimeDir(i),e.installedMarker));if(p===i&&s)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:p,latestVersion:i};let C=await V({version:i,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:C}}let h=await f(t),a=h.channels[r]?.latest;if(!a)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:e.readActiveRuntime()};if(!h.versions[a])return{checked:!0,updated:!1,reason:`manifest is missing version ${a}`,activeVersion:e.readActiveRuntime(),latestVersion:a};let g=e.readActiveRuntime(),O=g?e.runtimeDir(g):null,P=O?o.existsSync(y.join(O,e.installedMarker)):!1;if(!(!g||!P||k(a,g)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:g,latestVersion:a};let w=await V({version:a,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,activeVersion:a,latestVersion:a,install:w}}async function D(n={}){let t=e.readActiveRuntime(),r=u();if(r)return{active:t,latest:r,pinned:r,outdated:t!==r};try{let i=await f(l(n.cdnOrigin)),h=m(n.channel),a=i.channels[h]?.latest??null,d=!!(a&&(!t||k(a,t)>0));return{active:t,latest:a,pinned:null,outdated:d}}catch{return{active:t,latest:null,pinned:null,outdated:!1}}}function I(n={}){e.ensureHome();let t=Math.max(1,Math.floor(n.retainVersions??K)),r=M(e),i=new Set(r),h=e.readActiveRuntime(),a=u(),d=new Set;for(let s of[h,a,...n.protectVersions??[]])s&&i.has(s)&&d.add(s);for(let s of[...r].reverse()){if(d.size>=t)break;d.add(s)}let g="__RUNTIME_VERSION__",O=T(e,g),P=O.indexOf(g),S=O.slice(0,P),w=O.slice(P+g.length),p=[];if(P>=0)try{p=o.readdirSync(e.cacheDir(),{withFileTypes:!0}).filter(s=>{if(!s.isFile())return!1;let C=s.name.startsWith(S)&&s.name.endsWith(w),W=s.name.startsWith(S)&&s.name.endsWith(`${w}.partial`);return C||W}).map(s=>y.join(e.cacheDir(),s.name)).sort()}catch{}return{activeVersion:h,pinnedVersion:a,keepVersions:r.filter(s=>d.has(s)),removeVersions:r.filter(s=>!d.has(s)),removeCacheFiles:p}}function b(n={}){let t=I(n);for(let r of t.removeVersions)o.rmSync(e.runtimeDir(r),{recursive:!0,force:!0});for(let r of t.removeCacheFiles)o.rmSync(r,{force:!0});return t}return{product:e,resolveCdnOrigin:l,resolveChannel:m,resolvePin:u,manifestUrl:R,tarballUrl:x,fetchManifest:f,resolveVersion:v,install:V,updateToLatest:$,checkUpToDate:D,planLocalRetention:I,pruneLocalRetention:b,listInstalled:()=>M(e)}}async function Q(e,c){let l=await fetch(e);if(!l.ok||!l.body)throw new Error(`download failed: ${l.status} ${l.statusText} (${e})`);o.mkdirSync(y.dirname(c),{recursive:!0});let m=`${c}.partial`;try{await B(q.fromWeb(l.body),o.createWriteStream(m)),o.renameSync(m,c)}catch(u){try{o.unlinkSync(m)}catch{}throw u}}function X(e){return new Promise((c,l)=>{let m=J.createHash("sha256"),u=o.createReadStream(e);u.on("data",R=>m.update(R)),u.on("error",l),u.on("end",()=>c(m.digest("hex")))})}function ee(e,c){return new Promise((l,m)=>{let u=Z("tar",["-xzf",e,"-C",c],{stdio:["ignore","inherit","inherit"]});u.on("error",m),u.on("exit",R=>{R===0?l():m(new Error(`tar exited with code ${R}`))})})}var ne="https://contrast.dev",ve="https://sootsim.com/changelog",Oe="https://contrast.dev/api/changelog/sootsim",te={id:"sootsim",defaultCdnOrigin:ne,manifestPath:"/runtimes/manifest.json",tarballPath:e=>`/runtimes/sootsim-runtime-${e}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL"},ensureHome:E,configFile:_,runtimesDir:L,runtimeDir:N,cacheDir:U,readActiveRuntime:F,writeActiveRuntime:j},ye=H(te);export{A as a,k as b,ne as c,ve as d,Oe as e,ye as f};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.304 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.305 | (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};