sootsim 0.1.280 → 0.1.282

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 (143) hide show
  1. package/README.md +5 -0
  2. package/detox/index.ts +26 -20
  3. package/dist-cli/bin.js +4 -4
  4. package/dist-cli/chunks/{agent-ROXS5UKV.js → agent-YMJHMOHY.js} +2 -2
  5. package/dist-cli/chunks/{agent-wrapper-D5NKHRC2.js → agent-wrapper-UGI7UFK7.js} +2 -2
  6. package/dist-cli/chunks/{app-fonts-NLXHDDFY.js → app-fonts-HNYIHDUK.js} +2 -2
  7. package/dist-cli/chunks/{assert-6BX5ZJC6.js → assert-7GCQTWJG.js} +2 -2
  8. package/dist-cli/chunks/{auth-7IVPJHYP.js → auth-AOCG5K7G.js} +2 -2
  9. package/dist-cli/chunks/beta-J2INMHX7.js +2 -0
  10. package/dist-cli/chunks/{camera-NCWVBECI.js → camera-TLQLMDQA.js} +2 -2
  11. package/dist-cli/chunks/{chunk-OUHXKX62.js → chunk-5DLGNYY2.js} +1 -1
  12. package/dist-cli/chunks/{chunk-NFJHEVT2.js → chunk-5IZTKX4B.js} +1 -1
  13. package/dist-cli/chunks/{chunk-ZT5AT5TL.js → chunk-5NC4QBZ6.js} +2 -2
  14. package/dist-cli/chunks/{chunk-C6PU2Y3O.js → chunk-7SPYMCUP.js} +1 -1
  15. package/dist-cli/chunks/{chunk-QUW7SRYQ.js → chunk-A54JKLF7.js} +2 -2
  16. package/dist-cli/chunks/{chunk-YATEKNXL.js → chunk-AAGI4VCR.js} +2 -2
  17. package/dist-cli/chunks/{chunk-MYY572U5.js → chunk-B5MQOQY3.js} +1 -1
  18. package/dist-cli/chunks/{chunk-HYEFBMSG.js → chunk-CAP6VAWC.js} +72 -72
  19. package/dist-cli/chunks/{chunk-CNTAENS7.js → chunk-CEBX6W7O.js} +2 -2
  20. package/dist-cli/chunks/{chunk-FDXWQHE2.js → chunk-CIQPKTXJ.js} +2 -2
  21. package/dist-cli/chunks/{chunk-DUH4SRYN.js → chunk-CN7WMGUC.js} +2 -2
  22. package/dist-cli/chunks/{chunk-MUMR4ITL.js → chunk-DB34LDDE.js} +1 -1
  23. package/dist-cli/chunks/{chunk-TGARSKJS.js → chunk-DFUF2O65.js} +1 -1
  24. package/dist-cli/chunks/{chunk-33ZEVH5C.js → chunk-FDCFC7VE.js} +2 -2
  25. package/dist-cli/chunks/{chunk-5JMI6AGC.js → chunk-FHU5JDB7.js} +2 -2
  26. package/dist-cli/chunks/chunk-FXSKJKES.js +36 -0
  27. package/dist-cli/chunks/{chunk-JRRMIVSC.js → chunk-G2CDTGPM.js} +2 -2
  28. package/dist-cli/chunks/{chunk-4MOKMNXN.js → chunk-G5VNFV2Z.js} +1 -1
  29. package/dist-cli/chunks/{chunk-XRXBF2B4.js → chunk-HGMLAXQP.js} +2 -2
  30. package/dist-cli/chunks/{chunk-NK7I3QVD.js → chunk-HHS53DV7.js} +1 -1
  31. package/dist-cli/chunks/{chunk-GLOQZ4YT.js → chunk-HLPEJIUL.js} +1 -1
  32. package/dist-cli/chunks/{chunk-UEDGP46Q.js → chunk-HYDQ553G.js} +1 -1
  33. package/dist-cli/chunks/{chunk-A4YDHKVX.js → chunk-JJ4FN7P3.js} +3 -3
  34. package/dist-cli/chunks/{chunk-HVOLXPNB.js → chunk-K6WHVSB3.js} +1 -1
  35. package/dist-cli/chunks/chunk-NDLDJFBD.js +1 -0
  36. package/dist-cli/chunks/{chunk-YNXFCE4C.js → chunk-NVDVTPQT.js} +2 -2
  37. package/dist-cli/chunks/{chunk-AVOOC775.js → chunk-O477H7IP.js} +1 -1
  38. package/dist-cli/chunks/{chunk-SZOPUPSH.js → chunk-OA2CRGWD.js} +3 -3
  39. package/dist-cli/chunks/{chunk-V7ISEJ3S.js → chunk-OI5O7LGV.js} +2 -2
  40. package/dist-cli/chunks/{chunk-EMQ6G7EP.js → chunk-ORYM7PIQ.js} +1 -1
  41. package/dist-cli/chunks/{chunk-ZSTVFJS3.js → chunk-PFLURTAN.js} +2 -2
  42. package/dist-cli/chunks/{chunk-NSKS43OW.js → chunk-PJ5XTOPB.js} +1 -1
  43. package/dist-cli/chunks/{chunk-NOEMQR47.js → chunk-RFD6QYCB.js} +3 -3
  44. package/dist-cli/chunks/{chunk-JNI6O5ID.js → chunk-SQC34HN4.js} +32 -14
  45. package/dist-cli/chunks/{chunk-4X7KRVUQ.js → chunk-SQZIS7VH.js} +1 -1
  46. package/dist-cli/chunks/{chunk-G4JIE3MG.js → chunk-UG2PHFD3.js} +2 -2
  47. package/dist-cli/chunks/{chunk-AJLMKI3T.js → chunk-V632VZZW.js} +1 -1
  48. package/dist-cli/chunks/{chunk-UPXILQIY.js → chunk-VHUB4FSK.js} +2 -2
  49. package/dist-cli/chunks/{chunk-JBL6N36H.js → chunk-VQGOXCWL.js} +2 -2
  50. package/dist-cli/chunks/{chunk-L4PHKH3P.js → chunk-WPVNCWR3.js} +2 -2
  51. package/dist-cli/chunks/{chunk-EF7SUCU5.js → chunk-WPWLMLWQ.js} +1 -1
  52. package/dist-cli/chunks/{chunk-QRGDTI6D.js → chunk-Y47XMOVG.js} +2 -2
  53. package/dist-cli/chunks/{chunk-V5FIROGW.js → chunk-YP2ARD2P.js} +2 -2
  54. package/dist-cli/chunks/{chunk-HVW7KD5H.js → chunk-ZRFV5C7Q.js} +1 -1
  55. package/dist-cli/chunks/cli-version-FC2DYS2X.js +2 -0
  56. package/dist-cli/chunks/{compat-EB3D6QQF.js → compat-QYY2IZA2.js} +3 -3
  57. package/dist-cli/chunks/{config-RNKFWNIV.js → config-GUFW57NS.js} +2 -2
  58. package/dist-cli/chunks/{control-7ZDTAZUN.js → control-UA4A5CEM.js} +2 -2
  59. package/dist-cli/chunks/daemon-OJXFWLYU.js +2 -0
  60. package/dist-cli/chunks/{debug-RXXHRVIL.js → debug-FYNGTLX6.js} +3 -3
  61. package/dist-cli/chunks/{desktop-BN6J4PCR.js → desktop-GL773VB4.js} +3 -3
  62. package/dist-cli/chunks/{detox-7JRAP55Z.js → detox-L7TX672B.js} +2 -2
  63. package/dist-cli/chunks/{device-ECQZUWAB.js → device-UFEN7JQL.js} +2 -2
  64. package/dist-cli/chunks/{diagnose-WCYZVJYK.js → diagnose-H42635NI.js} +2 -2
  65. package/dist-cli/chunks/drivers-AHPMBHAH.js +2 -0
  66. package/dist-cli/chunks/{film-PBJTMXO6.js → film-AGMCH24E.js} +3 -3
  67. package/dist-cli/chunks/flow-VNC5ML3N.js +2 -0
  68. package/dist-cli/chunks/help-DJZT5SVH.js +2 -0
  69. package/dist-cli/chunks/{hidden-runtime-alias-R3PN4QI7.js → hidden-runtime-alias-C7V6D3UU.js} +2 -2
  70. package/dist-cli/chunks/{home-paths-W3I2O5KQ.js → home-paths-CB6NF6HS.js} +2 -2
  71. package/dist-cli/chunks/inspect-FMHOEBYK.js +2 -0
  72. package/dist-cli/chunks/install-desktop-BQF7PGI7.js +2 -0
  73. package/dist-cli/chunks/{login-SHL26YD7.js → login-CGWYT5EN.js} +4 -4
  74. package/dist-cli/chunks/{logout-GACILXYF.js → logout-5XV4DCWQ.js} +2 -2
  75. package/dist-cli/chunks/{maestro-7IPHVNRV.js → maestro-MAKUP5QO.js} +3 -3
  76. package/dist-cli/chunks/{maestro-generate-OXINOJKT.js → maestro-generate-FOWJAFLU.js} +3 -3
  77. package/dist-cli/chunks/{mode-UDK37JMK.js → mode-W7QOW4KZ.js} +2 -2
  78. package/dist-cli/chunks/optional-demo-registry-WULVVBQD.js +2 -0
  79. package/dist-cli/chunks/{perf-V55KCRZZ.js → perf-JK3TELR3.js} +2 -2
  80. package/dist-cli/chunks/{record-TOZEIESK.js → record-6NE3HUZ2.js} +3 -3
  81. package/dist-cli/chunks/runtime-T5R6GWUH.js +2 -0
  82. package/dist-cli/chunks/{screenshot-command-M7RQDY24.js → screenshot-command-QPGXGHPW.js} +3 -3
  83. package/dist-cli/chunks/{screenshots-capture-OOOIEOT3.js → screenshots-capture-ETFBAFGK.js} +2 -2
  84. package/dist-cli/chunks/{serve-JIESP3OL.js → serve-E6UUCJSF.js} +2 -2
  85. package/dist-cli/chunks/{setup-HKBKU6RB.js → setup-B63SUXFT.js} +3 -3
  86. package/dist-cli/chunks/{skills-LC76VPDE.js → skills-JNWSS3YU.js} +2 -2
  87. package/dist-cli/chunks/{storage-WS32EPR5.js → storage-WF2SDOJL.js} +2 -2
  88. package/dist-cli/chunks/store-7TLHFS2Z.js +2 -0
  89. package/dist-cli/chunks/telemetry-4RFYMBVY.js +2 -0
  90. package/dist-cli/chunks/{timeline-DD7JXLF4.js → timeline-5YD7OU7Z.js} +2 -2
  91. package/dist-cli/chunks/{upgrade-PRO7EDS7.js → upgrade-D7NUFJ5G.js} +2 -2
  92. package/dist-cli/chunks/upload-4ZIQG56C.js +2 -0
  93. package/dist-cli/chunks/{version-XPBJ4NKL.js → version-PEV3MQ4I.js} +2 -2
  94. package/dist-cli/chunks/{web-RYQFPTU7.js → web-UU3SRADV.js} +2 -2
  95. package/dist-cli/chunks/{what-happened-PX2UYSNH.js → what-happened-LB34GZQB.js} +2 -2
  96. package/dist-lib/agent-daemon-client.cjs +1 -1
  97. package/dist-lib/agent-events.cjs +1 -1
  98. package/dist-lib/agent-identity.cjs +1 -1
  99. package/dist-lib/agent-sessions.cjs +1 -1
  100. package/dist-lib/attached-projects.cjs +1 -1
  101. package/dist-lib/auth/shared-session.cjs +1 -1
  102. package/dist-lib/backend-origin.cjs +1 -1
  103. package/dist-lib/beta.cjs +1 -1
  104. package/dist-lib/beta.mjs +1 -1
  105. package/dist-lib/bridge-constants.cjs +1 -1
  106. package/dist-lib/cli-constants.cjs +1 -1
  107. package/dist-lib/config.cjs +1 -1
  108. package/dist-lib/detox/index.cjs +21 -21
  109. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  110. package/dist-lib/home-paths.cjs +1 -1
  111. package/dist-lib/host/bridge-host.cjs +1 -1
  112. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  113. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  114. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  115. package/dist-lib/host/websocket-proxy.cjs +1 -1
  116. package/dist-lib/index.cjs +1 -1
  117. package/dist-lib/jump-to-source-babel.cjs +1 -1
  118. package/dist-lib/menu.cjs +1 -1
  119. package/dist-lib/menu.mjs +1 -1
  120. package/dist-lib/metro.cjs +1 -1
  121. package/dist-lib/profiles.cjs +1 -1
  122. package/dist-lib/render-mode.cjs +1 -1
  123. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  124. package/dist-lib/sdk.cjs +30 -3
  125. package/dist-lib/sdk.mjs +30 -3
  126. package/dist-lib/skills.cjs +21 -3
  127. package/dist-lib/vite.cjs +1 -1
  128. package/package.json +1 -1
  129. package/dist-cli/chunks/beta-ACSL6DHP.js +0 -2
  130. package/dist-cli/chunks/chunk-F3R6EZXX.js +0 -1
  131. package/dist-cli/chunks/chunk-NGMNL724.js +0 -36
  132. package/dist-cli/chunks/cli-version-FQD2KSQY.js +0 -2
  133. package/dist-cli/chunks/daemon-FEOCQWJE.js +0 -2
  134. package/dist-cli/chunks/drivers-F56K2VMH.js +0 -2
  135. package/dist-cli/chunks/flow-EZ2VB7CJ.js +0 -2
  136. package/dist-cli/chunks/help-VHLOJJWI.js +0 -2
  137. package/dist-cli/chunks/inspect-T74KPORE.js +0 -2
  138. package/dist-cli/chunks/install-desktop-NQWN2YAX.js +0 -2
  139. package/dist-cli/chunks/optional-demo-registry-HMXG44PF.js +0 -2
  140. package/dist-cli/chunks/runtime-MAEGIKCE.js +0 -2
  141. package/dist-cli/chunks/store-SS33J2RI.js +0 -2
  142. package/dist-cli/chunks/telemetry-ITXU4MEQ.js +0 -2
  143. package/dist-cli/chunks/upload-T5FFFASC.js +0 -2
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as C,b as D}from"./chunk-AJLMKI3T.js";import{H as E}from"./chunk-UEDGP46Q.js";var N="sootsimConfig";function p(e){return!!e&&Object.keys(e).length>0}function $(e){return e?p(e.modules)||p(e.turboModules)||p(e.nativeModules)||p(e.env)||p(e.network?.remap)||p(e.settings)||p(e.initialState):!1}function A(e,n){let t=new URL(e);return $(n)?t.searchParams.set(N,JSON.stringify(n)):t.searchParams.delete(N),t.toString()}var pe="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function j(e){return/^https?:\/\//i.test(e)}function O(e){return e.endsWith(".bundle")}function H(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function I(e){try{let n=j(e),t=new URL(e,"http://sootsim.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),O(t.pathname)?(t.searchParams.delete("transform.bytecode"),t.searchParams.get("lazy")==="true"&&t.searchParams.set("lazy","false"),H(t),n?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}function ge(e,n){try{let t=j(e),o=new URL(e,"http://sootsim.local");return O(o.pathname)?(o.searchParams.set("hot",n?"true":"false"),t?o.toString():`${o.pathname}${o.search}${o.hash}`):e}catch{return e}}import{exec as B}from"child_process";import W from"http";import F from"net";import{promisify as G}from"util";var T=G(B);C();var z=250,J=1500,K=120;function V(e,n=K){return new Promise(t=>{let o=new F.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),t(a))};o.setTimeout(n),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,n,t="GET",o=z,s={}){return new Promise(i=>{let a=W.request({hostname:"localhost",port:e,path:n,method:t,timeout:o,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var q=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function k(e,n){return!(e<=0||e>=2e4||n.has(e)||e>=5170&&e<=5200)}async function Y(e=[]){let n=new Set(e);try{let{stdout:t}=await T("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as C,b as D}from"./chunk-V632VZZW.js";import{H as E}from"./chunk-HYDQ553G.js";var N="sootsimConfig";function p(e){return!!e&&Object.keys(e).length>0}function $(e){return e?p(e.modules)||p(e.turboModules)||p(e.nativeModules)||p(e.env)||p(e.network?.remap)||p(e.settings)||p(e.initialState):!1}function A(e,n){let t=new URL(e);return $(n)?t.searchParams.set(N,JSON.stringify(n)):t.searchParams.delete(N),t.toString()}var pe="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function j(e){return/^https?:\/\//i.test(e)}function O(e){return e.endsWith(".bundle")}function H(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function I(e){try{let n=j(e),t=new URL(e,"http://sootsim.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),O(t.pathname)?(t.searchParams.delete("transform.bytecode"),t.searchParams.get("lazy")==="true"&&t.searchParams.set("lazy","false"),H(t),n?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}function ge(e,n){try{let t=j(e),o=new URL(e,"http://sootsim.local");return O(o.pathname)?(o.searchParams.set("hot",n?"true":"false"),t?o.toString():`${o.pathname}${o.search}${o.hash}`):e}catch{return e}}import{exec as B}from"child_process";import W from"http";import F from"net";import{promisify as G}from"util";var T=G(B);C();var z=250,J=1500,K=120;function V(e,n=K){return new Promise(t=>{let o=new F.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),t(a))};o.setTimeout(n),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,n,t="GET",o=z,s={}){return new Promise(i=>{let a=W.request({hostname:"localhost",port:e,path:n,method:t,timeout:o,headers:s},r=>{let c="";r.on("data",l=>c+=l.toString());let u=(()=>{let l=r.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();r.on("end",()=>i({statusCode:r.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var q=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function k(e,n){return!(e<=0||e>=2e4||n.has(e)||e>=5170&&e<=5200)}async function Y(e=[]){let n=new Set(e);try{let{stdout:t}=await T("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
3
3
  `)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),c=i[8].match(/:(\d+)$/);if(!c)continue;let u=Number(c[1]);k(u,n)&&(o.has(u)||o.set(u,a))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:t}=await T(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
4
4
  `)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let r=Number(i[1]),c=a?Number(a[1]):0;k(r,n)&&(o.has(r)||o.set(r,c))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return q.filter(t=>k(t.port,n))}var x=new Map;async function Q(e){if(e<=0)return null;let n=x.get(e);if(n)return n;try{let{stdout:t}=await T(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let o of t.split(`
5
5
  `))if(o.startsWith("n")&&o.length>1){let s=o.slice(1).trim();if(s)return x.set(e,s),s}}catch{}return null}function X(e,n){return{port:e,framework:n,bundleUrl:S(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function S(e,n){let t=D().find(s=>s.preferredPort===e),o=t?.runtimeConfig?A(n,t.runtimeConfig):n;return I(o)}function Z(e){return e.includes("/node_modules/one/metro-entry.bundle")}function ee(e){try{let n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}function w(e,n,t){if(!n)return e;try{let o=JSON.parse(n.body),s=o?.extra?.expoClient||o?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=o?.launchAsset?.url;i&&!e.patched&&!Z(e.bundleUrl)&&(e.bundleUrl=S(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,t)if(a.startsWith("http"))e.iconUrl=t(a);else{let r=a.replace(/^\.\//,"");e.iconUrl=t(`http://localhost:${e.port}/assets/${r}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var ne=2e4,v=new Map,M=new Set;function _(e,n){if(e.projectName)return e;let t=v.get(e.port);if(t)return t.projectName&&(e.projectName=t.projectName),t.iconUrl&&!e.iconUrl&&(e.iconUrl=t.iconUrl,e.iconPath=t.iconPath),t.bundleId&&!e.bundleId&&(e.bundleId=t.bundleId),e;if(!M.has(e.port)){M.add(e.port);let o=e.port;te(o,n).finally(()=>M.delete(o))}return e}async function te(e,n){let t=await h(e,"/","GET",ne,{"expo-platform":"ios"});if(!t||t.statusCode!==200)return;let o=w({port:e,framework:"one",bundleUrl:"",lastSeen:0},t,n);!o.projectName&&!o.iconUrl||(v.set(e,{projectName:o.projectName,iconUrl:o.iconUrl,iconPath:o.iconPath,bundleId:o.bundleId}),b.delete(e))}var d=new Set,g=new Set,y=new Set;async function oe(e,n){if(!await V(e))return null;let t="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[o,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),y.has(e)?Promise.resolve(null):h(e,"/","GET",J,{"expo-platform":"ios"}),g.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?g.delete(e):g.has(e)||g.add(e);let r=i?ee(i.body):null,c=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:null,u=r?.extra?.expoClient||r?.extra||{};if(r&&(c||typeof u.name=="string")){d.add(e);let U=c||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,L=U.includes("/one/metro-entry.bundle")?"one":"expo";return w({port:e,framework:L,bundleUrl:S(e,U),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,n)}if(s&&s.body.includes("packager-status:running"))return d.add(e),_(w(X(e,a&&a.statusCode===200?"expo":"metro"),i,n),n);if(o&&o.statusCode===200&&o.body.includes("sootsim-patched"))return d.delete(e),_(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,n),n);if(s&&s.statusCode===200||a&&a.statusCode===200||i&&i.statusCode===200&&r!=null)return null;let m=await h(e,t,"HEAD");return m&&m.statusCode>0&&m.statusCode<400&&/application\/javascript/i.test(m.contentType||"")?(d.add(e),y.add(e),_(w({port:e,framework:"one",bundleUrl:S(e,`http://localhost:${e}${t}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,n),n)):(d.add(e),null)}function re(e){return!!e.bundleId?.trim().toLowerCase()?.startsWith("dev.sootsim.")}var b=new Map,se=3e4,ie=1500;function ae(e){return!e||e.framework==="metro"||e.framework==="unknown"}function ce(e){return e?S(e.port,e.bundleUrl)===e.bundleUrl:!0}function ue(e,n,t=Date.now()){if(n===0||e.pid!==n||!ce(e.result))return!1;let o=t-e.cachedAt;return!(e.result===null&&o>=se||ae(e.result)&&o>=ie)}async function Pe(e={}){await C();let n=await Y(e.excludePorts),t=new Set(n.map(r=>r.port));for(let r of[...b.keys()])t.has(r)||b.delete(r);for(let r of[...d])t.has(r)||d.delete(r);for(let r of[...g])t.has(r)||g.delete(r);for(let r of[...y])t.has(r)||y.delete(r);for(let r of[...v.keys()])t.has(r)||v.delete(r);let o=[],s=[];for(let{port:r,pid:c}of n){let u=b.get(r);if(u&&ue(u,c)){u.result&&o.push(u.result);continue}u&&u.pid!==c&&(d.delete(r),g.delete(r),y.delete(r),v.delete(r)),s.push({port:r,pid:c})}s.length>0&&(await Promise.all(s.map(c=>oe(c.port,e.buildIconProxyUrl)))).forEach((c,u)=>{let{port:l,pid:m}=s[u];m!==0&&b.set(l,{pid:m,result:c,cachedAt:Date.now()}),c&&o.push(c)});let i=new Map;for(let{port:r,pid:c}of n)c>0&&i.set(r,c);await Promise.all(o.map(async r=>{let c=i.get(r.port);if(!c)return;r.pid=c;let u=await Q(c);u&&(r.cwd=u)}));let a=new Set(i.values());for(let r of[...x.keys()])a.has(r)||x.delete(r);return o.filter(r=>!re(r))}function le(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function ke(e){let n=le(e);return n==="localhost"||n.endsWith(".localhost")||n==="0.0.0.0"||n==="::1"||/^127(?:\.\d{1,3}){3}$/.test(n)}import R from"fs";import f from"path";import{fileURLToPath as de}from"url";var P;function fe(){if(P!==void 0)return P;let e=f.dirname(de(import.meta.url));for(let n=0;n<12&&e!==f.dirname(e);n++){if(R.existsSync(f.join(e,"packages/sootsim-engine/package.json"))&&R.existsSync(f.join(e,"public/sootsim")))return P=e,e;e=f.dirname(e)}return P=null,null}function Ne(){if(process.env.SOOTSIM_HOME&&E())return null;let e=fe();if(!e)return null;let n=f.join(e,"public/sootsim");return R.existsSync(f.join(n,"index.html"))&&R.existsSync(f.join(n,"engine/index.html"))&&R.existsSync(f.join(n,"engine-tenant/worker.js"))?n:null}export{A as a,pe as b,I as c,ge as d,oe as e,Pe as f,ke as g,Ne as h};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{H as t,L as n,N as l,j as r}from"./chunk-UEDGP46Q.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{H as t,L as n,N as l,j as r}from"./chunk-HYDQ553G.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var t=Object.freeze({id:"ios",displayName:"iOS",isIOS:!0,isAndroid:!1,select:e=>e.ios}),r=Object.freeze({id:"android",displayName:"Android",isIOS:!1,isAndroid:!0,select:e=>e.android}),i=Object.freeze({ios:t,android:r});
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as R}from"./chunk-MUMR4ITL.js";import{o as T}from"./chunk-UEDGP46Q.js";import{a as D}from"./chunk-TGARSKJS.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import f from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||T()}function y(){return _()}function B(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=B(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=B();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function U(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ye(e){let t=h.resolve(e.cwd),r=U(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function Se(){return S().attachedProjects}var Q=336*60*60*1e3;function we(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-Q,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function ve(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function Ae(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function V(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=V(t.agentSessions[c],s,r))}})}function v(e,t){z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-HMXG44PF.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=U(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as Z,spawnSync as ee}from"node:child_process";import{randomUUID as te}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import re from"node:readline";function b(e){return u.join(y(),"sessions",e)}function W(e){return u.join(b(e),"prompt.in")}function J(e){return u.join(b(e),"events.out")}function ne(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function se(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=oe();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function oe(){try{let e=ie();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ie(){try{let r=D.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=ce();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ce(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ae(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!de(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function de(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=ee("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Re(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ae(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?te():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=W(s.id),d=J(s.id),a=ne(s.id);L(c),L(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=se(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=Z(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});x.unref();let E=e.readyTimeoutMs??6e3,j=await ue(d,p=>p.type==="ready"||p.type==="error",E);if(!j||j.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function Ne(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as R}from"./chunk-DB34LDDE.js";import{o as T}from"./chunk-HYDQ553G.js";import{a as D}from"./chunk-DFUF2O65.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import f from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||T()}function y(){return _()}function B(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=B(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=B();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function U(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ye(e){let t=h.resolve(e.cwd),r=U(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function Se(){return S().attachedProjects}var Q=336*60*60*1e3;function we(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-Q,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function ve(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function Ae(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function V(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=V(t.agentSessions[c],s,r))}})}function v(e,t){z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-WULVVBQD.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=U(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as Z,spawnSync as ee}from"node:child_process";import{randomUUID as te}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import re from"node:readline";function b(e){return u.join(y(),"sessions",e)}function W(e){return u.join(b(e),"prompt.in")}function J(e){return u.join(b(e),"events.out")}function ne(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function se(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=oe();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function oe(){try{let e=ie();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ie(){try{let r=D.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=ce();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ce(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ae(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!de(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function de(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=ee("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Re(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ae(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?te():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=W(s.id),d=J(s.id),a=ne(s.id);L(c),L(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=se(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=Z(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});x.unref();let E=e.readyTimeoutMs??6e3,j=await ue(d,p=>p.type==="ready"||p.type==="error",E);if(!j||j.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function Ne(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
3
3
  `)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function $e(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=b(e),n=y();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function _e(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,m.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=re.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let a=I(d);a&&t(a)});let c=!1;return()=>{if(!c){c=!0;try{i.writeSync(n,`
4
4
  `)}catch{}try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ue(e,t,r){let n=i.openSync(e,m.O_RDWR|m.O_NONBLOCK),o=Buffer.alloc(8192),s="",c=Date.now()+r;try{for(;Date.now()<c;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(a){if(a.code!=="EAGAIN")throw a;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let a;for(;(a=s.indexOf(`
5
5
  `))>=0;){let g=s.slice(0,a);s=s.slice(a+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(a=>setTimeout(a,30))}return null}finally{i.closeSync(n)}}export{I as a,y as b,ye as c,F as d,Se as e,we as f,ve as g,Ae as h,k as i,C as j,V as k,z as l,Pe as m,b as n,W as o,J as p,ne as q,O as r,se as s,l as t,Re as u,Ne as v,$e as w,_e as x};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as k,k as l,l as C,m as w}from"./chunk-AVOOC775.js";var m="sootsim:settings",a=["errorReporting","colorScheme","reduceMotion","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function R(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let n={};for(let t of a){if(!(t in e))continue;let o=e[t],i=l[t];i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||(n[t]=o)}return n}function V(e){let n={};for(let t of a)n[t]=e[t];return n}function D(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(m);return e?g(JSON.parse(e)):{}}catch{return{}}}function j(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(m,JSON.stringify(e))}catch{}}function x(){let n=R()?.sharedConfig?.settings;return!n||typeof n!="object"?{}:g(n)}function M(e){let n=R();if(n?.writeSharedConfig)try{n.writeSharedConfig({settings:e})}catch{}}function K(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function T(){let e=K()?.settings;return!e||typeof e!="object"?{}:g(e)}function I(e){if(!K())return;let n={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(n))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}catch{}}function P(){let e=D(),n=T(),t=x();return{...e,...n,...t}}function _(e,n={}){let t=V(e);for(let o of a)n[o]!==void 0&&(t[o]=n[o]);j(t),M(t),I(t)}function E(e){if(typeof window>"u")return()=>{};let n=r=>{if(!(r.key!==m||r.newValue==null))try{e(g(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",n);let t=R(),o;t?.onSharedConfigChanged&&(o=t.onSharedConfigChanged(r=>{let d=r?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let d=r?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",n),o?.(),c?.()}}var O=C(),B=w(),p=P(),u=new Set,S={};for(let e of a)O[e]!==void 0&&(u.add(e),p[e]!==void 0&&(S[e]=p[e]),delete p[e]);var s={...B,...p},h=[],f=null;function y(){for(let e of h)e()}function v(){y(),_(s,S)}function b(e,n){let t=l[e];return t.validate&&!t.validate(n)||t.options&&!t.options.includes(n)||s[e]===n?!1:(s={...s,[e]:n},e==="deviceModel"&&(f=null),!0)}E(e=>{let n={...s},t=!1;for(let[o,i]of Object.entries(e)){let c=o;if(u.has(c)){S[c]=i;continue}n[c]!==i&&(n[c]=i,t=!0)}t&&(s=n,f=null,y())});var N={get(e){return s[e]},set(e,n){b(e,n)&&v()},setRuntime(e,n){u.has(e)||(u.add(e),a.includes(e)&&(S[e]=s[e])),b(e,n)&&y()},isRuntimeControlled(e){return u.has(e)},getAll(){return s},apply(e){let n=!1,t={...s};for(let[o,i]of Object.entries(e)){if(i===void 0)continue;let c=o,r=l[c];r&&(r.validate&&!r.validate(i)||r.options&&!r.options.includes(i)||t[c]!==i&&(t[c]=i,n=!0))}n&&(s=t,f=null,v())},applyRuntime(e){let n=!1;for(let t of Object.keys(e)){let o=e[t];o!==void 0&&(u.has(t)||(u.add(t),a.includes(t)&&(S[t]=s[t])),b(t,o)&&(n=!0))}n&&y()},reset(){s=w(),f=null,v()},subscribe(e){return h.push(e),()=>{h=h.filter(n=>n!==e)}},getDeviceSpec(){return f||(f=k(s.deviceModel)),f},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{N as a};
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as k,k as l,l as C,m as w}from"./chunk-O477H7IP.js";var m="sootsim:settings",a=["errorReporting","colorScheme","reduceMotion","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function R(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let n={};for(let t of a){if(!(t in e))continue;let o=e[t],i=l[t];i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||(n[t]=o)}return n}function V(e){let n={};for(let t of a)n[t]=e[t];return n}function D(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(m);return e?g(JSON.parse(e)):{}}catch{return{}}}function j(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(m,JSON.stringify(e))}catch{}}function x(){let n=R()?.sharedConfig?.settings;return!n||typeof n!="object"?{}:g(n)}function M(e){let n=R();if(n?.writeSharedConfig)try{n.writeSharedConfig({settings:e})}catch{}}function K(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function T(){let e=K()?.settings;return!e||typeof e!="object"?{}:g(e)}function I(e){if(!K())return;let n={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(n))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}catch{}}function P(){let e=D(),n=T(),t=x();return{...e,...n,...t}}function _(e,n={}){let t=V(e);for(let o of a)n[o]!==void 0&&(t[o]=n[o]);j(t),M(t),I(t)}function E(e){if(typeof window>"u")return()=>{};let n=r=>{if(!(r.key!==m||r.newValue==null))try{e(g(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",n);let t=R(),o;t?.onSharedConfigChanged&&(o=t.onSharedConfigChanged(r=>{let d=r?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let d=r?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",n),o?.(),c?.()}}var O=C(),B=w(),p=P(),u=new Set,S={};for(let e of a)O[e]!==void 0&&(u.add(e),p[e]!==void 0&&(S[e]=p[e]),delete p[e]);var s={...B,...p},h=[],f=null;function y(){for(let e of h)e()}function v(){y(),_(s,S)}function b(e,n){let t=l[e];return t.validate&&!t.validate(n)||t.options&&!t.options.includes(n)||s[e]===n?!1:(s={...s,[e]:n},e==="deviceModel"&&(f=null),!0)}E(e=>{let n={...s},t=!1;for(let[o,i]of Object.entries(e)){let c=o;if(u.has(c)){S[c]=i;continue}n[c]!==i&&(n[c]=i,t=!0)}t&&(s=n,f=null,y())});var N={get(e){return s[e]},set(e,n){b(e,n)&&v()},setRuntime(e,n){u.has(e)||(u.add(e),a.includes(e)&&(S[e]=s[e])),b(e,n)&&y()},isRuntimeControlled(e){return u.has(e)},getAll(){return s},apply(e){let n=!1,t={...s};for(let[o,i]of Object.entries(e)){if(i===void 0)continue;let c=o,r=l[c];r&&(r.validate&&!r.validate(i)||r.options&&!r.options.includes(i)||t[c]!==i&&(t[c]=i,n=!0))}n&&(s=t,f=null,v())},applyRuntime(e){let n=!1;for(let t of Object.keys(e)){let o=e[t];o!==void 0&&(u.has(t)||(u.add(t),a.includes(t)&&(S[t]=s[t])),b(t,o)&&(n=!0))}n&&y()},reset(){s=w(),f=null,v()},subscribe(e){return h.push(e),()=>{h=h.filter(n=>n!==e)}},getDeviceSpec(){return f||(f=k(s.deviceModel)),f},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{N as a};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-ZRFV5C7Q.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-DFUF2O65.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-UU3SRADV.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-UU3SRADV.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A as i,C as s,x as t}from"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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.282 | (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-A54JKLF7.js";import"./chunk-VQGOXCWL.js";import"./chunk-WPWLMLWQ.js";import"./chunk-VHUB4FSK.js";import"./chunk-HLPEJIUL.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import"./chunk-V632VZZW.js";import"./chunk-FXSKJKES.js";import"./chunk-SQC34HN4.js";import"./chunk-AAGI4VCR.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e}from"./chunk-UG2PHFD3.js";import"./chunk-PFLURTAN.js";import"./chunk-5NC4QBZ6.js";import"./chunk-FDCFC7VE.js";import"./chunk-WPVNCWR3.js";import"./chunk-FHU5JDB7.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-ORYM7PIQ.js";import"./chunk-HYDQ553G.js";import"./chunk-ZRFV5C7Q.js";import"./chunk-G5VNFV2Z.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{f,m as T}from"./chunk-FXSKJKES.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-SQC34HN4.js";import{g as D,i as O,k as x}from"./chunk-AAGI4VCR.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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-FMHOEBYK.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-RFD6QYCB.js";import"./chunk-NDLDJFBD.js";import{a as v,h as k}from"./chunk-A54JKLF7.js";import"./chunk-VQGOXCWL.js";import"./chunk-WPWLMLWQ.js";import{b as m,g as f,l as h}from"./chunk-VHUB4FSK.js";import{a as c}from"./chunk-HLPEJIUL.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import"./chunk-V632VZZW.js";import{a as u}from"./chunk-B5MQOQY3.js";import"./chunk-FXSKJKES.js";import"./chunk-SQC34HN4.js";import"./chunk-AAGI4VCR.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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-BQF7PGI7.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{e as E}from"./chunk-OA2CRGWD.js";import"./chunk-G2CDTGPM.js";import"./chunk-HHS53DV7.js";import"./chunk-CAP6VAWC.js";import"./chunk-CEBX6W7O.js";import{c as P,d as F,e as M}from"./chunk-CIQPKTXJ.js";import{a as R}from"./chunk-OI5O7LGV.js";import"./chunk-A54JKLF7.js";import"./chunk-VQGOXCWL.js";import"./chunk-WPWLMLWQ.js";import"./chunk-VHUB4FSK.js";import"./chunk-HLPEJIUL.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import"./chunk-V632VZZW.js";import"./chunk-FXSKJKES.js";import"./chunk-SQC34HN4.js";import"./chunk-AAGI4VCR.js";import"./chunk-SQZIS7VH.js";import"./chunk-PFLURTAN.js";import"./chunk-5NC4QBZ6.js";import"./chunk-FHU5JDB7.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-ORYM7PIQ.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-WPWLMLWQ.js";import{g as d,i as l,l as a}from"./chunk-AAGI4VCR.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import{b as c,c as r,d as g}from"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as E,i as R,l as b}from"./chunk-AAGI4VCR.js";import"./chunk-5DLGNYY2.js";import{c as v}from"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-NDLDJFBD.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-VHUB4FSK.js";import"./chunk-HLPEJIUL.js";import"./chunk-PJ5XTOPB.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as L,d as T}from"./chunk-NVDVTPQT.js";import{g as $,i as R,m as b}from"./chunk-AAGI4VCR.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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-VNC5ML3N.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c,d,e,f,g,h}from"./chunk-OA2CRGWD.js";import"./chunk-G2CDTGPM.js";import"./chunk-HHS53DV7.js";import{c as a,d as b}from"./chunk-CAP6VAWC.js";import"./chunk-CEBX6W7O.js";import"./chunk-CIQPKTXJ.js";import"./chunk-OI5O7LGV.js";import"./chunk-A54JKLF7.js";import"./chunk-VQGOXCWL.js";import"./chunk-WPWLMLWQ.js";import"./chunk-VHUB4FSK.js";import"./chunk-HLPEJIUL.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import"./chunk-V632VZZW.js";import"./chunk-FXSKJKES.js";import"./chunk-SQC34HN4.js";import"./chunk-AAGI4VCR.js";import"./chunk-SQZIS7VH.js";import"./chunk-PFLURTAN.js";import"./chunk-5NC4QBZ6.js";import"./chunk-FHU5JDB7.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-ORYM7PIQ.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-FDCFC7VE.js";import"./chunk-WPVNCWR3.js";import"./chunk-FHU5JDB7.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-ORYM7PIQ.js";import"./chunk-HYDQ553G.js";import"./chunk-ZRFV5C7Q.js";import"./chunk-G5VNFV2Z.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as e,b as s}from"./chunk-ORYM7PIQ.js";import"./chunk-DFUF2O65.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.282 | (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-HYDQ553G.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{j as a,k as b}from"./chunk-CAP6VAWC.js";import"./chunk-CEBX6W7O.js";import"./chunk-A54JKLF7.js";import"./chunk-VQGOXCWL.js";import"./chunk-WPWLMLWQ.js";import"./chunk-VHUB4FSK.js";import"./chunk-HLPEJIUL.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import"./chunk-V632VZZW.js";import"./chunk-FXSKJKES.js";import"./chunk-SQC34HN4.js";import"./chunk-AAGI4VCR.js";import"./chunk-SQZIS7VH.js";import"./chunk-FHU5JDB7.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-ORYM7PIQ.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.js";export{a as printShellPerfReport,b as runInspect};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-RFD6QYCB.js";import"./chunk-HLPEJIUL.js";import"./chunk-B5MQOQY3.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as k,d as v}from"./chunk-5NC4QBZ6.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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-4RFYMBVY.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-4RFYMBVY.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-4RFYMBVY.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-4RFYMBVY.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-PFLURTAN.js";import{a as t,c as o}from"./chunk-5NC4QBZ6.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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.282 | (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-OA2CRGWD.js";import"./chunk-G2CDTGPM.js";import"./chunk-HHS53DV7.js";import{c as S}from"./chunk-CAP6VAWC.js";import{a as x}from"./chunk-CEBX6W7O.js";import{b as A,c as $,d as F,e as T}from"./chunk-CIQPKTXJ.js";import{a as k}from"./chunk-OI5O7LGV.js";import"./chunk-A54JKLF7.js";import"./chunk-VQGOXCWL.js";import"./chunk-WPWLMLWQ.js";import"./chunk-VHUB4FSK.js";import"./chunk-HLPEJIUL.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import"./chunk-V632VZZW.js";import"./chunk-FXSKJKES.js";import"./chunk-SQC34HN4.js";import"./chunk-AAGI4VCR.js";import"./chunk-SQZIS7VH.js";import"./chunk-PFLURTAN.js";import"./chunk-5NC4QBZ6.js";import"./chunk-FHU5JDB7.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-ORYM7PIQ.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.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-FOWJAFLU.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as v}from"./chunk-CEBX6W7O.js";import{b as O,d as A,e as E}from"./chunk-CIQPKTXJ.js";import{a as x,b as T}from"./chunk-OI5O7LGV.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import{f as y}from"./chunk-SQC34HN4.js";import{g as b,i as S}from"./chunk-AAGI4VCR.js";import"./chunk-PFLURTAN.js";import"./chunk-5NC4QBZ6.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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-VNC5ML3N.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s,b as i}from"./chunk-NVDVTPQT.js";import"./chunk-AAGI4VCR.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-HYDQ553G.js";import"./chunk-DFUF2O65.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.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-V632VZZW.js";import"./chunk-DFUF2O65.js";export{c as __withOptionalDemoAppsForTests,a as loadOptionalDemoApps,b as optionalDemoAppsSync};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.280 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{k as x}from"./chunk-HYEFBMSG.js";import"./chunk-CNTAENS7.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{g as R,i as N,l as d,m as S}from"./chunk-YATEKNXL.js";import"./chunk-4X7KRVUQ.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{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),v=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,t)=>{this.ws.once("open",()=>r()),this.ws.once("error",t)}),this.ws.on("message",r=>{let t=JSON.parse(r.toString());if(t.id&&this.pending.has(t.id)){let{res:n,rej:s}=this.pending.get(t.id);this.pending.delete(t.id),t.error?s(new Error(JSON.stringify(t.error))):n(t.result)}else if(t.method)for(let n of this.listeners)n(t.method,t.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},t){let n=this.nextId++;return new Promise((s,a)=>{this.pending.set(n,{res:s,rej:a}),this.ws.send(JSON.stringify({id:n,method:o,params:r,...t?{sessionId:t}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(h(e,"--sample-interval")??"0.1"),n=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return E(n),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${n}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new v(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:t*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${P(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function P(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,a=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(a,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
1
+ /*! sootsim v0.1.282 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{k as x}from"./chunk-CAP6VAWC.js";import"./chunk-CEBX6W7O.js";import"./chunk-A54JKLF7.js";import"./chunk-VQGOXCWL.js";import"./chunk-WPWLMLWQ.js";import"./chunk-VHUB4FSK.js";import"./chunk-HLPEJIUL.js";import"./chunk-7SPYMCUP.js";import"./chunk-5IZTKX4B.js";import"./chunk-PJ5XTOPB.js";import"./chunk-V632VZZW.js";import"./chunk-FXSKJKES.js";import"./chunk-SQC34HN4.js";import{g as R,i as N,l as d,m as S}from"./chunk-AAGI4VCR.js";import"./chunk-SQZIS7VH.js";import"./chunk-FHU5JDB7.js";import"./chunk-HGMLAXQP.js";import"./chunk-5DLGNYY2.js";import"./chunk-K6WHVSB3.js";import"./chunk-ORYM7PIQ.js";import"./chunk-HYDQ553G.js";import"./chunk-YP2ARD2P.js";import"./chunk-O477H7IP.js";import"./chunk-DFUF2O65.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),v=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,t)=>{this.ws.once("open",()=>r()),this.ws.once("error",t)}),this.ws.on("message",r=>{let t=JSON.parse(r.toString());if(t.id&&this.pending.has(t.id)){let{res:n,rej:s}=this.pending.get(t.id);this.pending.delete(t.id),t.error?s(new Error(JSON.stringify(t.error))):n(t.result)}else if(t.method)for(let n of this.listeners)n(t.method,t.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},t){let n=this.nextId++;return new Promise((s,a)=>{this.pending.set(n,{res:s,rej:a}),this.ws.send(JSON.stringify({id:n,method:o,params:r,...t?{sessionId:t}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(h(e,"--sample-interval")??"0.1"),n=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return E(n),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${n}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new v(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:t*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${P(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function P(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,a=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(a,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
3
3
  sootsim perf react \u2014 inspect React component render cost in the tenant worker
4
4
 
5
5
  usage: