sootsim 0.1.280 → 0.1.281

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/README.md +5 -0
  2. package/dist-cli/bin.js +4 -4
  3. package/dist-cli/chunks/{agent-ROXS5UKV.js → agent-H3NMY2PI.js} +2 -2
  4. package/dist-cli/chunks/{agent-wrapper-D5NKHRC2.js → agent-wrapper-KBNLBPI5.js} +2 -2
  5. package/dist-cli/chunks/{app-fonts-NLXHDDFY.js → app-fonts-BBUYJ6US.js} +2 -2
  6. package/dist-cli/chunks/{assert-6BX5ZJC6.js → assert-N57H6VGS.js} +2 -2
  7. package/dist-cli/chunks/{auth-7IVPJHYP.js → auth-GDXIGJL5.js} +2 -2
  8. package/dist-cli/chunks/beta-EQZEEN7X.js +2 -0
  9. package/dist-cli/chunks/{camera-NCWVBECI.js → camera-F2RDRNRG.js} +2 -2
  10. package/dist-cli/chunks/{chunk-GLOQZ4YT.js → chunk-4PEJMPN4.js} +1 -1
  11. package/dist-cli/chunks/{chunk-A4YDHKVX.js → chunk-5FQXFCIF.js} +3 -3
  12. package/dist-cli/chunks/{chunk-DUH4SRYN.js → chunk-6AN3FGY4.js} +2 -2
  13. package/dist-cli/chunks/{chunk-CNTAENS7.js → chunk-76NQG773.js} +2 -2
  14. package/dist-cli/chunks/{chunk-AJLMKI3T.js → chunk-7DBKPFMT.js} +1 -1
  15. package/dist-cli/chunks/{chunk-ZSTVFJS3.js → chunk-ARZJZUZN.js} +2 -2
  16. package/dist-cli/chunks/{chunk-EF7SUCU5.js → chunk-BEH7L47J.js} +1 -1
  17. package/dist-cli/chunks/{chunk-YNXFCE4C.js → chunk-BXO377TL.js} +2 -2
  18. package/dist-cli/chunks/{chunk-V5FIROGW.js → chunk-BYL4LXI2.js} +2 -2
  19. package/dist-cli/chunks/{chunk-UPXILQIY.js → chunk-CJJAKIW5.js} +2 -2
  20. package/dist-cli/chunks/{chunk-MYY572U5.js → chunk-CLGWPBAX.js} +1 -1
  21. package/dist-cli/chunks/{chunk-TGARSKJS.js → chunk-EXXJPCOE.js} +1 -1
  22. package/dist-cli/chunks/{chunk-33ZEVH5C.js → chunk-G26HA7RJ.js} +2 -2
  23. package/dist-cli/chunks/{chunk-AVOOC775.js → chunk-GJSRPQF3.js} +1 -1
  24. package/dist-cli/chunks/{chunk-JNI6O5ID.js → chunk-I26CCXY4.js} +32 -14
  25. package/dist-cli/chunks/{chunk-FDXWQHE2.js → chunk-IZ2STC6S.js} +2 -2
  26. package/dist-cli/chunks/{chunk-NOEMQR47.js → chunk-KBCU6ZSM.js} +3 -3
  27. package/dist-cli/chunks/{chunk-SZOPUPSH.js → chunk-LLOLNFOC.js} +3 -3
  28. package/dist-cli/chunks/{chunk-JBL6N36H.js → chunk-LO6HC3DY.js} +2 -2
  29. package/dist-cli/chunks/{chunk-HYEFBMSG.js → chunk-M3SBLCVQ.js} +72 -72
  30. package/dist-cli/chunks/{chunk-G4JIE3MG.js → chunk-M6YBVN3L.js} +2 -2
  31. package/dist-cli/chunks/{chunk-ZT5AT5TL.js → chunk-MKAHHLPB.js} +2 -2
  32. package/dist-cli/chunks/{chunk-XRXBF2B4.js → chunk-MV4B4SU4.js} +2 -2
  33. package/dist-cli/chunks/{chunk-YATEKNXL.js → chunk-NBE5LT2F.js} +2 -2
  34. package/dist-cli/chunks/{chunk-QRGDTI6D.js → chunk-NFMWFSRL.js} +2 -2
  35. package/dist-cli/chunks/{chunk-HVOLXPNB.js → chunk-NJIE2DWC.js} +1 -1
  36. package/dist-cli/chunks/{chunk-C6PU2Y3O.js → chunk-O5ABYG6P.js} +1 -1
  37. package/dist-cli/chunks/{chunk-JRRMIVSC.js → chunk-OE7UZ2N7.js} +2 -2
  38. package/dist-cli/chunks/{chunk-NFJHEVT2.js → chunk-OWYIFL7U.js} +1 -1
  39. package/dist-cli/chunks/{chunk-4X7KRVUQ.js → chunk-PKRZNYTJ.js} +1 -1
  40. package/dist-cli/chunks/{chunk-UEDGP46Q.js → chunk-PLKAPXAO.js} +1 -1
  41. package/dist-cli/chunks/{chunk-NSKS43OW.js → chunk-R3QQ4NB6.js} +1 -1
  42. package/dist-cli/chunks/{chunk-HVW7KD5H.js → chunk-SGKR7R2W.js} +1 -1
  43. package/dist-cli/chunks/{chunk-OUHXKX62.js → chunk-SHWJJEPO.js} +1 -1
  44. package/dist-cli/chunks/{chunk-EMQ6G7EP.js → chunk-TQ75ATRP.js} +1 -1
  45. package/dist-cli/chunks/{chunk-MUMR4ITL.js → chunk-TVTJ4MU7.js} +1 -1
  46. package/dist-cli/chunks/{chunk-4MOKMNXN.js → chunk-UBRDMIPO.js} +1 -1
  47. package/dist-cli/chunks/{chunk-V7ISEJ3S.js → chunk-UBZG4U6Y.js} +2 -2
  48. package/dist-cli/chunks/{chunk-L4PHKH3P.js → chunk-VJRGHV2T.js} +2 -2
  49. package/dist-cli/chunks/{chunk-NK7I3QVD.js → chunk-VPK4MS2R.js} +1 -1
  50. package/dist-cli/chunks/chunk-VPOAQYFB.js +36 -0
  51. package/dist-cli/chunks/{chunk-QUW7SRYQ.js → chunk-YASCPSFS.js} +2 -2
  52. package/dist-cli/chunks/chunk-YDXHF77F.js +1 -0
  53. package/dist-cli/chunks/{chunk-5JMI6AGC.js → chunk-ZMC5QAHG.js} +2 -2
  54. package/dist-cli/chunks/cli-version-GPHW2FDT.js +2 -0
  55. package/dist-cli/chunks/{compat-EB3D6QQF.js → compat-ZURAN7IX.js} +3 -3
  56. package/dist-cli/chunks/{config-RNKFWNIV.js → config-HMWQ4YBF.js} +2 -2
  57. package/dist-cli/chunks/{control-7ZDTAZUN.js → control-23GPC25Q.js} +2 -2
  58. package/dist-cli/chunks/daemon-T5PGVASX.js +2 -0
  59. package/dist-cli/chunks/{debug-RXXHRVIL.js → debug-ZMG6SUSI.js} +3 -3
  60. package/dist-cli/chunks/{desktop-BN6J4PCR.js → desktop-OXRI2NZT.js} +3 -3
  61. package/dist-cli/chunks/{detox-7JRAP55Z.js → detox-IGH7365Y.js} +2 -2
  62. package/dist-cli/chunks/{device-ECQZUWAB.js → device-PVNQ2SHY.js} +2 -2
  63. package/dist-cli/chunks/{diagnose-WCYZVJYK.js → diagnose-E3IECR4R.js} +2 -2
  64. package/dist-cli/chunks/drivers-AKRARWOS.js +2 -0
  65. package/dist-cli/chunks/{film-PBJTMXO6.js → film-76IAGEW4.js} +3 -3
  66. package/dist-cli/chunks/flow-FLKLFK6B.js +2 -0
  67. package/dist-cli/chunks/help-JLUECV66.js +2 -0
  68. package/dist-cli/chunks/{hidden-runtime-alias-R3PN4QI7.js → hidden-runtime-alias-QDD5MXAH.js} +2 -2
  69. package/dist-cli/chunks/{home-paths-W3I2O5KQ.js → home-paths-IPENAIUF.js} +2 -2
  70. package/dist-cli/chunks/inspect-2DY2DXPR.js +2 -0
  71. package/dist-cli/chunks/install-desktop-QMOFRUBR.js +2 -0
  72. package/dist-cli/chunks/{login-SHL26YD7.js → login-T5QCUIQG.js} +4 -4
  73. package/dist-cli/chunks/{logout-GACILXYF.js → logout-322EAZHR.js} +2 -2
  74. package/dist-cli/chunks/{maestro-7IPHVNRV.js → maestro-UIRV2OTW.js} +3 -3
  75. package/dist-cli/chunks/{maestro-generate-OXINOJKT.js → maestro-generate-GOOWEQ2E.js} +3 -3
  76. package/dist-cli/chunks/{mode-UDK37JMK.js → mode-7PSQFJX5.js} +2 -2
  77. package/dist-cli/chunks/optional-demo-registry-KI6L6CHC.js +2 -0
  78. package/dist-cli/chunks/{perf-V55KCRZZ.js → perf-EFU6MH2P.js} +2 -2
  79. package/dist-cli/chunks/{record-TOZEIESK.js → record-TGAPZA7M.js} +3 -3
  80. package/dist-cli/chunks/runtime-FR7QCZRH.js +2 -0
  81. package/dist-cli/chunks/{screenshot-command-M7RQDY24.js → screenshot-command-B7HGAM62.js} +3 -3
  82. package/dist-cli/chunks/{screenshots-capture-OOOIEOT3.js → screenshots-capture-3DLJONOY.js} +2 -2
  83. package/dist-cli/chunks/{serve-JIESP3OL.js → serve-CAHXPQYS.js} +2 -2
  84. package/dist-cli/chunks/{setup-HKBKU6RB.js → setup-4RVKOYLH.js} +3 -3
  85. package/dist-cli/chunks/{skills-LC76VPDE.js → skills-KDQCA6TK.js} +2 -2
  86. package/dist-cli/chunks/{storage-WS32EPR5.js → storage-7KWBDYJB.js} +2 -2
  87. package/dist-cli/chunks/store-YD3V42A7.js +2 -0
  88. package/dist-cli/chunks/telemetry-5SVL6DUX.js +2 -0
  89. package/dist-cli/chunks/{timeline-DD7JXLF4.js → timeline-OZ4GS3M7.js} +2 -2
  90. package/dist-cli/chunks/{upgrade-PRO7EDS7.js → upgrade-ZUL3MOSC.js} +2 -2
  91. package/dist-cli/chunks/upload-O7SEWFON.js +2 -0
  92. package/dist-cli/chunks/{version-XPBJ4NKL.js → version-HMF256O6.js} +2 -2
  93. package/dist-cli/chunks/{web-RYQFPTU7.js → web-VDJD7VQI.js} +2 -2
  94. package/dist-cli/chunks/{what-happened-PX2UYSNH.js → what-happened-5UGTEHS2.js} +2 -2
  95. package/dist-lib/agent-daemon-client.cjs +1 -1
  96. package/dist-lib/agent-events.cjs +1 -1
  97. package/dist-lib/agent-identity.cjs +1 -1
  98. package/dist-lib/agent-sessions.cjs +1 -1
  99. package/dist-lib/attached-projects.cjs +1 -1
  100. package/dist-lib/auth/shared-session.cjs +1 -1
  101. package/dist-lib/backend-origin.cjs +1 -1
  102. package/dist-lib/beta.cjs +1 -1
  103. package/dist-lib/beta.mjs +1 -1
  104. package/dist-lib/bridge-constants.cjs +1 -1
  105. package/dist-lib/cli-constants.cjs +1 -1
  106. package/dist-lib/config.cjs +1 -1
  107. package/dist-lib/detox/index.cjs +1 -1
  108. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  109. package/dist-lib/home-paths.cjs +1 -1
  110. package/dist-lib/host/bridge-host.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  112. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  113. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  114. package/dist-lib/host/websocket-proxy.cjs +1 -1
  115. package/dist-lib/index.cjs +1 -1
  116. package/dist-lib/jump-to-source-babel.cjs +1 -1
  117. package/dist-lib/menu.cjs +1 -1
  118. package/dist-lib/menu.mjs +1 -1
  119. package/dist-lib/metro.cjs +1 -1
  120. package/dist-lib/profiles.cjs +1 -1
  121. package/dist-lib/render-mode.cjs +1 -1
  122. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  123. package/dist-lib/sdk.cjs +30 -3
  124. package/dist-lib/sdk.mjs +30 -3
  125. package/dist-lib/skills.cjs +21 -3
  126. package/dist-lib/vite.cjs +1 -1
  127. package/package.json +1 -1
  128. package/dist-cli/chunks/beta-ACSL6DHP.js +0 -2
  129. package/dist-cli/chunks/chunk-F3R6EZXX.js +0 -1
  130. package/dist-cli/chunks/chunk-NGMNL724.js +0 -36
  131. package/dist-cli/chunks/cli-version-FQD2KSQY.js +0 -2
  132. package/dist-cli/chunks/daemon-FEOCQWJE.js +0 -2
  133. package/dist-cli/chunks/drivers-F56K2VMH.js +0 -2
  134. package/dist-cli/chunks/flow-EZ2VB7CJ.js +0 -2
  135. package/dist-cli/chunks/help-VHLOJJWI.js +0 -2
  136. package/dist-cli/chunks/inspect-T74KPORE.js +0 -2
  137. package/dist-cli/chunks/install-desktop-NQWN2YAX.js +0 -2
  138. package/dist-cli/chunks/optional-demo-registry-HMXG44PF.js +0 -2
  139. package/dist-cli/chunks/runtime-MAEGIKCE.js +0 -2
  140. package/dist-cli/chunks/store-SS33J2RI.js +0 -2
  141. package/dist-cli/chunks/telemetry-ITXU4MEQ.js +0 -2
  142. package/dist-cli/chunks/upload-T5FFFASC.js +0 -2
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  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(`
3
3
  `).filter(Boolean)}catch{}for(let n of r)h(Number(n));try{process.kill(e,"SIGKILL")}catch{}}function f(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?f(n):null}catch{return null}}function m(e,r,n){e&&typeof e=="object"&&p.set(e,n),p.set(r,n),u.add(n),B()}async function N(e){let r=w(e);if(r!==null)return r;let n=f(e);if(!n||typeof n.newBrowserCDPSession!="function")return null;let o=await n.newBrowserCDPSession();try{let s=C(await o.send("SystemInfo.getProcessInfo"));return s===null?null:(m(e,n,s),s)}finally{await o.detach?.()}}async function j(e){let r=w(e);if(r!==null){u.delete(r),h(r);return}let n=e;if(n&&typeof n.close=="function")try{await n.close()}catch{}}async function T(e,r,n){if(g(r))return;let o=w(e),s=f(e);if(o!==null&&s&&m(e,s,o),o!==null&&(r.platform==="darwin"||r.platform==="linux")){let t=b("ps",["-p",String(o),"-o","command="],{encoding:"utf8"}).trim();P(t,r)}let a=n?await n(e):e,i=f(a);if(i&&typeof i.newBrowserCDPSession=="function"){let t=await i.newBrowserCDPSession();try{let c=C(await t.send("SystemInfo.getProcessInfo"));if(c===null)throw new Error("[reap-browser] Chrome did not report its browser process id");if(m(e,i,c),a&&typeof a=="object"&&p.set(a,c),r.platform==="darwin"||r.platform==="linux"){let l=b("ps",["-p",String(c),"-o","command="],{encoding:"utf8"}).trim();P(l,r)}L(await t.send("SystemInfo.getInfo"),r);return}finally{await t.detach?.()}}throw new Error("[reap-browser] could not validate the launched Chrome GPU renderer")}var $=!1;function B(){if(y)return;y=!0;let e=()=>{for(let r of u)h(r)};$||(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=w(r);if(n===null)try{n=await N(r)}catch{n=null}let o=new Set;n!=null&&(o.add(n),u.add(n),B());let s=f(r)??r;if(typeof s.on=="function"){let i=typeof s.newBrowserCDPSession=="function"?"disconnected":"close";s.on(i,()=>{for(let t of o)u.delete(t)})}return{browser:r,reapNow:()=>{for(let i of o)h(i),u.delete(i);o.clear()}}}async function D(e){let{browser:r}=await R(e);return r}var k=!1;function W(e=process.platform){return[`--use-angle=${v(e)}`,"--enable-gpu","--enable-gpu-rasterization","--enable-zero-copy","--ignore-gpu-blocklist"]}function O(e={},r=d()){let n=Array.isArray(e.args)?e.args:[],o=n.find(I);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 s=new Set(["--enable-gpu","--enable-gpu-rasterization","--enable-zero-copy","--ignore-gpu-blocklist"]),a=n.filter(c=>{let l=String(c);return!s.has(l)&&!l.startsWith("--use-angle=")}),i=Array.isArray(e.ignoreDefaultArgs)?e.ignoreDefaultArgs:[],t=[...new Set([...i,"--disable-gpu","--enable-unsafe-swiftshader"])];return{...e,channel:"chromium",args:[...a,...W(r.platform)],ignoreDefaultArgs:t}}function x(e,r,n){return async()=>{let o=d(),s=g(o),a=O(r,o);if(!k){let i;try{i=await e(a)}catch(t){let c=t instanceof Error?t.message:String(t);if(!/not found at|not installed|Chromium distribution|Executable doesn't exist|No such file/i.test(c))throw t;if(!s)throw new Error("[reap-browser] Playwright Chrome for Testing is required for local GPU browser work; chromium_headless_shell fallback is disabled. Run `bunx playwright install chromium`.",{cause:t});return k=!0,console.warn("[reap-browser] GitHub Actions Linux Chrome for Testing not found, falling back to chromium_headless_shell software rendering."),e(S(r))}try{await T(i,o,n)}catch(t){throw await j(i),t}return i}return e(S(r))}}function S(e){let r={...e};return delete r.channel,delete r.executablePath,r}async function z(e,r={},n){return D(x(e,r,n))}async function U(e,r={},n){return R(x(e,r,n))}export{z as a,U as b};
@@ -0,0 +1,36 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{H as F,m as B,n as A,o as h,t as E,v as P}from"./chunk-I26CCXY4.js";import{h as y,l as N,m as I}from"./chunk-NBE5LT2F.js";var k={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function z(e){return e.includes("--json")}function K(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
3
+ `)}function Q(e){process.stderr.write(`${e}
4
+ `)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function O(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function j(e,t,...r){return I(e,`SootSim.bridges.mainShell.${t}`,...r)}async function X(e,t={}){try{let r=await O(e,"waitForScreenTransitions",k);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function Z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await j(e,t,...n)}catch(o){if(!F(o)||Date.now()>=s)throw o;await w(50)}}async function ee(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let i=0;i<s;i++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function te(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let i=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await i.send({type:"evaluate",code:"1"}),i}catch{i.close()}await w(o)}return null}async function ne(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,i=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,liveFrameActive:!1,liveFrameChannels:0,liveFramePublishes:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let a=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(a?.nodes)||0,$=Number(a?.targets)||0,C=a?.liveFrameActive===!0,W=Number(a?.liveFrameChannels)||0,q=Number(a?.liveFramePublishes)||0,x=Number(a?.errors)||0,T=a?.flag===!0,p=a?.externalReady,M=typeof a?.loadingText=="string"?a.loadingText.trim():"",D=typeof a?.externalStatus=="string"?a.externalStatus.trim():"",R=typeof a?.externalError=="string"?a.externalError.trim():"",v=typeof a?.externalError=="string"&&R.length>0;if(c=p,d=v,f!==i&&(i=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,liveFrameActive:C,liveFrameChannels:W,liveFramePublishes:q,flag:a?.flag,loadingText:M,externalReady:typeof p=="boolean"?p:null,externalStatus:D,externalError:R,errors:x},T&&p!==!1&&!v&&!M&&h({liveFrameActive:C,nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!T)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function H(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function L(e,t={}){let r=await e.send({type:"evaluate",code:P});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
5
+ console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await E(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
6
+ recent console errors:
7
+ `);for(let i of l){let u=b(i.timestamp),c=Array.isArray(i.args)?i.args.map(d=>typeof d=="object"?JSON.stringify(d):String(d)).join(" "):String(i);console.log(` [${u}] ${c}`)}}}async function G(e,t={}){let r=await _(e,"getRequestCounts");if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.failed)||0);if(n===0||(console.log(`
8
+ network: ${n} failed request${n===1?"":"s"}`),t.requestsCommand&&console.log(` inspect: ${t.requestsCommand}`),!t.includeTail))return;let s=await _(e,"getFailedRequests",5);if(!(!Array.isArray(s)||s.length===0)){console.log(`
9
+ recent failed requests:
10
+ `);for(let o of s){let l=b(o.timestamp);console.log(` [${l}] ${H(o)}`),o.responseBody?console.log(` ${o.responseBody}`):o.error&&console.log(` ${o.error}`)}}}async function J(e){let t=await e.send({type:"evaluate",code:`(async () => {
11
+ const test = window.__sootsimTest
12
+ const mainShell = window.SootSim?.bridges?.mainShell
13
+ let shell = null
14
+ try {
15
+ shell = typeof mainShell?.getState === 'function' ? await mainShell.getState() : null
16
+ } catch {}
17
+ let nodeCount = 0
18
+ try {
19
+ nodeCount = typeof test?.getNodeCount === 'function' ? await test.getNodeCount() : 0
20
+ } catch {}
21
+ return {
22
+ url: window.location.href,
23
+ simId: window.__sootsimSimId || null,
24
+ nodeCount,
25
+ mode: window.__sootsimRenderHost ? 'render-worker' : 'main-thread',
26
+ shell: shell
27
+ ? {
28
+ state: shell.state || null,
29
+ activeApp: shell.activeApp || null,
30
+ showSwitcher: !!shell.showSwitcher,
31
+ switcherPhase: shell.switcherPhase || null,
32
+ }
33
+ : null,
34
+ }
35
+ })()`});if(!t||typeof t!="object")return;console.log(`
36
+ state:`),t.simId&&console.log(` sim: ${t.simId}`),t.url&&console.log(` url: ${t.url}`),t.mode&&console.log(` mode: ${t.mode}`);let r=Number(t.nodeCount)||0;console.log(` nodes: ${r}${r>10?" (ready)":" (not ready)"}`);let n=t.shell;if(n&&typeof n=="object"){let s=[n.state?`state=${n.state}`:null,n.activeApp?`app=${n.activeApp}`:null,n.showSwitcher?"switcher=open":null,n.switcherPhase?`phase=${n.switcherPhase}`:null].filter(Boolean);s.length>0&&console.log(` shell: ${s.join(" ")}`)}}async function ae(e,t={}){try{await J(e)}catch{}try{await L(e,{includeTail:!0,errorsCommand:t.errorsCommand,warningsCommand:t.warningsCommand})}catch{}try{await G(e,{includeTail:!0,requestsCommand:t.requestsCommand})}catch{}}export{w as a,z as b,K as c,Q as d,b as e,O as f,X as g,Z as h,ee as i,te as j,ne as k,J as l,ae as m};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as K,b as ne,c as re,d as Pe,e as Ie,g as I,h as Ee}from"./chunk-JBL6N36H.js";import{b as Ce,l as ce}from"./chunk-UPXILQIY.js";import{a as O,b as ae}from"./chunk-GLOQZ4YT.js";import{a as _e,b as Ue}from"./chunk-C6PU2Y3O.js";import{a as Me,b as se,c as Te}from"./chunk-NFJHEVT2.js";import{d as le}from"./chunk-NSKS43OW.js";import{m as R}from"./chunk-NGMNL724.js";import{m as Re,o as Oe}from"./chunk-JNI6O5ID.js";import{a as Be,b as De,c as ie,e as Le,f as Ae,g as E,h as v,i as M}from"./chunk-YATEKNXL.js";import{d as ke,e as _,f as b,g as U}from"./chunk-HVOLXPNB.js";import{H as $e,K as te,M as j,l as Se}from"./chunk-UEDGP46Q.js";import{b as oe,d as xe}from"./chunk-AVOOC775.js";import{spawn as qe,spawnSync as ze}from"node:child_process";import L from"node:fs";import ft from"node:os";import T from"node:path";import{WebSocket as ht}from"ws";function Ne(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 at(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function He(e,o,t){return`${e}//${o}:${t}`}function lt(e){if(typeof window>"u")return!1;try{let o=new URL(e);return I(o.hostname)&&I(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Fe(e,o){let t={...o,cache:o?.cache??"no-store"};return lt(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function ct(e){return e==="https:"?443:80}function dt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function mt(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:re(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function We(e,o){let t=e.replace(/\/+$/,"");try{if(I(new URL(t).hostname)){let n=await mt(o);if(n)return n}}catch{}try{let n=await Fe(`${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:re(i||`${t}${ne}`),port:o,framework:at(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Fe(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${ne}`,port:o,framework:"metro"}}catch{}return null}async function ut(e){return We(He("http:","localhost",e),e)}async function je(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await ut(a);if(l)return l;throw Ne(`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):ct(r),i=He(r,n.hostname,s);if(dt(n)){let a=await We(i,s);if(a)return a;throw Ne(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function lo(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function Ke(e){let o=O();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 pt(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function co(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){pt(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 gt=12e4,Ve=100,wt=5e3,Ge=1e4,bt={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 Je(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function yt(){let e=Je("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??Je("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??gt;return{timeoutMs:e,hostTimeoutMs:e+wt,intervalMs:Ve,attempts:Math.max(1,Math.ceil(e/Ve))}}function vt(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function St(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 V(e){return e.trim()}var Xe=/^[A-Za-z][A-Za-z0-9+.-]*:/;function $t(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return Xe.test(o)||o.startsWith("/")?o:`/${o}`}function xt(e){return e!==null&&typeof e=="object"}function kt(e){let o=e.trim();return o?o.startsWith("/")?!0:Xe.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function Pt(e){if(await q(e,250))return e;let o=te();if(o&&j(o)&&await q(o.bridgePort,500))return o.bridgePort;if(o&&j(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 It();let t=Ct(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+Ge;for(;Date.now()<r;){let s=te();if(s&&j(s)&&await q(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 q(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(Ge/1e3)}s`)}async function It(){let e=$e();if(e&&L.existsSync(Se(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-MAEGIKCE.js");await o(["install"],{})}function Ct(e){let o=process.argv[1];return o&&L.existsSync(o)?qe(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):qe("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function q(e,o){return new Promise(t=>{let n=new ht(`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 ue(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 Et(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 Mt(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=G(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 Tt(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Do(e){let o=V(e);return(await et(o)).bundleUrl}function _t(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!I(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 et(e){let o=V(e),t=/^\d+$/.test(o)?Number(o):_t(o);if(t&&t>0){let n=await Ie(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return je(o)}function G(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Ut(e,o){let t=V(e),n=new URL(o),r=G(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 Rt(e){let o=V(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Ot(e,o,t={}){let n=await et(e),r=new URL(o),s=G(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:Pe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function Bt(e){return e.startsWith("~/")?T.join(ft.homedir(),e.slice(2)):T.isAbsolute(e)?e:T.resolve(process.cwd(),e)}function Dt(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=Bt(s.slice(i+1).trim());L.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}function tt(){return Be().shellBaseUrl}async function Lt(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=Me({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await At(r);return s.length===0?e:(o.searchParams.set("appFonts",Te(s)),o.toString())}catch{return e}}async function At(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 Nt(e,o,t={}){if(!e)return new URL(o).toString();if(ue(e))return new URL(e).toString();if(Et(e))return Mt(e,o);let n=bt[e.toLowerCase()];if(n){let r=new URL(o),s=G(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return Rt(e)?Ot(e,o,t):Ut(e,o)}async function Ft(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=_e({bundleUrl:t,repoDir:n});return!r||r.imageUrl&&!await Ht(r.imageUrl)?e:(o.searchParams.set("appSplash",Ue(r)),o.toString())}catch{return e}}async function Ht(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 z(e,o=tt(),t={}){let n=await Nt(e,o,t),r=await Ft(await Lt(n));if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function Qe(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 Wt(e,o,t,n={}){let r=new URL(await z(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function jt(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 Kt(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 qt(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==="AGENTBUS_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function Lo(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as K,b as ne,c as re,d as Pe,e as Ie,g as I,h as Ee}from"./chunk-LO6HC3DY.js";import{b as Ce,l as ce}from"./chunk-CJJAKIW5.js";import{a as O,b as ae}from"./chunk-4PEJMPN4.js";import{a as _e,b as Ue}from"./chunk-O5ABYG6P.js";import{a as Me,b as se,c as Te}from"./chunk-OWYIFL7U.js";import{d as le}from"./chunk-R3QQ4NB6.js";import{m as R}from"./chunk-VPOAQYFB.js";import{m as Re,o as Oe}from"./chunk-I26CCXY4.js";import{a as Be,b as De,c as ie,e as Le,f as Ae,g as E,h as v,i as M}from"./chunk-NBE5LT2F.js";import{d as ke,e as _,f as b,g as U}from"./chunk-NJIE2DWC.js";import{H as $e,K as te,M as j,l as Se}from"./chunk-PLKAPXAO.js";import{b as oe,d as xe}from"./chunk-GJSRPQF3.js";import{spawn as qe,spawnSync as ze}from"node:child_process";import L from"node:fs";import ft from"node:os";import T from"node:path";import{WebSocket as ht}from"ws";function Ne(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 at(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function He(e,o,t){return`${e}//${o}:${t}`}function lt(e){if(typeof window>"u")return!1;try{let o=new URL(e);return I(o.hostname)&&I(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Fe(e,o){let t={...o,cache:o?.cache??"no-store"};return lt(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function ct(e){return e==="https:"?443:80}function dt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function mt(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:re(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function We(e,o){let t=e.replace(/\/+$/,"");try{if(I(new URL(t).hostname)){let n=await mt(o);if(n)return n}}catch{}try{let n=await Fe(`${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:re(i||`${t}${ne}`),port:o,framework:at(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Fe(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${ne}`,port:o,framework:"metro"}}catch{}return null}async function ut(e){return We(He("http:","localhost",e),e)}async function je(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await ut(a);if(l)return l;throw Ne(`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):ct(r),i=He(r,n.hostname,s);if(dt(n)){let a=await We(i,s);if(a)return a;throw Ne(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function lo(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function Ke(e){let o=O();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 pt(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function co(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){pt(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 gt=12e4,Ve=100,wt=5e3,Ge=1e4,bt={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 Je(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function yt(){let e=Je("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??Je("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??gt;return{timeoutMs:e,hostTimeoutMs:e+wt,intervalMs:Ve,attempts:Math.max(1,Math.ceil(e/Ve))}}function vt(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function St(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 V(e){return e.trim()}var Xe=/^[A-Za-z][A-Za-z0-9+.-]*:/;function $t(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return Xe.test(o)||o.startsWith("/")?o:`/${o}`}function xt(e){return e!==null&&typeof e=="object"}function kt(e){let o=e.trim();return o?o.startsWith("/")?!0:Xe.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function Pt(e){if(await q(e,250))return e;let o=te();if(o&&j(o)&&await q(o.bridgePort,500))return o.bridgePort;if(o&&j(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 It();let t=Ct(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+Ge;for(;Date.now()<r;){let s=te();if(s&&j(s)&&await q(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 q(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(Ge/1e3)}s`)}async function It(){let e=$e();if(e&&L.existsSync(Se(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-FR7QCZRH.js");await o(["install"],{})}function Ct(e){let o=process.argv[1];return o&&L.existsSync(o)?qe(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):qe("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function q(e,o){return new Promise(t=>{let n=new ht(`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 ue(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 Et(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 Mt(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=G(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 Tt(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Do(e){let o=V(e);return(await et(o)).bundleUrl}function _t(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!I(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 et(e){let o=V(e),t=/^\d+$/.test(o)?Number(o):_t(o);if(t&&t>0){let n=await Ie(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return je(o)}function G(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Ut(e,o){let t=V(e),n=new URL(o),r=G(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 Rt(e){let o=V(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Ot(e,o,t={}){let n=await et(e),r=new URL(o),s=G(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:Pe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function Bt(e){return e.startsWith("~/")?T.join(ft.homedir(),e.slice(2)):T.isAbsolute(e)?e:T.resolve(process.cwd(),e)}function Dt(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=Bt(s.slice(i+1).trim());L.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}function tt(){return Be().shellBaseUrl}async function Lt(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=Me({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await At(r);return s.length===0?e:(o.searchParams.set("appFonts",Te(s)),o.toString())}catch{return e}}async function At(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 Nt(e,o,t={}){if(!e)return new URL(o).toString();if(ue(e))return new URL(e).toString();if(Et(e))return Mt(e,o);let n=bt[e.toLowerCase()];if(n){let r=new URL(o),s=G(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return Rt(e)?Ot(e,o,t):Ut(e,o)}async function Ft(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.CONTRAST_REPO_DIR||await se(t)||void 0,r=_e({bundleUrl:t,repoDir:n});return!r||r.imageUrl&&!await Ht(r.imageUrl)?e:(o.searchParams.set("appSplash",Ue(r)),o.toString())}catch{return e}}async function Ht(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 z(e,o=tt(),t={}){let n=await Nt(e,o,t),r=await Ft(await Lt(n));if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function Qe(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 Wt(e,o,t,n={}){let r=new URL(await z(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function jt(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 Kt(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 qt(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==="AGENTBUS_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function Lo(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
3
3
  `);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${qt(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=Kt(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=zt(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: ${Ye(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${Ye(Date.now()-t.lastActiveAt)}`)}}function zt(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)":Ee()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function Ye(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 de(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 Vt(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&&!pe(n);for(let d=0;d<s;d++){if(l())return{kind:"host-exit"};let m=v(e,{commandTimeoutMs:o});try{let g=(await m.listSims()).find(t);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{m.close()}if(l())return{kind:"host-exit"};await $(i)}return{kind:"timeout"}}async function Gt(e,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(m=>m.id===t);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await $(s)}return!1}function Jt(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 Qt(e){if(!e.connectAckFile)return!1;try{return L.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
4
4
  `,{flag:"w"}),!0}catch{return!1}}function Ze(e){if(e.diagnosticLogPath)try{let o=L.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${T.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
5
5
  ${o.slice(-4e3)}`:o;console.error(` ${T.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${T.basename(e.diagnosticLogPath)}: ${t}`)}}function pe(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function Yt(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!pe(e))return!0;await $(100)}return!pe(e)}function Zt(e){let o=ze("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=ze("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 me(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=Jt(r);s&&n.add(s)}for(let r of n){if(!Zt(r)){console.log(` skipped pid ${r}: not a sootsim playwright host (stale sim record)`);continue}try{process.kill(r,"SIGTERM")}catch{}if(await Yt(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function J(e,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 B(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 D(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 Xt(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:Re})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&Oe(s))){let m=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${m} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
@@ -0,0 +1 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as f}from"./chunk-HVOLXPNB.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 m}from"path";var p=new Map;function o(e,t){p.set(e,t)}var i=1;function c(){return m(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return m(y(),"sootsim-cli-hints-global.json")}function u(e){if(!w(e))return{version:i,shown:{}};try{let t=JSON.parse(h(e,"utf8"));return t?.version!==i||!t?.shown?{version:i,shown:{}}:t}catch{return{version:i,shown:{}}}}function l(e,t){try{g(b(e),{recursive:!0}),S(e,JSON.stringify(t)+`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as f}from"./chunk-NJIE2DWC.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 m}from"path";var p=new Map;function o(e,t){p.set(e,t)}var i=1;function c(){return m(y(),`sootsim-cli-hints-${f()}.json`)}function d(){return m(y(),"sootsim-cli-hints-global.json")}function u(e){if(!w(e))return{version:i,shown:{}};try{let t=JSON.parse(h(e,"utf8"));return t?.version!==i||!t?.shown?{version:i,shown:{}}:t}catch{return{version:i,shown:{}}}}function l(e,t){try{g(b(e),{recursive:!0}),S(e,JSON.stringify(t)+`
3
3
  `)}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 s=v();if(s==="off")return!1;if(s==="always"||t==="always")return!0;let r=Date.now();if(t==="once-per-identity"){let n=u(c());return n.shown[e]?!1:(n.shown[e]=r,l(c(),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(c()),a=n.shown[e]??0;return r-a<t.cooldownMs?!1:(n.shown[e]=r,l(c(),n),!0)}return!0}function M(e,...t){let s=p.get(e);if(!s)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!H(e,s.frequency))return!1;let r=s.render(...t);if(r==null)return!1;let n=Array.isArray(r)?r:[r];for(let a of n)console.error(` hint: ${a}`);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 uninstall sootsim completely, run `sootsim daemon uninstall`.","it removes the launchd / systemd agent and the ~/.sootsim cache (~80MB)."]});export{M as a};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-SGKR7R2W.js";import"./chunk-EXXJPCOE.js";export{a as getCliVersion};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-TGARSKJS.js";import{existsSync as x,readFileSync as j}from"fs";import{resolve as g}from"path";async function P(s){(s.includes("--help")||s.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-EXXJPCOE.js";import{existsSync as x,readFileSync as j}from"fs";import{resolve as g}from"path";async function P(s){(s.includes("--help")||s.includes("-h"))&&(console.log(`
3
3
  sootsim compat \u2014 check package compatibility
4
4
 
5
5
  usage:
@@ -20,7 +20,7 @@ examples:
20
20
  sootsim compat react-native-reanimated
21
21
  sootsim compat --json
22
22
  sootsim compat --brief
23
- `),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-RYQFPTU7.js"),a=g(n,"package.json");x(a)||(console.error(" no package.json found in",n),process.exit(1));let u=JSON.parse(j(a,"utf8")),r=o(u);if(c){console.log(JSON.stringify(r,null,2));return}if(r.packages.length===0){console.log(" no RN ecosystem packages detected");return}let T=Math.round(r.overallScore*100),v=r.packages.filter(i=>i.status==="full").length,$=r.packages.filter(i=>i.status==="partial"||i.status==="auto-stub").length,w=r.packages.filter(i=>i.status==="unsupported").length,p=[];v&&p.push(`${v} fully supported`),$&&p.push(`${$} partial`),w&&p.push(`${w} unsupported`),console.log(` ${p.join(", ")} \u2014 ${T}% compatible`);return}let{POLYFILL_REGISTRY:d}=await import("./web-RYQFPTU7.js");if(k){W(k,d);return}let b=g(n,"package.json");x(b)||(console.error(" no package.json found in",n),process.exit(1));let m=JSON.parse(j(b,"utf8")),S={...m.dependencies,...m.devDependencies},t={full:[],partial:[],autoStub:[],unsupported:[],justWorks:[],unknown:[]};for(let o of Object.keys(S)){let a=d[o];if(a){let u=a.stubType==="native"?"full":a.stubType==="works"?"not-relevant":a.stubType;if(a.stubType!=="native"&&a.versions?.length){let r=Math.max(...a.versions.map(y=>y.coverage||0));u=r>=.8?"full":r>=.3?"partial":"auto-stub"}switch(u){case"full":t.full.push(o);break;case"partial":t.partial.push(o);break;case"auto-stub":t.autoStub.push(o);break;case"unsupported":t.unsupported.push(o);break;case"not-relevant":t.justWorks.push(o);break;default:f(o)&&t.unknown.push(o)}}else f(o)&&t.unknown.push(o)}console.log(`
23
+ `),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-VDJD7VQI.js"),a=g(n,"package.json");x(a)||(console.error(" no package.json found in",n),process.exit(1));let u=JSON.parse(j(a,"utf8")),r=o(u);if(c){console.log(JSON.stringify(r,null,2));return}if(r.packages.length===0){console.log(" no RN ecosystem packages detected");return}let T=Math.round(r.overallScore*100),v=r.packages.filter(i=>i.status==="full").length,$=r.packages.filter(i=>i.status==="partial"||i.status==="auto-stub").length,w=r.packages.filter(i=>i.status==="unsupported").length,p=[];v&&p.push(`${v} fully supported`),$&&p.push(`${$} partial`),w&&p.push(`${w} unsupported`),console.log(` ${p.join(", ")} \u2014 ${T}% compatible`);return}let{POLYFILL_REGISTRY:d}=await import("./web-VDJD7VQI.js");if(k){W(k,d);return}let b=g(n,"package.json");x(b)||(console.error(" no package.json found in",n),process.exit(1));let m=JSON.parse(j(b,"utf8")),S={...m.dependencies,...m.devDependencies},t={full:[],partial:[],autoStub:[],unsupported:[],justWorks:[],unknown:[]};for(let o of Object.keys(S)){let a=d[o];if(a){let u=a.stubType==="native"?"full":a.stubType==="works"?"not-relevant":a.stubType;if(a.stubType!=="native"&&a.versions?.length){let r=Math.max(...a.versions.map(y=>y.coverage||0));u=r>=.8?"full":r>=.3?"partial":"auto-stub"}switch(u){case"full":t.full.push(o);break;case"partial":t.partial.push(o);break;case"auto-stub":t.autoStub.push(o);break;case"unsupported":t.unsupported.push(o);break;case"not-relevant":t.justWorks.push(o);break;default:f(o)&&t.unknown.push(o)}}else f(o)&&t.unknown.push(o)}console.log(`
24
24
  sootsim compatibility report
25
25
  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
26
26
 
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A as i,C as s,x as t}from"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";function l(){let e=i();console.log(` telemetry is ${e?"ON":"OFF"}`),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function r(e){let o=e.find(n=>!n.startsWith("-"))?.toLowerCase();switch(o){case void 0:case"status":l();return;case"on":case"enable":s(!0),console.log(" telemetry ON"),console.log(` config: ${t()}`);return;case"off":case"disable":s(!1),console.log(" telemetry OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${o}`),console.error(" usage: sootsim config telemetry [on|off|status]"),process.exit(1)}}function c(){console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A as i,C as s,x as t}from"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";function l(){let e=i();console.log(` telemetry is ${e?"ON":"OFF"}`),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function r(e){let o=e.find(n=>!n.startsWith("-"))?.toLowerCase();switch(o){case void 0:case"status":l();return;case"on":case"enable":s(!0),console.log(" telemetry ON"),console.log(` config: ${t()}`);return;case"off":case"disable":s(!1),console.log(" telemetry OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${o}`),console.error(" usage: sootsim config telemetry [on|off|status]"),process.exit(1)}}function c(){console.log(`
3
3
  sootsim config \u2014 manage local CLI preferences
4
4
 
5
5
  usage:
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u}from"./chunk-QUW7SRYQ.js";import"./chunk-JBL6N36H.js";import"./chunk-EF7SUCU5.js";import"./chunk-UPXILQIY.js";import"./chunk-GLOQZ4YT.js";import"./chunk-C6PU2Y3O.js";import"./chunk-NFJHEVT2.js";import"./chunk-NSKS43OW.js";import"./chunk-AJLMKI3T.js";import"./chunk-NGMNL724.js";import"./chunk-JNI6O5ID.js";import"./chunk-YATEKNXL.js";import"./chunk-XRXBF2B4.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-V5FIROGW.js";import"./chunk-AVOOC775.js";import"./chunk-TGARSKJS.js";export{f as buildOpenUrl,e as buildShellUrl,s as closeSimsBulk,b as normalizeDeepLinkTarget,t as planBulkCloseTargets,k as playwrightHostPidForSim,h as printConnectedSims,c as resolveBundleTarget,d as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,r as runClaimCommand,u as runCloseCommand,q as runFocusCommand,n as runLinkCommand,o as runOpenCommand,p as runUseCommand,l as signalDriverLaunchConnected,g as summarizeSimUrl,m as terminatePlaywrightHostsForSims,i as waitForSimMatch,j as waitForSimMatchOrHostExit};
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u}from"./chunk-YASCPSFS.js";import"./chunk-LO6HC3DY.js";import"./chunk-BEH7L47J.js";import"./chunk-CJJAKIW5.js";import"./chunk-4PEJMPN4.js";import"./chunk-O5ABYG6P.js";import"./chunk-OWYIFL7U.js";import"./chunk-R3QQ4NB6.js";import"./chunk-7DBKPFMT.js";import"./chunk-VPOAQYFB.js";import"./chunk-I26CCXY4.js";import"./chunk-NBE5LT2F.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-BYL4LXI2.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";export{f as buildOpenUrl,e as buildShellUrl,s as closeSimsBulk,b as normalizeDeepLinkTarget,t as planBulkCloseTargets,k as playwrightHostPidForSim,h as printConnectedSims,c as resolveBundleTarget,d as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,r as runClaimCommand,u as runCloseCommand,q as runFocusCommand,n as runLinkCommand,o as runOpenCommand,p as runUseCommand,l as signalDriverLaunchConnected,g as summarizeSimUrl,m as terminatePlaywrightHostsForSims,i as waitForSimMatch,j as waitForSimMatchOrHostExit};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e}from"./chunk-M6YBVN3L.js";import"./chunk-ARZJZUZN.js";import"./chunk-MKAHHLPB.js";import"./chunk-G26HA7RJ.js";import"./chunk-VJRGHV2T.js";import"./chunk-ZMC5QAHG.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-TQ75ATRP.js";import"./chunk-PLKAPXAO.js";import"./chunk-SGKR7R2W.js";import"./chunk-UBRDMIPO.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,d as teardownDaemonService,e as teardownSootsimHome};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{f,m as T}from"./chunk-NGMNL724.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-JNI6O5ID.js";import{g as D,i as O,k as x}from"./chunk-YATEKNXL.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{f,m as T}from"./chunk-VPOAQYFB.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-I26CCXY4.js";import{g as D,i as O,k as x}from"./chunk-NBE5LT2F.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
3
3
  sootsim debug \u2014 drive __sootsimDebug from the terminal
4
4
 
5
5
  usage:
@@ -170,7 +170,7 @@ examples:
170
170
  } : null,
171
171
  samples,
172
172
  }
173
- })()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-T74KPORE.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=O(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
173
+ })()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-2DY2DXPR.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=O(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
174
174
  known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await S(t);console.log(a(e,n));break}case"channels":{let e=await c(t,"window.__sootsimDebug.channels()");console.log(a(e,n));break}case"flags":{let e=await $(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
175
175
  const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
176
176
  if (!d) return null;
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-NOEMQR47.js";import"./chunk-F3R6EZXX.js";import{a as v,h as k}from"./chunk-QUW7SRYQ.js";import"./chunk-JBL6N36H.js";import"./chunk-EF7SUCU5.js";import{b as m,g as f,l as h}from"./chunk-UPXILQIY.js";import{a as c}from"./chunk-GLOQZ4YT.js";import"./chunk-C6PU2Y3O.js";import"./chunk-NFJHEVT2.js";import"./chunk-NSKS43OW.js";import"./chunk-AJLMKI3T.js";import{a as u}from"./chunk-MYY572U5.js";import"./chunk-NGMNL724.js";import"./chunk-JNI6O5ID.js";import"./chunk-YATEKNXL.js";import"./chunk-XRXBF2B4.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-V5FIROGW.js";import"./chunk-AVOOC775.js";import"./chunk-TGARSKJS.js";function I(e){let i=e.indexOf("--port");if(i<0)return;let o=e[i+1],t=o?Number(o):Number.NaN;return(!Number.isInteger(t)||t<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),t}async function O(e,i){let o=I(e)??i.port;return o?k(String(o)):void 0}async function w(e,i){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-KBCU6ZSM.js";import"./chunk-YDXHF77F.js";import{a as v,h as k}from"./chunk-YASCPSFS.js";import"./chunk-LO6HC3DY.js";import"./chunk-BEH7L47J.js";import{b as m,g as f,l as h}from"./chunk-CJJAKIW5.js";import{a as c}from"./chunk-4PEJMPN4.js";import"./chunk-O5ABYG6P.js";import"./chunk-OWYIFL7U.js";import"./chunk-R3QQ4NB6.js";import"./chunk-7DBKPFMT.js";import{a as u}from"./chunk-CLGWPBAX.js";import"./chunk-VPOAQYFB.js";import"./chunk-I26CCXY4.js";import"./chunk-NBE5LT2F.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-BYL4LXI2.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";function I(e){let i=e.indexOf("--port");if(i<0)return;let o=e[i+1],t=o?Number(o):Number.NaN;return(!Number.isInteger(t)||t<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),t}async function O(e,i){let o=I(e)??i.port;return o?k(String(o)):void 0}async function w(e,i){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim desktop \u2014 launch the desktop companion
4
4
 
5
5
  usage:
@@ -16,7 +16,7 @@ examples:
16
16
  sootsim desktop --port 5173
17
17
  sootsim desktop --profile qa
18
18
  sootsim desktop --driver system
19
- `),process.exit(0));let o=e.indexOf("--driver"),t=o>=0?e[o+1]:void 0,n=e.find((r,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");n&&d&&(console.error(" sootsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let x=n?m(n).id:void 0,s=t||i.driver,l=f;if(s){let r=h(s);r||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=r}if(l.id==="electron"){let r=c();if(!r){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await u("run sootsim desktop install now?",!0)){console.log();let{runInstallDesktop:D}=await import("./install-desktop-NQWN2YAX.js");await D(["--yes"]),r=c()}r||process.exit(1)}console.log(` launching ${r.path}`)}let b=await O(e,i),p=await l.launch({url:b,device:i.device,profileId:x,ephemeralProfile:d});p.launched||(console.error(` ${p.message}`),process.exit(1)),console.log(` ${p.message}`)}function y(){console.log(`
19
+ `),process.exit(0));let o=e.indexOf("--driver"),t=o>=0?e[o+1]:void 0,n=e.find((r,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");n&&d&&(console.error(" sootsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let x=n?m(n).id:void 0,s=t||i.driver,l=f;if(s){let r=h(s);r||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=r}if(l.id==="electron"){let r=c();if(!r){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await u("run sootsim desktop install now?",!0)){console.log();let{runInstallDesktop:D}=await import("./install-desktop-QMOFRUBR.js");await D(["--yes"]),r=c()}r||process.exit(1)}console.log(` launching ${r.path}`)}let b=await O(e,i),p=await l.launch({url:b,device:i.device,profileId:x,ephemeralProfile:d});p.launched||(console.error(` ${p.message}`),process.exit(1)),console.log(` ${p.message}`)}function y(){console.log(`
20
20
  sootsim desktop \u2014 launch or install the desktop companion
21
21
 
22
22
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{e as E}from"./chunk-SZOPUPSH.js";import"./chunk-JRRMIVSC.js";import"./chunk-NK7I3QVD.js";import"./chunk-HYEFBMSG.js";import"./chunk-CNTAENS7.js";import{c as P,d as F,e as M}from"./chunk-FDXWQHE2.js";import{a as R}from"./chunk-V7ISEJ3S.js";import"./chunk-QUW7SRYQ.js";import"./chunk-JBL6N36H.js";import"./chunk-EF7SUCU5.js";import"./chunk-UPXILQIY.js";import"./chunk-GLOQZ4YT.js";import"./chunk-C6PU2Y3O.js";import"./chunk-NFJHEVT2.js";import"./chunk-NSKS43OW.js";import"./chunk-AJLMKI3T.js";import"./chunk-NGMNL724.js";import"./chunk-JNI6O5ID.js";import"./chunk-YATEKNXL.js";import"./chunk-4X7KRVUQ.js";import"./chunk-ZSTVFJS3.js";import"./chunk-ZT5AT5TL.js";import"./chunk-5JMI6AGC.js";import"./chunk-XRXBF2B4.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-EMQ6G7EP.js";import"./chunk-UEDGP46Q.js";import"./chunk-V5FIROGW.js";import"./chunk-AVOOC775.js";import"./chunk-TGARSKJS.js";import{spawn as L}from"child_process";import{existsSync as x,mkdirSync as G,readFileSync as C,writeFileSync as w,unlinkSync as J}from"fs";import{tmpdir as $}from"os";import{dirname as W,resolve as l,join as N,relative as B}from"path";function q(){try{let t=import.meta.resolve("sootsim/detox");return W(t.startsWith("file://")?t.slice(7):t)}catch{return l(import.meta.dirname,"..","..","detox")}}var H=`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{e as E}from"./chunk-LLOLNFOC.js";import"./chunk-OE7UZ2N7.js";import"./chunk-VPK4MS2R.js";import"./chunk-M3SBLCVQ.js";import"./chunk-76NQG773.js";import{c as P,d as F,e as M}from"./chunk-IZ2STC6S.js";import{a as R}from"./chunk-UBZG4U6Y.js";import"./chunk-YASCPSFS.js";import"./chunk-LO6HC3DY.js";import"./chunk-BEH7L47J.js";import"./chunk-CJJAKIW5.js";import"./chunk-4PEJMPN4.js";import"./chunk-O5ABYG6P.js";import"./chunk-OWYIFL7U.js";import"./chunk-R3QQ4NB6.js";import"./chunk-7DBKPFMT.js";import"./chunk-VPOAQYFB.js";import"./chunk-I26CCXY4.js";import"./chunk-NBE5LT2F.js";import"./chunk-PKRZNYTJ.js";import"./chunk-ARZJZUZN.js";import"./chunk-MKAHHLPB.js";import"./chunk-ZMC5QAHG.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-TQ75ATRP.js";import"./chunk-PLKAPXAO.js";import"./chunk-BYL4LXI2.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";import{spawn as L}from"child_process";import{existsSync as x,mkdirSync as G,readFileSync as C,writeFileSync as w,unlinkSync as J}from"fs";import{tmpdir as $}from"os";import{dirname as W,resolve as l,join as N,relative as B}from"path";function q(){try{let t=import.meta.resolve("sootsim/detox");return W(t.startsWith("file://")?t.slice(7):t)}catch{return l(import.meta.dirname,"..","..","detox")}}var H=`
3
3
  sootsim detox \u2014 run detox-style tests against a sootsim shell
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-EF7SUCU5.js";import{g as d,i as l,l as a}from"./chunk-YATEKNXL.js";import"./chunk-XRXBF2B4.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-V5FIROGW.js";import{b as c,c as r,d as g}from"./chunk-AVOOC775.js";import"./chunk-TGARSKJS.js";function h(){console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-BEH7L47J.js";import{g as d,i as l,l as a}from"./chunk-NBE5LT2F.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-BYL4LXI2.js";import{b as c,c as r,d as g}from"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";function h(){console.log(`
3
3
  sootsim device \u2014 inspect or change the live device preset for a sim
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as E,i as R,l as b}from"./chunk-YATEKNXL.js";import"./chunk-OUHXKX62.js";import{c as v}from"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as E,i as R,l as b}from"./chunk-NBE5LT2F.js";import"./chunk-SHWJJEPO.js";import{c as v}from"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
3
3
  sootsim get diagnosis \u2014 compact "what just went wrong?" report
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-YDXHF77F.js";import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk-CJJAKIW5.js";import"./chunk-4PEJMPN4.js";import"./chunk-R3QQ4NB6.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as L,d as T}from"./chunk-YNXFCE4C.js";import{g as $,i as R,m as b}from"./chunk-YATEKNXL.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";import{spawnSync as x}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as q}from"node:os";import{dirname as j,extname as H,join as K,resolve as C}from"node:path";var s=t=>new Promise(a=>setTimeout(a,t)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(t,a){let n=t.indexOf(a);return n>=0?t[n+1]:void 0}async function r(t,a,n=3e4){return await t.send({type:"evaluate",code:a},{timeoutMs:n})}async function le(t,a){if(t.length===0||t.includes("--help")||t.includes("-h"))return console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as L,d as T}from"./chunk-BXO377TL.js";import{g as $,i as R,m as b}from"./chunk-NBE5LT2F.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";import{spawnSync as x}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as q}from"node:os";import{dirname as j,extname as H,join as K,resolve as C}from"node:path";var s=t=>new Promise(a=>setTimeout(a,t)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(t,a){let n=t.indexOf(a);return n>=0?t[n+1]:void 0}async function r(t,a,n=3e4){return await t.send({type:"evaluate",code:a},{timeoutMs:n})}async function le(t,a){if(t.length===0||t.includes("--help")||t.includes("-h"))return console.log(`
3
3
  sootsim film \u2014 record a flow flat, replay it on the 3d stage, save a clip
4
4
 
5
5
  usage:
@@ -33,7 +33,7 @@ examples:
33
33
  sootsim film flows/swap.yaml --script hero-arc --background gradient-tide --out ~/Desktop/swap-3d.mp4
34
34
  sootsim film flows/login.yaml --colorway deep-blue --environment on --env-shape pane --room on
35
35
  `),0;let n=t.find(d=>!d.startsWith("--")&&/\.ya?ml$/.test(d));if(!n||!V(C(n)))return console.error(` film: flow file not found: ${n??"(none given)"}`),1;let P=Number.parseInt(c(t,"--fps")??"30",10),h=c(t,"--script")??"hero-arc",D=t.includes("--keep-three"),v=n.replace(/^.*\//,"").replace(/\.ya?ml$/,""),I=c(t,"--out"),l=C(I??K(q(),"Desktop","sootsim-films",`${v}.webm`)),y=H(l).toLowerCase()===".mp4";if(y&&x("ffmpeg",["-version"]).status!==0)return console.error(" film: --out ends in .mp4 but ffmpeg is not installed"),console.error(" install ffmpeg or use a .webm output path"),1;let z=$(t,{port:a.port,stripValueFlags:[...X,...Q],stripBooleanFlags:J}),e=R({...z,commandTimeoutMs:6e4});try{let d=await r(e,`(() => { const s = window.SootSim?.bridges?.settings?.get?.() || {}
36
- return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(e,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let O=Date.now();await s(500);let{runFlowPlayback:G}=await import("./flow-EZ2VB7CJ.js"),m=[n],S=c(t,"--sim");S&&m.push("--sim",S);let k=c(t,"--slow");k&&m.push("--slow",k);let f=await G(m);await s(400);let u=Math.min(Date.now()-O,Y);if(await r(e,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let _=!1;for(let o=0;o<50;o++){await s(400);let i=await r(e,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
36
+ return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(e,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let O=Date.now();await s(500);let{runFlowPlayback:G}=await import("./flow-FLKLFK6B.js"),m=[n],S=c(t,"--sim");S&&m.push("--sim",S);let k=c(t,"--slow");k&&m.push("--slow",k);let f=await G(m);await s(400);let u=Math.min(Date.now()-O,Y);if(await r(e,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let _=!1;for(let o=0;o<50;o++){await s(400);let i=await r(e,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
37
37
  return { state: s?.state, hasBlob: !!s?.lastVideoBlob } })()`);if(i?.state==="idle"&&i.hasBlob){_=!0;break}}if(!_)return console.error(" film: flow recording never produced a video blob"),1;console.log(` film: flow captured (${(u/1e3).toFixed(1)}s)`),await r(e,"window.SootSim?.bridges?.settings?.set?.('threeMode', true)"),await L(e),await s(1400),await r(e,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', true)");let F=!1;for(let o=0;o<60;o++)if(await s(250),await r(e,`(() => { const rs = window.SootSim?.replayStore
38
38
  return rs?.value?.preview?.surface === 'video' && !!rs?.value?.preview?.flowVideoUrl })()`)){F=!0;break}if(!F)return console.error(" film: recording editor did not seed the replay store"),1;await r(e,`(async () => {
39
39
  const entitled = () =>
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c,d,e,f,g,h}from"./chunk-LLOLNFOC.js";import"./chunk-OE7UZ2N7.js";import"./chunk-VPK4MS2R.js";import{c as a,d as b}from"./chunk-M3SBLCVQ.js";import"./chunk-76NQG773.js";import"./chunk-IZ2STC6S.js";import"./chunk-UBZG4U6Y.js";import"./chunk-YASCPSFS.js";import"./chunk-LO6HC3DY.js";import"./chunk-BEH7L47J.js";import"./chunk-CJJAKIW5.js";import"./chunk-4PEJMPN4.js";import"./chunk-O5ABYG6P.js";import"./chunk-OWYIFL7U.js";import"./chunk-R3QQ4NB6.js";import"./chunk-7DBKPFMT.js";import"./chunk-VPOAQYFB.js";import"./chunk-I26CCXY4.js";import"./chunk-NBE5LT2F.js";import"./chunk-PKRZNYTJ.js";import"./chunk-ARZJZUZN.js";import"./chunk-MKAHHLPB.js";import"./chunk-ZMC5QAHG.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-TQ75ATRP.js";import"./chunk-PLKAPXAO.js";import"./chunk-BYL4LXI2.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";export{e as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,g as hoistLeadingSimFlag,a as parseFlowFile,f as runFlowPlayback,h as runMaestroAuthoring,b as validateFlowFile};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-G26HA7RJ.js";import"./chunk-VJRGHV2T.js";import"./chunk-ZMC5QAHG.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-TQ75ATRP.js";import"./chunk-PLKAPXAO.js";import"./chunk-SGKR7R2W.js";import"./chunk-UBRDMIPO.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as e,b as s}from"./chunk-EMQ6G7EP.js";import"./chunk-TGARSKJS.js";var n=[{title:"Overview",route:"/docs/sootsim/cli"},...e.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/sootsim/cli/${o.slug}`}))];var i=["do","get"];function g(o){if(o.command)return o;let t=o.commandArgs.find(r=>!r.startsWith("-"));if(!t)return o;for(let r of i)if(s(r,t))return{...o,command:r};return o}export{g as resolveHiddenRuntimeAlias};
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as e,b as s}from"./chunk-TQ75ATRP.js";import"./chunk-EXXJPCOE.js";var n=[{title:"Overview",route:"/docs/sootsim/cli"},...e.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/sootsim/cli/${o.slug}`}))];var i=["do","get"];function g(o){if(o.command)return o;let t=o.commandArgs.find(r=>!r.startsWith("-"));if(!t)return o;for(let r of i)if(s(r,t))return{...o,command:r};return o}export{g as resolveHiddenRuntimeAlias};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,J as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,Q as claimDaemonLockfile,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,M as isDaemonLockfileFresh,N as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,q as profilesDir,H as readActiveRuntime,K as readDaemonLockfile,L as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,R as removeDaemonLockfile,S as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,O as writeDaemonLockfile,P as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,J as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,Q as claimDaemonLockfile,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,M as isDaemonLockfileFresh,N as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,q as profilesDir,H as readActiveRuntime,K as readDaemonLockfile,L as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,R as removeDaemonLockfile,S as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,O as writeDaemonLockfile,P as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{j as a,k as b}from"./chunk-M3SBLCVQ.js";import"./chunk-76NQG773.js";import"./chunk-YASCPSFS.js";import"./chunk-LO6HC3DY.js";import"./chunk-BEH7L47J.js";import"./chunk-CJJAKIW5.js";import"./chunk-4PEJMPN4.js";import"./chunk-O5ABYG6P.js";import"./chunk-OWYIFL7U.js";import"./chunk-R3QQ4NB6.js";import"./chunk-7DBKPFMT.js";import"./chunk-VPOAQYFB.js";import"./chunk-I26CCXY4.js";import"./chunk-NBE5LT2F.js";import"./chunk-PKRZNYTJ.js";import"./chunk-ZMC5QAHG.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-TQ75ATRP.js";import"./chunk-PLKAPXAO.js";import"./chunk-BYL4LXI2.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";export{a as printShellPerfReport,b as runInspect};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-KBCU6ZSM.js";import"./chunk-4PEJMPN4.js";import"./chunk-CLGWPBAX.js";import"./chunk-EXXJPCOE.js";export{a as runInstallDesktop};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as k,d as v}from"./chunk-ZT5AT5TL.js";import"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as k,d as v}from"./chunk-MKAHHLPB.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
3
3
  sootsim login \u2014 sign in so uploads can attach to your account
4
4
 
5
5
  usage:
@@ -21,6 +21,6 @@ options:
21
21
  <p style="color:#ccc">${r}</p>
22
22
  </div>
23
23
  </body>
24
- </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-ITXU4MEQ.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-ITXU4MEQ.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("contrast",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
24
+ </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-5SVL6DUX.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-5SVL6DUX.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("contrast",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
25
25
  ${n.toString()}
26
- `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-ITXU4MEQ.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-ITXU4MEQ.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
26
+ `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-5SVL6DUX.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-5SVL6DUX.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as r,b as i}from"./chunk-ZSTVFJS3.js";import{a as t,c as o}from"./chunk-ZT5AT5TL.js";import"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-ARZJZUZN.js";import{a as t,c as o}from"./chunk-MKAHHLPB.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as M,d as E,f as O,g as L,h as R}from"./chunk-SZOPUPSH.js";import"./chunk-JRRMIVSC.js";import"./chunk-NK7I3QVD.js";import{c as S}from"./chunk-HYEFBMSG.js";import{a as x}from"./chunk-CNTAENS7.js";import{b as A,c as $,d as F,e as T}from"./chunk-FDXWQHE2.js";import{a as k}from"./chunk-V7ISEJ3S.js";import"./chunk-QUW7SRYQ.js";import"./chunk-JBL6N36H.js";import"./chunk-EF7SUCU5.js";import"./chunk-UPXILQIY.js";import"./chunk-GLOQZ4YT.js";import"./chunk-C6PU2Y3O.js";import"./chunk-NFJHEVT2.js";import"./chunk-NSKS43OW.js";import"./chunk-AJLMKI3T.js";import"./chunk-NGMNL724.js";import"./chunk-JNI6O5ID.js";import"./chunk-YATEKNXL.js";import"./chunk-4X7KRVUQ.js";import"./chunk-ZSTVFJS3.js";import"./chunk-ZT5AT5TL.js";import"./chunk-5JMI6AGC.js";import"./chunk-XRXBF2B4.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-EMQ6G7EP.js";import"./chunk-UEDGP46Q.js";import"./chunk-V5FIROGW.js";import"./chunk-AVOOC775.js";import"./chunk-TGARSKJS.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function P(){console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as M,d as E,f as O,g as L,h as R}from"./chunk-LLOLNFOC.js";import"./chunk-OE7UZ2N7.js";import"./chunk-VPK4MS2R.js";import{c as S}from"./chunk-M3SBLCVQ.js";import{a as x}from"./chunk-76NQG773.js";import{b as A,c as $,d as F,e as T}from"./chunk-IZ2STC6S.js";import{a as k}from"./chunk-UBZG4U6Y.js";import"./chunk-YASCPSFS.js";import"./chunk-LO6HC3DY.js";import"./chunk-BEH7L47J.js";import"./chunk-CJJAKIW5.js";import"./chunk-4PEJMPN4.js";import"./chunk-O5ABYG6P.js";import"./chunk-OWYIFL7U.js";import"./chunk-R3QQ4NB6.js";import"./chunk-7DBKPFMT.js";import"./chunk-VPOAQYFB.js";import"./chunk-I26CCXY4.js";import"./chunk-NBE5LT2F.js";import"./chunk-PKRZNYTJ.js";import"./chunk-ARZJZUZN.js";import"./chunk-MKAHHLPB.js";import"./chunk-ZMC5QAHG.js";import"./chunk-MV4B4SU4.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-TQ75ATRP.js";import"./chunk-PLKAPXAO.js";import"./chunk-BYL4LXI2.js";import"./chunk-GJSRPQF3.js";import"./chunk-EXXJPCOE.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function P(){console.log(`
3
3
  sootsim maestro \u2014 author and run Maestro YAML flows against sootsim
4
4
 
5
5
  usage:
@@ -89,7 +89,7 @@ appId: com.example.app
89
89
  - inputText: "secret123"
90
90
  - tapOn: "Sign in"
91
91
  - assertVisible: "Welcome"
92
- `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function z(o,n={}){if(o.includes("--help")||o.includes("-h"))return P(),0;if(o.includes("--list-compat"))return W(),0;let e;try{e=D(o)}catch(r){return console.error(` error: ${r.message}`),1}e=L(e);let t=process.cwd(),i=e[0];if(i==="init")return N(t);if(i==="generate"){let{runMaestroGenerate:r}=await import("./maestro-generate-OXINOJKT.js");return r(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return R(e);e=Y(e);let u=null,p;if(i==="test"){let r=e.slice(1).find(f=>!U(f));r?(u=a.resolve(t,r),p=e.slice(1).filter(f=>f!==r)):(u=j(t),p=e.slice(1))}else i&&!U(i)?(u=a.resolve(t,i),p=e.slice(1)):(u=j(t),p=e);if(!u)return console.error(`
92
+ `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function z(o,n={}){if(o.includes("--help")||o.includes("-h"))return P(),0;if(o.includes("--list-compat"))return W(),0;let e;try{e=D(o)}catch(r){return console.error(` error: ${r.message}`),1}e=L(e);let t=process.cwd(),i=e[0];if(i==="init")return N(t);if(i==="generate"){let{runMaestroGenerate:r}=await import("./maestro-generate-GOOWEQ2E.js");return r(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return R(e);e=Y(e);let u=null,p;if(i==="test"){let r=e.slice(1).find(f=>!U(f));r?(u=a.resolve(t,r),p=e.slice(1).filter(f=>f!==r)):(u=j(t),p=e.slice(1))}else i&&!U(i)?(u=a.resolve(t,i),p=e.slice(1)):(u=j(t),p=e);if(!u)return console.error(`
93
93
  error: no maestro flows found.
94
94
  expected one of: ${I.map(r=>`./${r}/`).join(", ")}
95
95
  or pass a flow explicitly: sootsim maestro test path/to/flow.yaml
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as v}from"./chunk-CNTAENS7.js";import{b as O,d as A,e as E}from"./chunk-FDXWQHE2.js";import{a as x,b as T}from"./chunk-V7ISEJ3S.js";import"./chunk-C6PU2Y3O.js";import"./chunk-NFJHEVT2.js";import"./chunk-NSKS43OW.js";import{f as y}from"./chunk-JNI6O5ID.js";import{g as b,i as S}from"./chunk-YATEKNXL.js";import"./chunk-ZSTVFJS3.js";import"./chunk-ZT5AT5TL.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";import{mkdtempSync as R,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var P=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(P.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...P]}),i=S(o);try{let n=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as v}from"./chunk-76NQG773.js";import{b as O,d as A,e as E}from"./chunk-IZ2STC6S.js";import{a as x,b as T}from"./chunk-UBZG4U6Y.js";import"./chunk-O5ABYG6P.js";import"./chunk-OWYIFL7U.js";import"./chunk-R3QQ4NB6.js";import{f as y}from"./chunk-I26CCXY4.js";import{g as b,i as S}from"./chunk-NBE5LT2F.js";import"./chunk-ARZJZUZN.js";import"./chunk-MKAHHLPB.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";import{mkdtempSync as R,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var P=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(P.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...P]}),i=S(o);try{let n=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
3
3
  `);return s.length>_?s.slice(0,_)+`
4
4
  [tree truncated]`:s}finally{i.close()}}var K=`
5
5
  You write Maestro-compatible SootSim YAML flows from a user's plain-language test goal.
@@ -30,5 +30,5 @@ ${t||"[no tree available]"}
30
30
 
31
31
  Generate the shortest replayable flow that verifies the goal from this current state.
32
32
  `.trim()}async function W(e){let t=await fetch(`${e.origin.replace(/\/$/,"")}/api/llm`,{method:"POST",headers:{"content-type":"application/json",authorization:e.authHeader},body:JSON.stringify({modelId:J,context:{systemPrompt:K,messages:[{role:"user",content:z(e.prompt,e.describe),timestamp:Date.now()}]},options:{maxTokens:1800,temperature:.2},threadId:null}),signal:AbortSignal.timeout(j)});if(!t.ok||!t.body){let a=await t.text().catch(()=>"");throw new Error(`/api/llm ${t.status}${a?`: ${a}`:""}`)}let r=t.body.getReader(),o=new TextDecoder,i=[],n="",c=a=>{let l=a.trim();if(!l)return;let u=JSON.parse(l);if(u.type==="text_delta"&&u.delta)i.push(u.delta);else if(u.type==="error")throw new Error(u.errorMessage||"llm error")};for(;;){let{value:a,done:l}=await r.read();if(l)break;n+=o.decode(a,{stream:!0});let u;for(;(u=n.indexOf(`
33
- `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function X(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function M(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=X(e);if(!M(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"SootSim generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!M(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:v.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=x();if(!i||i.kind==="github")return console.error(' sootsim maestro generate "<goal>" needs a login or SOOTSIM_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await W({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=R(k(C(),"sootsim-maestro-generate-")),m=k(u,"flow.yaml");N(m,l.yamlText),console.log(` flow: ${m}`);let F=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-EZ2VB7CJ.js"),L=Q(e,o,m,c),w=await I(L),p=$(),h=D(),U=h.find(B=>B.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?U?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-F,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
33
+ `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function X(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function M(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=X(e);if(!M(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"SootSim generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!M(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:v.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=x();if(!i||i.kind==="github")return console.error(' sootsim maestro generate "<goal>" needs a login or SOOTSIM_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await W({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=R(k(C(),"sootsim-maestro-generate-")),m=k(u,"flow.yaml");N(m,l.yamlText),console.log(` flow: ${m}`);let F=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-FLKLFK6B.js"),L=Q(e,o,m,c),w=await I(L),p=$(),h=D(),U=h.find(B=>B.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?U?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-F,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
34
34
  result: ${g}`),d&&console.log(` run: ${d.id}`),p?.previewUrl&&console.log(` preview: ${p.previewUrl}`),d?.traceUrl&&console.log(` replay: ${d.traceUrl}`),w}export{le as runMaestroGenerate};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as s,b as i}from"./chunk-YNXFCE4C.js";import"./chunk-YATEKNXL.js";import"./chunk-OUHXKX62.js";import"./chunk-HVOLXPNB.js";import"./chunk-UEDGP46Q.js";import"./chunk-TGARSKJS.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s,b as i}from"./chunk-BXO377TL.js";import"./chunk-NBE5LT2F.js";import"./chunk-SHWJJEPO.js";import"./chunk-NJIE2DWC.js";import"./chunk-PLKAPXAO.js";import"./chunk-EXXJPCOE.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim mode screenshot \u2014 toggle the screenshot-mode chrome overlay
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.281 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-7DBKPFMT.js";import"./chunk-EXXJPCOE.js";export{c as __withOptionalDemoAppsForTests,a as loadOptionalDemoApps,b as optionalDemoAppsSync};