sootsim 0.1.208 → 0.1.210

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 (139) hide show
  1. package/dist-cli/bin.js +4 -4
  2. package/dist-cli/chunks/{agent-SWCIBLMI.js → agent-KAQZXQI7.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-B4ZAHKEH.js → agent-wrapper-2FEBECLE.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-NUJXRDSC.js → app-fonts-527RTD7E.js} +2 -2
  5. package/dist-cli/chunks/{assert-HYA6XYK4.js → assert-FD7ABNEJ.js} +2 -2
  6. package/dist-cli/chunks/{auth-CS5YYZUI.js → auth-U5CEZXAX.js} +2 -2
  7. package/dist-cli/chunks/beta-77XRUQXG.js +2 -0
  8. package/dist-cli/chunks/{camera-6S7HTOPV.js → camera-OIURHC5C.js} +2 -2
  9. package/dist-cli/chunks/{chunk-T4NDDMK4.js → chunk-2HT73DM2.js} +2 -2
  10. package/dist-cli/chunks/{chunk-ADJPXWHT.js → chunk-2RJ57USW.js} +2 -2
  11. package/dist-cli/chunks/{chunk-W4QRVE6C.js → chunk-3ZZ4QGEW.js} +1 -1
  12. package/dist-cli/chunks/{chunk-ZDPA55TU.js → chunk-4X3L2WDG.js} +3 -3
  13. package/dist-cli/chunks/{chunk-4MFK53N4.js → chunk-5S7BCA4C.js} +3 -3
  14. package/dist-cli/chunks/{chunk-E227YZ2E.js → chunk-74SGAJAJ.js} +2 -2
  15. package/dist-cli/chunks/{chunk-Q5MDNEUJ.js → chunk-7YKBZB7D.js} +3 -3
  16. package/dist-cli/chunks/{chunk-RS7VZ3CR.js → chunk-ATMXAOZC.js} +2 -2
  17. package/dist-cli/chunks/{chunk-KN4EIFHO.js → chunk-AYU7TPLY.js} +2 -2
  18. package/dist-cli/chunks/{chunk-43APLSK3.js → chunk-BCDCPHIB.js} +2 -2
  19. package/dist-cli/chunks/{chunk-RIXBSFVQ.js → chunk-CQHQSDDJ.js} +1 -1
  20. package/dist-cli/chunks/{chunk-6YHO5OZH.js → chunk-DO4AU4FA.js} +2 -2
  21. package/dist-cli/chunks/{chunk-LG3QMLIP.js → chunk-FF7B5JFA.js} +1 -1
  22. package/dist-cli/chunks/{chunk-RVUBOWIS.js → chunk-FMIR4NMA.js} +1 -1
  23. package/dist-cli/chunks/{chunk-DPPE2X5U.js → chunk-GCW2PJGE.js} +2 -2
  24. package/dist-cli/chunks/{chunk-GRSCRRWU.js → chunk-IPX2D5AJ.js} +1 -1
  25. package/dist-cli/chunks/chunk-JY6W7FJK.js +1 -0
  26. package/dist-cli/chunks/{chunk-25KNBRLI.js → chunk-KCGE56W3.js} +2 -2
  27. package/dist-cli/chunks/{chunk-LNF35IOM.js → chunk-KEWZBN4M.js} +1 -1
  28. package/dist-cli/chunks/{chunk-VK7BQECJ.js → chunk-KLPGPFZF.js} +2 -2
  29. package/dist-cli/chunks/{chunk-K2V2S3VK.js → chunk-KWAAJUF2.js} +1 -1
  30. package/dist-cli/chunks/{chunk-BP4PZWLR.js → chunk-LO7DZIFS.js} +1 -1
  31. package/dist-cli/chunks/{chunk-MIJLFF2K.js → chunk-MVIWCOR3.js} +1 -1
  32. package/dist-cli/chunks/{chunk-KF7BOAIC.js → chunk-NLRGBEDV.js} +2 -2
  33. package/dist-cli/chunks/{chunk-V4N65DTH.js → chunk-NV7QTS3L.js} +1 -1
  34. package/dist-cli/chunks/chunk-O4QDSXAR.js +1 -0
  35. package/dist-cli/chunks/{chunk-HJHKHI5E.js → chunk-P6L7NTH2.js} +2 -2
  36. package/dist-cli/chunks/{chunk-N7VEPGM7.js → chunk-PH46EVF3.js} +2 -2
  37. package/dist-cli/chunks/{chunk-K7D326IL.js → chunk-PIONEQXI.js} +2 -2
  38. package/dist-cli/chunks/{chunk-PL6D2V4B.js → chunk-QMS2S3EF.js} +1 -1
  39. package/dist-cli/chunks/{chunk-IAS7DTWH.js → chunk-SVLKYHDO.js} +1 -1
  40. package/dist-cli/chunks/{chunk-I3PUCAVF.js → chunk-SX5M6VA3.js} +1 -1
  41. package/dist-cli/chunks/{chunk-JNEW6IZR.js → chunk-T7SAFPA6.js} +1 -1
  42. package/dist-cli/chunks/{chunk-ZFH3NSNB.js → chunk-USLCZL6I.js} +2 -2
  43. package/dist-cli/chunks/{chunk-JPSBYSMX.js → chunk-VAMOANYW.js} +2 -2
  44. package/dist-cli/chunks/{chunk-GH3HR3AH.js → chunk-VCFHK3EU.js} +1 -1
  45. package/dist-cli/chunks/{chunk-K7CWBMOR.js → chunk-VMRT3K3M.js} +2 -2
  46. package/dist-cli/chunks/{chunk-OSYDT4WA.js → chunk-VVRIRW4K.js} +1 -1
  47. package/dist-cli/chunks/{chunk-UAP5LKOX.js → chunk-WTJP6C4W.js} +3 -3
  48. package/dist-cli/chunks/{chunk-GADW4EOH.js → chunk-XRUPDNSR.js} +2 -2
  49. package/dist-cli/chunks/{chunk-7Y72TT54.js → chunk-XTKTKQIT.js} +2 -2
  50. package/dist-cli/chunks/chunk-XUXEKCY2.js +13 -0
  51. package/dist-cli/chunks/cli-version-HFRMOBQC.js +2 -0
  52. package/dist-cli/chunks/{compat-5QUTDNYD.js → compat-2QLPOPPM.js} +3 -3
  53. package/dist-cli/chunks/{config-UX4NMEEJ.js → config-U3Z5QR5Q.js} +2 -2
  54. package/dist-cli/chunks/{control-CRQQFV2S.js → control-YUIGGT7H.js} +2 -2
  55. package/dist-cli/chunks/daemon-6SB37NMK.js +2 -0
  56. package/dist-cli/chunks/{debug-K52BRT7V.js → debug-Z5LPQGQY.js} +3 -3
  57. package/dist-cli/chunks/{desktop-T4XNGU35.js → desktop-2MG6MKXV.js} +3 -3
  58. package/dist-cli/chunks/{detox-GEKSAX2S.js → detox-OWZNY37O.js} +2 -2
  59. package/dist-cli/chunks/{device-WF6GJZHP.js → device-PQN5ZIOA.js} +2 -2
  60. package/dist-cli/chunks/{diagnose-7TFMKUVG.js → diagnose-A5XCL535.js} +2 -2
  61. package/dist-cli/chunks/drivers-JVQ2IGFA.js +2 -0
  62. package/dist-cli/chunks/flow-ENY24D57.js +2 -0
  63. package/dist-cli/chunks/help-O4NYJLMW.js +2 -0
  64. package/dist-cli/chunks/{home-paths-MN5NZUZJ.js → home-paths-SD3NRI7J.js} +2 -2
  65. package/dist-cli/chunks/inspect-B4GJTKF4.js +2 -0
  66. package/dist-cli/chunks/install-desktop-PE662CEU.js +2 -0
  67. package/dist-cli/chunks/{login-2SGLAHBV.js → login-7V3C7LUJ.js} +4 -4
  68. package/dist-cli/chunks/{logout-DM6QP7DR.js → logout-MMMVGJ65.js} +2 -2
  69. package/dist-cli/chunks/{maestro-GJO7C2WK.js → maestro-KPKOSHF5.js} +2 -2
  70. package/dist-cli/chunks/{mode-Y67XBAXY.js → mode-SPC2PQIA.js} +2 -2
  71. package/dist-cli/chunks/optional-demo-registry-ZXW3LBUE.js +2 -0
  72. package/dist-cli/chunks/{perf-54HDUGIZ.js → perf-S6P6POGY.js} +2 -2
  73. package/dist-cli/chunks/{record-LI2FEYCH.js → record-MSARERUQ.js} +3 -3
  74. package/dist-cli/chunks/runtime-S3TTT5GK.js +2 -0
  75. package/dist-cli/chunks/{screenshot-command-VICAMKAC.js → screenshot-command-BWEJO65L.js} +3 -3
  76. package/dist-cli/chunks/{screenshots-capture-FMJ733QD.js → screenshots-capture-6O4U2QZP.js} +2 -2
  77. package/dist-cli/chunks/{serve-JEI27CXA.js → serve-B3GZM4I2.js} +2 -2
  78. package/dist-cli/chunks/{setup-IOZXFA77.js → setup-BVF7AE4F.js} +3 -3
  79. package/dist-cli/chunks/{skills-DR3IWRMF.js → skills-OOGMXBUU.js} +2 -2
  80. package/dist-cli/chunks/{storage-ZJYNB4RH.js → storage-B6KLLSZ5.js} +2 -2
  81. package/dist-cli/chunks/store-VT7DQ5SF.js +2 -0
  82. package/dist-cli/chunks/telemetry-7K33P734.js +2 -0
  83. package/dist-cli/chunks/{test-ZJJIC57P.js → test-TN3KDDT2.js} +5 -5
  84. package/dist-cli/chunks/{timeline-GRDTJPYS.js → timeline-DNEEKXNB.js} +2 -2
  85. package/dist-cli/chunks/upgrade-4QBAXVEE.js +4 -0
  86. package/dist-cli/chunks/upload-T6F6NRSY.js +2 -0
  87. package/dist-cli/chunks/{version-PBEI5ACE.js → version-GZ3CPO3H.js} +2 -2
  88. package/dist-cli/chunks/{web-77ERA3YQ.js → web-NTF5XYWV.js} +2 -2
  89. package/dist-cli/chunks/{what-happened-HWOXEBNN.js → what-happened-XIXJ455M.js} +2 -2
  90. package/dist-lib/agent-daemon-client.cjs +1 -1
  91. package/dist-lib/agent-events.cjs +1 -1
  92. package/dist-lib/agent-identity.cjs +1 -1
  93. package/dist-lib/agent-sessions.cjs +1 -1
  94. package/dist-lib/attached-projects.cjs +1 -1
  95. package/dist-lib/auth/shared-session.cjs +1 -1
  96. package/dist-lib/backend-origin.cjs +1 -1
  97. package/dist-lib/beta.cjs +1 -1
  98. package/dist-lib/beta.mjs +1 -1
  99. package/dist-lib/bridge-constants.cjs +1 -1
  100. package/dist-lib/cli-constants.cjs +1 -1
  101. package/dist-lib/config.cjs +1 -1
  102. package/dist-lib/detox/index.cjs +1 -1
  103. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  104. package/dist-lib/home-paths.cjs +1 -1
  105. package/dist-lib/host/bridge-host.cjs +1 -1
  106. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  107. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  108. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  109. package/dist-lib/host/websocket-proxy.cjs +1 -1
  110. package/dist-lib/index.cjs +1 -1
  111. package/dist-lib/jump-to-source-babel.cjs +1 -1
  112. package/dist-lib/menu.cjs +1 -1
  113. package/dist-lib/menu.mjs +1 -1
  114. package/dist-lib/metro.cjs +1 -1
  115. package/dist-lib/profiles.cjs +1 -1
  116. package/dist-lib/render-mode.cjs +1 -1
  117. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  118. package/dist-lib/sdk.cjs +1 -1
  119. package/dist-lib/sdk.mjs +1 -1
  120. package/dist-lib/skills.cjs +1 -1
  121. package/dist-lib/vite.cjs +1 -1
  122. package/package.json +1 -1
  123. package/dist-cli/chunks/beta-RTXHUH76.js +0 -2
  124. package/dist-cli/chunks/chunk-F2CU2Q6V.js +0 -1
  125. package/dist-cli/chunks/chunk-JYADQK47.js +0 -1
  126. package/dist-cli/chunks/chunk-MUGUKWIG.js +0 -13
  127. package/dist-cli/chunks/cli-version-7NKCCZZT.js +0 -2
  128. package/dist-cli/chunks/daemon-A2EJBCXS.js +0 -2
  129. package/dist-cli/chunks/drivers-UMX76I6F.js +0 -2
  130. package/dist-cli/chunks/flow-KKW6NG4F.js +0 -2
  131. package/dist-cli/chunks/help-NBX2H4OL.js +0 -2
  132. package/dist-cli/chunks/inspect-PSNHXZJT.js +0 -2
  133. package/dist-cli/chunks/install-desktop-5HHL7X6Y.js +0 -2
  134. package/dist-cli/chunks/optional-demo-registry-AOL2UJY3.js +0 -2
  135. package/dist-cli/chunks/runtime-MSUVT4LD.js +0 -2
  136. package/dist-cli/chunks/store-AGS74Q3V.js +0 -2
  137. package/dist-cli/chunks/telemetry-ETAYU7DW.js +0 -2
  138. package/dist-cli/chunks/upgrade-AVEGOPBM.js +0 -4
  139. package/dist-cli/chunks/upload-BG3V5KDH.js +0 -2
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{execFileSync as d,spawn as g}from"child_process";import{existsSync as m}from"fs";import{homedir as h}from"os";import{join as C}from"path";var f=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","~/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","~/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Arc.app/Contents/MacOS/Arc","~/Applications/Arc.app/Contents/MacOS/Arc"],O=["/usr/bin/google-chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/microsoft-edge","/usr/bin/brave-browser","/snap/bin/chromium"],w=["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe","C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"],U=["google-chrome","chromium","chromium-browser","microsoft-edge","brave-browser"],M=["chrome","msedge","brave"];function A(r){return r.startsWith("~/")?C(h(),r.slice(2)):r}function a(r){for(let n of r){let o=A(n);if(m(o))return o}return null}function x(r,n){try{let e=d(n==="win32"?"where":"which",[r],{encoding:"utf8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim();return e?e.split(/\r?\n/)[0]:null}catch{return null}}function c(r=process.platform){let n=process.env.CHROME_PATH||process.env.CHROMIUM_PATH;if(n&&m(n))return n;let o=a(r==="darwin"?f:r==="win32"?w:O);if(o)return o;let e=r==="win32"?M:U;for(let t of e){let i=x(t,r);if(i)return i}return null}function p(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform;return n.newWindow?s(r,{...n,platform:o,newWindow:!0}):o==="darwin"?{command:"open",args:n.background===!1?[r]:["-g",r],via:"system"}:o==="win32"?{command:"cmd",args:["/c","start","",r],via:"system"}:{command:"xdg-open",args:[r],via:"system"}}function s(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform,e="chromiumBinary"in n?n.chromiumBinary:c(o);if(!e)throw new Error("browser launch requires Chrome, Chromium, Edge, Brave, or Arc");let t=[];return n.newWindow!==!1&&t.push("--new-window"),t.push(r),{command:e,args:t,via:"chromium",target:e}}async function l(r,n,o){return new Promise((e,t)=>{let i=g(r,n,{detached:o,stdio:"ignore"});i.once("error",t),i.once("spawn",()=>{o&&i.unref(),e(i.pid)})})}async function u(r,n={}){let o=p(r,n),e=await l(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function b(r,n={}){let o=s(r,n),e=await l(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function v(r,n={}){await u(r,n)}export{c as a,u as b,b as c,v as d};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  function o(e,r,n,i){return{width:3,ringToggle:{top:e[0],height:e[1]},volumeUp:{top:r[0],height:r[1]},volumeDown:{top:n[0],height:n[1]},lock:{top:i[0],height:i[1]}}}var b={width:2.5,lock:{top:188.7,height:68.1},ringToggle:{top:113.2,height:36},volumeUp:{top:188.2,height:68.1},volumeDown:{top:269,height:68.1}},d={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},g={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},a=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var p={"canvas-workspace":t({name:"Canvas Workspace",width:1440,height:900,scale:1,statusBarHeight:0,homeIndicatorHeight:0,cornerRadius:0,bezelWidth:16,dynamicIsland:null,safeAreaInsets:{top:0,bottom:0,left:0,right:0},iosVersion:"26.4",physicalPPI:110,hardwareButtons:o([185.8,41.7],[258.2,67.6],[344,67.6],[281.5,106.9]),experimental:!0}),"iphone-se":t({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,bezelWidth:28.7,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:b}),"iphone-14":t({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:49,bezelWidth:21.8,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o([176.1,35.8],[239.5,71.5],[325.2,71.5],[262.7,110.8])}),"iphone-15":t({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,bezelWidth:20.5,dynamicIsland:{width:126,height:37.3,top:14.1},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o([181.2,35.8],[246.4,67.6],[332.1,67.6],[269.6,106.9])}),"iphone-15-plus":t({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,bezelWidth:20.5,dynamicIsland:{width:126,height:37.3,top:11.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o([175.8,35.8],[241.1,67.6],[326.8,67.6],[264.3,106.9])}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,bezelWidth:17.8,dynamicIsland:{width:126,height:38,top:13.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o([174.1,36.5],[240.4,67.6],[326.1,67.6],[286.9,106.9])}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,bezelWidth:17.8,dynamicIsland:{width:126,height:38,top:13.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o([174.1,36.5],[240.4,67.6],[326.1,67.6],[286.9,106.9])}),"iphone-16":t({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,bezelWidth:20.5,dynamicIsland:{width:126,height:37.3,top:11},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([185.8,41.7],[258.2,67.6],[344,67.6],[281.5,106.9])}),"iphone-16-plus":t({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,bezelWidth:20.6,dynamicIsland:{width:126,height:37.3,top:11.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([185.8,41.7],[258.2,67.6],[344,67.6],[281.5,106.9])}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:64,bezelWidth:16.3,dynamicIsland:{width:126,height:38,top:13.5},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([186.4,41.7],[258.9,67.6],[344.6,67.6],[282.1,106.9])}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:64,bezelWidth:14.3,dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([185,41.7],[257.4,67.6],[343.2,67.6],[280.7,106.9])}),"iphone-17":t({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:64,bezelWidth:16.2,dynamicIsland:{width:126,height:37.3,top:14},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([186.4,41.7],[258.9,67.6],[344.6,67.6],[282,106.9])}),"iphone-17-air":t({name:"iPhone Air",width:420,height:912,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:64,bezelWidth:15.6,dynamicIsland:{width:126,height:38,top:20},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([185.6,40.5],[257.4,67.6],[343.2,67.6],[280.7,106.9])}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:64,bezelWidth:17.4,dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([187.7,41.7],[263.2,61.6],[348.9,61.6],[283.4,106.9])}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:64,bezelWidth:17,dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o([187.7,41.7],[260.1,67.6],[345.9,67.6],[283.4,106.9])}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,bezelWidth:13,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:d},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,bezelWidth:13,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:d},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,bezelWidth:12,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:d},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,bezelWidth:8,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:g},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:a,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,bezelWidth:9,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:a,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:g}},m="iphone-17-pro";function v(e){return p[e]}function h(){return Object.keys(p)}function P(){return h().filter(e=>!p[e].experimental)}var l={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},c={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},B={color:"#25c3ec",blur:120,spread:52,opacity:.34},I="iphone-17-pro";var y=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],f=Object.fromEntries(y.map(e=>[e.name,e.value]));function T(e){return f[e]??f.gray}function A(e){return Object.prototype.hasOwnProperty.call(l,e)?l[e]:null}function S(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(r=>({...r}))}}function R(e){return Object.prototype.hasOwnProperty.call(c,e)?S(c[e]):null}var u={deviceModel:{type:"enum",default:m,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:h(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(l),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(c),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},alwaysShowLiveWebViews:{type:"boolean",default:!1,description:"always render WebViews as live browser views",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function w(){if(typeof window>"u")return{};let e={};try{let r=new URLSearchParams(window.location.search),n=r.get("device");n&&u.deviceModel.options?.includes(n)&&(e.deviceModel=n);let i=r.get("colorScheme")??r.get("theme");i&&u.colorScheme.options?.includes(i)&&(e.colorScheme=i);let s=r.get("alwaysShowLiveWebViews");s==="1"||s==="true"?e.alwaysShowLiveWebViews=!0:(s==="0"||s==="false")&&(e.alwaysShowLiveWebViews=!1)}catch{}return e}function D(){let e={};for(let[r,n]of Object.entries(u))e[r]=n.default;return Object.assign(e,w()),e}export{B as a,I as b,T as c,A as d,S as e,R as f,p as g,v as h,P as i,u as j,w as k,D as l};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-GRSCRRWU.js";import{h,l as N,m as P}from"./chunk-25KNBRLI.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-IPX2D5AJ.js";import{h,l as N,m as P}from"./chunk-KCGE56W3.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
3
3
  `)}function V(e){process.stderr.write(`${e}
4
4
  `)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function D(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return P(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!I(o)||Date.now()>=s)throw o;await w(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function X(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await w(o)}return null}async function Z(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&y({nodes:f,targets:$})&&g-u>=E)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&y(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:A});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
5
5
  console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await v(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as Ie,b as Ae,c as Ue}from"./chunk-K7D326IL.js";import{c as ke}from"./chunk-RVUBOWIS.js";import{d as xe}from"./chunk-BP4PZWLR.js";import{g as Be,i as Ee,k as B}from"./chunk-25KNBRLI.js";import{d as Re}from"./chunk-I3PUCAVF.js";import{a as ve,b as k}from"./chunk-HJHKHI5E.js";import{a as Se}from"./chunk-DPPE2X5U.js";import{createHash as ft}from"crypto";import{readFileSync as U}from"fs";import Oe from"path";import{gzipSync as ae,gunzipSync as mt}from"zlib";function _e(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as nt,constants as rt}from"node:zlib";var st=9;function Pe(e){return nt(e,{params:{[rt.BROTLI_PARAM_QUALITY]:st}})}function oe(e,t){let r=new AbortController,o=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(o)}}async function ot(e){let t=oe(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let o=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${o.slice(0,200)}`)}}async function it(e,t=8,r){let o=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;o<a;){let u=e[o++];await ot(u),i++,r?.(i,a)}}))}function at(e,t,r,o){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let u=r.get(a.urlhash);u&&i.push({url:a.putUrl,contentType:a.contentType,bytes:u})}e.events&&o?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:o.eventsBytes}),e.timeline&&o?.timelineBytes&&i.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:o.timelineBytes}),e.flowVideo&&o?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:o.videoBytes}),e.storage&&o?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:o.storageBytes}),e.failureBundle&&o?.failureBundleBytes&&i.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:o.failureBundleBytes});for(let a of e.snapshots??[]){let u=o?.snapshotBytes?.get(a.id);u&&i.push({url:a.putUrl,contentType:a.contentType,bytes:u})}return i}function lt(e){return e.replace(/\/+$/,"")}var J=class extends Error{constructor(r,o,i,a=""){super(r);this.status=o;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function Le(e){let t=lt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let o=oe(3e4,"init"),i;try{i=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:o.signal})}finally{o.cancel()}if(!i.ok){let g=await i.text().catch(()=>"");throw new J(`init failed: ${i.status} ${g.slice(0,200)}`,i.status,"init",g)}let a=await i.json(),u=at(a,e.bundleBytes,e.filesByHash,e.extras);await it(u,e.concurrency??8,e.onPutProgress);let b=oe(3e4,"finalize"),m;try{m=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:b.signal})}finally{b.cancel()}if(!m.ok){let g=await m.text().catch(()=>"");throw new J(`finalize failed: ${m.status} ${g.slice(0,200)}`,m.status,"finalize",g)}let C=await m.json();return{init:a,finalize:C}}function ut(e){return e!==null&&typeof e=="object"?e:null}function Fe(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ie(e){let t=ut(e);return t?t.schemaVersion===1&&Fe(t.t)!==void 0&&Fe(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function ct(e,t){let r=[];for(let o of e.split(`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as Ie,b as Ae,c as Ue}from"./chunk-PIONEQXI.js";import{c as ke}from"./chunk-FMIR4NMA.js";import{d as xe}from"./chunk-LO7DZIFS.js";import{g as Be,i as Ee,k as B}from"./chunk-KCGE56W3.js";import{d as Re}from"./chunk-SX5M6VA3.js";import{a as ve,b as k}from"./chunk-P6L7NTH2.js";import{a as Se}from"./chunk-GCW2PJGE.js";import{createHash as ft}from"crypto";import{readFileSync as U}from"fs";import Oe from"path";import{gzipSync as ae,gunzipSync as mt}from"zlib";function _e(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as nt,constants as rt}from"node:zlib";var st=9;function Pe(e){return nt(e,{params:{[rt.BROTLI_PARAM_QUALITY]:st}})}function oe(e,t){let r=new AbortController,o=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(o)}}async function ot(e){let t=oe(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let o=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${o.slice(0,200)}`)}}async function it(e,t=8,r){let o=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;o<a;){let u=e[o++];await ot(u),i++,r?.(i,a)}}))}function at(e,t,r,o){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let u=r.get(a.urlhash);u&&i.push({url:a.putUrl,contentType:a.contentType,bytes:u})}e.events&&o?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:o.eventsBytes}),e.timeline&&o?.timelineBytes&&i.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:o.timelineBytes}),e.flowVideo&&o?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:o.videoBytes}),e.storage&&o?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:o.storageBytes}),e.failureBundle&&o?.failureBundleBytes&&i.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:o.failureBundleBytes});for(let a of e.snapshots??[]){let u=o?.snapshotBytes?.get(a.id);u&&i.push({url:a.putUrl,contentType:a.contentType,bytes:u})}return i}function lt(e){return e.replace(/\/+$/,"")}var J=class extends Error{constructor(r,o,i,a=""){super(r);this.status=o;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function Le(e){let t=lt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let o=oe(3e4,"init"),i;try{i=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:o.signal})}finally{o.cancel()}if(!i.ok){let g=await i.text().catch(()=>"");throw new J(`init failed: ${i.status} ${g.slice(0,200)}`,i.status,"init",g)}let a=await i.json(),u=at(a,e.bundleBytes,e.filesByHash,e.extras);await it(u,e.concurrency??8,e.onPutProgress);let b=oe(3e4,"finalize"),m;try{m=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:b.signal})}finally{b.cancel()}if(!m.ok){let g=await m.text().catch(()=>"");throw new J(`finalize failed: ${m.status} ${g.slice(0,200)}`,m.status,"finalize",g)}let C=await m.json();return{init:a,finalize:C}}function ut(e){return e!==null&&typeof e=="object"?e:null}function Fe(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ie(e){let t=ut(e);return t?t.schemaVersion===1&&Fe(t.t)!==void 0&&Fe(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function ct(e,t){let r=[];for(let o of e.split(`
3
3
  `)){let i=o.trim();if(i)try{let a=JSON.parse(i);t(a)&&r.push(a)}catch{}}return r}function $e(e){return ct(e,ie)}function gt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}var je=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",He=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",ue="http://localhost:3000",ht=2e3;async function yt(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${ue}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(ht)});if(t.ok||t.status===204||t.status===405)return ue}catch{}return je}function F(e){return e.replace(/\/$/,"")}function bt(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function Mt(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function wt(e,t){return t?F(t):process.env.SOOTSIM_PREVIEW_ORIGIN?F(process.env.SOOTSIM_PREVIEW_ORIGIN):bt(e)?F(e):Mt(e)?F(He):F(e)}function Tt(){console.log(`
4
4
  sootsim record upload \u2014 publish the current recorded bundle as a /preview/<id> link
5
5
 
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
3
3
  ${o}
4
4
  `);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as c}from"./chunk-6YHO5OZH.js";import{a as u,b as f,c as s,d as a}from"./chunk-T4NDDMK4.js";import{a as e}from"./chunk-GADW4EOH.js";import{c as n}from"./chunk-MIJLFF2K.js";import{a as i}from"./chunk-IAS7DTWH.js";import{a as m,c as p}from"./chunk-LNF35IOM.js";function g(){return`sootsim CLI v${i()} \xB7 ${c().primary}`}function C(){let r=f({bridgePort:7668,defaultShellUrl:n},e()),o=`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as c}from"./chunk-DO4AU4FA.js";import{a as u,b as f,c as s,d as a}from"./chunk-2HT73DM2.js";import{a as e}from"./chunk-XRUPDNSR.js";import{c as n}from"./chunk-MVIWCOR3.js";import{a as i}from"./chunk-SVLKYHDO.js";import{a as m,c as p}from"./chunk-KEWZBN4M.js";function g(){return`sootsim CLI v${i()} \xB7 ${c().primary}`}function C(){let r=f({bridgePort:7668,defaultShellUrl:n},e()),o=`
3
3
  ${p}
4
4
  `;console.log(`${g()}
5
5
  ${o}${r}
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as he,c as fe,d as me,e as Ye,f as ge,g as we,h as Ze,i as ye,j as Xe}from"./chunk-Q5MDNEUJ.js";import{a as qe}from"./chunk-ADJPXWHT.js";import{a as et}from"./chunk-43APLSK3.js";import{a as Qe}from"./chunk-JPSBYSMX.js";import{h as Je,p as Ge,r as ze,v as Ke}from"./chunk-MUGUKWIG.js";import{f as Le}from"./chunk-E227YZ2E.js";import{a as Be}from"./chunk-V4N65DTH.js";import{h as pe,m as Ue}from"./chunk-ZFH3NSNB.js";import{I as V,m as Ce,n as Ne,o as He,p as We}from"./chunk-GRSCRRWU.js";import{g as ce,h as ue,i as je}from"./chunk-25KNBRLI.js";import{a as Ve}from"./chunk-W4QRVE6C.js";import{a as Me,b as le}from"./chunk-HJHKHI5E.js";import{d as de,e as De}from"./chunk-PL6D2V4B.js";import{g as Oe,h as _e}from"./chunk-JNEW6IZR.js";import*as k from"fs";import{tmpdir as ie}from"os";import*as w from"path";import*as S from"fs";import*as b from"path";var vt="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",it=1;function xt(n){let e=_e(n),t=e.scale,i=e.statusBarHeight>0&&!e.dynamicIsland&&e.homeIndicatorHeight===0&&e.cornerRadius===0,r=e.width,o=e.height,a=i?e.width+58:e.width+e.bezelWidth*2,s=i?e.height+111+111:e.height+e.bezelWidth*2,l=9.5,u=it,p=a+l*2,m=s+it*2,x=l+(i?29:e.bezelWidth),g=i?111:e.bezelWidth,P=i?52:e.cornerRadius+e.bezelWidth,_=[{side:"right",top:e.hardwareButtons.lock.top,height:e.hardwareButtons.lock.height,width:e.hardwareButtons.width},{side:"left",top:e.hardwareButtons.ringToggle.top,height:e.hardwareButtons.ringToggle.height,width:e.hardwareButtons.width},{side:"left",top:e.hardwareButtons.volumeUp.top,height:e.hardwareButtons.volumeUp.height,width:e.hardwareButtons.width},{side:"left",top:e.hardwareButtons.volumeDown.top,height:e.hardwareButtons.volumeDown.height,width:e.hardwareButtons.width}];return{model:n,renderScale:t,outerWidth:Math.round(p*t),outerHeight:Math.round(m*t),logicalOuterWidth:p,logicalOuterHeight:m,logicalFrameWidth:a,logicalFrameHeight:s,logicalFrameLeft:l,logicalFrameTop:u,logicalScreenWidth:r,logicalScreenHeight:o,logicalScreenLeft:x,logicalScreenTop:g,logicalScreenRadius:i?0:e.cornerRadius,logicalFrameRadius:P,frameBackground:i?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:i?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:i?null:vt,buttons:_,legacyHomeButton:i?{top:111+e.height+47/2,left:e.width/2-64/2+29,size:64,ring:1.5}:null,showHomeIndicator:e.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:e.homeIndicatorHeight}}function Tt(n){let e=n.side==="right",t=e?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as he,c as fe,d as me,e as Ye,f as ge,g as we,h as Ze,i as ye,j as Xe}from"./chunk-7YKBZB7D.js";import{a as qe}from"./chunk-2RJ57USW.js";import{a as et}from"./chunk-BCDCPHIB.js";import{a as Qe}from"./chunk-VAMOANYW.js";import{h as Je,p as Ge,r as ze,v as Ke}from"./chunk-XUXEKCY2.js";import{f as Le}from"./chunk-74SGAJAJ.js";import{a as Be}from"./chunk-NV7QTS3L.js";import{h as pe,m as Ue}from"./chunk-USLCZL6I.js";import{I as V,m as Ce,n as Ne,o as He,p as We}from"./chunk-IPX2D5AJ.js";import{g as ce,h as ue,i as je}from"./chunk-KCGE56W3.js";import{a as Ve}from"./chunk-3ZZ4QGEW.js";import{a as Me,b as le}from"./chunk-P6L7NTH2.js";import{d as de,e as De}from"./chunk-QMS2S3EF.js";import{g as Oe,h as _e}from"./chunk-T7SAFPA6.js";import*as k from"fs";import{tmpdir as ie}from"os";import*as w from"path";import*as S from"fs";import*as b from"path";var vt="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",it=1;function xt(n){let e=_e(n),t=e.scale,i=e.statusBarHeight>0&&!e.dynamicIsland&&e.homeIndicatorHeight===0&&e.cornerRadius===0,r=e.width,o=e.height,a=i?e.width+58:e.width+e.bezelWidth*2,s=i?e.height+111+111:e.height+e.bezelWidth*2,l=9.5,u=it,p=a+l*2,m=s+it*2,x=l+(i?29:e.bezelWidth),g=i?111:e.bezelWidth,P=i?52:e.cornerRadius+e.bezelWidth,_=[{side:"right",top:e.hardwareButtons.lock.top,height:e.hardwareButtons.lock.height,width:e.hardwareButtons.width},{side:"left",top:e.hardwareButtons.ringToggle.top,height:e.hardwareButtons.ringToggle.height,width:e.hardwareButtons.width},{side:"left",top:e.hardwareButtons.volumeUp.top,height:e.hardwareButtons.volumeUp.height,width:e.hardwareButtons.width},{side:"left",top:e.hardwareButtons.volumeDown.top,height:e.hardwareButtons.volumeDown.height,width:e.hardwareButtons.width}];return{model:n,renderScale:t,outerWidth:Math.round(p*t),outerHeight:Math.round(m*t),logicalOuterWidth:p,logicalOuterHeight:m,logicalFrameWidth:a,logicalFrameHeight:s,logicalFrameLeft:l,logicalFrameTop:u,logicalScreenWidth:r,logicalScreenHeight:o,logicalScreenLeft:x,logicalScreenTop:g,logicalScreenRadius:i?0:e.cornerRadius,logicalFrameRadius:P,frameBackground:i?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:i?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:i?null:vt,buttons:_,legacyHomeButton:i?{top:111+e.height+47/2,left:e.width/2-64/2+29,size:64,ring:1.5}:null,showHomeIndicator:e.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:e.homeIndicatorHeight}}function Tt(n){let e=n.side==="right",t=e?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
3
3
  <div
4
4
  aria-hidden="true"
5
5
  style="
@@ -559,7 +559,7 @@ flow extension:
559
559
  })()`}),console.log(` captured ${O.length} partial replay events`)}catch(d){console.warn(` event recorder stop failed: ${d?.message||String(d)}`)}console.error(`
560
560
  x failed: ${h.message}
561
561
  `),M&&(console.log(" partial profile:"),at(M)),T&&console.log(` partial video: ${T}`);try{let d=c.lastFailedStep,y=d?`step-${String(d.index+1).padStart(2,"0")}-${d.kind}`:"unstaged",$=w.join(s,y);await c.captureFailureBundle($,{error:h,stepIndex:d?.index,stepKind:d?.kind,stepTarget:d?.target}),ae=$,console.log(` failure bundle: ${$}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(d){try{let y=w.join(s,"error.png");await c.captureFailureScreenshot(y),console.log(` error screenshot: ${y}`)}catch{}console.log(` (failure bundle capture failed: ${d instanceof Error?d.message:String(d)})`)}await Ue(F,{errorsCommand:`sootsim get errors 5${c.simId?` --sim ${c.simId}`:""}`,warningsCommand:`sootsim get warnings 5${c.simId?` --sim ${c.simId}`:""}`,requestsCommand:`sootsim get requests 5${c.simId?` --sim ${c.simId}`:""}`}),j=1}if(await c.liveStatus?.end(j===0?"passed":"failed"),g&&(j===0||T||O))try{let h=await Wt(O??[]),d=["--origin",P,"--events",h];_&&d.push("--public-origin",_),T&&d.push("--video",T),T&&B&&Number.isFinite(B)&&(d.push("--video-duration-ms",String(Math.round(B))),d.push("--recorded-duration-ms",String(Math.round(B))));let y=c.getLastRecordingStartedAtMs();y&&Number.isFinite(y)&&d.push("--recording-started-at-ms",String(Math.round(y))),v.wsPort&&d.push("--port",String(v.wsPort)),c.simId&&d.push("--sim",c.simId),dt&&d.push("--open"),Fe&&d.push("--owner",Fe),Ie&&d.push("--repo",Ie),H&&d.push("--billing-kind",H),console.log(`
562
- preparing preview upload\u2026`);let $=c.getFlowTraceSteps();$.length>0&&d.push("--timeline-events",await jt($)),ae&&d.push("--failure-bundle",ae);let U=c.getLastRecordingFrameStats();U&&d.push("--trace-frame-stats",await Ut(U));let{runUpload:L}=await import("./upload-BG3V5KDH.js");Te=await L(d,{})}catch(h){console.error(` preview upload failed: ${h?.message||h}`),j=1}return Ee=c.getFlowTraceSteps(),F.close(),oe?(c.simId&&se.add(c.simId),await Ht(v.wsPort,v.commandTimeoutMs,[...se])):c.simId&&c.simId!==K&&De(c.simId),await le(),j}async function Ht(n,e,t){let i=[...new Set(t.filter(Boolean))];if(i.length===0)return;let r=ue(n,{commandTimeoutMs:e});try{let o=await r.listSims(),a=i.filter(l=>o.some(u=>u.id===l&&u.readyState==="open"));if(a.length===0)return;let s=await Ke(r,n,e,a);await Ge(o,a),s.closed.length>0&&console.log(` closed flow sim(s): ${s.closed.join(", ")}`),s.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${s.remaining.join(", ")}`)}catch(o){console.warn(` warn: failed to close flow sim(s): ${o instanceof Error?o.message:String(o)}`)}finally{r.close()}}async function Wt(n){let{gzipSync:e}=await import("zlib"),t=n.map(o=>JSON.stringify(o)).join(`
562
+ preparing preview upload\u2026`);let $=c.getFlowTraceSteps();$.length>0&&d.push("--timeline-events",await jt($)),ae&&d.push("--failure-bundle",ae);let U=c.getLastRecordingFrameStats();U&&d.push("--trace-frame-stats",await Ut(U));let{runUpload:L}=await import("./upload-T6F6NRSY.js");Te=await L(d,{})}catch(h){console.error(` preview upload failed: ${h?.message||h}`),j=1}return Ee=c.getFlowTraceSteps(),F.close(),oe?(c.simId&&se.add(c.simId),await Ht(v.wsPort,v.commandTimeoutMs,[...se])):c.simId&&c.simId!==K&&De(c.simId),await le(),j}async function Ht(n,e,t){let i=[...new Set(t.filter(Boolean))];if(i.length===0)return;let r=ue(n,{commandTimeoutMs:e});try{let o=await r.listSims(),a=i.filter(l=>o.some(u=>u.id===l&&u.readyState==="open"));if(a.length===0)return;let s=await Ke(r,n,e,a);await Ge(o,a),s.closed.length>0&&console.log(` closed flow sim(s): ${s.closed.join(", ")}`),s.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${s.remaining.join(", ")}`)}catch(o){console.warn(` warn: failed to close flow sim(s): ${o instanceof Error?o.message:String(o)}`)}finally{r.close()}}async function Wt(n){let{gzipSync:e}=await import("zlib"),t=n.map(o=>JSON.stringify(o)).join(`
563
563
  `)+(n.length?`
564
564
  `:""),i=e(Buffer.from(t,"utf8")),r=w.join(ie(),`sootsim-events-${Date.now()}.jsonl.gz`);return k.writeFileSync(r,i),console.log(` events: ${n.length} written to ${r} (${i.length} bytes gz)`),r}async function jt(n){let{gzipSync:e}=await import("zlib"),t=n.map((a,s)=>({schemaVersion:1,t:a.endedAtMs,seq:1e6+s,context:"host",kind:"flow-step",id:`flow-step-${a.stepIndex}`,data:{stepIndex:a.stepIndex,stepNumber:a.stepIndex+1,stepName:a.stepName,...a.targetLabel?{targetLabel:a.targetLabel}:{},status:a.status,durationMs:a.durationMs,startedAtMs:a.startedAtMs,endedAtMs:a.endedAtMs,...a.error?{error:a.error}:{}}})),i=t.map(a=>JSON.stringify(a)).join(`
565
565
  `)+`
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{j as n}from"./chunk-JNEW6IZR.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{j as n}from"./chunk-T7SAFPA6.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
3
3
  `)}export{g as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as m,b as I}from"./chunk-W4QRVE6C.js";import{a as w,b as _,c as T}from"./chunk-I3PUCAVF.js";import{c as k}from"./chunk-PL6D2V4B.js";import{G as O,o as D,q as f}from"./chunk-K2V2S3VK.js";import h from"fs";import v from"path";var c="default",F="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),F)}function G(e){return`sootsim-profile-${s(e)}`}function B(e){return v.join(D(),"Partitions",G(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function A(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:A(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:A([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as m,b as I}from"./chunk-3ZZ4QGEW.js";import{a as w,b as _,c as T}from"./chunk-SX5M6VA3.js";import{c as k}from"./chunk-QMS2S3EF.js";import{G as O,o as D,q as f}from"./chunk-KWAAJUF2.js";import h from"fs";import v from"path";var c="default",F="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),F)}function G(e){return`sootsim-profile-${s(e)}`}function B(e){return v.join(D(),"Partitions",G(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function A(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:A(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:A([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
3
3
  `,"utf8"),h.renameSync(t,g()),r}function H(){return S(b()).profiles}function j(e){let r=s(e);return H().find(t=>t.id===r)??null}function E(e=c){let r=s(e),t=j(r);return t||q(r)}function q(e){let r=s(e),t=P(b());if(t.profiles.some(n=>n.id===r))throw new Error(`profile already exists: ${r}`);let o=new Date().toISOString(),i={id:r,createdAt:o,updatedAt:o};return S({version:a,profiles:[...t.profiles,i]}),i}function pe(e){let r=s(e);if(r===c)throw new Error("the default profile cannot be deleted; clear it instead");let t=P(b()),o=t.profiles.find(i=>i.id===r);if(!o)throw new Error(`profile not found: ${r}`);return S({version:a,profiles:t.profiles.filter(i=>i.id!==r)}),z(r),o}function z(e){let r=s(e);for(let t of[B(r),y(r)])try{h.rmSync(t,{recursive:!0,force:!0})}catch{}}function Y(){let e=w();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function K(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=w();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await T(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var M={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:Y,launch:K};function V(){let e=m();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim desktop install`)"}}async function J(e){let r=m();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await I(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var C={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:V,launch:J};import{spawn as X}from"child_process";import{closeSync as Z,mkdtempSync as Q,openSync as ee,readFileSync as re}from"fs";import{createRequire as te}from"module";import{tmpdir as L}from"os";import{join as W}from"path";var oe=`
4
4
  const modulePath = process.env.SOOTSIM_PW_MODULE;
5
5
  const url = process.env.SOOTSIM_PW_URL;
@@ -0,0 +1,13 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as j,b as ne,c as re,d as xe,e as ke,g as Pe}from"./chunk-74SGAJAJ.js";import{a as Me,b as _e}from"./chunk-FMIR4NMA.js";import{a as Ce,b as se,c as Ee}from"./chunk-LO7DZIFS.js";import{m as T}from"./chunk-USLCZL6I.js";import{m as Ue,o as Te}from"./chunk-IPX2D5AJ.js";import{a as Re,b as Oe,c as ie,e as Be,f as De,g as C,h as v,i as E}from"./chunk-KCGE56W3.js";import{b as Ie,l as ce}from"./chunk-XTKTKQIT.js";import{a as R,b as ae}from"./chunk-3ZZ4QGEW.js";import{d as le}from"./chunk-SX5M6VA3.js";import{d as _,e as b,f as U}from"./chunk-QMS2S3EF.js";import{H as Se,M as te,O as W,l as ve}from"./chunk-KWAAJUF2.js";import{g as oe,i as $e}from"./chunk-T7SAFPA6.js";import{spawn as je}from"node:child_process";import D from"node:fs";import ut from"node:os";import M from"node:path";import{WebSocket as pt}from"ws";function rt(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function K(e){let t=rt(e);return t==="localhost"||t.endsWith(".localhost")||t==="0.0.0.0"||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function Le(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function st(e,t){return e?.includes("/one/metro-entry.bundle")?"one":typeof t=="string"&&t?"expo":"unknown"}function Ne(e,t,o){return`${e}//${t}:${o}`}function it(e){if(typeof window>"u")return!1;try{let t=new URL(e);return K(t.hostname)&&K(window.location.hostname)&&t.origin!==window.location.origin}catch{return!1}}async function Ae(e,t){let o={...t,cache:t?.cache??"no-store"};return it(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,o):fetch(e,o)}function at(e){return e==="https:"?443:80}function lt(e){let t=e.pathname||"/";return(t==="/"||t==="")&&!e.search&&!e.hash}async function ct(e){try{let t=await fetch("/__server-scan",{cache:"no-store"});if(!t.ok||!(t.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let o=await t.json();if(!Array.isArray(o))return null;let n=o.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:re(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Fe(e,t){let o=e.replace(/\/+$/,"");try{if(K(new URL(o).hostname)){let n=await ct(t);if(n)return n}}catch{}try{let n=await Ae(`${o}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:re(i||`${o}${ne}`),port:t,framework:st(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ae(`${o}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${o}${ne}`,port:t,framework:"metro"}}catch{}return null}async function dt(e){return Fe(Ne("http:","localhost",e),e)}async function He(e){let t=e.trim();if(/^\d+$/.test(t)){let a=parseInt(t,10),l=await dt(a);if(l)return l;throw Le(`localhost:${a}`)}let o=t.startsWith("http")?t:`http://${t}`,n;try{n=new URL(o)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):at(r),i=Ne(r,n.hostname,s);if(lt(n)){let a=await Fe(i,s);if(a)return a;throw Le(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function io(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function We(e){let t=R();if(console.log(` note: no sootsim bridge detected on port ${e}`),t){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function mt(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function ao(e,t,o){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){mt(t);return}console.error(` no sim with id "${o}" is connected to the bridge on port ${t}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var ft=12e4,Ke=100,ht=5e3,ze=1e4,gt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(t=>setTimeout(t,e))}function qe(e){let t=process.env[e]?.trim();if(!t)return null;let o=Number(t);return Number.isInteger(o)&&o>0?o:null}function wt(){let e=qe("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??qe("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??ft;return{timeoutMs:e,hostTimeoutMs:e+ht,intervalMs:Ke,attempts:Math.max(1,Math.ceil(e/Ke))}}function bt(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function yt(e,t){return e.includes("--headless")?!0:e.includes("--headed")?!1:t==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function G(e){return e.trim()}var Qe=/^[A-Za-z][A-Za-z0-9+.-]*:/;function vt(e){let t=e.trim();if(!t)throw new Error("expected <url-or-route>");return Qe.test(t)||t.startsWith("/")?t:`/${t}`}function St(e){return e!==null&&typeof e=="object"}function $t(e){let t=e.trim();return t?t.startsWith("/")?!0:Qe.test(t)?!/^https?:\/\//i.test(t):!1:!1}async function xt(e){if(await z(e,250))return e;let t=te();if(t&&W(t)&&await z(t.bridgePort,500))return t.bridgePort;if(t&&W(t))throw new Error(`sootsim bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await kt();let o=It(["serve","--quiet","--port",String(e)]),n=null;o.once("exit",(s,i)=>{n=String(s??i??"unknown")}),o.unref();let r=Date.now()+ze;for(;Date.now()<r;){let s=te();if(s&&W(s)&&await z(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await z(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(ze/1e3)}s`)}async function kt(){let e=Se();if(e&&D.existsSync(ve(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:t}=await import("./runtime-S3TTT5GK.js");await t(["install"],{})}function It(e){let t=process.argv[1];return t&&D.existsSync(t)?je(process.execPath,[t,...e],{detached:!0,stdio:"ignore",env:process.env}):je("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function z(e,t){return new Promise(o=>{let n=new pt(`ws://127.0.0.1:${e}`,{handshakeTimeout:t}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}o(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),t)})}function ue(e){try{let t=new URL(e),o=t.pathname.replace(/\/+$/,"")||"/";return t.searchParams.has("open")||t.searchParams.has("port")||t.searchParams.has("bundle")||t.searchParams.has("demo")||t.pathname.includes("/sootsim/index.html")||o==="/sootsim"||t.pathname==="/__soot"||t.pathname==="/__soot/"||o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}function Pt(e){try{let t=new URL(e,"http://sootsim.local");if(t.origin!=="http://sootsim.local")return!1;let o=t.pathname.replace(/\/+$/,"")||"/";return o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}function Ct(e,t){let o=new URL(e,"http://sootsim.local"),n=new URL(t),r=V(n.pathname),s=o.pathname.startsWith("/__soot/")?o.pathname.slice(7):o.pathname;return n.pathname=`${r}${s}`,n.search=o.search,n.hash=o.hash,n.toString()}function Et(e){try{let t=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(t)||/^\/build\/.+/.test(t)}catch{return!1}}async function Ro(e){let t=G(e);return(await Ye(t)).bundleUrl}function Mt(e){try{let t=new URL(e.startsWith("http")?e:`http://${e}`),o=t.pathname||"/";if(o!=="/"&&o!==""||t.search||t.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(t.hostname))return null;let n=t.port?Number(t.port):t.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Ye(e){let t=G(e),o=/^\d+$/.test(t)?Number(t):Mt(t);if(o&&o>0){let n=await ke(o);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return He(t)}function V(e){let t=e.replace(/\/+$/,"")||"/";return t==="/__soot"||t.startsWith("/__soot/")?"/__soot":""}function _t(e,t){let o=G(e),n=new URL(t),r=V(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(o)?n.pathname=`${r}/rn/${o}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",o)),n.toString()}function Ut(e){let t=G(e);return/^\d+$/.test(t)||/^https?:\/\//i.test(t)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(t)}async function Tt(e,t,o={}){let n=await Ye(e),r=new URL(t),s=V(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=o.hot===void 0?n.bundleUrl:xe(n.bundleUrl,o.hot);return r.searchParams.set("bundle",i),r.toString()}function Rt(e){return e.startsWith("~/")?M.join(ut.homedir(),e.slice(2)):M.isAbsolute(e)?e:M.resolve(process.cwd(),e)}function Ot(e){let t={},o={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=Rt(s.slice(i+1).trim());D.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),t[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),o[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(t).length>0&&(n.modules=t),Object.keys(o).length>0&&(n.network={remap:o}),n.modules||n.network?n:void 0}function Ze(){return Re().shellBaseUrl}async function Bt(e){try{let t=new URL(e),o=t.searchParams.get("bundle")||"";if(!o)return e;let n=process.env.SOOT_REPO_DIR||await se(o)||void 0,r=Ce({bundleUrl:o,repoDir:n});if(r.length===0)return e;let s=await Dt(r);return s.length===0?e:(t.searchParams.set("appFonts",Ee(s)),t.toString())}catch{return e}}async function Dt(e){let t=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),o=[];for(let n of t)n!==null&&o.push(n);return o}async function Lt(e,t,o={}){if(!e)return new URL(t).toString();if(ue(e))return new URL(e).toString();if(Pt(e))return Ct(e,t);let n=gt[e.toLowerCase()];if(n){let r=new URL(t),s=V(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return Ut(e)?Tt(e,t,o):_t(e,t)}async function At(e){try{let t=new URL(e),o=t.searchParams.get("bundle")||"";if(!o)return e;let n=process.env.SOOT_REPO_DIR||await se(o)||void 0,r=Me({bundleUrl:o,repoDir:n});return!r||r.imageUrl&&!await Nt(r.imageUrl)?e:(t.searchParams.set("appSplash",_e(r)),t.toString())}catch{return e}}async function Nt(e){let t=new AbortController,o=setTimeout(()=>t.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:t.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(o)}}async function q(e,t=Ze(),o={}){let n=await Lt(e,t,o),r=await At(await Bt(n));if(!o.device)return r;let s=new URL(r);return s.searchParams.set("device",o.device),s.toString()}function Ge(e,t){let o=e?.url||e?.origin||t;try{let n=new URL(o);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return t}}async function Ft(e,t,o,n={}){let r=new URL(await q(e,t,n));return r.searchParams.set("inspectOpen",o),r.toString()}async function Ht(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:t,simId:o,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function Wt(e){if(!e)return null;try{let t=new URL(e);if(t.searchParams.has("bundle")){let o=t.searchParams.get("bundle")||"";try{let n=new URL(o),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return t.searchParams.has("port")?`connect :${t.searchParams.get("port")||""}`:t.searchParams.has("open")?`connect ${t.searchParams.get("open")||""}`:t.searchParams.has("demo")?`demo ${t.searchParams.get("demo")||"default"}`:t.pathname.includes("/sootsim/index.html")||t.pathname==="/sootsim/"||t.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function jt(e){let t=e.indexOf(":");if(t<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let o=e.slice(0,t),n=e.slice(t+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return o==="AGENTBUS_SESSION"||o==="CLAUDE_CODE_SESSION_ID"||o==="CODEX_THREAD_ID"?`agent ${r}`:`${o} ${r}`}function Oo(e,t){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
3
+ `);for(let o of e){let n=o.lockedBy&&o.lockExpiresAt?`locked by ${jt(o.lockedBy)} (${Math.max(0,Math.round((o.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[o.isPrimary?"primary":"",o.id===t?"selected":"",o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":"",o.attachedCliCount&&o.attachedCliCount>0?"in use":"",o.userFocused?"focused":"",n].filter(Boolean);console.log(` ${o.id}${r.length?` [${r.join(", ")}]`:""}`);let s=Wt(o.url);if(s)console.log(` loaded: ${s}`);else if(o.url){let a=o.url.length>96?`${o.url.slice(0,93)}\u2026`:o.url;console.log(` url: ${a}`)}else o.origin&&console.log(` origin: ${o.origin}`);let i=Kt(o);i&&console.log(` engine: ${i}`),o.title&&console.log(` title: ${o.title}`),o.visibilityState&&o.visibilityState!=="visible"&&console.log(` visibility: ${o.visibilityState}`),console.log(` connected: ${Ve(Date.now()-o.connectedAt)}`),o.lastActiveAt&&o.lastActiveAt>0&&console.log(` last active: ${Ve(Date.now()-o.lastActiveAt)}`)}}function Kt(e){let t=e.url||e.origin||"";if(!t)return null;try{let o=new URL(t).port;return o==="5173"?"dev \u2014 local source (:5173)":o==="3000"?"soot app embedded (:3000)":Pe()?`dev \u2014 local build (:${o||"?"})`:`runtime \u2014 published engine (:${o||"?"})`}catch{return null}}function Ve(e){let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s ago`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}async function de(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:t});try{let d=(await a.listSims()).find(o);if(d)return d}catch{}finally{a.close()}await $(s)}return null}async function zt(e,t,o,n,r={}){let s=r.attempts??30,i=r.intervalMs??500,a=!!n&&Number.isInteger(n)&&n>1,l=()=>a&&n!==void 0&&!pe(n);for(let d=0;d<s;d++){if(l())return{kind:"host-exit"};let m=v(e,{commandTimeoutMs:t});try{let g=(await m.listSims()).find(o);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{m.close()}if(l())return{kind:"host-exit"};await $(i)}return{kind:"timeout"}}async function qt(e,t,o,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:t});try{let d=(await a.listSims()).find(m=>m.id===o);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await $(s)}return!1}function Gt(e){let t=e.meta;if(!t||t.sootsimHostDriver!=="playwright")return null;let o=Number(t.sootsimHostPid);return!Number.isInteger(o)||o<=1||o===process.pid?null:o}function Vt(e){if(!e.connectAckFile)return!1;try{return D.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
4
+ `,{flag:"w"}),!0}catch{return!1}}function Je(e){if(e.diagnosticLogPath)try{let t=D.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!t){console.error(` ${M.basename(e.diagnosticLogPath)} was empty`);return}let o=t.length>4e3?`\u2026
5
+ ${t.slice(-4e3)}`:t;console.error(` ${M.basename(e.diagnosticLogPath)}:`),console.error(o)}catch(t){let o=t instanceof Error?t.message:String(t);console.error(` failed to read ${M.basename(e.diagnosticLogPath)}: ${o}`)}}function pe(e){try{return process.kill(e,0),!0}catch(t){return t?.code==="EPERM"}}async function Jt(e,t=2500){let o=Date.now()+t;for(;Date.now()<o;){if(!pe(e))return!0;await $(100)}return!pe(e)}async function me(e,t){let o=new Set(t),n=new Set;for(let r of e){if(!o.has(r.id))continue;let s=Gt(r);s&&n.add(s)}for(let r of n){try{process.kill(r,"SIGTERM")}catch{}if(await Jt(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function J(e,t){if(t){let r=t.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let o=e.find(r=>r.isPrimary&&r.readyState==="open");if(o)return o;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function O(e,t,o){console.log(` ${o==="current sim"?"loaded":"opened"}: ${e} [${o}]`),console.log(` current sim: ${t.id}`),console.log(JSON.stringify({simId:t.id,url:t.url},null,2))}async function B(e,t,o){if(o.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await Qt(e,t,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:t,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:Ue})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&Te(s))){let m=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${m} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
6
+ const t = window.__sootsimTest
7
+ const ms = window.SootSim?.bridges?.mainShell
8
+ if (!t) return null
9
+ let shell = null
10
+ try { shell = ms?.getState ? await ms.getState() : null } catch {}
11
+ const tree = await t.dumpTree(12, ${JSON.stringify({describe:!0,verbose:!1,filter:""})})
12
+ return { tree, shell }
13
+ })()`,l=await r.send({type:"evaluate",code:a});if(!l?.tree)return;if(console.log(""),l.shell?.state){let d=[`state=${l.shell.state}`,l.shell.activeApp?`app=${l.shell.activeApp}`:null].filter(Boolean);console.log(` shell: ${d.join(" ")}`)}console.log(l.tree)}finally{r.close()}}catch{}finally{n===void 0?delete process.env.SOOTSIM_QUIET_TARGET_NOTICE:process.env.SOOTSIM_QUIET_TARGET_NOTICE=n}}async function Qt(e,t,o){let n=Date.now()+o.maxMs,r="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",s=v(e,{commandTimeoutMs:2e3,simId:t,simIdSource:"flag"});try{let i=-1,a=0;for(;Date.now()<n;){let l=-1;try{let d=await s.send({type:"evaluate",code:r});typeof d=="number"&&(l=d)}catch{}if(l>=0&&l===i){if(Date.now()-a>=o.stableMs)return}else i=l,a=Date.now();await $(50)}}finally{s.close()}}async function Yt(e,t={}){let o=C(e,{port:t.port,commandTimeoutMs:t.timeoutMs});o.positional.length!==1&&(console.error(" sootsim open: expected exactly one <url-or-route>"),console.error(" examples: sootsim open /settings | sootsim open myapp://settings"),process.exit(1));let n;try{n=vt(o.positional[0]??"")}catch(i){console.error(` sootsim open: ${i instanceof Error?i.message:String(i)}`),process.exit(1)}let r=E(o),s=o.simId?` --sim ${o.simId}`:"";try{let i=await r.send({type:"call",path:"SootSim.bridges.test.openDeepLink",args:[n]});if(St(i)&&i.ok===!1)throw new Error(typeof i.error=="string"?i.error:"deep-link dispatch failed");console.log(` opened deep link: ${n}`)}catch(i){console.error(` link failed: ${i instanceof Error?i.message:String(i)}`),await T(r,{errorsCommand:`sootsim get errors 5${s}`,warningsCommand:`sootsim get warnings 5${s}`,requestsCommand:`sootsim get requests 5${s}`}),process.exit(1)}finally{r.close()}}async function Bo(e,t={}){let o=C(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--new","--headless","--headed","--ephemeral","--hot","--no-hmr","--no-describe"],stripValueFlags:["--base-url","--replace","--driver","--profile","--cdp-port","--browser","--device"]}),n=e.find((c,p)=>e[p-1]==="--profile"),r=e.includes("--ephemeral"),s=e.find((c,p)=>e[p-1]==="--cdp-port"),i=s?Number(s):void 0;s&&(!Number.isFinite(i)||i<=0)&&(console.error(` sootsim open: --cdp-port must be a positive port number, got "${s}"`),process.exit(1)),n&&r&&(console.error(" sootsim open: --profile cannot be combined with --ephemeral"),process.exit(1));let a=n?Ie(n).id:void 0,l=!!a||r,d=e.includes("--new")||l,m=Ot(e);d&&o.simIdSource==="flag"&&(console.error(" sootsim open: --new, --profile, and --ephemeral cannot be combined with --sim"),process.exit(1));let u=o.positional[0]||"";if($t(u)){d&&(console.error(" sootsim open: deep links target the current app; remove --new, --profile, or --ephemeral"),process.exit(1)),await Yt(e,t);return}if(Et(u)){let c=(()=>{try{return/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(new URL(u).hostname)}catch{return!1}})();console.log(" that\u2019s a SootSim preview/build link \u2014 a full player page, not a driveable sim."),console.log(" opening it in your browser for viewing\u2026");try{await le(u,{background:!1})}catch(p){console.error(` could not launch a browser: ${p instanceof Error?p.message:String(p)}`),console.error(` open it yourself: ${u}`),process.exit(1)}console.log(c?" to drive it under the CLI, point `sootsim open` at the app\u2019s dev port instead (e.g. `sootsim open 8081`).":" the CLI can\u2019t drive a remote preview (the engine only attaches to the local bridge from localhost). to drive the app, run it locally and `sootsim open <port>`.");return}let g=e.find((c,p)=>e[p-1]==="--base-url"),Q=t.port!==void 0||e.some(c=>c==="--port"||c==="-p"||c.startsWith("--port="));if(g&&!Q){let c=ie(g);c&&(o.wsPort=c)}o.wsPort=await xt(o.wsPort);let y=e.find((c,p)=>e[p-1]==="--driver")||"",et=yt(e,y);i&&y!=="playwright"&&(console.error(" sootsim open: --cdp-port is only honored by the playwright driver \u2014 add `--driver playwright`"),process.exit(1));let x=e.find((c,p)=>e[p-1]==="--browser");x&&y!=="playwright"&&(console.error(" sootsim open: --browser is only honored by the playwright driver \u2014 add `--driver playwright`"),process.exit(1));let L=x==="chromium"||x==="webkit"||x==="firefox"?x:void 0;x&&!L&&(console.error(` sootsim open: --browser must be chromium, webkit, or firefox \u2014 got "${x}"`),process.exit(1)),i&&L&&L!=="chromium"&&(console.error(" sootsim open: --cdp-port requires the chromium engine"),process.exit(1));let fe=e.includes("--hot"),he=e.includes("--no-hmr");fe&&he&&(console.error(" sootsim open: --hot and --no-hmr cannot be combined"),process.exit(1));let tt=fe?!0:he?!1:y!=="playwright",k=e.find((c,p)=>e[p-1]==="--device");k&&!(k in oe)&&(console.error(` sootsim open: unknown device "${k}"`),console.error(` known devices: ${$e().join(", ")}`),process.exit(1));let Y=k?oe[k]:void 0,A={hot:tt,device:k},ot=Oe(o.wsPort),I=g||ot?.shellBaseUrl||Ze(),ge=e.includes("--base-url");Be(o.wsPort,I);let we=_();if(!y&&!d&&(o.simIdSource==="flag"||o.simIdSource==="saved"&&!!we)){let c=E(o),p=o.simId?` --sim ${o.simId}`:"",f=!1;try{let h=null;try{let w=await c.listSims();if(o.simIdSource==="saved"?(h=w.find(P=>P.id===we&&P.readyState==="open")??null,h||U()):h=J(w,o.simId),!h)if(o.simIdSource==="saved")f=!0;else throw new Error("no sim connected");if(!f&&h){let P=ge||ue(u)?I:Ge(h,I),H=await q(u,j(P,m),A);c.send({type:"evaluate",simId:h.id,code:`window.location.href = ${JSON.stringify(H)}`}).catch(()=>{})}}catch(w){console.error(` open failed: ${w instanceof Error?w.message:String(w)}`),await T(c,{errorsCommand:`sootsim get errors 5${p}`,warningsCommand:`sootsim get warnings 5${p}`,requestsCommand:`sootsim get requests 5${p}`}),process.exit(1)}if(!f&&h){await $(1500);let w=await Ht(o.wsPort,o.commandTimeoutMs,h.id);w||(console.error(" timed out waiting for current sim to load target"),process.exit(1)),w.bridge.close(),b(h.id);let P=ge||ue(u)?I:Ge(h,I),H=await q(u,j(P,m),A);O(H,{...h,url:H},"current sim"),await B(o.wsPort,h.id,e);return}}finally{c.close()}}let be=j(I,m),nt=await q(u,be,A),ye=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,S=await Ft(u,be,ye,A),Z={newWindow:!0},N=c=>c.url?.includes(`inspectOpen=${ye}`)??!1;if(y){bt(y)||(console.error(` unknown driver "${y}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let c=ce(y);c||(console.error(` unknown driver "${y}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let p=wt(),f=await c.launch({url:S,bridgePort:ie(I)??void 0,headless:et,newWindow:Z.newWindow,profileId:a,ephemeralProfile:r,cdpPort:i,browser:L,device:k,viewport:Y?{width:Y.width+120,height:Y.height+60}:void 0,connectTimeoutMs:p.hostTimeoutMs});f.launched||(console.error(` ${c.name} driver: ${f.message}`),process.exit(1));let h=await zt(o.wsPort,o.commandTimeoutMs,N,f.pid,{attempts:p.attempts,intervalMs:p.intervalMs});if(h.kind==="host-exit"&&(Je(f),console.error(` ${c.name} host crashed \u2014 sim is no longer attached`),process.exit(1)),h.kind==="timeout"){if(f.pid)try{process.kill(f.pid,"SIGTERM"),console.error(` closed ${c.name} host process ${f.pid}`)}catch{}Je(f),console.error(` timed out after ${p.timeoutMs}ms waiting for opened sim to connect`),process.exit(1)}let w=h.sim;b(w.id),Vt(f),O(S,w,`${c.name} driver`),await B(o.wsPort,w.id,e);return}if(l){let c=R();c||(console.error(" profiles require electron or playwright; install the desktop companion or use `--driver playwright`"),process.exit(1));try{(await ae(S,c,{profileId:a,ephemeralProfile:r})).launched||(console.error(" desktop companion failed to start"),process.exit(1))}catch(f){console.error(` desktop companion failed: ${f instanceof Error?f.message:String(f)}`),process.exit(1)}let p=await de(o.wsPort,o.commandTimeoutMs,N,{attempts:40,intervalMs:500});p||(console.error(" timed out waiting for profiled sim to connect"),process.exit(1)),b(p.id),O(S,p,"desktop companion"),await B(o.wsPort,p.id,e);return}let X=!1,ee=!1;try{let c=v(o.wsPort,{commandTimeoutMs:2e3});try{await c.listSims(),X=!0}finally{c.close()}}catch{}if(X)try{let c=v(o.wsPort,{commandTimeoutMs:3e3});try{await c.openUrl(S,Z),ee=!0}finally{c.close()}}catch{}if(!ee){let c=R();if(c)try{if((await ae(S,c)).launched){let f=await de(o.wsPort,o.commandTimeoutMs,N,{attempts:20,intervalMs:500});if(f){b(f.id),O(S,f,"desktop companion"),await B(o.wsPort,f.id,e);return}}}catch{}try{await le(S,Z)}catch(p){console.error(` open failed: ${p instanceof Error?p.message:String(p)}`),ce("playwright")?.availability().available?console.error(" no system browser found \u2014 retry with `sootsim open \u2026 --driver playwright` for a headless sim."):console.error(" run `sootsim list --drivers` to see available drivers."),process.exit(1)}if(!X){console.log(` opened: ${nt}`),We(o.wsPort);return}}let F=await de(o.wsPort,o.commandTimeoutMs,N,{attempts:30,intervalMs:500});F||(console.error(" timed out waiting for opened sim to connect"),process.exit(1)),b(F.id),O(S,F,ee?"bridge":"direct shell open"),await B(o.wsPort,F.id,e)}async function Xe(e,t={}){let o=C(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=E(o),s=o.simId?` --sim ${o.simId}`:"";try{try{let i=await r.listSims(),a=J(i,o.positional[0]||o.simId);if(a.lockedBy&&a.lockExpiresAt&&a.lockExpiresAt>Date.now()){let l=Math.max(0,Math.round((a.lockExpiresAt-Date.now())/1e3));a.lockedByKind==="user-active"&&(console.error(` refused: ${a.id} is locked by the active user (${l}s) \u2014 that's a live human tab`),console.error(" run `sootsim open --new` for a fresh investigation sim"),process.exit(1)),n||(console.error(` refused: ${a.id} is leased by ${a.lockedBy} (${l}s)`),console.error(` \`sootsim use ${a.id} --force\` to take it, or \`sootsim open --new\` for a fresh sim`),process.exit(1))}await r.focusSim(a.id),b(a.id),console.log(` using: ${a.id}`)}catch(i){console.error(` use failed: ${i instanceof Error?i.message:String(i)}`),await T(r,{errorsCommand:`sootsim get errors 5${s}`,warningsCommand:`sootsim get warnings 5${s}`,requestsCommand:`sootsim get requests 5${s}`}),process.exit(1)}}finally{r.close()}}async function Do(e,t={}){await Xe(e,t)}async function Lo(e,t={}){await Xe(e,t)}async function Ao(e,t={}){let o=C(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=E(o);try{try{let s=await r.listSims(),i=J(s,o.positional[0]||o.simId),a=n&&i.lockedBy&&i.lockedByKind!=="user-active"?i.lockedBy:null,l=await r.claim(i.id,{force:n});b(i.id);let d=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),m=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${d}s]${m}`),a&&console.log(` took over from: ${a}`)}catch(s){if(s instanceof De){let i=Math.max(0,Math.round(s.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${s.lock.by} for ${i}s more`),console.error(" use --force to take it, or `sootsim open --new` for a fresh sim"),process.exit(1)}console.error(` claim failed: ${s instanceof Error?s.message:String(s)}`),process.exit(1)}}finally{r.close()}}async function Zt(e,t,o,n){if(n.length===0)return{closed:[],remaining:[]};await Promise.all(n.map(s=>e.closeSim(s).catch(()=>{})));let r=new Set(n);for(let s=0;s<40;s++){let i=[];try{let a=v(t,{commandTimeoutMs:o});try{i=(await a.listSims()).filter(d=>r.has(d.id)&&d.readyState==="open").map(d=>d.id)}finally{a.close()}}catch{i=[]}if(i.length===0)return{closed:[...r],remaining:[]};if(s===39)return{closed:[...r].filter(a=>!i.includes(a)),remaining:i};await $(250)}return{closed:[...r],remaining:[]}}function Xt(e,t){let o=e.filter(u=>u.readyState==="open"),n=o.map(u=>u.id),r=t.explicitKeepId?.trim()||"",s=t.savedKeepId?.trim()||"",i=s?o.some(u=>u.id===s):!1,a=s&&!i?s:null,l=null,d=null,m=null;if(t.closeOthers)if(r){let u=o.find(g=>g.id===r);u?l=u.id:d=r}else if(s&&i)l=s;else{let u=o.find(g=>g.isPrimary)??o[0]??null;u&&(l=u.id,s&&!i&&(m=u.id))}return{openIds:n,keepId:l,targets:d?[]:n.filter(u=>u!==l),staleSavedId:a,missingExplicitKeepId:d,fallbackKeepId:m}}async function No(e,t={}){let o=C(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--all","--others"]}),n=E(o),r=o.simId?` --sim ${o.simId}`:"",s=e.includes("--all"),i=e.includes("--others");if(s||i){try{let a=await n.listSims(),l=_(),d=o.positional[0]||(o.simIdSource==="flag"?o.simId:void 0),m=Xt(a,{closeOthers:i,explicitKeepId:d,savedKeepId:l});if(m.staleSavedId&&U(),m.fallbackKeepId&&(b(m.fallbackKeepId),console.log(` saved sim ${m.staleSavedId} is gone \u2014 keeping primary ${m.fallbackKeepId}`)),m.missingExplicitKeepId&&(console.error(` close failed: keep sim ${m.missingExplicitKeepId} is not connected; not closing other sims`),process.exit(1)),m.targets.length===0){console.log(m.keepId?` nothing to close \u2014 only the kept sim ${m.keepId} is connected`:m.staleSavedId?` nothing to close \u2014 no sims connected (cleared stale current sim ${m.staleSavedId})`:" nothing to close \u2014 no sims connected");return}let u=await Zt(n,o.wsPort,o.commandTimeoutMs,m.targets);await me(a,m.targets);let g=_();g&&u.closed.includes(g)&&(m.keepId?b(m.keepId):U());let Q=` closed ${u.closed.length} sim(s)${m.keepId?` (kept ${m.keepId})`:""}`;console.log(Q),u.remaining.length>0&&(console.error(` close failed: still connected: ${u.remaining.join(", ")}`),process.exit(1))}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}finally{n.close()}return}try{try{let a=await n.listSims(),l=J(a,o.positional[0]||o.simId),d=a.find(u=>u.id!==l.id&&u.readyState==="open");await n.closeSim(l.id),await qt(o.wsPort,o.commandTimeoutMs,l.id)||(await me(a,[l.id]),console.error(` close failed: ${l.id} is still connected`),process.exit(1)),await me(a,[l.id]),_()===l.id&&(d?b(d.id):U()),console.log(` closed: ${l.id}`)}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),await T(n,{errorsCommand:`sootsim get errors 5${r}`,warningsCommand:`sootsim get warnings 5${r}`,requestsCommand:`sootsim get requests 5${r}`}),process.exit(1)}}finally{n.close()}}export{io as a,mt as b,ao as c,wt as d,vt as e,Ro as f,Ze as g,q as h,Ft as i,Wt as j,Oo as k,de as l,zt as m,Gt as n,Vt as o,me as p,Yt as q,Bo as r,Do as s,Lo as t,Ao as u,Zt as v,Xt as w,No as x};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-SVLKYHDO.js";import"./chunk-FF7B5JFA.js";export{a as getCliVersion};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-LG3QMLIP.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.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-FF7B5JFA.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-77ERA3YQ.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-77ERA3YQ.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-NTF5XYWV.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-NTF5XYWV.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.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A as i,C as s,x as t}from"./chunk-K2V2S3VK.js";import"./chunk-LG3QMLIP.js";function l(){let e=i();console.log(` telemetry is ${e?"ON":"OFF"}`),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function r(e){let o=e.find(n=>!n.startsWith("-"))?.toLowerCase();switch(o){case void 0:case"status":l();return;case"on":case"enable":s(!0),console.log(" telemetry ON"),console.log(` config: ${t()}`);return;case"off":case"disable":s(!1),console.log(" telemetry OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${o}`),console.error(" usage: sootsim config telemetry [on|off|status]"),process.exit(1)}}function c(){console.log(`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A as i,C as s,x as t}from"./chunk-KWAAJUF2.js";import"./chunk-FF7B5JFA.js";function l(){let e=i();console.log(` telemetry is ${e?"ON":"OFF"}`),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function r(e){let o=e.find(n=>!n.startsWith("-"))?.toLowerCase();switch(o){case void 0:case"status":l();return;case"on":case"enable":s(!0),console.log(" telemetry ON"),console.log(` config: ${t()}`);return;case"off":case"disable":s(!1),console.log(" telemetry OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${o}`),console.error(" usage: sootsim config telemetry [on|off|status]"),process.exit(1)}}function c(){console.log(`
3
3
  sootsim config \u2014 manage local CLI preferences
4
4
 
5
5
  usage:
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u}from"./chunk-MUGUKWIG.js";import"./chunk-E227YZ2E.js";import"./chunk-JYADQK47.js";import"./chunk-RVUBOWIS.js";import"./chunk-BP4PZWLR.js";import"./chunk-V4N65DTH.js";import"./chunk-ZFH3NSNB.js";import"./chunk-GRSCRRWU.js";import"./chunk-25KNBRLI.js";import"./chunk-7Y72TT54.js";import"./chunk-W4QRVE6C.js";import"./chunk-I3PUCAVF.js";import"./chunk-N7VEPGM7.js";import"./chunk-GADW4EOH.js";import"./chunk-MIJLFF2K.js";import"./chunk-PL6D2V4B.js";import"./chunk-K2V2S3VK.js";import"./chunk-JNEW6IZR.js";import"./chunk-LG3QMLIP.js";export{f as buildOpenUrl,e as buildShellUrl,s as closeSimsBulk,b as normalizeDeepLinkTarget,t as planBulkCloseTargets,k as playwrightHostPidForSim,h as printConnectedSims,c as resolveBundleTarget,d as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,r as runClaimCommand,u as runCloseCommand,q as runFocusCommand,n as runLinkCommand,o as runOpenCommand,p as runUseCommand,l as signalDriverLaunchConnected,g as summarizeSimUrl,m as terminatePlaywrightHostsForSims,i as waitForSimMatch,j as waitForSimMatchOrHostExit};
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r,v as s,w as t,x as u}from"./chunk-XUXEKCY2.js";import"./chunk-74SGAJAJ.js";import"./chunk-JY6W7FJK.js";import"./chunk-FMIR4NMA.js";import"./chunk-LO7DZIFS.js";import"./chunk-NV7QTS3L.js";import"./chunk-USLCZL6I.js";import"./chunk-IPX2D5AJ.js";import"./chunk-KCGE56W3.js";import"./chunk-XTKTKQIT.js";import"./chunk-3ZZ4QGEW.js";import"./chunk-SX5M6VA3.js";import"./chunk-PH46EVF3.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.js";export{f as buildOpenUrl,e as buildShellUrl,s as closeSimsBulk,b as normalizeDeepLinkTarget,t as planBulkCloseTargets,k as playwrightHostPidForSim,h as printConnectedSims,c as resolveBundleTarget,d as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,r as runClaimCommand,u as runCloseCommand,q as runFocusCommand,n as runLinkCommand,o as runOpenCommand,p as runUseCommand,l as signalDriverLaunchConnected,g as summarizeSimUrl,m as terminatePlaywrightHostsForSims,i as waitForSimMatch,j as waitForSimMatchOrHostExit};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e}from"./chunk-NLRGBEDV.js";import"./chunk-P6L7NTH2.js";import"./chunk-GCW2PJGE.js";import"./chunk-VMRT3K3M.js";import"./chunk-DO4AU4FA.js";import"./chunk-2HT73DM2.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-SVLKYHDO.js";import"./chunk-KEWZBN4M.js";import"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,d as teardownDaemonService,e as teardownSootsimHome};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{f,m as T}from"./chunk-ZFH3NSNB.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-GRSCRRWU.js";import{g as D,i as O,k as x}from"./chunk-25KNBRLI.js";import"./chunk-MIJLFF2K.js";import"./chunk-PL6D2V4B.js";import"./chunk-K2V2S3VK.js";import"./chunk-LG3QMLIP.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{f,m as T}from"./chunk-USLCZL6I.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-IPX2D5AJ.js";import{g as D,i as O,k as x}from"./chunk-KCGE56W3.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-FF7B5JFA.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
3
3
  sootsim debug \u2014 drive __sootsimDebug from the terminal
4
4
 
5
5
  usage:
@@ -170,7 +170,7 @@ examples:
170
170
  } : null,
171
171
  samples,
172
172
  }
173
- })()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-PSNHXZJT.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=O(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
173
+ })()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-B4GJTKF4.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=O(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
174
174
  known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await S(t);console.log(a(e,n));break}case"channels":{let e=await c(t,"window.__sootsimDebug.channels()");console.log(a(e,n));break}case"flags":{let e=await $(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
175
175
  const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
176
176
  if (!d) return null;
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-ZDPA55TU.js";import{a as v,h as k}from"./chunk-MUGUKWIG.js";import"./chunk-E227YZ2E.js";import"./chunk-JYADQK47.js";import"./chunk-RVUBOWIS.js";import"./chunk-BP4PZWLR.js";import"./chunk-V4N65DTH.js";import{a as u}from"./chunk-GH3HR3AH.js";import"./chunk-ZFH3NSNB.js";import"./chunk-GRSCRRWU.js";import"./chunk-25KNBRLI.js";import"./chunk-F2CU2Q6V.js";import{b as m,g as f,l as h}from"./chunk-7Y72TT54.js";import{a as c}from"./chunk-W4QRVE6C.js";import"./chunk-I3PUCAVF.js";import"./chunk-N7VEPGM7.js";import"./chunk-GADW4EOH.js";import"./chunk-MIJLFF2K.js";import"./chunk-PL6D2V4B.js";import"./chunk-K2V2S3VK.js";import"./chunk-JNEW6IZR.js";import"./chunk-LG3QMLIP.js";function I(e){let i=e.indexOf("--port");if(i<0)return;let o=e[i+1],t=o?Number(o):Number.NaN;return(!Number.isInteger(t)||t<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),t}async function O(e,i){let o=I(e)??i.port;return o?k(String(o)):void 0}async function w(e,i){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-4X3L2WDG.js";import{a as v,h as k}from"./chunk-XUXEKCY2.js";import"./chunk-74SGAJAJ.js";import"./chunk-JY6W7FJK.js";import"./chunk-FMIR4NMA.js";import"./chunk-LO7DZIFS.js";import"./chunk-NV7QTS3L.js";import{a as u}from"./chunk-VCFHK3EU.js";import"./chunk-USLCZL6I.js";import"./chunk-IPX2D5AJ.js";import"./chunk-KCGE56W3.js";import"./chunk-O4QDSXAR.js";import{b as m,g as f,l as h}from"./chunk-XTKTKQIT.js";import{a as c}from"./chunk-3ZZ4QGEW.js";import"./chunk-SX5M6VA3.js";import"./chunk-PH46EVF3.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.js";function I(e){let i=e.indexOf("--port");if(i<0)return;let o=e[i+1],t=o?Number(o):Number.NaN;return(!Number.isInteger(t)||t<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),t}async function O(e,i){let o=I(e)??i.port;return o?k(String(o)):void 0}async function w(e,i){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim desktop \u2014 launch the desktop companion
4
4
 
5
5
  usage:
@@ -16,7 +16,7 @@ examples:
16
16
  sootsim desktop --port 5173
17
17
  sootsim desktop --profile qa
18
18
  sootsim desktop --driver system
19
- `),process.exit(0));let o=e.indexOf("--driver"),t=o>=0?e[o+1]:void 0,n=e.find((r,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");n&&d&&(console.error(" sootsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let x=n?m(n).id:void 0,s=t||i.driver,l=f;if(s){let r=h(s);r||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=r}if(l.id==="electron"){let r=c();if(!r){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await u("run sootsim desktop install now?",!0)){console.log();let{runInstallDesktop:D}=await import("./install-desktop-5HHL7X6Y.js");await D(["--yes"]),r=c()}r||process.exit(1)}console.log(` launching ${r.path}`)}let b=await O(e,i),p=await l.launch({url:b,device:i.device,profileId:x,ephemeralProfile:d});p.launched||(console.error(` ${p.message}`),process.exit(1)),console.log(` ${p.message}`)}function y(){console.log(`
19
+ `),process.exit(0));let o=e.indexOf("--driver"),t=o>=0?e[o+1]:void 0,n=e.find((r,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");n&&d&&(console.error(" sootsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let x=n?m(n).id:void 0,s=t||i.driver,l=f;if(s){let r=h(s);r||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=r}if(l.id==="electron"){let r=c();if(!r){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await u("run sootsim desktop install now?",!0)){console.log();let{runInstallDesktop:D}=await import("./install-desktop-PE662CEU.js");await D(["--yes"]),r=c()}r||process.exit(1)}console.log(` launching ${r.path}`)}let b=await O(e,i),p=await l.launch({url:b,device:i.device,profileId:x,ephemeralProfile:d});p.launched||(console.error(` ${p.message}`),process.exit(1)),console.log(` ${p.message}`)}function y(){console.log(`
20
20
  sootsim desktop \u2014 launch or install the desktop companion
21
21
 
22
22
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{e as I}from"./chunk-UAP5LKOX.js";import"./chunk-Q5MDNEUJ.js";import{b as D,c as P}from"./chunk-VK7BQECJ.js";import"./chunk-ADJPXWHT.js";import"./chunk-43APLSK3.js";import{a as _}from"./chunk-JPSBYSMX.js";import{a as b}from"./chunk-K7D326IL.js";import"./chunk-MUGUKWIG.js";import"./chunk-E227YZ2E.js";import"./chunk-JYADQK47.js";import"./chunk-RVUBOWIS.js";import"./chunk-BP4PZWLR.js";import"./chunk-V4N65DTH.js";import"./chunk-ZFH3NSNB.js";import"./chunk-GRSCRRWU.js";import"./chunk-25KNBRLI.js";import"./chunk-7Y72TT54.js";import"./chunk-W4QRVE6C.js";import"./chunk-I3PUCAVF.js";import"./chunk-RIXBSFVQ.js";import"./chunk-N7VEPGM7.js";import"./chunk-HJHKHI5E.js";import"./chunk-DPPE2X5U.js";import"./chunk-T4NDDMK4.js";import"./chunk-GADW4EOH.js";import"./chunk-MIJLFF2K.js";import"./chunk-PL6D2V4B.js";import"./chunk-K2V2S3VK.js";import"./chunk-JNEW6IZR.js";import"./chunk-LG3QMLIP.js";import{spawn as N}from"child_process";import{existsSync as x,mkdirSync as k,readFileSync as A,writeFileSync as w,unlinkSync as M}from"fs";import{tmpdir as F}from"os";import{dirname as L,resolve as l,join as R,relative as C}from"path";function W(){try{let e=import.meta.resolve("sootsim/detox");return L(e.startsWith("file://")?e.slice(7):e)}catch{return l(import.meta.dirname,"..","..","detox")}}var B=`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{e as I}from"./chunk-WTJP6C4W.js";import"./chunk-7YKBZB7D.js";import{b as D,c as P}from"./chunk-KLPGPFZF.js";import"./chunk-2RJ57USW.js";import"./chunk-BCDCPHIB.js";import{a as _}from"./chunk-VAMOANYW.js";import{a as b}from"./chunk-PIONEQXI.js";import"./chunk-XUXEKCY2.js";import"./chunk-74SGAJAJ.js";import"./chunk-JY6W7FJK.js";import"./chunk-FMIR4NMA.js";import"./chunk-LO7DZIFS.js";import"./chunk-NV7QTS3L.js";import"./chunk-USLCZL6I.js";import"./chunk-IPX2D5AJ.js";import"./chunk-KCGE56W3.js";import"./chunk-XTKTKQIT.js";import"./chunk-3ZZ4QGEW.js";import"./chunk-SX5M6VA3.js";import"./chunk-CQHQSDDJ.js";import"./chunk-PH46EVF3.js";import"./chunk-P6L7NTH2.js";import"./chunk-GCW2PJGE.js";import"./chunk-2HT73DM2.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.js";import{spawn as N}from"child_process";import{existsSync as x,mkdirSync as k,readFileSync as A,writeFileSync as w,unlinkSync as M}from"fs";import{tmpdir as F}from"os";import{dirname as L,resolve as l,join as R,relative as C}from"path";function W(){try{let e=import.meta.resolve("sootsim/detox");return L(e.startsWith("file://")?e.slice(7):e)}catch{return l(import.meta.dirname,"..","..","detox")}}var B=`
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.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-JYADQK47.js";import{g as d,i as l,l as a}from"./chunk-25KNBRLI.js";import"./chunk-N7VEPGM7.js";import"./chunk-GADW4EOH.js";import"./chunk-MIJLFF2K.js";import"./chunk-PL6D2V4B.js";import"./chunk-K2V2S3VK.js";import{g as c,h as r,i as g}from"./chunk-JNEW6IZR.js";import"./chunk-LG3QMLIP.js";function h(){console.log(`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-JY6W7FJK.js";import{g as d,i as l,l as a}from"./chunk-KCGE56W3.js";import"./chunk-PH46EVF3.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import{g as c,h as r,i as g}from"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.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.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as E,i as R,l as b}from"./chunk-25KNBRLI.js";import"./chunk-MIJLFF2K.js";import{b as v}from"./chunk-PL6D2V4B.js";import"./chunk-K2V2S3VK.js";import"./chunk-LG3QMLIP.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.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as E,i as R,l as b}from"./chunk-KCGE56W3.js";import"./chunk-MVIWCOR3.js";import{b as v}from"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-FF7B5JFA.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
3
3
  sootsim get diagnosis \u2014 compact "what just went wrong?" report
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-O4QDSXAR.js";import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk-XTKTKQIT.js";import"./chunk-3ZZ4QGEW.js";import"./chunk-SX5M6VA3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-FF7B5JFA.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};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c,d,e,f,g,h}from"./chunk-WTJP6C4W.js";import{c as a,d as b}from"./chunk-7YKBZB7D.js";import"./chunk-2RJ57USW.js";import"./chunk-BCDCPHIB.js";import"./chunk-VAMOANYW.js";import"./chunk-PIONEQXI.js";import"./chunk-XUXEKCY2.js";import"./chunk-74SGAJAJ.js";import"./chunk-JY6W7FJK.js";import"./chunk-FMIR4NMA.js";import"./chunk-LO7DZIFS.js";import"./chunk-NV7QTS3L.js";import"./chunk-USLCZL6I.js";import"./chunk-IPX2D5AJ.js";import"./chunk-KCGE56W3.js";import"./chunk-XTKTKQIT.js";import"./chunk-3ZZ4QGEW.js";import"./chunk-SX5M6VA3.js";import"./chunk-CQHQSDDJ.js";import"./chunk-PH46EVF3.js";import"./chunk-P6L7NTH2.js";import"./chunk-GCW2PJGE.js";import"./chunk-2HT73DM2.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.js";export{e as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,g as hoistLeadingSimFlag,a as parseFlowFile,h as runFlow,f as runFlowPlayback,b as validateFlowFile};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-VMRT3K3M.js";import"./chunk-DO4AU4FA.js";import"./chunk-2HT73DM2.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-SVLKYHDO.js";import"./chunk-KEWZBN4M.js";import"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,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-K2V2S3VK.js";import"./chunk-LG3QMLIP.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,L as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,S as claimDaemonLockfile,K as compareSemver,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,O as isDaemonLockfileFresh,P as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,J as listInstalledRuntimes,q as profilesDir,H as readActiveRuntime,M as readDaemonLockfile,N as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,T as removeDaemonLockfile,U as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,Q as writeDaemonLockfile,R as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,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-KWAAJUF2.js";import"./chunk-FF7B5JFA.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,L as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,S as claimDaemonLockfile,K as compareSemver,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,O as isDaemonLockfileFresh,P as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,J as listInstalledRuntimes,q as profilesDir,H as readActiveRuntime,M as readDaemonLockfile,N as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,T as removeDaemonLockfile,U as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,Q as writeDaemonLockfile,R as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{j as a,k as b}from"./chunk-7YKBZB7D.js";import"./chunk-2RJ57USW.js";import"./chunk-XUXEKCY2.js";import"./chunk-74SGAJAJ.js";import"./chunk-JY6W7FJK.js";import"./chunk-FMIR4NMA.js";import"./chunk-LO7DZIFS.js";import"./chunk-NV7QTS3L.js";import"./chunk-USLCZL6I.js";import"./chunk-IPX2D5AJ.js";import"./chunk-KCGE56W3.js";import"./chunk-XTKTKQIT.js";import"./chunk-3ZZ4QGEW.js";import"./chunk-SX5M6VA3.js";import"./chunk-CQHQSDDJ.js";import"./chunk-PH46EVF3.js";import"./chunk-2HT73DM2.js";import"./chunk-XRUPDNSR.js";import"./chunk-MVIWCOR3.js";import"./chunk-QMS2S3EF.js";import"./chunk-KWAAJUF2.js";import"./chunk-T7SAFPA6.js";import"./chunk-FF7B5JFA.js";export{a as printShellPerfReport,b as runInspect};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-4X3L2WDG.js";import"./chunk-VCFHK3EU.js";import"./chunk-3ZZ4QGEW.js";import"./chunk-FF7B5JFA.js";export{a as runInstallDesktop};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as k,d as v}from"./chunk-DPPE2X5U.js";import"./chunk-K2V2S3VK.js";import"./chunk-LG3QMLIP.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",w="http://localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
1
+ /*! sootsim v0.1.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as k,d as v}from"./chunk-GCW2PJGE.js";import"./chunk-KWAAJUF2.js";import"./chunk-FF7B5JFA.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",w="http://localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
3
3
  sootsim login \u2014 sign in so uploads can attach to your account
4
4
 
5
5
  usage:
@@ -21,6 +21,6 @@ options:
21
21
  <p style="color:#ccc">${r}</p>
22
22
  </div>
23
23
  </body>
24
- </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-ETAYU7DW.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-ETAYU7DW.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("sootbean",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
24
+ </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-7K33P734.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-7K33P734.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("sootbean",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
25
25
  ${n.toString()}
26
- `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-ETAYU7DW.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-ETAYU7DW.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
26
+ `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-7K33P734.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-7K33P734.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.208 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as r,b as i}from"./chunk-HJHKHI5E.js";import{a as t,c as o}from"./chunk-DPPE2X5U.js";import"./chunk-K2V2S3VK.js";import"./chunk-LG3QMLIP.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.210 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-P6L7NTH2.js";import{a as t,c as o}from"./chunk-GCW2PJGE.js";import"./chunk-KWAAJUF2.js";import"./chunk-FF7B5JFA.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};