sootsim 0.1.53 → 0.1.54

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 (136) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-PA7ZGTHU.js → agent-VZPUCYJ5.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-CVZFXQKJ.js → agent-wrapper-V7ALP2GU.js} +2 -2
  4. package/dist-cli/chunks/{assert-6LHIY63B.js → assert-7P4UILIO.js} +2 -2
  5. package/dist-cli/chunks/auto-bootstrap-45LPPN26.js +2 -0
  6. package/dist-cli/chunks/beta-YJTC67JV.js +2 -0
  7. package/dist-cli/chunks/{chunk-ZYITMTYD.js → chunk-3HYJL6GY.js} +1 -1
  8. package/dist-cli/chunks/{chunk-STWL7EXR.js → chunk-4PVSZ6GE.js} +1 -1
  9. package/dist-cli/chunks/{chunk-XBP7BBSF.js → chunk-5FQNBWBM.js} +2 -2
  10. package/dist-cli/chunks/{chunk-AYU6WUNF.js → chunk-5SWIBDHV.js} +1 -1
  11. package/dist-cli/chunks/chunk-76WUDRCG.js +2 -0
  12. package/dist-cli/chunks/{chunk-AFXPU7YQ.js → chunk-7FOK7RXF.js} +3 -3
  13. package/dist-cli/chunks/{chunk-LYHVX7TD.js → chunk-A2BA2KJN.js} +3 -3
  14. package/dist-cli/chunks/{chunk-RBXJA2PW.js → chunk-ACSKJEJV.js} +2 -2
  15. package/dist-cli/chunks/chunk-ARLGT7VR.js +1 -0
  16. package/dist-cli/chunks/{chunk-R3VVVXF3.js → chunk-ATMCM62D.js} +2 -2
  17. package/dist-cli/chunks/chunk-BS3ITOUF.js +1 -0
  18. package/dist-cli/chunks/chunk-CKZ4LXSQ.js +1 -0
  19. package/dist-cli/chunks/{chunk-MX5HFYST.js → chunk-DLINRAGW.js} +1 -1
  20. package/dist-cli/chunks/{chunk-CRUPWYHV.js → chunk-DNTCQJWP.js} +3 -3
  21. package/dist-cli/chunks/{chunk-7ZHWA3WD.js → chunk-E3P25GBM.js} +2 -2
  22. package/dist-cli/chunks/{chunk-SQZXAKBL.js → chunk-EDU6E62D.js} +2 -2
  23. package/dist-cli/chunks/{chunk-LL3XAMKC.js → chunk-EE54B5YB.js} +2 -2
  24. package/dist-cli/chunks/{chunk-CTDDR7HW.js → chunk-G33A5TWY.js} +2 -2
  25. package/dist-cli/chunks/{chunk-CW2X4KRW.js → chunk-IGM4OHW6.js} +2 -2
  26. package/dist-cli/chunks/{chunk-5Q3XBH5M.js → chunk-ISHA4IUC.js} +2 -2
  27. package/dist-cli/chunks/{chunk-ELEP2COQ.js → chunk-ISQUXL6J.js} +2 -2
  28. package/dist-cli/chunks/chunk-J6CCM5BR.js +2 -0
  29. package/dist-cli/chunks/{chunk-6JZNIGOQ.js → chunk-JBGQ23F4.js} +1 -1
  30. package/dist-cli/chunks/{chunk-5U2BN4IU.js → chunk-KK5EUVGJ.js} +2 -2
  31. package/dist-cli/chunks/{chunk-QTVGSFY6.js → chunk-LHDZ4VZV.js} +1 -1
  32. package/dist-cli/chunks/{chunk-7IYYIF5B.js → chunk-LZ7CVJAO.js} +2 -2
  33. package/dist-cli/chunks/{chunk-AZYLZGRV.js → chunk-M3KFUEUN.js} +1 -1
  34. package/dist-cli/chunks/{chunk-FDA2NX2E.js → chunk-MAKAGEKD.js} +2 -2
  35. package/dist-cli/chunks/{chunk-N3RWXMD3.js → chunk-MNGXYS2K.js} +2 -2
  36. package/dist-cli/chunks/{chunk-E4JTYQVY.js → chunk-NXR73Q5J.js} +2 -2
  37. package/dist-cli/chunks/{chunk-ERC46HTZ.js → chunk-NZNOUWTN.js} +1 -1
  38. package/dist-cli/chunks/{chunk-WXOAHKCZ.js → chunk-QVCVU4DC.js} +1 -1
  39. package/dist-cli/chunks/{chunk-LELB2PV3.js → chunk-TJMYDDAG.js} +1 -1
  40. package/dist-cli/chunks/{chunk-GWGF4J4Y.js → chunk-TSXBCV5T.js} +2 -2
  41. package/dist-cli/chunks/{chunk-6A4CZMPO.js → chunk-UYCFIVX6.js} +2 -2
  42. package/dist-cli/chunks/{chunk-2ZBZCRN6.js → chunk-VHKFU4S2.js} +1 -1
  43. package/dist-cli/chunks/{chunk-CTGH5SFH.js → chunk-VWCU546H.js} +1 -1
  44. package/dist-cli/chunks/{chunk-XC3T7UDH.js → chunk-WYBVFDX7.js} +1 -1
  45. package/dist-cli/chunks/{chunk-IS5ORPFW.js → chunk-XFI4SBWQ.js} +2 -2
  46. package/dist-cli/chunks/chunk-XSZCYAXF.js +11 -0
  47. package/dist-cli/chunks/{chunk-YEE4EO2P.js → chunk-Y7ITI3X2.js} +1 -1
  48. package/dist-cli/chunks/{chunk-WBAIONOO.js → chunk-Z5YTYQHU.js} +2 -2
  49. package/dist-cli/chunks/{chunk-E3S6U2QR.js → chunk-ZBR6H6LW.js} +1 -1
  50. package/dist-cli/chunks/{chunk-R5XV3WIE.js → chunk-ZT6JZN2V.js} +2 -2
  51. package/dist-cli/chunks/cli-version-TG76CSHZ.js +2 -0
  52. package/dist-cli/chunks/{compat-CHBJ7TDK.js → compat-XQTJJGFN.js} +3 -3
  53. package/dist-cli/chunks/{config-XTZOLM5E.js → config-SREAYZNH.js} +2 -2
  54. package/dist-cli/chunks/control-LZR3EEK6.js +2 -0
  55. package/dist-cli/chunks/{cpu-profile-EQHKYVOF.js → cpu-profile-CUXZKZ4Z.js} +2 -2
  56. package/dist-cli/chunks/{daemon-K42MZR2E.js → daemon-MCR7OR22.js} +2 -2
  57. package/dist-cli/chunks/{debug-ULTTL5L2.js → debug-XZBCUV3A.js} +3 -3
  58. package/dist-cli/chunks/demo-app-registry-TTMQ5X4I.js +2 -0
  59. package/dist-cli/chunks/{detox-LU3G3EBC.js → detox-X3G5ASPP.js} +2 -2
  60. package/dist-cli/chunks/{device-RYW4ZE4R.js → device-BV3VJE3V.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-5YQAXWFB.js → diagnose-F52LKBS6.js} +2 -2
  62. package/dist-cli/chunks/drivers-A75SQEWU.js +2 -0
  63. package/dist-cli/chunks/{electron-ORBIXXTP.js → electron-VFZMSSGO.js} +3 -3
  64. package/dist-cli/chunks/flow-5LTGWXWP.js +2 -0
  65. package/dist-cli/chunks/{hints-V4SHPWCI.js → hints-VANECRXI.js} +2 -2
  66. package/dist-cli/chunks/{home-paths-UYEDTYXU.js → home-paths-J6PSRIMF.js} +2 -2
  67. package/dist-cli/chunks/{inspect-K2FN4JPL.js → inspect-SNFMIN2L.js} +3 -3
  68. package/dist-cli/chunks/install-NEFJEKEX.js +2 -0
  69. package/dist-cli/chunks/{install-desktop-BDDNVONK.js → install-desktop-X53RE7IV.js} +3 -3
  70. package/dist-cli/chunks/{keys-QH5VOSUK.js → keys-TS7M56JL.js} +2 -2
  71. package/dist-cli/chunks/{launch-K2LP5XFZ.js → launch-OW5YEDFK.js} +3 -3
  72. package/dist-cli/chunks/{login-5AJTPRVD.js → login-4TXQM3BF.js} +4 -4
  73. package/dist-cli/chunks/{logout-45VCRSXX.js → logout-3C3FPCG7.js} +2 -2
  74. package/dist-cli/chunks/{maestro-5LDII3YE.js → maestro-N74HJGTI.js} +2 -2
  75. package/dist-cli/chunks/{preview-IA2UUMLO.js → preview-FXVS46B5.js} +2 -2
  76. package/dist-cli/chunks/{profile-ZALUAYTJ.js → profile-TPFRKRKJ.js} +2 -2
  77. package/dist-cli/chunks/{react-KJBOHVG7.js → react-6Q34SQFO.js} +2 -2
  78. package/dist-cli/chunks/{record-UI226Z7F.js → record-7F6XI6Z3.js} +2 -2
  79. package/dist-cli/chunks/runtime-UHC43LJI.js +2 -0
  80. package/dist-cli/chunks/{runtime-delivery-Y4QVOPLO.js → runtime-delivery-7TRQ44Z6.js} +2 -2
  81. package/dist-cli/chunks/{screenshot-SV5S4UGU.js → screenshot-M2F3KS6M.js} +2 -2
  82. package/dist-cli/chunks/{screenshot-mode-NCISGI6W.js → screenshot-mode-HZAPMY7V.js} +2 -2
  83. package/dist-cli/chunks/{screenshots-MQZDYKF5.js → screenshots-PKBYEBBM.js} +2 -2
  84. package/dist-cli/chunks/{server-RLDTPMHN.js → server-OU3NTCYI.js} +2 -2
  85. package/dist-cli/chunks/setup-repo-4WQXPADN.js +2 -0
  86. package/dist-cli/chunks/{skills-NECP76E4.js → skills-L5EPL5WL.js} +2 -2
  87. package/dist-cli/chunks/{start-K4ASMK7D.js → start-XLPRV6L7.js} +4 -4
  88. package/dist-cli/chunks/store-TUCLRZNK.js +2 -0
  89. package/dist-cli/chunks/telemetry-PHCMEH7N.js +2 -0
  90. package/dist-cli/chunks/{test-YJLRC3IE.js → test-W5YAIGGY.js} +3 -3
  91. package/dist-cli/chunks/{three-mode-NAAIMEHL.js → three-mode-NXKHTAYK.js} +2 -2
  92. package/dist-cli/chunks/{timeline-BJXCTH7E.js → timeline-5UL2A7L2.js} +2 -2
  93. package/dist-cli/chunks/{upgrade-NRJOML2W.js → upgrade-K4WXKMQI.js} +2 -2
  94. package/dist-cli/chunks/upload-LVC4KCUG.js +2 -0
  95. package/dist-cli/chunks/{web-P3IP7M5Q.js → web-SLKO5KZU.js} +2 -2
  96. package/dist-cli/chunks/{what-happened-5Q2RBX5R.js → what-happened-NYYYNWGO.js} +2 -2
  97. package/dist-cli/chunks/{whoami-7W6WPTVA.js → whoami-OUJMAWR7.js} +2 -2
  98. package/dist-lib/agent-daemon-client.cjs +1 -1
  99. package/dist-lib/agent-events.cjs +1 -1
  100. package/dist-lib/agent-sessions.cjs +1 -1
  101. package/dist-lib/attached-projects.cjs +1 -1
  102. package/dist-lib/auth/shared-session.cjs +1 -1
  103. package/dist-lib/backend-origin.cjs +1 -1
  104. package/dist-lib/bridge-constants.cjs +1 -1
  105. package/dist-lib/cli-constants.cjs +1 -1
  106. package/dist-lib/config.cjs +1 -1
  107. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  108. package/dist-lib/home-paths.cjs +1 -1
  109. package/dist-lib/host/bridge-host.cjs +1 -1
  110. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  111. package/dist-lib/index.cjs +1 -1
  112. package/dist-lib/metro.cjs +1 -1
  113. package/dist-lib/profiles.cjs +1 -1
  114. package/dist-lib/render-mode.cjs +1 -1
  115. package/dist-lib/vite-base.cjs +1 -1
  116. package/dist-lib/vite.cjs +1 -1
  117. package/package.json +1 -1
  118. package/dist-cli/chunks/auto-bootstrap-SVBAUCSM.js +0 -2
  119. package/dist-cli/chunks/beta-YEBFYYIB.js +0 -2
  120. package/dist-cli/chunks/chunk-BPXSSZJS.js +0 -11
  121. package/dist-cli/chunks/chunk-CKZSGUTE.js +0 -2
  122. package/dist-cli/chunks/chunk-H4C3WE3C.js +0 -1
  123. package/dist-cli/chunks/chunk-NIHI6NXE.js +0 -1
  124. package/dist-cli/chunks/chunk-XO4UV6EO.js +0 -1
  125. package/dist-cli/chunks/chunk-YCPH4ZTS.js +0 -2
  126. package/dist-cli/chunks/cli-version-NMWGV7OU.js +0 -2
  127. package/dist-cli/chunks/control-XAZGNLFM.js +0 -2
  128. package/dist-cli/chunks/demo-app-registry-SO43B5HW.js +0 -2
  129. package/dist-cli/chunks/drivers-SXP44QNY.js +0 -2
  130. package/dist-cli/chunks/flow-GP7GAXLT.js +0 -2
  131. package/dist-cli/chunks/install-R4H47HDX.js +0 -2
  132. package/dist-cli/chunks/runtime-JNHCYB5L.js +0 -2
  133. package/dist-cli/chunks/setup-repo-F4RNWTDL.js +0 -2
  134. package/dist-cli/chunks/store-TLB2YDDQ.js +0 -2
  135. package/dist-cli/chunks/telemetry-EXCKYRZL.js +0 -2
  136. package/dist-cli/chunks/upload-BQTZTOJL.js +0 -2
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-LELB2PV3.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.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-TJMYDDAG.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-P3IP7M5Q.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-P3IP7M5Q.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-SLKO5KZU.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-SLKO5KZU.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.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-LELB2PV3.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-TJMYDDAG.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
3
3
  sootsim config \u2014 manage sootsim configuration
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.54 | (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}from"./chunk-XSZCYAXF.js";import"./chunk-QVCVU4DC.js";import"./chunk-JBGQ23F4.js";import"./chunk-UYCFIVX6.js";import"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import"./chunk-76WUDRCG.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";export{d as buildOpenUrl,c as buildShellUrl,f as printConnectedSims,a as resolveBundleTarget,b as resolveDefaultShellBaseUrl,l as runClaimCommand,m as runCloseCommand,k as runFocusCommand,h as runListCommand,i as runOpenCommand,j as runUseCommand,e as summarizeSimUrl,g as waitForSimMatch};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as I,e as N,i as S}from"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{createWriteStream as k,mkdirSync as v,writeFileSync as C}from"fs";import{dirname as T,resolve as w}from"path";import{Readable as F}from"stream";import{pipeline as y}from"stream/promises";import{createGzip as x}from"zlib";async function U(o,m){let n=Number(b(o,"--duration")??"5");if(!Number.isFinite(n)||n<=0)return console.error(" --duration must be a positive number (seconds)"),1;let a=Number(b(o,"--sample-interval")??"10");if(!Number.isFinite(a)||a<=0)return console.error(" --sample-interval must be a positive number (milliseconds)"),1;let t=Number(b(o,"--max-buffer")??"100000");if(!Number.isFinite(t)||t<=0)return console.error(" --max-buffer must be a positive number"),1;let p=b(o,"--output")??b(o,"-o"),l=w(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=l.endsWith(".gz"),h=I(o,{port:m.port,stripValueFlags:["--duration","--output","-o","--sample-interval","--max-buffer"]}),c=N({...h,commandTimeoutMs:Math.max(3e4,(n+20)*1e3)});try{let u=await S(c,"SootSim.bridges.workerCpuProfileStart",{sampleInterval:a,maxBufferSize:t});if(!u?.started)return u?.error?.includes("cpu-profile-unsupported")?(console.error(" cpu-profile is currently unsupported."),console.error(" the JS Self-Profiler API cannot profile a dedicated worker, and"),console.error(" sootsim runs the guest app in the tenant worker. a CDP-based"),console.error(" profiler is required \u2014 tracked as the F28 follow-up.")):(console.error(" could not start tenant-worker profiler."),console.error(" is sootsim running? (try `sootsim list`)")),1;m.verbose&&console.error(` started: sampleInterval=${u.sampleInterval}ms buffer=${u.maxBufferSize}`),console.log(` recording for ${n}s\u2026`),await new Promise(r=>setTimeout(r,n*1e3));let s=await S(c,"SootSim.bridges.workerCpuProfileStop");if(!s||s.error||!s.trace)return console.error(` profile capture failed: ${s?.error??"no trace returned"}`),1;let P=B(s.trace),e=JSON.stringify(P);v(T(l),{recursive:!0}),g?await y(F.from([e]),x(),k(l)):C(l,e);let i=(Buffer.byteLength(e)/1024/1024).toFixed(2);return console.log(` samples: ${P.samples.length} (${i} MB uncompressed)`),console.log(` saved: ${l}`),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}catch(u){let s=u?.message??String(u);return console.error(` profile failed: ${s}`),/could not connect|ECONNREFUSED/i.test(s)&&console.error(" is sootsim running? (try `sootsim list`)"),1}finally{c.close()}}function B(o){let m=o.frames??[],n=o.resources??[],a=o.stacks??[],t=o.samples??[],p=1,l=[{id:p,callFrame:{functionName:"(root)",scriptId:"0",url:"",lineNumber:-1,columnNumber:-1},hitCount:0,children:[]}];for(let e=0;e<a.length;e++){let i=a[e],r=m[i.frameId]??{name:"(unknown)"},f=r.resource!==void 0?n[r.resource]??"":"";l.push({id:e+2,callFrame:{functionName:r.name||"(anonymous)",scriptId:r.resource!==void 0?String(r.resource):"0",url:f,lineNumber:typeof r.line=="number"?r.line-1:-1,columnNumber:typeof r.column=="number"?r.column-1:-1},hitCount:0,children:[]})}for(let e=0;e<a.length;e++){let i=a[e],r=e+2,f=i.parentId!==void 0?i.parentId+2:p,d=l[f-1];d&&!d.children.includes(r)&&d.children.push(r)}let g=[],h=[],c=t.length>0?t[0].timestamp:0,u=c;for(let e=0;e<t.length;e++){let i=t[e],r=i.stackId!==void 0?i.stackId+2:p;g.push(r);let f=l[r-1];f&&f.hitCount++;let d=e===0?0:i.timestamp-u;h.push(Math.max(0,Math.round(d*1e3))),u=i.timestamp}let s=Math.round(c*1e3),P=t.length>0?Math.round(t[t.length-1].timestamp*1e3):s;return{nodes:l,startTime:s,endTime:P,samples:g,timeDeltas:h}}function b(o,m){let n=o.indexOf(m);if(!(n<0||n===o.length-1))return o[n+1]}export{U as runCpuProfile};
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as I,e as N,i as S}from"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{createWriteStream as k,mkdirSync as v,writeFileSync as C}from"fs";import{dirname as T,resolve as w}from"path";import{Readable as F}from"stream";import{pipeline as y}from"stream/promises";import{createGzip as x}from"zlib";async function U(o,m){let n=Number(b(o,"--duration")??"5");if(!Number.isFinite(n)||n<=0)return console.error(" --duration must be a positive number (seconds)"),1;let a=Number(b(o,"--sample-interval")??"10");if(!Number.isFinite(a)||a<=0)return console.error(" --sample-interval must be a positive number (milliseconds)"),1;let t=Number(b(o,"--max-buffer")??"100000");if(!Number.isFinite(t)||t<=0)return console.error(" --max-buffer must be a positive number"),1;let p=b(o,"--output")??b(o,"-o"),l=w(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=l.endsWith(".gz"),h=I(o,{port:m.port,stripValueFlags:["--duration","--output","-o","--sample-interval","--max-buffer"]}),c=N({...h,commandTimeoutMs:Math.max(3e4,(n+20)*1e3)});try{let u=await S(c,"SootSim.bridges.workerCpuProfileStart",{sampleInterval:a,maxBufferSize:t});if(!u?.started)return u?.error?.includes("cpu-profile-unsupported")?(console.error(" cpu-profile is currently unsupported."),console.error(" the JS Self-Profiler API cannot profile a dedicated worker, and"),console.error(" sootsim runs the guest app in the tenant worker. a CDP-based"),console.error(" profiler is required \u2014 tracked as the F28 follow-up.")):(console.error(" could not start tenant-worker profiler."),console.error(" is sootsim running? (try `sootsim list`)")),1;m.verbose&&console.error(` started: sampleInterval=${u.sampleInterval}ms buffer=${u.maxBufferSize}`),console.log(` recording for ${n}s\u2026`),await new Promise(r=>setTimeout(r,n*1e3));let s=await S(c,"SootSim.bridges.workerCpuProfileStop");if(!s||s.error||!s.trace)return console.error(` profile capture failed: ${s?.error??"no trace returned"}`),1;let P=B(s.trace),e=JSON.stringify(P);v(T(l),{recursive:!0}),g?await y(F.from([e]),x(),k(l)):C(l,e);let i=(Buffer.byteLength(e)/1024/1024).toFixed(2);return console.log(` samples: ${P.samples.length} (${i} MB uncompressed)`),console.log(` saved: ${l}`),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}catch(u){let s=u?.message??String(u);return console.error(` profile failed: ${s}`),/could not connect|ECONNREFUSED/i.test(s)&&console.error(" is sootsim running? (try `sootsim list`)"),1}finally{c.close()}}function B(o){let m=o.frames??[],n=o.resources??[],a=o.stacks??[],t=o.samples??[],p=1,l=[{id:p,callFrame:{functionName:"(root)",scriptId:"0",url:"",lineNumber:-1,columnNumber:-1},hitCount:0,children:[]}];for(let e=0;e<a.length;e++){let i=a[e],r=m[i.frameId]??{name:"(unknown)"},f=r.resource!==void 0?n[r.resource]??"":"";l.push({id:e+2,callFrame:{functionName:r.name||"(anonymous)",scriptId:r.resource!==void 0?String(r.resource):"0",url:f,lineNumber:typeof r.line=="number"?r.line-1:-1,columnNumber:typeof r.column=="number"?r.column-1:-1},hitCount:0,children:[]})}for(let e=0;e<a.length;e++){let i=a[e],r=e+2,f=i.parentId!==void 0?i.parentId+2:p,d=l[f-1];d&&!d.children.includes(r)&&d.children.push(r)}let g=[],h=[],c=t.length>0?t[0].timestamp:0,u=c;for(let e=0;e<t.length;e++){let i=t[e],r=i.stackId!==void 0?i.stackId+2:p;g.push(r);let f=l[r-1];f&&f.hitCount++;let d=e===0?0:i.timestamp-u;h.push(Math.max(0,Math.round(d*1e3))),u=i.timestamp}let s=Math.round(c*1e3),P=t.length>0?Math.round(t[t.length-1].timestamp*1e3):s;return{nodes:l,startTime:s,endTime:P,samples:g,timeDeltas:h}}function b(o,m){let n=o.indexOf(m);if(!(n<0||n===o.length-1))return o[n+1]}export{U as runCpuProfile};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as T,b as _}from"./chunk-SQZXAKBL.js";import"./chunk-CTDDR7HW.js";import"./chunk-YCPH4ZTS.js";import{g as I,o as C,p as w,q as B}from"./chunk-E3S6U2QR.js";import{a as W}from"./chunk-LELB2PV3.js";import{execFileSync as tt,spawnSync as n}from"child_process";import{existsSync as a,mkdirSync as v,readFileSync as et,rmSync as S,writeFileSync as R}from"fs";import{homedir as $}from"os";import{dirname as U,resolve as m}from"path";import{execFileSync as Y}from"child_process";import{chmodSync as H,mkdirSync as D,rmSync as K,writeFileSync as L}from"fs";import{dirname as P}from"path";var X="dev.sootsim.daemon",N="SootSim Daemon",O="0.1.36";function F(t,e,r){let o=w(),s=B(),i=P(P(s)),f=P(s),u=`${i}/Resources`;K(o,{recursive:!0,force:!0}),D(C(),{recursive:!0}),D(f,{recursive:!0}),D(u,{recursive:!0}),L(`${i}/Info.plist`,Q()),L(`${i}/PkgInfo`,"APPL????"),L(s,z(t,e,r)),H(s,493);try{Y("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(c){let g=c instanceof Error?c.message:String(c);console.warn(` warning: ad-hoc codesign of ${o} failed: ${g}
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as T,b as _}from"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-J6CCM5BR.js";import{g as I,o as C,p as w,q as B}from"./chunk-ZBR6H6LW.js";import{a as W}from"./chunk-TJMYDDAG.js";import{execFileSync as tt,spawnSync as n}from"child_process";import{existsSync as a,mkdirSync as v,readFileSync as et,rmSync as S,writeFileSync as R}from"fs";import{homedir as $}from"os";import{dirname as U,resolve as m}from"path";import{execFileSync as Y}from"child_process";import{chmodSync as H,mkdirSync as D,rmSync as K,writeFileSync as L}from"fs";import{dirname as P}from"path";var X="dev.sootsim.daemon",N="SootSim Daemon",O="0.1.36";function F(t,e,r){let o=w(),s=B(),i=P(P(s)),f=P(s),u=`${i}/Resources`;K(o,{recursive:!0,force:!0}),D(C(),{recursive:!0}),D(f,{recursive:!0}),D(u,{recursive:!0}),L(`${i}/Info.plist`,Q()),L(`${i}/PkgInfo`,"APPL????"),L(s,z(t,e,r)),H(s,493);try{Y("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(c){let g=c instanceof Error?c.message:String(c);console.warn(` warning: ad-hoc codesign of ${o} failed: ${g}
3
3
  the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:o,launcherPath:s}}function Q(){return`<?xml version="1.0" encoding="UTF-8"?>
4
4
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
5
5
  <plist version="1.0">
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as f}from"./chunk-ELEP2COQ.js";import{D,E as O,F as x,G as T,H as v}from"./chunk-QTVGSFY6.js";import{b as A}from"./chunk-6JZNIGOQ.js";import{c as S,e as $,g as N}from"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as f}from"./chunk-ISQUXL6J.js";import{D,E as O,F as x,G as T,H as v}from"./chunk-LHDZ4VZV.js";import{b as A}from"./chunk-JBGQ23F4.js";import{c as S,e as $,g as N}from"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.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:
@@ -167,7 +167,7 @@ examples:
167
167
  } : null,
168
168
  samples,
169
169
  }
170
- })()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(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","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-K2FN4JPL.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
170
+ })()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(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","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-SNFMIN2L.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
171
171
  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 D(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 O(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=`(() => {
172
172
  const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
173
173
  if (!d) return null;
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-ZT6JZN2V.js";import"./chunk-TJMYDDAG.js";export{a as APPS};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as S}from"./chunk-AFXPU7YQ.js";import"./chunk-R3VVVXF3.js";import"./chunk-FDA2NX2E.js";import"./chunk-H4C3WE3C.js";import"./chunk-5U2BN4IU.js";import"./chunk-CW2X4KRW.js";import"./chunk-IS5ORPFW.js";import"./chunk-7ZHWA3WD.js";import"./chunk-BPXSSZJS.js";import"./chunk-WXOAHKCZ.js";import"./chunk-6JZNIGOQ.js";import"./chunk-6A4CZMPO.js";import"./chunk-AYU6WUNF.js";import"./chunk-NIHI6NXE.js";import"./chunk-7IYYIF5B.js";import"./chunk-YEE4EO2P.js";import"./chunk-R5XV3WIE.js";import"./chunk-N3RWXMD3.js";import"./chunk-CKZSGUTE.js";import"./chunk-SQZXAKBL.js";import"./chunk-CTDDR7HW.js";import"./chunk-WBAIONOO.js";import"./chunk-AZYLZGRV.js";import"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as S}from"./chunk-7FOK7RXF.js";import"./chunk-ATMCM62D.js";import"./chunk-MAKAGEKD.js";import"./chunk-BS3ITOUF.js";import"./chunk-KK5EUVGJ.js";import"./chunk-IGM4OHW6.js";import"./chunk-XFI4SBWQ.js";import"./chunk-E3P25GBM.js";import"./chunk-XSZCYAXF.js";import"./chunk-QVCVU4DC.js";import"./chunk-JBGQ23F4.js";import"./chunk-UYCFIVX6.js";import"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import"./chunk-ZT6JZN2V.js";import"./chunk-MNGXYS2K.js";import"./chunk-76WUDRCG.js";import"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-Z5YTYQHU.js";import"./chunk-M3KFUEUN.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
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.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-H4C3WE3C.js";import"./chunk-N3RWXMD3.js";import"./chunk-WBAIONOO.js";import{f as c,g as r,h as g}from"./chunk-AZYLZGRV.js";import{c as d,e as l,h as a}from"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";function h(){console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-BS3ITOUF.js";import"./chunk-MNGXYS2K.js";import"./chunk-Z5YTYQHU.js";import{f as c,g as r,h as g}from"./chunk-M3KFUEUN.js";import{c as d,e as l,h as a}from"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.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.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as E,e as R,h as b}from"./chunk-GWGF4J4Y.js";import{b as v}from"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.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.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as E,e as R,h as b}from"./chunk-TSXBCV5T.js";import{b as v}from"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.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 diagnose \u2014 compact "what just went wrong?" report
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-CKZ4LXSQ.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-UYCFIVX6.js";import"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.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.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-MX5HFYST.js";import"./chunk-XO4UV6EO.js";import{a as v,f as h}from"./chunk-BPXSSZJS.js";import"./chunk-WXOAHKCZ.js";import"./chunk-6JZNIGOQ.js";import{b as f,g as u}from"./chunk-6A4CZMPO.js";import{a as p}from"./chunk-AYU6WUNF.js";import"./chunk-NIHI6NXE.js";import{c as m}from"./chunk-7IYYIF5B.js";import"./chunk-YEE4EO2P.js";import"./chunk-CKZSGUTE.js";import"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-DLINRAGW.js";import"./chunk-CKZ4LXSQ.js";import{a as v,f as h}from"./chunk-XSZCYAXF.js";import"./chunk-QVCVU4DC.js";import"./chunk-JBGQ23F4.js";import{b as f,g as u}from"./chunk-UYCFIVX6.js";import{a as p}from"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import{c as m}from"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import"./chunk-76WUDRCG.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim electron \u2014 launch the desktop companion
4
4
 
5
5
  usage:
@@ -15,4 +15,4 @@ examples:
15
15
  sootsim electron
16
16
  sootsim electron --port 5173
17
17
  sootsim electron --profile qa
18
- `),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-BDDNVONK.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
18
+ `),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-X53RE7IV.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as c,b as d,c as e,d as f}from"./chunk-7FOK7RXF.js";import"./chunk-ATMCM62D.js";import"./chunk-MAKAGEKD.js";import"./chunk-BS3ITOUF.js";import"./chunk-KK5EUVGJ.js";import"./chunk-IGM4OHW6.js";import"./chunk-XFI4SBWQ.js";import{c as a,d as b}from"./chunk-E3P25GBM.js";import"./chunk-XSZCYAXF.js";import"./chunk-QVCVU4DC.js";import"./chunk-JBGQ23F4.js";import"./chunk-UYCFIVX6.js";import"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import"./chunk-ZT6JZN2V.js";import"./chunk-MNGXYS2K.js";import"./chunk-76WUDRCG.js";import"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-Z5YTYQHU.js";import"./chunk-M3KFUEUN.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as n,c as r,d as l}from"./chunk-RBXJA2PW.js";import"./chunk-STWL7EXR.js";import"./chunk-LELB2PV3.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as n,c as r,d as l}from"./chunk-ACSKJEJV.js";import"./chunk-4PVSZ6GE.js";import"./chunk-TJMYDDAG.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A,B,C,D,E,F,G,H,I,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-E3S6U2QR.js";import"./chunk-LELB2PV3.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,D as activeRuntimeDir,j as activeRuntimeFile,r as cacheDir,H as claimDaemonLockfile,C as compareSemver,t as configFilePath,p as daemonAppBundlePath,o as daemonAppDir,q as daemonAppLauncherPath,s as daemonLockfilePath,k as electronDir,l as electronUserDataDir,m as electronVersionDir,y as ensureSootsimHome,F as isDaemonLockfileFresh,g as isSootsimDevCheckout,B as listInstalledRuntimes,n as profilesDir,z as readActiveRuntime,E as readDaemonLockfile,u as readSharedConfig,w as readTelemetryEnabled,I as removeDaemonLockfile,i as runtimeDir,h as runtimesDir,f as sootsimHomeDir,A as writeActiveRuntime,G as writeDaemonLockfile,v as writeSharedConfig,x as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A,B,C,D,E,F,G,H,I,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-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,D as activeRuntimeDir,j as activeRuntimeFile,r as cacheDir,H as claimDaemonLockfile,C as compareSemver,t as configFilePath,p as daemonAppBundlePath,o as daemonAppDir,q as daemonAppLauncherPath,s as daemonLockfilePath,k as electronDir,l as electronUserDataDir,m as electronVersionDir,y as ensureSootsimHome,F as isDaemonLockfileFresh,g as isSootsimDevCheckout,B as listInstalledRuntimes,n as profilesDir,z as readActiveRuntime,E as readDaemonLockfile,u as readSharedConfig,w as readTelemetryEnabled,I as removeDaemonLockfile,i as runtimeDir,h as runtimesDir,f as sootsimHomeDir,A as writeActiveRuntime,G as writeDaemonLockfile,v as writeSharedConfig,x as writeTelemetryEnabled};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as G}from"./chunk-RBXJA2PW.js";import{a as je,b as Je}from"./chunk-ZYITMTYD.js";import{a as X,b as D,c as B,d as Y,e as de,f as re,g as it,h as at,i as ve}from"./chunk-ELEP2COQ.js";import{B as se,C as nt,I as rt,a as Le,b as We,c as qe,d as He,e as Ue,f as Ke,g as xe,h as Se,m as ze,n as Ye,o as Ge,p as Xe,q as Ve,r as Qe,s as Ze,t as et,u as tt,v as ot,z as st}from"./chunk-QTVGSFY6.js";import{a as De,g as ce}from"./chunk-7ZHWA3WD.js";import{b as lt,c as ct,i as dt}from"./chunk-BPXSSZJS.js";import"./chunk-WXOAHKCZ.js";import{a as Be}from"./chunk-6JZNIGOQ.js";import"./chunk-6A4CZMPO.js";import"./chunk-AYU6WUNF.js";import"./chunk-NIHI6NXE.js";import"./chunk-7IYYIF5B.js";import"./chunk-YEE4EO2P.js";import{a as be,c as we,d as Ae}from"./chunk-XC3T7UDH.js";import{a as Fe}from"./chunk-CKZSGUTE.js";import{c as Oe,e as Re,f as Ee,g as Ce,h as $e}from"./chunk-GWGF4J4Y.js";import{b as Pe}from"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{existsSync as qt,mkdirSync as Ht,readFileSync as Ut,rmSync as ut,writeFileSync as Kt}from"fs";import{tmpdir as zt}from"os";import{dirname as Yt,join as Gt,resolve as Xt}from"path";var ie=1,Vt="SOOTSIM_INSPECT_NOTICE_PATH",Qt=300*1e3,Zt=15e3;function mt(){return Xt(process.env[Vt]||Gt(zt(),"sootsim-inspect-notice-state.json"))}function eo(o,d){return Object.fromEntries(Object.entries(o).filter(([,i])=>typeof i?.signature=="string"&&Number.isFinite(i?.updatedAt)&&d-i.updatedAt<=Qt))}function to(o){let d=mt();if(!qt(d))return{version:ie,entries:{}};try{let i=JSON.parse(Ut(d,"utf8"));return i.version!==ie||!i.entries||typeof i.entries!="object"?(ut(d,{force:!0}),{version:ie,entries:{}}):{version:ie,entries:eo(i.entries,o)}}catch{return ut(d,{force:!0}),{version:ie,entries:{}}}}function oo(o){let d=mt();Ht(Yt(d),{recursive:!0}),Kt(d,JSON.stringify(o,null,2)+`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as G}from"./chunk-ACSKJEJV.js";import{a as je,b as Je}from"./chunk-3HYJL6GY.js";import{a as X,b as D,c as B,d as Y,e as de,f as re,g as it,h as at,i as ve}from"./chunk-ISQUXL6J.js";import{B as se,C as nt,I as rt,a as Le,b as We,c as qe,d as He,e as Ue,f as Ke,g as xe,h as Se,m as ze,n as Ye,o as Ge,p as Xe,q as Ve,r as Qe,s as Ze,t as et,u as tt,v as ot,z as st}from"./chunk-LHDZ4VZV.js";import{a as De,g as ce}from"./chunk-E3P25GBM.js";import{b as lt,c as ct,i as dt}from"./chunk-XSZCYAXF.js";import"./chunk-QVCVU4DC.js";import{a as Be}from"./chunk-JBGQ23F4.js";import"./chunk-UYCFIVX6.js";import"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import{a as be,c as we,d as Ae}from"./chunk-WYBVFDX7.js";import{a as Fe}from"./chunk-76WUDRCG.js";import{c as Oe,e as Re,f as Ee,g as Ce,h as $e}from"./chunk-TSXBCV5T.js";import{b as Pe}from"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{existsSync as qt,mkdirSync as Ht,readFileSync as Ut,rmSync as ut,writeFileSync as Kt}from"fs";import{tmpdir as zt}from"os";import{dirname as Yt,join as Gt,resolve as Xt}from"path";var ie=1,Vt="SOOTSIM_INSPECT_NOTICE_PATH",Qt=300*1e3,Zt=15e3;function mt(){return Xt(process.env[Vt]||Gt(zt(),"sootsim-inspect-notice-state.json"))}function eo(o,d){return Object.fromEntries(Object.entries(o).filter(([,i])=>typeof i?.signature=="string"&&Number.isFinite(i?.updatedAt)&&d-i.updatedAt<=Qt))}function to(o){let d=mt();if(!qt(d))return{version:ie,entries:{}};try{let i=JSON.parse(Ut(d,"utf8"));return i.version!==ie||!i.entries||typeof i.entries!="object"?(ut(d,{force:!0}),{version:ie,entries:{}}):{version:ie,entries:eo(i.entries,o)}}catch{return ut(d,{force:!0}),{version:ie,entries:{}}}}function oo(o){let d=mt();Ht(Yt(d),{recursive:!0}),Kt(d,JSON.stringify(o,null,2)+`
3
3
  `)}function so(o,d){let i=d.trim()||"default";return`${o}:${i}`}function ke(o,d,i,l={}){let f=l.nowMs??Date.now(),a=l.cooldownMs??Zt,y=to(f),S=so(o,d),I=y.entries[S];return I&&I.signature===i&&f-I.updatedAt<a?!1:(y.entries[S]={signature:i,updatedAt:f},oo(y),!0)}async function pt(o,d={args:[]}){let i=await Le(o);if(D(d.args)){B(i);return}console.log(` nodes: ${i.nodes}`)}function Te(o,d){let i=o.indexOf(d);return i>=0&&i+1<o.length?o[i+1]:null}async function ft(o){let{bridge:d,args:i,positional:l}=o,f=i.includes("--verbose")||i.includes("-v"),a=D(i),y=f&&!a,S=i.includes("--watch")||i.includes("-w"),I=1e3,k=i.includes("--compact"),b=i.includes("--no-xy"),v=Te(i,"--testid-like"),_=Te(i,"--only"),T=Te(i,"--subtree"),C=l[1],c=C?/[*?]/.test(C):!1,L=!c&&!_?C:void 0,K=_??(c?C:void 0),E=async()=>{await de(d,{verbose:y});let z=await He(d,{describe:!0,verbose:f,filter:L||"",testIdLike:v||void 0,onlyGlob:K||void 0,subtreeRoot:T||void 0,compact:k,hideXy:b}),q=z?.tree,w=z?.shell,M=z?.keyboard;if(a){B({shell:w,tree:q??"",keyboard:M});return}if(w&&typeof w=="object"){let P=[w.state?`state=${w.state}`:null,w.activeApp?`app=${w.activeApp}`:null,w.showSwitcher?"switcher":null,w.switcherPhase&&w.switcherPhase!=="idle"?`phase=${w.switcherPhase}`:null].filter(Boolean);P.length>0&&console.log(` shell: ${P.join(" ")}`)}if(typeof q=="string"&&q.startsWith("__SUBTREE_NOT_FOUND__:")){let P=q.slice(22);console.log(` subtree root not found: ${P}`),G("subtree-root-not-found",P);return}if(!q){let P=z?.nodeCount??0;console.log(" no matching nodes found"),!(L||v||K||T)&&P<10&&G("app-still-loading",P);return}if(console.log(q),!(L||v||K||T)&&!S&&q.split(`
4
4
  `).length>=80&&G("describe-use-filters"),M&&M.visible){let P=M.spec,V=[P?.keyboardType?`type=${P.keyboardType}`:null,P?.returnKeyType&&P.returnKeyType!=="default"?`return=${P.returnKeyType}`:null,M.mode!=="letters"?`mode=${M.mode}`:null,M.shifted?"shift":null,M.capsLock?"caps":null,P?.autoCapitalize&&P.autoCapitalize!=="sentences"?`autoCap=${P.autoCapitalize}`:null,M.accessoryBarId?`accessory=${M.accessoryBarId}`:null].filter(Boolean);console.log(`
5
5
  keyboard: ${V.join(" ")||"visible"}`)}};if(S)for(console.log(` watching... (Ctrl+C to stop)
@@ -135,7 +135,7 @@ import{a as G}from"./chunk-RBXJA2PW.js";import{a as je,b as Je}from"./chunk-ZYIT
135
135
  `);console.log(`${t??""}
136
136
 
137
137
  ${s}
138
- `),process.exit(0)}let _=f.wsPort,T=f.simId,C=f.commandTimeoutMs;if(y==="list"&&l.some(e=>e==="--drivers"||e==="-D")){let{buildDriverListRows:e}=await import("./drivers-SXP44QNY.js"),t=e();console.log(` available drivers (${t.length}):
138
+ `),process.exit(0)}let _=f.wsPort,T=f.simId,C=f.commandTimeoutMs;if(y==="list"&&l.some(e=>e==="--drivers"||e==="-D")){let{buildDriverListRows:e}=await import("./drivers-A75SQEWU.js"),t=e();console.log(` available drivers (${t.length}):
139
139
  `);let s=Math.max(...t.map(r=>r.id.length),6),n=Math.max(...t.map(r=>r.kind.length),4);for(let r of t){let u=r.available?"\u2713":"\u2717",m=r.id.padEnd(s),x=r.kind.padEnd(n);console.log(` ${u} ${m} ${x} ${r.description}`),r.available&&r.detail?console.log(` ${r.detail}`):!r.available&&r.reason&&console.log(` unavailable: ${r.reason}`)}return}let c=Re(f),L=T||"default",K=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),E=200;function J(e){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(t)){let n=/<title[^>]*>([^<]+)<\/title>/i.exec(e)?.[1]?.trim(),r=/<body[^>]*>([\s\S]*?)<\//i.exec(e)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=n||r||"html error page";return`<html ${e.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return t.length<=E?t:`${t.slice(0,E)}\u2026 (+${t.length-E} more bytes)`}function z(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function q(e){let t=gt()?1200:350;try{let{settled:s,elapsed:n}=await ne({bridge:e,maxMs:t,pollMs:32,stablePolls:2});s||process.stderr.write(` \u26A0 auto-wait timed out after ${n??t}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
140
140
  `)}catch{}}async function w(){try{return await c.send({type:"evaluate",code:`(() => ({
141
141
  console: window.__sootsimConsole?.count?.() || null,
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-5FQNBWBM.js";import"./chunk-DLINRAGW.js";import"./chunk-A2BA2KJN.js";import"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";async function t(n){console.error(" note: `sootsim install` is now `sootsim setup-repo`. forwarding\u2026\n"),await o(n)}export{t as runInstall};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as b}from"./chunk-MX5HFYST.js";import{a as x}from"./chunk-AYU6WUNF.js";import"./chunk-LELB2PV3.js";import{spawn as k,spawnSync as u}from"child_process";import{chmodSync as S,createWriteStream as E,existsSync as w,mkdirSync as y,renameSync as T,rmSync as g,statSync as P}from"fs";import{tmpdir as D}from"os";import{dirname as M,join as f,resolve as v}from"path";var h="https://sootbean.com/api/electron-release";function A(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",n=`sootsim-latest-${o}.dmg`;return{platform:o,filename:n,url:`${h}/${n}`,install:_}}if(process.platform==="linux"){let o="sootsim-latest-linux-x64.AppImage";return{platform:"linux-x64",filename:o,url:`${h}/${o}`,install:L}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:C}}return null}async function O({url:r,dest:o,onProgress:n}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${r})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");y(M(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,n?.(c,a)}}finally{await new Promise((l,p)=>{i.end(e=>e?p(e):l())})}}function I(r,o){let n=(r/1048576).toFixed(1);if(!o)return` ${n} MB`;let s=Math.min(100,Math.round(r/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${n} / ${t} MB`}async function _(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let n=o.stdout.trim().split(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as b}from"./chunk-DLINRAGW.js";import{a as x}from"./chunk-5SWIBDHV.js";import"./chunk-TJMYDDAG.js";import{spawn as k,spawnSync as u}from"child_process";import{chmodSync as S,createWriteStream as E,existsSync as w,mkdirSync as y,renameSync as T,rmSync as g,statSync as P}from"fs";import{tmpdir as D}from"os";import{dirname as M,join as f,resolve as v}from"path";var h="https://sootbean.com/api/electron-release";function A(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",n=`sootsim-latest-${o}.dmg`;return{platform:o,filename:n,url:`${h}/${n}`,install:_}}if(process.platform==="linux"){let o="sootsim-latest-linux-x64.AppImage";return{platform:"linux-x64",filename:o,url:`${h}/${o}`,install:L}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:C}}return null}async function O({url:r,dest:o,onProgress:n}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${r})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");y(M(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,n?.(c,a)}}finally{await new Promise((l,p)=>{i.end(e=>e?p(e):l())})}}function I(r,o){let n=(r/1048576).toFixed(1);if(!o)return` ${n} MB`;let s=Math.min(100,Math.round(r/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${n} / ${t} MB`}async function _(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let n=o.stdout.trim().split(`
3
3
  `),t=n[n.length-1].split(" ").pop()?.trim();if(!t||!w(t))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=f(t,"sootsim.app");if(!w(a))throw u("hdiutil",["detach","-force",t]),new Error(`sootsim.app not found inside ${t}`);let i="/Applications",d=v(process.env.HOME||"","Applications"),c=i;try{let m=f(i,`.sootsim-write-probe-${process.pid}`);u("touch",[m]),w(m)?g(m,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=u("cp",["-R",a,l]),e=u("hdiutil",["detach","-force",t]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return e.status!==0&&console.warn(` warning: failed to unmount ${t} (${e.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",l]),l}async function L(r){let o=v(process.env.HOME||"","Applications");y(o,{recursive:!0});let n=f(o,"sootsim.AppImage");return w(n)&&g(n,{force:!0}),T(r,n),S(n,493),n}async function C(r){return await new Promise((o,n)=>{let s=k("cmd",["/c","start",'""',"/wait",r],{stdio:"inherit"});s.once("error",n),s.once("exit",t=>{t===0?o():n(new Error(`installer exited with code ${t}`))})}),r}async function Y(r){(r.includes("--help")||r.includes("-h"))&&(console.log(`
4
4
  sootsim install-desktop \u2014 download and install the optional desktop GUI
5
5
 
@@ -20,4 +20,4 @@ examples:
20
20
  `),process.exit(0));let o=r.includes("--yes")||r.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,n=r.includes("--force"),s=x();if(s&&!n){console.log(` sootsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let t=A();if(t||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, win32-x64"),process.exit(1)),console.log(` platform: ${t.platform}`),console.log(` download: ${t.url}`),console.log(),!o){if(!await b("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(D(),`sootsim-install-${Date.now()}`),i=f(a,t.filename),d=0;process.stdout.write(` downloading ${t.filename}...
21
21
  `);try{await O({url:t.url,dest:i,onProgress:(e,m)=>{let $=Date.now();$-d<100&&e<(m??1/0)||(d=$,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${I(e,m)}`))}})}catch(e){g(a,{recursive:!0,force:!0}),console.error(`
22
22
  download failed: ${e instanceof Error?e.message:String(e)}`),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
23
- `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-EXCKYRZL.js");try{let e=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${e}`)}catch(e){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:e instanceof Error?e.message:String(e)}}),await p(),console.error(` install failed: ${e instanceof Error?e.message:String(e)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{Y as runInstallDesktop};
23
+ `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-PHCMEH7N.js");try{let e=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${e}`)}catch(e){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:e instanceof Error?e.message:String(e)}}),await p(),console.error(` install failed: ${e instanceof Error?e.message:String(e)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{Y as runInstallDesktop};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as l,b as d,c as k,d as y,e as g}from"./chunk-IS5ORPFW.js";import{d as c}from"./chunk-CTDDR7HW.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as l,b as d,c as k,d as y,e as g}from"./chunk-XFI4SBWQ.js";import{d as c}from"./chunk-G33A5TWY.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
3
3
  created: ${t.record.label} (${t.record.keyPrefix}\u2026)`),console.log(` scopes: ${t.record.scopes.join(",")}`),console.log(`
4
4
  secret: ${t.secret}
5
5
  `),console.log(` copy this now \u2014 we can't show it again.
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-XO4UV6EO.js";import{b as m}from"./chunk-6A4CZMPO.js";import{a as u}from"./chunk-AYU6WUNF.js";import"./chunk-NIHI6NXE.js";import"./chunk-7IYYIF5B.js";import"./chunk-YEE4EO2P.js";import{D as c,E as r,F as l,y as s,z as a}from"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{spawn as p}from"child_process";import{existsSync as h}from"fs";async function I(n){if(n.includes("--help")||n.includes("-h")){console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-CKZ4LXSQ.js";import{b as m}from"./chunk-UYCFIVX6.js";import{a as u}from"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import{D as c,E as r,F as l,y as s,z as a}from"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{spawn as p}from"child_process";import{existsSync as h}from"fs";async function I(n){if(n.includes("--help")||n.includes("-h")){console.log(`
3
3
  sootsim launch \u2014 one-shot: install runtime if needed, start daemon, open app
4
4
 
5
5
  usage:
@@ -13,4 +13,4 @@ options:
13
13
  examples:
14
14
  sootsim launch
15
15
  sootsim launch --version 1.2.3
16
- `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-JNHCYB5L.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await t(["install",...o],{channel:n.channel})}async function d(){let n=r();if(l(n))return;console.log("sootsim: starting daemon");let e=w();p(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let t=Date.now()+8e3;for(;Date.now()<t;){let o=r();if(l(o))return;await g(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function x(){u()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await m.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function w(){let n=process.argv[1];return n&&h(n)?n:"sootsim"}function g(n){return new Promise(e=>setTimeout(e,n))}async function R(){s(),await d()}export{R as ensureDaemonRunning,I as runLaunch};
16
+ `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-UHC43LJI.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await t(["install",...o],{channel:n.channel})}async function d(){let n=r();if(l(n))return;console.log("sootsim: starting daemon");let e=w();p(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let t=Date.now()+8e3;for(;Date.now()<t;){let o=r();if(l(o))return;await g(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function x(){u()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await m.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function w(){let n=process.argv[1];return n&&h(n)?n:"sootsim"}function g(n){return new Promise(e=>setTimeout(e,n))}async function R(){s(),await d()}export{R as ensureDaemonRunning,I as runLaunch};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as f,d as m}from"./chunk-CTDDR7HW.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(t){if(t)return t;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(`${h}/api/auth/me`)).ok)return h}catch{}return I}function R(){console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as f,d as m}from"./chunk-G33A5TWY.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(t){if(t)return t;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(`${h}/api/auth/me`)).ok)return h}catch{}return I}function R(){console.log(`
3
3
  sootsim login \u2014 sign in so desktop uploads can attach to your account
4
4
 
5
5
  usage:
@@ -21,6 +21,6 @@ options:
21
21
  <p style="color:#ccc">${t}</p>
22
22
  </div>
23
23
  </body>
24
- </html>`}async function P(t){try{let o=await fetch(`${t.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(o.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!o.ok){let c=await o.text().catch(()=>"");return{ok:!1,error:`dev-login ${o.status}: ${c}`}}let e=await o.json();return e.token?{ok:!0,token:e.token,userId:e.user?.id,email:e.email}:{ok:!1,error:"dev-login response missing token"}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"dev-login fetch failed"}}}function A(t){try{let o=new URL(t).hostname;return o==="localhost"||o==="127.0.0.1"||o.endsWith(".local")}catch{return!1}}async function G(t){(t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let o=[...t],e=await x(T(o,"--origin"));if(A(e)){console.log(` detected local origin (${e}) \u2014 signing in as dev user`);let r=await P(e);if(r.ok){f({token:r.token,user:r.userId?{id:r.userId,email:r.email}:null,origin:e,source:"cli"});let s=await m(e),l=s?.user?.email||r.email||s?.user?.id||r.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-EXCKYRZL.js");n({event:"cli_login_succeeded",identity:{userId:r.userId??s?.user?.id??null},properties:{origin:e,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${r.error}); falling back to browser`)}let c=$(16).toString("hex"),i=await new Promise(r=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,O=a.searchParams.get("userId")||void 0,g=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),g){n.end(u(`sign-in failed: ${g}`)),r({ok:!1,error:g}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),r({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),r({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),r({ok:!0,token:k,email:b,userId:O}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),r({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){r({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${e.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",e),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
24
+ </html>`}async function P(t){try{let o=await fetch(`${t.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(o.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!o.ok){let c=await o.text().catch(()=>"");return{ok:!1,error:`dev-login ${o.status}: ${c}`}}let e=await o.json();return e.token?{ok:!0,token:e.token,userId:e.user?.id,email:e.email}:{ok:!1,error:"dev-login response missing token"}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"dev-login fetch failed"}}}function A(t){try{let o=new URL(t).hostname;return o==="localhost"||o==="127.0.0.1"||o.endsWith(".local")}catch{return!1}}async function G(t){(t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let o=[...t],e=await x(T(o,"--origin"));if(A(e)){console.log(` detected local origin (${e}) \u2014 signing in as dev user`);let r=await P(e);if(r.ok){f({token:r.token,user:r.userId?{id:r.userId,email:r.email}:null,origin:e,source:"cli"});let s=await m(e),l=s?.user?.email||r.email||s?.user?.id||r.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-PHCMEH7N.js");n({event:"cli_login_succeeded",identity:{userId:r.userId??s?.user?.id??null},properties:{origin:e,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${r.error}); falling back to browser`)}let c=$(16).toString("hex"),i=await new Promise(r=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,O=a.searchParams.get("userId")||void 0,g=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),g){n.end(u(`sign-in failed: ${g}`)),r({ok:!1,error:g}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),r({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),r({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),r({ok:!0,token:k,email:b,userId:O}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),r({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){r({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${e.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",e),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
25
25
  ${n.toString()}
26
- `),L(n.toString())})});if(!i.ok){let{trackCliEvent:r,flushCliTelemetry:s}=await import("./telemetry-EXCKYRZL.js");r({event:"cli_login_failed",properties:{origin:e,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}f({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:e,source:"cli"});let d=await m(e),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-EXCKYRZL.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:e}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
26
+ `),L(n.toString())})});if(!i.ok){let{trackCliEvent:r,flushCliTelemetry:s}=await import("./telemetry-PHCMEH7N.js");r({event:"cli_login_failed",properties:{origin:e,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}f({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:e,source:"cli"});let d=await m(e),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-PHCMEH7N.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:e}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as r,b as i}from"./chunk-SQZXAKBL.js";import{a as t,c as o}from"./chunk-CTDDR7HW.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.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.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-EDU6E62D.js";import{a as t,c as o}from"./chunk-G33A5TWY.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.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.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as h,c as w}from"./chunk-AFXPU7YQ.js";import"./chunk-R3VVVXF3.js";import"./chunk-FDA2NX2E.js";import"./chunk-H4C3WE3C.js";import"./chunk-5U2BN4IU.js";import"./chunk-CW2X4KRW.js";import"./chunk-IS5ORPFW.js";import"./chunk-7ZHWA3WD.js";import"./chunk-BPXSSZJS.js";import"./chunk-WXOAHKCZ.js";import"./chunk-6JZNIGOQ.js";import"./chunk-6A4CZMPO.js";import"./chunk-AYU6WUNF.js";import"./chunk-NIHI6NXE.js";import"./chunk-7IYYIF5B.js";import"./chunk-YEE4EO2P.js";import"./chunk-R5XV3WIE.js";import"./chunk-N3RWXMD3.js";import"./chunk-CKZSGUTE.js";import"./chunk-SQZXAKBL.js";import"./chunk-CTDDR7HW.js";import"./chunk-WBAIONOO.js";import"./chunk-AZYLZGRV.js";import"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import*as i from"fs";import*as l from"path";var v=[".maestro","maestro"];function x(){console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as h,c as w}from"./chunk-7FOK7RXF.js";import"./chunk-ATMCM62D.js";import"./chunk-MAKAGEKD.js";import"./chunk-BS3ITOUF.js";import"./chunk-KK5EUVGJ.js";import"./chunk-IGM4OHW6.js";import"./chunk-XFI4SBWQ.js";import"./chunk-E3P25GBM.js";import"./chunk-XSZCYAXF.js";import"./chunk-QVCVU4DC.js";import"./chunk-JBGQ23F4.js";import"./chunk-UYCFIVX6.js";import"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import"./chunk-ZT6JZN2V.js";import"./chunk-MNGXYS2K.js";import"./chunk-76WUDRCG.js";import"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-Z5YTYQHU.js";import"./chunk-M3KFUEUN.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import*as i from"fs";import*as l from"path";var v=[".maestro","maestro"];function x(){console.log(`
3
3
  sootsim maestro \u2014 run maestro YAML flows against sootsim (drop-in)
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-LELB2PV3.js";import{resolve as c,dirname as m}from"path";import{fileURLToPath as a}from"url";var t=m(a(import.meta.resolve("sootsim-engine/package.json")));async function g(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-TJMYDDAG.js";import{resolve as c,dirname as m}from"path";import{fileURLToPath as a}from"url";var t=m(a(import.meta.resolve("sootsim-engine/package.json")));async function g(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
3
3
  sootsim preview \u2014 production-like preview
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as s,c as i,d as t,e as n,f as c}from"./chunk-7IYYIF5B.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";function f(){console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as s,c as i,d as t,e as n,f as c}from"./chunk-LZ7CVJAO.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";function f(){console.log(`
3
3
  sootsim profile \u2014 manage isolated storage profiles
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as w,e as b,h as m,i as f}from"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";function h(){console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as w,e as b,h as m,i as f}from"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";function h(){console.log(`
3
3
  sootsim react \u2014 inspect React component render cost in the tenant worker
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as A}from"./chunk-5U2BN4IU.js";import"./chunk-CW2X4KRW.js";import{d as K}from"./chunk-IS5ORPFW.js";import"./chunk-NIHI6NXE.js";import{d as G}from"./chunk-YEE4EO2P.js";import"./chunk-SQZXAKBL.js";import"./chunk-CTDDR7HW.js";import{c as v,e as y}from"./chunk-GWGF4J4Y.js";import{b as q}from"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{existsSync as ue,mkdirSync as k,readdirSync as me,readFileSync as fe,rmSync as W,writeFileSync as M}from"fs";import{homedir as pe,tmpdir as ge}from"os";import{dirname as P,extname as H,join as U,resolve as we}from"path";var X=6e4,he=3e4;async function N(e,t,o,i){let r=Math.max(2e4,i+he);try{return await e.send({type:"evaluate",code:t},{timeoutMs:r})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(r/1e3)}s; it is likely contended or wedged.
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as A}from"./chunk-KK5EUVGJ.js";import"./chunk-IGM4OHW6.js";import{d as K}from"./chunk-XFI4SBWQ.js";import"./chunk-ARLGT7VR.js";import{d as G}from"./chunk-Y7ITI3X2.js";import"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import{c as v,e as y}from"./chunk-TSXBCV5T.js";import{b as q}from"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{existsSync as ue,mkdirSync as k,readdirSync as me,readFileSync as fe,rmSync as W,writeFileSync as M}from"fs";import{homedir as pe,tmpdir as ge}from"os";import{dirname as P,extname as H,join as U,resolve as we}from"path";var X=6e4,he=3e4;async function N(e,t,o,i){let r=Math.max(2e4,i+he);try{return await e.send({type:"evaluate",code:t},{timeoutMs:r})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(r/1e3)}s; it is likely contended or wedged.
3
3
  the capture lock auto-releases, so simply retry the recording.
4
4
  if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording/i.test(s)&&(console.error(` ${o} failed: ${s}
5
5
  a prior recording was abandoned and its capture is still
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-DNTCQJWP.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-NXR73Q5J.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";export{a as runRuntime};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-E4JTYQVY.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,l as checkRuntimeUpToDate,h as fetchRuntimeManifest,j as installRuntime,d as resolveRuntimeCdnOrigin,e as resolveRuntimeChannel,i as resolveRuntimeVersion,f as runtimeManifestUrl,g as runtimeTarballUrl,k as updateRuntimeToLatest};
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-NXR73Q5J.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,l as checkRuntimeUpToDate,h as fetchRuntimeManifest,j as installRuntime,d as resolveRuntimeCdnOrigin,e as resolveRuntimeChannel,i as resolveRuntimeVersion,f as runtimeManifestUrl,g as runtimeTarballUrl,k as updateRuntimeToLatest};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as S}from"./chunk-FDA2NX2E.js";import"./chunk-H4C3WE3C.js";import{a as x}from"./chunk-ZYITMTYD.js";import"./chunk-N3RWXMD3.js";import"./chunk-WBAIONOO.js";import{f as m}from"./chunk-AZYLZGRV.js";import{c as h,d as g,e as w,h as y}from"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{mkdirSync as R,writeFileSync as v}from"fs";import{dirname as _,resolve as $}from"path";async function W(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as S}from"./chunk-MAKAGEKD.js";import"./chunk-BS3ITOUF.js";import{a as x}from"./chunk-3HYJL6GY.js";import"./chunk-MNGXYS2K.js";import"./chunk-Z5YTYQHU.js";import{f as m}from"./chunk-M3KFUEUN.js";import{c as h,d as g,e as w,h as y}from"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{mkdirSync as R,writeFileSync as v}from"fs";import{dirname as _,resolve as $}from"path";async function W(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim screenshot \u2014 capture the canvas as a PNG
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as o}from"./chunk-LL3XAMKC.js";import"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";async function n(e,s){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-EE54B5YB.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";async function n(e,s){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim screenshot-mode \u2014 toggle the screenshot-mode chrome overlay
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as Y}from"./chunk-AFXPU7YQ.js";import"./chunk-R3VVVXF3.js";import{b as j}from"./chunk-FDA2NX2E.js";import"./chunk-H4C3WE3C.js";import"./chunk-5U2BN4IU.js";import"./chunk-CW2X4KRW.js";import"./chunk-IS5ORPFW.js";import{b as O}from"./chunk-7ZHWA3WD.js";import"./chunk-BPXSSZJS.js";import"./chunk-WXOAHKCZ.js";import"./chunk-6JZNIGOQ.js";import"./chunk-6A4CZMPO.js";import"./chunk-AYU6WUNF.js";import"./chunk-NIHI6NXE.js";import"./chunk-7IYYIF5B.js";import"./chunk-YEE4EO2P.js";import"./chunk-R5XV3WIE.js";import"./chunk-N3RWXMD3.js";import"./chunk-CKZSGUTE.js";import"./chunk-SQZXAKBL.js";import"./chunk-CTDDR7HW.js";import"./chunk-WBAIONOO.js";import{a as w,b as D,c as k,d as z,e as x,f as T}from"./chunk-AZYLZGRV.js";import"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import"./chunk-YCPH4ZTS.js";import"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{mkdirSync as B,readFileSync as pe,writeFileSync as G}from"fs";import{tmpdir as je}from"os";import C from"path";import{mkdirSync as I,readFileSync as Q,writeFileSync as H}from"fs";import F from"path";function _(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function v(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ee(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function M(e,t){let o=ee(e),i=Math.max(0,Math.min(1,t)),n=o.match(/^#([0-9a-f]{6})$/i);if(n){let s=n[1],r=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),u=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${u}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function te(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function re(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${M(t,.46)} 0%, ${M(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function A(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";default:return"none"}}function L(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function E(e){let t=M(e.color,e.opacity),o=M(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function R(e,t){return!t.glow||e.color&&e.color!==w.color?e:{...e,color:t.glow}}function oe(e,t){if(e==="editorial-left"){let n=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),c=a.pose||r.pose||"tilted-right",m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.18)+l}px`,`left:${Math.round(t.width*.56)}px`,`width:${p}px`,"transform-origin:center center",`transform:${A(c)}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let n=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),c=a.pose||r.pose,m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${L("translateX(-50%)",A(c))}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,s,r)=>{let a=t.name==="ipad-13"?.54:.64,u=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,c=R(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${u}px`,"transform-origin:center top",`transform:${L("translateX(-50%)",A(l))}`,`filter:${E(c)}`,"z-index:2"].join(";")}}}function ne({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=oe(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),u=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${v(o.headline)}</div>`:"",p=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${v(o.subheadline)}</div>`:"",l=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${v(o.eyebrow)}</div></div>`:"";return`<!doctype html>
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as Y}from"./chunk-7FOK7RXF.js";import"./chunk-ATMCM62D.js";import{b as j}from"./chunk-MAKAGEKD.js";import"./chunk-BS3ITOUF.js";import"./chunk-KK5EUVGJ.js";import"./chunk-IGM4OHW6.js";import"./chunk-XFI4SBWQ.js";import{b as O}from"./chunk-E3P25GBM.js";import"./chunk-XSZCYAXF.js";import"./chunk-QVCVU4DC.js";import"./chunk-JBGQ23F4.js";import"./chunk-UYCFIVX6.js";import"./chunk-5SWIBDHV.js";import"./chunk-ARLGT7VR.js";import"./chunk-LZ7CVJAO.js";import"./chunk-Y7ITI3X2.js";import"./chunk-ZT6JZN2V.js";import"./chunk-MNGXYS2K.js";import"./chunk-76WUDRCG.js";import"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-Z5YTYQHU.js";import{a as w,b as D,c as k,d as z,e as x,f as T}from"./chunk-M3KFUEUN.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{mkdirSync as B,readFileSync as pe,writeFileSync as G}from"fs";import{tmpdir as je}from"os";import C from"path";import{mkdirSync as I,readFileSync as Q,writeFileSync as H}from"fs";import F from"path";function _(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function v(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ee(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function M(e,t){let o=ee(e),i=Math.max(0,Math.min(1,t)),n=o.match(/^#([0-9a-f]{6})$/i);if(n){let s=n[1],r=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),u=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${u}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function te(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function re(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${M(t,.46)} 0%, ${M(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function A(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";default:return"none"}}function L(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function E(e){let t=M(e.color,e.opacity),o=M(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function R(e,t){return!t.glow||e.color&&e.color!==w.color?e:{...e,color:t.glow}}function oe(e,t){if(e==="editorial-left"){let n=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),c=a.pose||r.pose||"tilted-right",m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.18)+l}px`,`left:${Math.round(t.width*.56)}px`,`width:${p}px`,"transform-origin:center center",`transform:${A(c)}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let n=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),c=a.pose||r.pose,m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${L("translateX(-50%)",A(c))}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,s,r)=>{let a=t.name==="ipad-13"?.54:.64,u=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,c=R(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${u}px`,"transform-origin:center top",`transform:${L("translateX(-50%)",A(l))}`,`filter:${E(c)}`,"z-index:2"].join(";")}}}function ne({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=oe(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),u=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${v(o.headline)}</div>`:"",p=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${v(o.subheadline)}</div>`:"",l=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${v(o.eyebrow)}</div></div>`:"";return`<!doctype html>
3
3
  <html>
4
4
  <head>
5
5
  <meta charset="utf-8" />
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.53 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as Q,c as D,d as ee,e as H,f as te,h as ie,i as A,j as re,k as ne,l as se,p as oe,s as k,t as ae,u as ce,v as de,w as le}from"./chunk-5Q3XBH5M.js";import"./chunk-2ZBZCRN6.js";import{a as I}from"./chunk-R3VVVXF3.js";import{a as Z}from"./chunk-CW2X4KRW.js";import"./chunk-IS5ORPFW.js";import"./chunk-WXOAHKCZ.js";import"./chunk-NIHI6NXE.js";import{d as Y}from"./chunk-YEE4EO2P.js";import"./chunk-R5XV3WIE.js";import{a as U}from"./chunk-CTGH5SFH.js";import{a as q,b as z}from"./chunk-SQZXAKBL.js";import"./chunk-CTDDR7HW.js";import"./chunk-GWGF4J4Y.js";import"./chunk-STWL7EXR.js";import{a as M}from"./chunk-YCPH4ZTS.js";import{k as X}from"./chunk-E4JTYQVY.js";import{A as j,B,D as $,E as J,F as K,G as V,H as G,I as N,u as L,v as F,y as T,z as W}from"./chunk-E3S6U2QR.js";import"./chunk-LELB2PV3.js";import{spawn as _e}from"child_process";import w from"fs";import{createServer as Re}from"http";import S from"path";import{WebSocket as h,WebSocketServer as xe}from"ws";import ue from"node:fs";import E from"node:path";var P=1;function be(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(a=>Number.isFinite(a)&&a>0)}var O=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await se()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as Q,c as D,d as ee,e as H,f as te,h as ie,i as A,j as re,k as ne,l as se,p as oe,s as k,t as ae,u as ce,v as de,w as le}from"./chunk-ISHA4IUC.js";import"./chunk-VHKFU4S2.js";import{a as I}from"./chunk-ATMCM62D.js";import{a as Z}from"./chunk-IGM4OHW6.js";import"./chunk-XFI4SBWQ.js";import"./chunk-QVCVU4DC.js";import"./chunk-ARLGT7VR.js";import{d as Y}from"./chunk-Y7ITI3X2.js";import"./chunk-ZT6JZN2V.js";import{a as U}from"./chunk-VWCU546H.js";import{a as q,b as z}from"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import{a as M}from"./chunk-J6CCM5BR.js";import{k as X}from"./chunk-NXR73Q5J.js";import{A as j,B,D as $,E as J,F as K,G as V,H as G,I as N,u as L,v as F,y as T,z as W}from"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";import{spawn as _e}from"child_process";import w from"fs";import{createServer as Re}from"http";import S from"path";import{WebSocket as h,WebSocketServer as xe}from"ws";import ue from"node:fs";import E from"node:path";var P=1;function be(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(a=>Number.isFinite(a)&&a>0)}var O=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await se()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
3
3
  `)}}close(){for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return H();case"agent:upsert-project":return D(i.input??{});case"agent:delete-project":return ie(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return re(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-prompt":{let n=String(i.sessionId),o=A(n);if(!o)throw new k("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await ce(n,r),this.notePromptAccepted(n,r,o.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await de(String(i.sessionId));let s=A(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new k("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async doStartSession(e){if(!ee(e.projectId))throw new k("NO_PROJECT",`no project: ${e.projectId}`);let i=await ae(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??be(),o=(await I({excludePorts:s})).find(d=>String(d.port)===i);if(!o||!o.cwd)return{project:null};let r=H().find(d=>d.cwd===o.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],o.bundleUrl,t]));return{project:D({cwd:o.cwd,name:o.projectName??E.basename(o.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[o.cwd],knownBundleUrls:c,framework:r?.framework??we(o.framework),bundleId:o.bundleId??r?.bundleId})}}getTranscript(e){let t=oe(e);return ue.existsSync(t)?ue.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=Q();return{userDataDir:e,storeFile:E.join(e,"attached-projects.json"),sessionsDir:E.join(e,"sessions"),transcriptsDir:E.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=le(t,o=>{let r=this.coalescePromptEcho(t,o);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),o.type==="turn-completed"){let c=A(t);if(c)try{te(c.projectId,{usd:o.costUsd,ts:o.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
4
4
  `)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let o=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,o);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:o>1,pendingTurns:o,queueDepth:Math.max(0,o-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){ne(e,t);let i=A(e);i&&this.broadcastSessionStatus(i)}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===P)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===P)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===P)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===P)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function we(a){return a==="expo"?"expo":a==="one"||a==="vxrn"?"one":"unknown"}import Ae from"http";import ke from"https";var Ce="sootsim",Te=new Set(["host","origin","referer","user-agent","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),Ie={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"};function C(a){for(let[e,t]of Object.entries(Ie))a.setHeader(e,t)}function Ee(a,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return a.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function Pe(a){let e={};for(let[t,i]of Object.entries(a))i&&(Te.has(t.toLowerCase())||(e[t]=Array.isArray(i)?i.join(", "):i));return e["user-agent"]=Ce,e}function pe(a){return a?.startsWith("/__fetch-proxy?")||a?.startsWith("/__proxy?")||!1}function me(a){return a?!!(a.startsWith("/__app-api?")||a.startsWith("/__app-api/")):!1}async function he(a,e){if(a.method==="OPTIONS"){C(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((a.url||"").split("?")[1]||"").get("url");if(!i){C(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{C(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=Pe(a.headers),o;if(a.method!=="GET"&&a.method!=="HEAD"){let d=[];for await(let u of a)d.push(Buffer.isBuffer(u)?u:Buffer.from(u));d.length>0&&(o=Buffer.concat(d))}let r;try{r=await fetch(s.href,{method:a.method,headers:n,body:o,redirect:"follow"})}catch(d){C(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${Ee(s.href,d)}`);return}r.headers.forEach((d,u)=>{let p=u.toLowerCase();p==="content-encoding"||p==="transfer-encoding"||p==="content-length"||p==="set-cookie"||p.startsWith("access-control-")||e.setHeader(u,d)}),C(e);let c=r.headers.getSetCookie?.()??[];c.length>0&&e.setHeader("x-sootsim-set-cookie",c.join(", ")),e.statusCode=r.status;let l=Buffer.from(await r.arrayBuffer());e.end(l)}function fe(a,e){let t=a.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(a.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":a.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":a.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let o=n.protocol==="https:"?ke:Ae,r={...a.headers};delete r.host,r.host=n.host;let c=o.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:a.method,headers:r},l=>{let d=Object.keys(l.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":a.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return c.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),a.pipe(c),!0}var Le=new Set(["tap","keyboard","close"]),Be=2e3,Ne=1e3;function De(a){return!a||typeof a.type!="string"?!1:a.acquireLock===!0?!0:a.readOnly===!0?!1:Le.has(a.type)}var He=5e3,Me=3600*1e3,Ue="SOOTSIM_RUNTIME_UPDATE_INTERVAL_MS",Fe={".html":"text/html; charset=utf-8",".js":"application/javascript",".cjs":"application/javascript",".mjs":"application/javascript",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".avif":"image/avif",".ico":"image/x-icon",".wasm":"application/wasm",".ttf":"font/ttf",".otf":"font/otf",".woff":"font/woff",".woff2":"font/woff2",".map":"application/json",".txt":"text/plain; charset=utf-8"};function ge(a,e,t){let i;try{let c=L();i=JSON.stringify(c)}catch{i="{}"}let s=e>0?`window.__sootsimBridgePort=${e};`:"",n=t?`window.__sootsimSootbeanOrigin=${JSON.stringify(t)};`:"",o=`<script>window.__sootsimSharedConfig=${i};`+s+n+`window.__sootsimCliVersion=${JSON.stringify(U())};</script>`,r=a.toString("utf8");return r.includes("</head>")?r.replace("</head>",o+"</head>"):r.includes("</body>")?r.replace("</body>",o+"</body>"):o+r}function Se(a){typeof a=="object"&&a!==null&&"unref"in a&&a.unref()}var _=class a{port;openUrlHandler;httpServer=null;wss=null;nextCommandId=1;nextSimNumber=161;sims=new Map;primarySimId=null;pendingCommands=new Map;cliBySentId=new Map;cliSimBySocket=new Map;cliLastCommandAt=new Map;cliIdentityKeyBySocket=new Map;cliLabelBySocket=new Map;restorableSims=new Map;nextCliFallbackId=1;cliIdleTimer=null;agentHost;static CLI_IDLE_TIMEOUT_MS=6e4;static CLI_LEASE_TTL_MS=6e5;static USER_ACTIVE_LEASE_TTL_MS=8e3;static USER_BOOT_LEASE_TTL_MS=6e4;static SIM_RECONNECT_TTL_MS=3e4;static SIM_IDLE_REAP_TTL_MS=30*6e4;preferredPort;portFallbackCount;simIdleReapTtlMs;shouldWriteLockfile;sootbeanOrigin=null;effectivePort=0;startedAt=0;heartbeatTimer=null;wsHeartbeatTimer=null;wsIsAlive=new WeakMap;static WS_HEARTBEAT_INTERVAL_MS=3e4;runtimeUpdateTimer=null;runtimeUpdateInFlight=null;activeRuntimeVersion=null;activeRuntimeDirPath=null;scanCache=null;scanCacheAt=0;inflightScan=null;static SCAN_FRESH_MS=2e3;constructor(e={}){this.preferredPort=e.port||7668,this.port=this.preferredPort,this.shouldWriteLockfile=e.writeLockfile===!0,this.portFallbackCount=Math.max(1,e.portFallbackCount??10),this.openUrlHandler=e.openUrl,this.agentHost=new O({getExcludePorts:e.agentScanExcludes}),this.sootbeanOrigin=e.sootbeanOrigin?.replace(/\/$/,"")||null,this.simIdleReapTtlMs=e.simIdleReapTtlMs??a.SIM_IDLE_REAP_TTL_MS}getAgentHost(){return this.agentHost}reapIdleSimsForTest(e=Date.now()){this.reapIdleSims(e)}start(e){this.startAsync(e)}async startAsync(e){if(this.httpServer||this.wss)return this.effectivePort;this.refreshActiveRuntime();for(let t=0;t<this.portFallbackCount;t++){let i=this.preferredPort+t;try{return await this.bindOnce(i,e?.silent===!0),this.effectivePort=i,this.port=i,this.startedAt=Date.now(),t>0&&!e?.silent&&process.stderr.write(`ws bridge bound to port ${i} (preferred ${this.preferredPort} was taken)
5
5
  `),this.afterBind(),i}catch(s){if(s?.code!=="EADDRINUSE")throw s;e?.silent||process.stderr.write(`ws bridge port ${i} already in use, trying ${i+1}
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.54 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-5FQNBWBM.js";import"./chunk-DLINRAGW.js";import"./chunk-A2BA2KJN.js";import"./chunk-EDU6E62D.js";import"./chunk-G33A5TWY.js";import"./chunk-TSXBCV5T.js";import"./chunk-4PVSZ6GE.js";import"./chunk-J6CCM5BR.js";import"./chunk-ZBR6H6LW.js";import"./chunk-TJMYDDAG.js";export{a as runSetupRepo};