sootsim 0.1.165 → 0.1.167

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 (162) hide show
  1. package/README.md +7 -0
  2. package/dist-cli/bin.js +3 -3
  3. package/dist-cli/chunks/{agent-2EPUTBUL.js → agent-FGNA3LC6.js} +2 -2
  4. package/dist-cli/chunks/{agent-wrapper-VMZZJY7Y.js → agent-wrapper-5CRKG7K7.js} +2 -2
  5. package/dist-cli/chunks/{app-fonts-6L4RKPLM.js → app-fonts-CM3ML6NV.js} +2 -2
  6. package/dist-cli/chunks/{assert-7XQLVOIT.js → assert-DCO6XYDU.js} +2 -2
  7. package/dist-cli/chunks/auto-bootstrap-QJUHQLQH.js +2 -0
  8. package/dist-cli/chunks/beta-W5Y32GJR.js +2 -0
  9. package/dist-cli/chunks/{camera-F7ADKILD.js → camera-HWLYOMJV.js} +2 -2
  10. package/dist-cli/chunks/{chunk-5IXQLSHV.js → chunk-27CWE62K.js} +2 -2
  11. package/dist-cli/chunks/{chunk-32YLDVP3.js → chunk-2QPTZHGU.js} +2 -2
  12. package/dist-cli/chunks/{chunk-T3SJIJNN.js → chunk-2UGS25BK.js} +1 -1
  13. package/dist-cli/chunks/{chunk-WJHZQUAF.js → chunk-3MQAPPOW.js} +1 -1
  14. package/dist-cli/chunks/{chunk-QQXWV7VE.js → chunk-3RHECMKV.js} +4 -6
  15. package/dist-cli/chunks/{chunk-6WWYHNYI.js → chunk-47JNNTYQ.js} +1 -1
  16. package/dist-cli/chunks/chunk-7P6CUODK.js +1 -0
  17. package/dist-cli/chunks/{chunk-MF7QK7PS.js → chunk-AB6TZFIE.js} +1 -1
  18. package/dist-cli/chunks/{chunk-2N5FR2CU.js → chunk-ACNSMZSP.js} +1 -1
  19. package/dist-cli/chunks/chunk-BIG5BGMC.js +5 -0
  20. package/dist-cli/chunks/{chunk-ESGMJNNM.js → chunk-D6QVHHDU.js} +1 -1
  21. package/dist-cli/chunks/{chunk-XJQRNGCW.js → chunk-DAMNOIAJ.js} +5 -4
  22. package/dist-cli/chunks/{chunk-ALSMTP6C.js → chunk-DM2EOTY5.js} +2 -2
  23. package/dist-cli/chunks/{chunk-X3Q65CKA.js → chunk-DWYDDN7J.js} +2 -2
  24. package/dist-cli/chunks/chunk-E5E7XQIN.js +2 -0
  25. package/dist-cli/chunks/{chunk-HQZMG2HF.js → chunk-EIMDQRZS.js} +2 -2
  26. package/dist-cli/chunks/{chunk-TGNYK2JI.js → chunk-ELHNXEJI.js} +2 -2
  27. package/dist-cli/chunks/chunk-F2UUNDRU.js +119 -0
  28. package/dist-cli/chunks/chunk-F5PLWUIU.js +1 -0
  29. package/dist-cli/chunks/{chunk-XLVOIA4F.js → chunk-F5REXFAW.js} +23 -13
  30. package/dist-cli/chunks/{chunk-ZUY4EZUO.js → chunk-GNHGTWDX.js} +2 -2
  31. package/dist-cli/chunks/{chunk-FXQRRTHD.js → chunk-HCNW2QTI.js} +3 -3
  32. package/dist-cli/chunks/chunk-HHOQMAVJ.js +1 -0
  33. package/dist-cli/chunks/{chunk-YXQNPOHC.js → chunk-IV5NEIXZ.js} +2 -2
  34. package/dist-cli/chunks/{chunk-BZS6I346.js → chunk-JDFPPPPS.js} +1 -1
  35. package/dist-cli/chunks/{chunk-AA5UBYX7.js → chunk-JI72D4RY.js} +1 -1
  36. package/dist-cli/chunks/{chunk-5IIMWTMI.js → chunk-JL7K7EPF.js} +3 -3
  37. package/dist-cli/chunks/{chunk-AJD3G3DQ.js → chunk-KCETAALD.js} +2 -2
  38. package/dist-cli/chunks/{chunk-L3ZBX3DX.js → chunk-MGX3HHAR.js} +1 -1
  39. package/dist-cli/chunks/{chunk-HAJPACUR.js → chunk-MI7BLMGH.js} +2 -2
  40. package/dist-cli/chunks/chunk-MPUONWKJ.js +13 -0
  41. package/dist-cli/chunks/{chunk-EV5NG4AO.js → chunk-OGH3OCGP.js} +2 -2
  42. package/dist-cli/chunks/{chunk-J7YRSCPF.js → chunk-OKBGHUCY.js} +1 -1
  43. package/dist-cli/chunks/{chunk-43R7N2HR.js → chunk-PDPBZD5O.js} +1 -1
  44. package/dist-cli/chunks/{chunk-UYFIE5X3.js → chunk-QIXDVNSM.js} +6 -6
  45. package/dist-cli/chunks/{chunk-KMXETT3S.js → chunk-QX25ZRIQ.js} +2 -2
  46. package/dist-cli/chunks/{chunk-BVMLSYUA.js → chunk-RTBG543W.js} +2 -2
  47. package/dist-cli/chunks/{chunk-HA5LR3RI.js → chunk-SIRMLK54.js} +1 -1
  48. package/dist-cli/chunks/{chunk-DZPNBMAP.js → chunk-T4UHUISG.js} +1 -1
  49. package/dist-cli/chunks/{chunk-EGBFMW45.js → chunk-TFF3KXNC.js} +1 -1
  50. package/dist-cli/chunks/{chunk-6YEVWYSG.js → chunk-U7LLQDO4.js} +1 -1
  51. package/dist-cli/chunks/{chunk-53AQC5XE.js → chunk-UC7LRLPE.js} +1 -1
  52. package/dist-cli/chunks/chunk-UF2T46AA.js +3 -0
  53. package/dist-cli/chunks/{chunk-OXGEETXY.js → chunk-VCKKDUWG.js} +2 -2
  54. package/dist-cli/chunks/{chunk-FNUHS7EZ.js → chunk-WXFUXFY7.js} +2 -2
  55. package/dist-cli/chunks/{chunk-IIY2O6LJ.js → chunk-ZLZ3R452.js} +2 -2
  56. package/dist-cli/chunks/cli-version-RHOJPOQJ.js +2 -0
  57. package/dist-cli/chunks/{compat-VN34CJ6G.js → compat-WZAQMU3Y.js} +3 -3
  58. package/dist-cli/chunks/{config-XDZODP5I.js → config-EMVWQLSZ.js} +2 -2
  59. package/dist-cli/chunks/control-P3M34LCO.js +2 -0
  60. package/dist-cli/chunks/{cpu-profile-JFAHFE6I.js → cpu-profile-FIXB3BPM.js} +2 -2
  61. package/dist-cli/chunks/daemon-VPUPR3CK.js +67 -0
  62. package/dist-cli/chunks/{debug-ABBVZGOK.js → debug-QW2VVENB.js} +3 -3
  63. package/dist-cli/chunks/{detox-SIZWOR5E.js → detox-RLEEW5BN.js} +2 -2
  64. package/dist-cli/chunks/{device-RLXPXXPO.js → device-MCFZ5J5W.js} +2 -2
  65. package/dist-cli/chunks/{diagnose-V73S6VLC.js → diagnose-VSSY5XMS.js} +2 -2
  66. package/dist-cli/chunks/drivers-GPZ62RP5.js +2 -0
  67. package/dist-cli/chunks/{electron-YQR52UGK.js → electron-OD7H7UBA.js} +3 -3
  68. package/dist-cli/chunks/flow-JFSZHDB2.js +2 -0
  69. package/dist-cli/chunks/help-DFQRIC3T.js +2 -0
  70. package/dist-cli/chunks/{hints-ZL56EHFZ.js → hints-TU5HBDRY.js} +2 -2
  71. package/dist-cli/chunks/{home-paths-U4FRKF6W.js → home-paths-6WZQKHRA.js} +2 -2
  72. package/dist-cli/chunks/{inspect-LPQT5DTA.js → inspect-UNZ7Z5PF.js} +3 -3
  73. package/dist-cli/chunks/install-7JTNTNNX.js +2 -0
  74. package/dist-cli/chunks/{install-desktop-KEOL5MR2.js → install-desktop-6LB2C5H5.js} +3 -3
  75. package/dist-cli/chunks/{keys-7S22SCJL.js → keys-5XMDDDUV.js} +2 -2
  76. package/dist-cli/chunks/{launch-MP6Y7PAS.js → launch-RVQHYE5V.js} +3 -3
  77. package/dist-cli/chunks/{login-7IAUA2K7.js → login-BGMYYUK2.js} +4 -4
  78. package/dist-cli/chunks/{logout-L2KZIVSL.js → logout-PXZVOWLU.js} +2 -2
  79. package/dist-cli/chunks/{maestro-UPW6VRQA.js → maestro-RIGROEAZ.js} +2 -2
  80. package/dist-cli/chunks/optional-demo-registry-GQL6Z6OH.js +2 -0
  81. package/dist-cli/chunks/{preview-D4GRDZRM.js → preview-3XCXJMNU.js} +2 -2
  82. package/dist-cli/chunks/{profile-NU5AQZYQ.js → profile-7MQEP55V.js} +2 -2
  83. package/dist-cli/chunks/{react-FMBASJYN.js → react-BBOQIY6V.js} +2 -2
  84. package/dist-cli/chunks/{record-UGXBLMIS.js → record-4U2X6JDH.js} +4 -4
  85. package/dist-cli/chunks/runtime-HPZWCYML.js +2 -0
  86. package/dist-cli/chunks/{runtime-delivery-23LSZG33.js → runtime-delivery-VK2HCMQW.js} +2 -2
  87. package/dist-cli/chunks/screenshot-MCFHIP2H.js +35 -0
  88. package/dist-cli/chunks/{screenshot-mode-Y26AAZTJ.js → screenshot-mode-VJEAECKO.js} +2 -2
  89. package/dist-cli/chunks/{screenshots-OWPSRJ5A.js → screenshots-3NSCRA3U.js} +2 -2
  90. package/dist-cli/chunks/{server-3ZCQ257D.js → server-HIPHVNKP.js} +3 -3
  91. package/dist-cli/chunks/setup-repo-LFSW66HX.js +2 -0
  92. package/dist-cli/chunks/{skills-BF5OYDL4.js → skills-JILZXX7E.js} +2 -2
  93. package/dist-cli/chunks/{slides-NI6F3FRT.js → slides-IWZX6TCC.js} +2 -2
  94. package/dist-cli/chunks/{start-PN6254AD.js → start-4RYQMQMM.js} +4 -4
  95. package/dist-cli/chunks/store-RGD3TDGI.js +2 -0
  96. package/dist-cli/chunks/telemetry-7TRVV4JE.js +2 -0
  97. package/dist-cli/chunks/{test-GYLIVGBO.js → test-VQ6HIPKR.js} +3 -3
  98. package/dist-cli/chunks/{three-mode-BXCPBK7G.js → three-mode-UWH72A46.js} +2 -2
  99. package/dist-cli/chunks/{timeline-RR75CYQP.js → timeline-T6LM4W3H.js} +2 -2
  100. package/dist-cli/chunks/{upgrade-POFEYCZJ.js → upgrade-KEJ2H2WE.js} +2 -2
  101. package/dist-cli/chunks/upload-BWSIC24N.js +2 -0
  102. package/dist-cli/chunks/{version-ZIW3AABE.js → version-PIJ2OP5O.js} +2 -2
  103. package/dist-cli/chunks/{web-AMUML35L.js → web-DCGXY52J.js} +2 -2
  104. package/dist-cli/chunks/{what-happened-YRVA42P7.js → what-happened-CUA3N455.js} +2 -2
  105. package/dist-cli/chunks/{whoami-TIO2K57H.js → whoami-Z5XNGCGJ.js} +2 -2
  106. package/dist-lib/agent-daemon-client.cjs +1 -1
  107. package/dist-lib/agent-events.cjs +1 -1
  108. package/dist-lib/agent-sessions.cjs +1 -1
  109. package/dist-lib/attached-projects.cjs +1 -1
  110. package/dist-lib/auth/shared-session.cjs +1 -1
  111. package/dist-lib/backend-origin.cjs +1 -1
  112. package/dist-lib/beta.cjs +1 -1
  113. package/dist-lib/beta.mjs +1 -1
  114. package/dist-lib/bridge-constants.cjs +1 -1
  115. package/dist-lib/cli-constants.cjs +1 -1
  116. package/dist-lib/config.cjs +1 -1
  117. package/dist-lib/detox/index.cjs +1 -1
  118. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  119. package/dist-lib/home-paths.cjs +1 -1
  120. package/dist-lib/host/bridge-host.cjs +1 -1
  121. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  122. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  123. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  124. package/dist-lib/host/websocket-proxy.cjs +1 -1
  125. package/dist-lib/index.cjs +1 -1
  126. package/dist-lib/menu.cjs +1 -1
  127. package/dist-lib/menu.mjs +1 -1
  128. package/dist-lib/metro.cjs +1 -1
  129. package/dist-lib/profiles.cjs +1 -1
  130. package/dist-lib/render-mode.cjs +1 -1
  131. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  132. package/dist-lib/sdk.cjs +1 -1
  133. package/dist-lib/sdk.mjs +1 -1
  134. package/dist-lib/skills.cjs +1 -1
  135. package/dist-lib/vite.cjs +1 -1
  136. package/package.json +4 -2
  137. package/scripts/preuninstall.cjs +118 -0
  138. package/src/native-dev-bundle-url.ts +22 -0
  139. package/dist-cli/chunks/auto-bootstrap-GOOU4KQE.js +0 -2
  140. package/dist-cli/chunks/beta-CRII6BIU.js +0 -2
  141. package/dist-cli/chunks/chunk-5QWSPJHN.js +0 -13
  142. package/dist-cli/chunks/chunk-HFPCHOKV.js +0 -2
  143. package/dist-cli/chunks/chunk-HKCO4GFF.js +0 -5
  144. package/dist-cli/chunks/chunk-M72THY5Y.js +0 -1
  145. package/dist-cli/chunks/chunk-O4J2RSBF.js +0 -119
  146. package/dist-cli/chunks/chunk-RAS5AWIY.js +0 -1
  147. package/dist-cli/chunks/chunk-X3TVSME2.js +0 -3
  148. package/dist-cli/chunks/chunk-YIZQFYDE.js +0 -1
  149. package/dist-cli/chunks/cli-version-EJUVAAK3.js +0 -2
  150. package/dist-cli/chunks/control-QUGPN5RE.js +0 -2
  151. package/dist-cli/chunks/daemon-TUYHAVYA.js +0 -67
  152. package/dist-cli/chunks/drivers-HBCRUONZ.js +0 -2
  153. package/dist-cli/chunks/flow-VY5435YB.js +0 -2
  154. package/dist-cli/chunks/help-GCFMWV2P.js +0 -2
  155. package/dist-cli/chunks/install-HLUFKIYY.js +0 -2
  156. package/dist-cli/chunks/optional-demo-registry-WSPMNQX5.js +0 -2
  157. package/dist-cli/chunks/runtime-QAQWW2CP.js +0 -2
  158. package/dist-cli/chunks/screenshot-RFDYG3WW.js +0 -35
  159. package/dist-cli/chunks/setup-repo-IT6HNGID.js +0 -2
  160. package/dist-cli/chunks/store-NU4G6MAF.js +0 -2
  161. package/dist-cli/chunks/telemetry-WZFPP7XR.js +0 -2
  162. package/dist-cli/chunks/upload-NHL3ZR6J.js +0 -2
@@ -0,0 +1,67 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as R,b as O}from"./chunk-OGH3OCGP.js";import"./chunk-DM2EOTY5.js";import{c as U}from"./chunk-QIXDVNSM.js";import"./chunk-VCKKDUWG.js";import"./chunk-F2UUNDRU.js";import"./chunk-UF2T46AA.js";import"./chunk-E5E7XQIN.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-SIRMLK54.js";import"./chunk-2UGS25BK.js";import"./chunk-OKBGHUCY.js";import{f as T,h as _,i as C,q as N,r as S,s as B}from"./chunk-TFF3KXNC.js";import{a as X}from"./chunk-ACNSMZSP.js";import{execFileSync as st,spawnSync as n}from"child_process";import{existsSync as c,mkdirSync as b,readFileSync as nt,rmSync as h,writeFileSync as V}from"fs";import{homedir as w}from"os";import{dirname as G,resolve as f}from"path";import{execFileSync as Q}from"child_process";import{chmodSync as z,mkdirSync as E,rmSync as J,writeFileSync as L}from"fs";import{dirname as A}from"path";var Z="dev.sootsim.daemon",F="SootSim Daemon",M="0.1.36";function j(t,e,r){let o=S(),s=B(),a=A(A(s)),l=A(s),u=`${a}/Resources`;J(o,{recursive:!0,force:!0}),E(N(),{recursive:!0}),E(l,{recursive:!0}),E(u,{recursive:!0}),L(`${a}/Info.plist`,tt()),L(`${a}/PkgInfo`,"APPL????"),L(s,et(t,e,r)),z(s,493);try{Q("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(i){let d=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${o} failed: ${d}
3
+ the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:o,launcherPath:s}}function tt(){return`<?xml version="1.0" encoding="UTF-8"?>
4
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
5
+ <plist version="1.0">
6
+ <dict>
7
+ <key>CFBundleDevelopmentRegion</key><string>en</string>
8
+ <key>CFBundleDisplayName</key><string>${F}</string>
9
+ <key>CFBundleExecutable</key><string>sootsim-daemon</string>
10
+ <key>CFBundleIdentifier</key><string>${Z}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key><string>6.0</string>
12
+ <key>CFBundleName</key><string>${F}</string>
13
+ <key>CFBundlePackageType</key><string>APPL</string>
14
+ <key>CFBundleShortVersionString</key><string>${M}</string>
15
+ <key>CFBundleSignature</key><string>????</string>
16
+ <key>CFBundleVersion</key><string>${M}</string>
17
+ <key>LSBackgroundOnly</key><true/>
18
+ <key>LSUIElement</key><true/>
19
+ <key>LSMinimumSystemVersion</key><string>13.0</string>
20
+ <key>NSHumanReadableCopyright</key><string>Tamagui LLC</string>
21
+ </dict>
22
+ </plist>
23
+ `}function et(t,e,r){let s=[t.executable,...t.prefixArgs,"server","--quiet","--port",String(e)].map(rt).join(" ");return`#!/bin/sh
24
+ # SootSim Daemon launcher \u2014 auto-generated by 'sootsim daemon install'.
25
+ # launchd spawns this; we exec the real sootsim invocation in place so
26
+ # launchd tracks the daemon process, not the shell wrapper.
27
+ #
28
+ # stdout: ${r.stdout}
29
+ # stderr: ${r.stderr}
30
+ exec ${s}
31
+ `}function rt(t){return`'${t.replace(/'/g,"'\\''")}'`}var q=60,y="dev.sootsim.daemon",P="dev.sootsim.server",m="sootsim-server",g=f(w(),"Library/Logs/sootsim"),k=f(w(),".local/state/sootsim");async function Rt(t,e={}){let[r,...o]=t,s=e.port??7668;if(!r||r==="--help"||r==="-h"){H();return}new Set(["install","uninstall","restart","start","stop","logs"]).has(r)&&R({event:`daemon_${r}`,properties:{platform:process.platform,subsource:"daemon"}});try{switch(r){case"install":return await pt({port:s,force:o.includes("--force")});case"uninstall":return await ft();case"status":return await yt();case"restart":return await ht();case"start":return await $t();case"stop":return await wt();case"logs":return await vt(o);default:console.error(` unknown daemon subcommand: ${r}`),H(),process.exit(1)}}finally{await O()}}function H(){U("daemon")}function it(){let t=at();return{executable:process.execPath,prefixArgs:[t]}}function at(){try{let e=st("which",["sootsim"],{encoding:"utf8"}).trim();if(e&&c(e))return Y(e)}catch{}let t=process.argv[1];if(t&&c(t))return Y(t);throw new Error("could not locate the sootsim binary")}function Y(t){try{return X("fs").realpathSync(t)}catch{return t}}function ct(t,e){b(g,{recursive:!0});let r=f(g,"server.out.log"),o=f(g,"server.err.log"),{launcherPath:s}=j(t,e,{stdout:r,stderr:o}),a=` <string>${ut(s)}</string>`;return`<?xml version="1.0" encoding="UTF-8"?>
32
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
+ <plist version="1.0">
34
+ <dict>
35
+ <key>Label</key><string>${y}</string>
36
+ <key>ProgramArguments</key>
37
+ <array>
38
+ ${a}
39
+ </array>
40
+ <key>RunAtLoad</key><true/>
41
+ <key>KeepAlive</key><true/>
42
+ <key>ThrottleInterval</key><integer>${q}</integer>
43
+ <key>ProcessType</key><string>Background</string>
44
+ <key>StandardOutPath</key><string>${r}</string>
45
+ <key>StandardErrorPath</key><string>${o}</string>
46
+ </dict>
47
+ </plist>
48
+ `}function lt(t,e){return b(k,{recursive:!0}),`[Unit]
49
+ Description=sootsim bridge daemon
50
+ After=default.target
51
+
52
+ [Service]
53
+ Type=simple
54
+ ExecStart=${[t.executable,...t.prefixArgs].map(dt).join(" ")} server --quiet --port ${e}
55
+ Restart=always
56
+ RestartSec=${q}
57
+
58
+ [Install]
59
+ WantedBy=default.target
60
+ `}function ut(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function dt(t){return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}function x(){return f(w(),"Library/LaunchAgents",`${y}.plist`)}function W(){return f(w(),"Library/LaunchAgents",`${P}.plist`)}function D(){return f(w(),".config/systemd/user",`${m}.service`)}function K(){let t=W();return c(t)?(n("launchctl",["bootout",`gui/${process.getuid()}/${P}`],{stdio:"ignore"}),h(t,{force:!0}),!0):!1}async function pt({port:t,force:e}){if(C()){let o=_()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new Error(`refusing to install the persistent sootsim daemon agent \u2014 ${o}.
61
+ the launchd / systemd agent would point at workspace artifacts / dev env that
62
+ change between sessions, and would serve stale prod-built engine assets instead
63
+ of the live \`bun dev:sootsim\` output. start the daemon manually in another
64
+ shell with: sootsim server
65
+ (set SOOTSIM_FORCE_DAEMON_INSTALL=1 to override.)`)}let r=it();if(console.log(` binary: ${[r.executable,...r.prefixArgs].join(" ")}`),console.log(` port: ${t}`),process.platform==="darwin"){K()&&console.log(` migrated away from legacy ${P} plist`);let o=x();if(c(o)&&!e){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}b(G(o),{recursive:!0}),V(o,ct(r,t)),console.log(` wrote ${o}`);let s=`gui/${process.getuid()}`,a=`${s}/${y}`,l=()=>{let p=n("launchctl",["bootstrap",s,o],{stdio:"pipe",encoding:"utf8"}),v=(p.stderr||p.stdout||"").trim();if(p.status!==0)return{ok:!1,reason:`bootstrap exit ${p.status}${v?`: ${v}`:""}`};let I=n("launchctl",["print",a],{encoding:"utf8"});return I.status!==0?{ok:!1,reason:`bootstrap returned 0 but service not registered (print exit ${I.status})`}:{ok:!0}},u=l();if(!u.ok){let p=u.reason;if(n("launchctl",["bootout",a],{stdio:"ignore"}),u=l(),!u.ok)throw new Error(`launchctl bootstrap failed: ${u.reason}`+(p!==u.reason?` (initial: ${p})`:"")+" \u2014 try `sootsim daemon uninstall` then retry, or reboot if launchd state is stuck.")}let i=Date.now()+4e3,d,$;for(;Date.now()<i;){let p=n("launchctl",["print",a],{encoding:"utf8"});if(p.status===0&&(d=p.stdout?.match(/state\s*=\s*(\w+)/)?.[1],$=p.stdout?.match(/pid\s*=\s*(\d+)/)?.[1],d==="running"||$))break;await new Promise(v=>setTimeout(v,150))}if(d!=="running"&&!$)throw new Error(`daemon registered but did not reach running state within 4s (last state: ${d||"unknown"}). check ${f(g,"server.err.log")} \u2014 typically a stale runtime or a port already bound by another process.`);console.log(` registered (state: ${d||"unknown"}${$?`, pid ${$}`:""}, log: ${f(g,"server.err.log")})`);return}if(process.platform==="linux"){let o=D();if(c(o)&&!e){console.log(` already installed at ${o}`),console.log(" pass --force to overwrite, or use 'sootsim daemon restart' to reload");return}b(G(o),{recursive:!0}),V(o,lt(r,t)),console.log(` wrote ${o}`);let s=n("systemctl",["--user","daemon-reload"],{stdio:"pipe",encoding:"utf8"});if(s.status!==0){let i=(s.stderr||s.stdout||"").trim();throw new Error(`systemctl daemon-reload failed${i?`: ${i}`:""}`)}let a=n("systemctl",["--user","enable","--now",m],{stdio:"pipe",encoding:"utf8"});if(a.status!==0){let i=(a.stderr||a.stdout||"").trim();throw new Error(`systemctl enable --now failed${i?`: ${i}`:""} \u2014 try \`sootsim daemon uninstall\` then retry.`)}let u=(n("systemctl",["--user","is-active",m],{encoding:"utf8"}).stdout||"").trim()||"unknown";console.log(` registered (state: ${u}, journalctl --user -u ${m} to tail logs)`);try{let i=process.env.USER||process.env.LOGNAME||"";if(i){let d=n("loginctl",["show-user",i,"--property=Linger","--value"],{encoding:"utf8"});!((d.stdout||"").trim().toLowerCase()==="yes")&&d.status===0&&console.log(` note: linger is not enabled for "${i}". the daemon will exit at logout.
66
+ enable persistence with: sudo loginctl enable-linger ${i}`)}}catch{}return}console.error(` sootsim daemon install is not supported on ${process.platform}`),console.error(" run 'sootsim server' in a persistent shell instead"),process.exit(1)}function mt(){let t=[];if(process.platform==="darwin"){let e=x();K()&&t.push(W()),c(e)&&(n("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"ignore"}),h(e,{force:!0}),t.push(e));let o=S();return c(o)&&(h(o,{recursive:!0,force:!0}),t.push(o)),c(g)&&(h(g,{recursive:!0,force:!0}),t.push(g)),{removed:t,missing:t.length===0}}if(process.platform==="linux"){let e=D();return c(e)&&(n("systemctl",["--user","disable","--now",m],{stdio:"ignore"}),h(e,{force:!0}),n("systemctl",["--user","daemon-reload"],{stdio:"ignore"}),n("systemctl",["--user","reset-failed",m],{stdio:"ignore"}),t.push(e)),c(k)&&(h(k,{recursive:!0,force:!0}),t.push(k)),{removed:t,missing:t.length===0}}return{removed:t,missing:!0}}function gt(){let t=[],e=T();return c(e)&&(h(e,{recursive:!0,force:!0}),t.push(e)),{removed:t,missing:t.length===0}}async function ft(){let t=mt();for(let r of t.removed)console.log(` removed ${r}`);let e=gt();for(let r of e.removed)console.log(` removed ${r}`);t.missing&&e.missing&&console.log(" not installed")}async function yt(){if(process.platform==="darwin"){let t=x();if(!c(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=St(t);e&&console.log(` binary: ${e}`);let r=n("launchctl",["print",`gui/${process.getuid()}/${y}`],{encoding:"utf8"});if(r.status===0){let o=r.stdout.match(/state\s*=\s*(\w+)/)?.[1],s=r.stdout.match(/pid\s*=\s*(\d+)/)?.[1];console.log(` state: ${o||"unknown"}${s?` (pid ${s})`:""}`)}else console.log(" state: not running");return}if(process.platform==="linux"){let t=D();if(!c(t)){console.log(" installed: no");return}console.log(` installed: yes (${t})`);let e=n("systemctl",["--user","is-active",m],{encoding:"utf8"});console.log(` state: ${e.stdout.trim()||"unknown"}`);return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function ht(){if(process.platform==="darwin"){let t=x();c(t)||(console.error(" daemon not registered \u2014 run any sootsim command to bootstrap it"),process.exit(1));let e=n("launchctl",["kickstart","-k",`gui/${process.getuid()}/${y}`],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` kickstart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}if(process.platform==="linux"){let t=D();c(t)||(console.error(" daemon not registered \u2014 run any sootsim command to bootstrap it"),process.exit(1));let e=n("systemctl",["--user","restart",m],{stdio:"pipe",encoding:"utf8"});e.status!==0&&(console.error(` restart failed: ${e.stderr?.trim()}`),process.exit(1)),console.log(" restarted");return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function $t(){if(process.platform==="darwin"){n("launchctl",["kickstart",`gui/${process.getuid()}/${y}`],{stdio:"inherit"});return}if(process.platform==="linux"){n("systemctl",["--user","start",m],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function wt(){if(process.platform==="darwin"){n("launchctl",["bootout",`gui/${process.getuid()}/${y}`],{stdio:"inherit"});return}if(process.platform==="linux"){n("systemctl",["--user","stop",m],{stdio:"inherit"});return}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}async function vt(t){let e=t.find(s=>/^-n\d+$|^--lines=\d+$|^\d+$/.test(s)),r=e?Number(e.replace(/\D/g,"")):200,o=t.includes("-f")||t.includes("--follow");if(process.platform==="darwin"){let s=f(g,"server.out.log"),a=f(g,"server.err.log"),l=[s,a].filter(i=>c(i));l.length===0&&(console.error(` no daemon logs yet at ${g} \u2014 run any sootsim command to start the daemon`),process.exit(1));let u=o?["-n",String(r),"-F",...l]:["-n",String(r),...l];n("tail",u,{stdio:"inherit"});return}if(process.platform==="linux"){let s=`${m}.service`,a=["--user","-u",s,"-n",String(r),"--no-pager"],l=n("journalctl",o?[...a,"-f"]:a,{encoding:"utf8",stdio:o?"inherit":"pipe"});if(o)return;let u=`${l.stdout||""}${l.stderr||""}`,i=/insufficient permissions|No journal files were opened/i.test(u);if(l.status===0&&!i){process.stdout.write(l.stdout||"");return}let d=n("journalctl",[`_SYSTEMD_USER_UNIT=${s}`,"-n",String(r),"--no-pager"],{encoding:"utf8"});if(d.status===0&&(d.stdout||"").trim()){process.stdout.write(d.stdout);return}console.error(` could not read --user journal for ${s} (this user isn't in the systemd-journal group yet).
67
+ run: sudo journalctl _SYSTEMD_USER_UNIT=${s} -n ${r} --no-pager`),process.exit(1)}console.error(` unsupported platform: ${process.platform}`),process.exit(1)}function St(t){try{return nt(t,"utf8").match(/<array>\s*<string>([^<]+)<\/string>/)?.[1]||null}catch{return null}}export{pt as daemonInstall,Rt as runDaemon,mt as teardownDaemonService,gt as teardownSootsimHome};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{f,m as T}from"./chunk-32YLDVP3.js";import{J as A,K as D,L as O,M as x,N as v}from"./chunk-MF7QK7PS.js";import{c as S,e as $,g as N}from"./chunk-IIY2O6LJ.js";import"./chunk-ESGMJNNM.js";import"./chunk-6YEVWYSG.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{f,m as T}from"./chunk-2QPTZHGU.js";import{J as A,K as D,L as O,M as x,N as v}from"./chunk-AB6TZFIE.js";import{c as S,e as $,g as N}from"./chunk-ZLZ3R452.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
3
3
  sootsim debug \u2014 drive __sootsimDebug from the terminal
4
4
 
5
5
  usage:
@@ -167,7 +167,7 @@ examples:
167
167
  } : null,
168
168
  samples,
169
169
  }
170
- })()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-LPQT5DTA.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
170
+ })()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-UNZ7Z5PF.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
171
171
  known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await A(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 D(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
172
172
  const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
173
173
  if (!d) return null;
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as S}from"./chunk-FXQRRTHD.js";import"./chunk-HQZMG2HF.js";import"./chunk-M72THY5Y.js";import"./chunk-TGNYK2JI.js";import"./chunk-5IXQLSHV.js";import"./chunk-FNUHS7EZ.js";import"./chunk-ZUY4EZUO.js";import"./chunk-5QWSPJHN.js";import"./chunk-HKCO4GFF.js";import"./chunk-32YLDVP3.js";import"./chunk-MF7QK7PS.js";import"./chunk-BZS6I346.js";import"./chunk-6WWYHNYI.js";import"./chunk-IIY2O6LJ.js";import"./chunk-WJHZQUAF.js";import"./chunk-XJQRNGCW.js";import"./chunk-L3ZBX3DX.js";import"./chunk-HAJPACUR.js";import"./chunk-RAS5AWIY.js";import"./chunk-43R7N2HR.js";import"./chunk-ESGMJNNM.js";import"./chunk-EV5NG4AO.js";import"./chunk-ALSMTP6C.js";import"./chunk-OXGEETXY.js";import"./chunk-HFPCHOKV.js";import"./chunk-6YEVWYSG.js";import"./chunk-X3Q65CKA.js";import"./chunk-J7YRSCPF.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as S}from"./chunk-HCNW2QTI.js";import"./chunk-EIMDQRZS.js";import"./chunk-HHOQMAVJ.js";import"./chunk-ELHNXEJI.js";import"./chunk-27CWE62K.js";import"./chunk-WXFUXFY7.js";import"./chunk-GNHGTWDX.js";import"./chunk-MPUONWKJ.js";import"./chunk-BIG5BGMC.js";import"./chunk-2QPTZHGU.js";import"./chunk-AB6TZFIE.js";import"./chunk-JDFPPPPS.js";import"./chunk-47JNNTYQ.js";import"./chunk-ZLZ3R452.js";import"./chunk-3MQAPPOW.js";import"./chunk-DAMNOIAJ.js";import"./chunk-MGX3HHAR.js";import"./chunk-MI7BLMGH.js";import"./chunk-7P6CUODK.js";import"./chunk-PDPBZD5O.js";import"./chunk-OGH3OCGP.js";import"./chunk-DM2EOTY5.js";import"./chunk-VCKKDUWG.js";import"./chunk-E5E7XQIN.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-DWYDDN7J.js";import"./chunk-OKBGHUCY.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
3
3
  sootsim detox \u2014 run detox-style tests against a sootsim shell
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-M72THY5Y.js";import{c as d,e as l,h as a}from"./chunk-IIY2O6LJ.js";import"./chunk-ESGMJNNM.js";import"./chunk-OXGEETXY.js";import"./chunk-6YEVWYSG.js";import"./chunk-X3Q65CKA.js";import{g as c,h as r,i as g}from"./chunk-J7YRSCPF.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";function h(){console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-HHOQMAVJ.js";import{c as d,e as l,h as a}from"./chunk-ZLZ3R452.js";import"./chunk-VCKKDUWG.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-DWYDDN7J.js";import{g as c,h as r,i as g}from"./chunk-OKBGHUCY.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.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.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as E,e as R,h as b}from"./chunk-IIY2O6LJ.js";import{b as v}from"./chunk-ESGMJNNM.js";import"./chunk-6YEVWYSG.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.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.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as E,e as R,h as b}from"./chunk-ZLZ3R452.js";import"./chunk-U7LLQDO4.js";import{b as v}from"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
3
3
  sootsim diagnose \u2014 compact "what just went wrong?" report
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-F5PLWUIU.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-DAMNOIAJ.js";import"./chunk-MGX3HHAR.js";import"./chunk-MI7BLMGH.js";import"./chunk-7P6CUODK.js";import"./chunk-PDPBZD5O.js";import"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-AA5UBYX7.js";import"./chunk-YIZQFYDE.js";import{a as v,g as h}from"./chunk-5QWSPJHN.js";import"./chunk-HKCO4GFF.js";import"./chunk-32YLDVP3.js";import"./chunk-MF7QK7PS.js";import"./chunk-BZS6I346.js";import"./chunk-6WWYHNYI.js";import"./chunk-IIY2O6LJ.js";import"./chunk-WJHZQUAF.js";import{b as f,g as u}from"./chunk-XJQRNGCW.js";import{a as p}from"./chunk-L3ZBX3DX.js";import{c as m}from"./chunk-HAJPACUR.js";import"./chunk-RAS5AWIY.js";import"./chunk-43R7N2HR.js";import"./chunk-ESGMJNNM.js";import"./chunk-HFPCHOKV.js";import"./chunk-6YEVWYSG.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-JI72D4RY.js";import"./chunk-F5PLWUIU.js";import{a as v,g as h}from"./chunk-MPUONWKJ.js";import"./chunk-BIG5BGMC.js";import"./chunk-2QPTZHGU.js";import"./chunk-AB6TZFIE.js";import"./chunk-JDFPPPPS.js";import"./chunk-47JNNTYQ.js";import"./chunk-ZLZ3R452.js";import"./chunk-3MQAPPOW.js";import{b as f,g as u}from"./chunk-DAMNOIAJ.js";import{a as p}from"./chunk-MGX3HHAR.js";import{c as m}from"./chunk-MI7BLMGH.js";import"./chunk-7P6CUODK.js";import"./chunk-PDPBZD5O.js";import"./chunk-E5E7XQIN.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim electron \u2014 launch the desktop companion
4
4
 
5
5
  usage:
@@ -15,4 +15,4 @@ examples:
15
15
  sootsim electron
16
16
  sootsim electron --port 5173
17
17
  sootsim electron --profile qa
18
- `),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-KEOL5MR2.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
18
+ `),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-6LB2C5H5.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as c,b as d,c as e,d as f}from"./chunk-HCNW2QTI.js";import"./chunk-EIMDQRZS.js";import"./chunk-HHOQMAVJ.js";import"./chunk-ELHNXEJI.js";import"./chunk-27CWE62K.js";import"./chunk-WXFUXFY7.js";import{c as a,d as b}from"./chunk-GNHGTWDX.js";import"./chunk-MPUONWKJ.js";import"./chunk-BIG5BGMC.js";import"./chunk-2QPTZHGU.js";import"./chunk-AB6TZFIE.js";import"./chunk-JDFPPPPS.js";import"./chunk-47JNNTYQ.js";import"./chunk-ZLZ3R452.js";import"./chunk-3MQAPPOW.js";import"./chunk-DAMNOIAJ.js";import"./chunk-MGX3HHAR.js";import"./chunk-MI7BLMGH.js";import"./chunk-7P6CUODK.js";import"./chunk-PDPBZD5O.js";import"./chunk-OGH3OCGP.js";import"./chunk-DM2EOTY5.js";import"./chunk-VCKKDUWG.js";import"./chunk-E5E7XQIN.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-DWYDDN7J.js";import"./chunk-OKBGHUCY.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-QIXDVNSM.js";import"./chunk-VCKKDUWG.js";import"./chunk-F2UUNDRU.js";import"./chunk-UF2T46AA.js";import"./chunk-E5E7XQIN.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-SIRMLK54.js";import"./chunk-2UGS25BK.js";import"./chunk-OKBGHUCY.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as n,c as r,d as l}from"./chunk-X3TVSME2.js";import"./chunk-ESGMJNNM.js";import"./chunk-2N5FR2CU.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as n,c as r,d as l}from"./chunk-UF2T46AA.js";import"./chunk-D6QVHHDU.js";import"./chunk-ACNSMZSP.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A,B,C,D,E,F,G,H,I,J,K,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-EGBFMW45.js";import"./chunk-2N5FR2CU.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,F as activeRuntimeDir,l as activeRuntimeFile,t as cacheDir,J as claimDaemonLockfile,E as compareSemver,v as configFilePath,r as daemonAppBundlePath,q as daemonAppDir,s as daemonAppLauncherPath,u as daemonLockfilePath,m as electronDir,n as electronUserDataDir,o as electronVersionDir,A as ensureSootsimHome,H as isDaemonLockfileFresh,h as isDevWorkstation,g as isSootsimDevCheckout,D as listInstalledRuntimes,p as profilesDir,B as readActiveRuntime,G as readDaemonLockfile,w as readSharedConfig,y as readTelemetryEnabled,K as removeDaemonLockfile,k as runtimeDir,j as runtimesDir,i as shouldSkipPersistentDaemon,f as sootsimHomeDir,C as writeActiveRuntime,I as writeDaemonLockfile,x as writeSharedConfig,z as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A,B,C,D,E,F,G,H,I,J,K,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-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,F as activeRuntimeDir,l as activeRuntimeFile,t as cacheDir,J as claimDaemonLockfile,E as compareSemver,v as configFilePath,r as daemonAppBundlePath,q as daemonAppDir,s as daemonAppLauncherPath,u as daemonLockfilePath,m as electronDir,n as electronUserDataDir,o as electronVersionDir,A as ensureSootsimHome,H as isDaemonLockfileFresh,h as isDevWorkstation,g as isSootsimDevCheckout,D as listInstalledRuntimes,p as profilesDir,B as readActiveRuntime,G as readDaemonLockfile,w as readSharedConfig,y as readTelemetryEnabled,K as removeDaemonLockfile,k as runtimeDir,j as runtimesDir,i as shouldSkipPersistentDaemon,f as sootsimHomeDir,C as writeActiveRuntime,I as writeDaemonLockfile,x as writeSharedConfig,z as writeTelemetryEnabled};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as Y}from"./chunk-X3TVSME2.js";import{a as vt,b as kt}from"./chunk-53AQC5XE.js";import{a as Qe,g as ve,j as te}from"./chunk-ZUY4EZUO.js";import{b as Tt,c as Mt,j as It}from"./chunk-5QWSPJHN.js";import"./chunk-HKCO4GFF.js";import{a as ee,b as A,c as P,d as Re,e as ie,f as G,g as ue,h as fe,i as xt,j as $t,k as De,l as St}from"./chunk-32YLDVP3.js";import{A as gt,B as yt,F as ht,H as ce,I as bt,O as wt,a as xe,b as Ze,c as et,d as tt,e as ot,f as st,g as nt,h as rt,i as it,j as at,k as Ae,l as Pe,q as Ee,r as lt,s as ct,t as $e,u as ut,v as Se,w as dt,x as mt,y as pt,z as ft}from"./chunk-MF7QK7PS.js";import"./chunk-BZS6I346.js";import"./chunk-6WWYHNYI.js";import{c as Ge,e as Ye,f as Xe,g as Ve,h as Oe}from"./chunk-IIY2O6LJ.js";import"./chunk-WJHZQUAF.js";import"./chunk-XJQRNGCW.js";import"./chunk-L3ZBX3DX.js";import"./chunk-HAJPACUR.js";import"./chunk-RAS5AWIY.js";import"./chunk-43R7N2HR.js";import{b as ze}from"./chunk-ESGMJNNM.js";import{a as Ke}from"./chunk-KMXETT3S.js";import{a as Fe,c as _e}from"./chunk-O4J2RSBF.js";import{a as Ue}from"./chunk-HFPCHOKV.js";import"./chunk-6YEVWYSG.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";import{existsSync as fo,mkdirSync as go,readFileSync as yo,rmSync as Nt,writeFileSync as ho}from"fs";import{tmpdir as bo}from"os";import{dirname as wo,join as xo,resolve as $o}from"path";var ge=1,So="SOOTSIM_INSPECT_NOTICE_PATH",vo=300*1e3,ko=15e3;function Ft(){return $o(process.env[So]||xo(bo(),"sootsim-inspect-notice-state.json"))}function To(e,l){return Object.fromEntries(Object.entries(e).filter(([,n])=>typeof n?.signature=="string"&&Number.isFinite(n?.updatedAt)&&l-n.updatedAt<=vo))}function Mo(e){let l=Ft();if(!fo(l))return{version:ge,entries:{}};try{let n=JSON.parse(yo(l,"utf8"));return n.version!==ge||!n.entries||typeof n.entries!="object"?(Nt(l,{force:!0}),{version:ge,entries:{}}):{version:ge,entries:To(n.entries,e)}}catch{return Nt(l,{force:!0}),{version:ge,entries:{}}}}function Io(e){let l=Ft();go(wo(l),{recursive:!0}),ho(l,JSON.stringify(e,null,2)+`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as vt,b as kt}from"./chunk-UC7LRLPE.js";import{a as Qe,g as ve,j as te}from"./chunk-GNHGTWDX.js";import{b as Tt,c as Mt,j as It}from"./chunk-MPUONWKJ.js";import"./chunk-BIG5BGMC.js";import{a as ee,b as A,c as P,d as Re,e as ie,f as G,g as ue,h as fe,i as xt,j as $t,k as De,l as St}from"./chunk-2QPTZHGU.js";import{A as gt,B as yt,F as ht,H as ce,I as bt,O as wt,a as xe,b as Ze,c as et,d as tt,e as ot,f as st,g as nt,h as rt,i as it,j as at,k as Ae,l as Pe,q as Ee,r as lt,s as ct,t as $e,u as ut,v as Se,w as dt,x as mt,y as pt,z as ft}from"./chunk-AB6TZFIE.js";import"./chunk-JDFPPPPS.js";import"./chunk-47JNNTYQ.js";import{c as Ge,e as Ye,f as Xe,g as Ve,h as Oe}from"./chunk-ZLZ3R452.js";import"./chunk-3MQAPPOW.js";import"./chunk-DAMNOIAJ.js";import"./chunk-MGX3HHAR.js";import"./chunk-MI7BLMGH.js";import"./chunk-7P6CUODK.js";import"./chunk-PDPBZD5O.js";import{a as Ke}from"./chunk-QX25ZRIQ.js";import{a as Fe,c as _e}from"./chunk-F2UUNDRU.js";import{a as Y}from"./chunk-UF2T46AA.js";import{a as Ue}from"./chunk-E5E7XQIN.js";import"./chunk-U7LLQDO4.js";import{b as ze}from"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";import{existsSync as fo,mkdirSync as go,readFileSync as yo,rmSync as Nt,writeFileSync as ho}from"fs";import{tmpdir as bo}from"os";import{dirname as wo,join as xo,resolve as $o}from"path";var ge=1,So="SOOTSIM_INSPECT_NOTICE_PATH",vo=300*1e3,ko=15e3;function Ft(){return $o(process.env[So]||xo(bo(),"sootsim-inspect-notice-state.json"))}function To(e,l){return Object.fromEntries(Object.entries(e).filter(([,n])=>typeof n?.signature=="string"&&Number.isFinite(n?.updatedAt)&&l-n.updatedAt<=vo))}function Mo(e){let l=Ft();if(!fo(l))return{version:ge,entries:{}};try{let n=JSON.parse(yo(l,"utf8"));return n.version!==ge||!n.entries||typeof n.entries!="object"?(Nt(l,{force:!0}),{version:ge,entries:{}}):{version:ge,entries:To(n.entries,e)}}catch{return Nt(l,{force:!0}),{version:ge,entries:{}}}}function Io(e){let l=Ft();go(wo(l),{recursive:!0}),ho(l,JSON.stringify(e,null,2)+`
3
3
  `)}function No(e,l){let n=l.trim()||"default";return`${e}:${n}`}function Ce(e,l,n,c={}){let m=c.nowMs??Date.now(),i=c.cooldownMs??ko,g=Mo(m),y=No(e,l),T=g.entries[y];return T&&T.signature===n&&m-T.updatedAt<i?!1:(g.entries[y]={signature:n,updatedAt:m},Io(g),!0)}var Fo={initialWaitMs:3e3,deadlineMs:5e3,retryWaitMs:700},_o={initialWaitMs:1200,deadlineMs:2500,retryWaitMs:700};function Oo(e,l={}){return{...e?Fo:_o,...l}}function de(e){return!(!e||e.hit===!1||e.ok===!1||e.pointerTapHandled===!1&&!e.keyboardOpened&&!e.isTextInput)}function Ao(e,l){return{id:e.target?.id??e.match?.id??e.node?.id??null,testID:e.target?.testID??e.match?.testID??e.node?.testID??null,text:e.target?.text??e.target?.accessibilityLabel??e.match?.text??e.match?.accessibilityLabel??e.node?.text??l??null,type:e.target?.type??e.match?.type??e.node?.type??null}}async function ye(e,l){let n=Oo(!!l.agent,l.timing),c=0,m=null,i=null;try{await te({bridge:e,maxMs:n.initialWaitMs,pollMs:32,stablePolls:2})}catch{}let g=Date.now()+n.deadlineMs;for(;Date.now()<=g||c===0;){c++;let y=await l.resolve();if(m=y,y?.error==="bridge-not-ready"||y?.ambiguous||y?.nthOutOfRange)return{payload:y,result:null,attempts:c,failure:"special"};if(y&&typeof y.cx=="number"&&typeof y.cy=="number"){let M=await e.send({type:"tap",x:y.cx,y:y.cy,target:Ao(y,l.textFallback)});if(i=M,de(M))return{payload:y,result:M,attempts:c}}let T=g-Date.now();if(T<=0)break;try{await te({bridge:e,maxMs:Math.min(T,n.retryWaitMs),pollMs:32,stablePolls:2})}catch{await new Promise(M=>setTimeout(M,Math.min(120,T)))}}return{payload:m,result:i,attempts:c,failure:m&&typeof m.cx=="number"?"missed":"not-found"}}async function _t(e,l,n,c){return e.send({type:"tap",x:l,y:n,...c?{target:c}:{}})}async function Ot(e,l,n={}){let c=JSON.stringify(l);return ye(e,{agent:n.agent,timing:n.timing,resolve:()=>e.send({type:"evaluate",code:`(async () => {
4
4
  const t = window.__sootsimTest
5
5
  if (!t) return null
@@ -319,7 +319,7 @@ import{a as Y}from"./chunk-X3TVSME2.js";import{a as vt,b as kt}from"./chunk-53AQ
319
319
  `);console.log(`${t??""}
320
320
 
321
321
  ${s}
322
- `),process.exit(0)}let _=m.wsPort,I=m.simId,E=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&c.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-HBCRUONZ.js"),t=o();console.log(` available drivers (${t.length}):
322
+ `),process.exit(0)}let _=m.wsPort,I=m.simId,E=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&c.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-GPZ62RP5.js"),t=o();console.log(` available drivers (${t.length}):
323
323
  `);let s=Math.max(...t.map(a=>a.id.length),6),r=Math.max(...t.map(a=>a.kind.length),4);for(let a of t){let d=a.available?"\u2713":"\u2717",p=a.id.padEnd(s),h=a.kind.padEnd(r);console.log(` ${d} ${p} ${h} ${a.description}`),a.available&&a.detail?console.log(` ${a.detail}`):!a.available&&a.reason&&console.log(` unavailable: ${a.reason}`)}return}let u=Ye(m),z=I||"default",B=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),D=200;function Q(o){let t=o.replace(/\s+/g," ").trim();if(!t)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(t)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(o)?.[1]?.trim(),a=/<body[^>]*>([\s\S]*?)<\//i.exec(o)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),d=r||a||"html error page";return`<html ${o.length}B> "${d}" (body elided \u2014 add --json for the full payload)`}return t.length<=D?t:`${t.slice(0,D)}\u2026 (+${t.length-D} more bytes)`}function oe(o){let t=o.displayUrl||o.url;return o.status!=null?`${o.method} ${t} -> ${o.status}${o.statusText?` ${o.statusText}`:""}`:o.error?`${o.method} ${t} -> ${o.error}`:`${o.method} ${t}`}async function S(o){let t=me()?5e3:1500;try{let{settled:s,elapsed:r}=await te({bridge:o,maxMs:t,pollMs:32,stablePolls:2});s||process.stderr.write(` \u26A0 auto-wait timed out after ${r??t}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
324
324
  `)}catch{}}function N(o,t){console.error(` tap failed: ${o} stayed visible but did not receive a hittable press after ${t.attempts} attempt${t.attempts===1?"":"s"}`),t.result&&console.error(` last result: ${JSON.stringify(t.result)}`)}async function J(){try{return await u.send({type:"evaluate",code:`(() => ({
325
325
  console: ${Se},
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-F5REXFAW.js";import"./chunk-JI72D4RY.js";import"./chunk-JL7K7EPF.js";import"./chunk-ZLZ3R452.js";import"./chunk-OGH3OCGP.js";import"./chunk-DM2EOTY5.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";async function t(n){console.error(" note: `sootsim install` is now `sootsim setup-repo`. forwarding\u2026\n"),await o(n)}export{t as runInstall};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as k}from"./chunk-AA5UBYX7.js";import{a as x}from"./chunk-L3ZBX3DX.js";import"./chunk-2N5FR2CU.js";import{spawn as v,spawnSync as u}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as b}from"path";var h="https://sootbean.com/api/electron-release";function O(){let n=process.arch;if(process.platform==="darwin"){let o=n==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${o}.dmg`;return{platform:o,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let o=n==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${o}.AppImage`;return{platform:o,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:B}}return null}async function I({url:n,dest:o,onProgress:e}){let s=await fetch(n,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${n})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error(`empty response body (${n})`);y(A(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(r=>r?p(r):l())})}}function _(n,o){let e=(n/1048576).toFixed(1);if(!o)return` ${e} MB`;let s=Math.min(100,Math.round(n/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${t} MB`}async function L(n){let o=u("hdiutil",["attach","-nobrowse","-readonly",n],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let e=o.stdout.trim().split(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as k}from"./chunk-JI72D4RY.js";import{a as x}from"./chunk-MGX3HHAR.js";import"./chunk-ACNSMZSP.js";import{spawn as v,spawnSync as u}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as b}from"path";var h="https://sootbean.com/api/electron-release";function O(){let n=process.arch;if(process.platform==="darwin"){let o=n==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${o}.dmg`;return{platform:o,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let o=n==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${o}.AppImage`;return{platform:o,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:B}}return null}async function I({url:n,dest:o,onProgress:e}){let s=await fetch(n,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${n})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error(`empty response body (${n})`);y(A(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(r=>r?p(r):l())})}}function _(n,o){let e=(n/1048576).toFixed(1);if(!o)return` ${e} MB`;let s=Math.min(100,Math.round(n/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${t} MB`}async function L(n){let o=u("hdiutil",["attach","-nobrowse","-readonly",n],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let e=o.stdout.trim().split(`
3
3
  `),t=e[e.length-1].split(" ").pop()?.trim();if(!t||!w(t))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=f(t,"sootsim.app");if(!w(a))throw u("hdiutil",["detach","-force",t]),new Error(`sootsim.app not found inside ${t}`);let i="/Applications",d=b(process.env.HOME||"","Applications"),c=i;try{let m=f(i,`.sootsim-write-probe-${process.pid}`);u("touch",[m]),w(m)?g(m,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=u("cp",["-R",a,l]),r=u("hdiutil",["detach","-force",t]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return r.status!==0&&console.warn(` warning: failed to unmount ${t} (${r.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",l]),l}async function C(n){let o=b(process.env.HOME||"","Applications");y(o,{recursive:!0});let e=f(o,"sootsim.AppImage");return w(e)&&g(e,{force:!0}),T(n,e),D(n),S(e,493),e}async function B(n){return await new Promise((o,e)=>{let s=v("cmd",["/c","start",'""',"/wait",n],{stdio:"inherit"});s.once("error",e),s.once("exit",t=>{t===0?o():e(new Error(`installer exited with code ${t}`))})}),n}async function q(n){(n.includes("--help")||n.includes("-h"))&&(console.log(`
4
4
  sootsim install-desktop \u2014 download and install the optional desktop GUI
5
5
 
@@ -20,4 +20,4 @@ examples:
20
20
  `),process.exit(0));let o=n.includes("--yes")||n.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,e=n.includes("--force"),s=x();if(s&&!e){console.log(` sootsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let t=O();if(t||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, win32-x64"),process.exit(1)),console.log(` platform: ${t.platform}`),console.log(` download: ${t.url}`),console.log(),!o){if(!await k("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(M(),`sootsim-install-${Date.now()}`),i=f(a,t.filename),d=0;process.stdout.write(` downloading ${t.filename}...
21
21
  `);try{await I({url:t.url,dest:i,onProgress:(r,m)=>{let $=Date.now();$-d<100&&r<(m??1/0)||(d=$,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${_(r,m)}`))}})}catch(r){g(a,{recursive:!0,force:!0});let m=r instanceof Error?r.message:String(r);console.error(`
22
22
  download failed: ${m}`),console.error(` the ${t.platform} desktop build may not be published yet, or your`),console.error(" network blocked the request. check your connection and try again later;"),console.error(" the CLI + daemon work without the desktop app (run: sootsim --help)."),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
23
- `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-WZFPP7XR.js");try{let r=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${r}`)}catch(r){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:r instanceof Error?r.message:String(r)}}),await p(),console.error(` install failed: ${r instanceof Error?r.message:String(r)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{q as runInstallDesktop};
23
+ `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-7TRVV4JE.js");try{let r=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${r}`)}catch(r){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:r instanceof Error?r.message:String(r)}}),await p(),console.error(` install failed: ${r instanceof Error?r.message:String(r)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{q as runInstallDesktop};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as l,b as d,c as k,d as y,e as g}from"./chunk-FNUHS7EZ.js";import{d as c}from"./chunk-ALSMTP6C.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as l,b as d,c as k,d as y,e as g}from"./chunk-WXFUXFY7.js";import{d as c}from"./chunk-DM2EOTY5.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
3
3
  created: ${t.record.label} (${t.record.keyPrefix}\u2026)`),console.log(` scopes: ${t.record.scopes.join(",")}`),console.log(`
4
4
  secret: ${t.secret}
5
5
  `),console.log(` copy this now \u2014 we can't show it again.
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-YIZQFYDE.js";import{b as h}from"./chunk-XJQRNGCW.js";import{a as d}from"./chunk-L3ZBX3DX.js";import"./chunk-HAJPACUR.js";import"./chunk-RAS5AWIY.js";import"./chunk-43R7N2HR.js";import"./chunk-ESGMJNNM.js";import{A as t,B as u,F as m,G as r,H as a,h as l,i as c}from"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";import{spawn as v}from"child_process";import{existsSync as w}from"fs";async function O(n){if(n.includes("--help")||n.includes("-h")){console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-F5PLWUIU.js";import{b as h}from"./chunk-DAMNOIAJ.js";import{a as d}from"./chunk-MGX3HHAR.js";import"./chunk-MI7BLMGH.js";import"./chunk-7P6CUODK.js";import"./chunk-PDPBZD5O.js";import"./chunk-D6QVHHDU.js";import{A as t,B as u,F as m,G as r,H as a,h as l,i as c}from"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";import{spawn as v}from"child_process";import{existsSync as w}from"fs";async function O(n){if(n.includes("--help")||n.includes("-h")){console.log(`
3
3
  sootsim launch \u2014 one-shot: install runtime if needed, start daemon, open app
4
4
 
5
5
  usage:
@@ -13,4 +13,4 @@ options:
13
13
  examples:
14
14
  sootsim launch
15
15
  sootsim launch --version 1.2.3
16
- `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),s=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;t(),await x({skipAutoInstall:e,channel:s,explicitVersion:f}),await p(),await k()}async function x(n){let e=u(),i=m();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:s}=await import("./runtime-QAQWW2CP.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await s(["install",...o],{channel:n.channel})}async function p(){let n=r();if(a(n))return;if(c()){let o=l()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";console.error(` not spawning a standalone sootsim daemon \u2014 ${o}.`),console.error(" the live `bun dev` stack hosts the bridge in-process (run it, or its electron);"),console.error(" set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose."),process.exit(1)}console.log("sootsim: starting daemon");let e=g();v(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let s=Date.now()+8e3;for(;Date.now()<s;){let o=r();if(a(o))return;await D(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function k(){d()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await h.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function g(){let n=process.argv[1];return n&&w(n)?n:"sootsim"}function D(n){return new Promise(e=>setTimeout(e,n))}async function R(){t(),await p()}export{R as ensureDaemonRunning,O as runLaunch};
16
+ `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),s=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;t(),await x({skipAutoInstall:e,channel:s,explicitVersion:f}),await p(),await k()}async function x(n){let e=u(),i=m();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:s}=await import("./runtime-HPZWCYML.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await s(["install",...o],{channel:n.channel})}async function p(){let n=r();if(a(n))return;if(c()){let o=l()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";console.error(` not spawning a standalone sootsim daemon \u2014 ${o}.`),console.error(" the live `bun dev` stack hosts the bridge in-process (run it, or its electron);"),console.error(" set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose."),process.exit(1)}console.log("sootsim: starting daemon");let e=g();v(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let s=Date.now()+8e3;for(;Date.now()<s;){let o=r();if(a(o))return;await D(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function k(){d()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await h.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function g(){let n=process.argv[1];return n&&w(n)?n:"sootsim"}function D(n){return new Promise(e=>setTimeout(e,n))}async function R(){t(),await p()}export{R as ensureDaemonRunning,O as runLaunch};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as g,d as m}from"./chunk-ALSMTP6C.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";import{exec as O}from"node:child_process";import{randomBytes as S}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(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(`${h}/api/auth/me`)).ok)return h}catch{}return I}function L(){console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as g,d as m}from"./chunk-DM2EOTY5.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";import{exec as O}from"node:child_process";import{randomBytes as S}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(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(`${h}/api/auth/me`)).ok)return h}catch{}return I}function L(){console.log(`
3
3
  sootsim login \u2014 sign in so desktop uploads can attach to your account
4
4
 
5
5
  usage:
@@ -21,6 +21,6 @@ options:
21
21
  <p style="color:#ccc">${r}</p>
22
22
  </div>
23
23
  </body>
24
- </html>`}async function P(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 c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}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 A(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 G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-WZFPP7XR.js");n({event:"cli_login_succeeded",identity:{userId:o.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let c=S(16).toString("hex"),i=await new Promise(o=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,$=a.searchParams.get("userId")||void 0,f=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),f){n.end(u(`sign-in failed: ${f}`)),o({ok:!1,error:f}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),o({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),o({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),o({ok:!0,token:k,email:b,userId:$}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),o({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){o({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",t),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
24
+ </html>`}async function P(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 c=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${c}`}}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 A(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 G(r){(r.includes("--help")||r.includes("-h"))&&(L(),process.exit(0));let e=[...r],t=await x(R(e,"--origin"));if(A(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await P(t);if(o.ok){g({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let s=await m(t),l=s?.user?.email||o.email||s?.user?.id||o.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-7TRVV4JE.js");n({event:"cli_login_succeeded",identity:{userId:o.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let c=S(16).toString("hex"),i=await new Promise(o=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,$=a.searchParams.get("userId")||void 0,f=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),f){n.end(u(`sign-in failed: ${f}`)),o({ok:!1,error:f}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),o({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),o({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),o({ok:!0,token:k,email:b,userId:$}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),o({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){o({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",t),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
25
25
  ${n.toString()}
26
- `),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-WZFPP7XR.js");o({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}g({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let d=await m(t),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-WZFPP7XR.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:t}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
26
+ `),T(n.toString())})});if(!i.ok){let{trackCliEvent:o,flushCliTelemetry:s}=await import("./telemetry-7TRVV4JE.js");o({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}g({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let d=await m(t),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-7TRVV4JE.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:t}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as r,b as i}from"./chunk-EV5NG4AO.js";import{a as t,c as o}from"./chunk-ALSMTP6C.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.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.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-OGH3OCGP.js";import{a as t,c as o}from"./chunk-DM2EOTY5.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as y,c as v}from"./chunk-FXQRRTHD.js";import"./chunk-HQZMG2HF.js";import"./chunk-M72THY5Y.js";import"./chunk-TGNYK2JI.js";import"./chunk-5IXQLSHV.js";import"./chunk-FNUHS7EZ.js";import{b as h,c as w}from"./chunk-ZUY4EZUO.js";import"./chunk-5QWSPJHN.js";import"./chunk-HKCO4GFF.js";import"./chunk-32YLDVP3.js";import"./chunk-MF7QK7PS.js";import"./chunk-BZS6I346.js";import"./chunk-6WWYHNYI.js";import"./chunk-IIY2O6LJ.js";import"./chunk-WJHZQUAF.js";import"./chunk-XJQRNGCW.js";import"./chunk-L3ZBX3DX.js";import"./chunk-HAJPACUR.js";import"./chunk-RAS5AWIY.js";import"./chunk-43R7N2HR.js";import"./chunk-ESGMJNNM.js";import"./chunk-EV5NG4AO.js";import"./chunk-ALSMTP6C.js";import"./chunk-OXGEETXY.js";import"./chunk-HFPCHOKV.js";import"./chunk-6YEVWYSG.js";import"./chunk-X3Q65CKA.js";import"./chunk-J7YRSCPF.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";import*as n from"fs";import*as a from"path";var S=[".maestro","maestro"];function k(){console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as y,c as v}from"./chunk-HCNW2QTI.js";import"./chunk-EIMDQRZS.js";import"./chunk-HHOQMAVJ.js";import"./chunk-ELHNXEJI.js";import"./chunk-27CWE62K.js";import"./chunk-WXFUXFY7.js";import{b as h,c as w}from"./chunk-GNHGTWDX.js";import"./chunk-MPUONWKJ.js";import"./chunk-BIG5BGMC.js";import"./chunk-2QPTZHGU.js";import"./chunk-AB6TZFIE.js";import"./chunk-JDFPPPPS.js";import"./chunk-47JNNTYQ.js";import"./chunk-ZLZ3R452.js";import"./chunk-3MQAPPOW.js";import"./chunk-DAMNOIAJ.js";import"./chunk-MGX3HHAR.js";import"./chunk-MI7BLMGH.js";import"./chunk-7P6CUODK.js";import"./chunk-PDPBZD5O.js";import"./chunk-OGH3OCGP.js";import"./chunk-DM2EOTY5.js";import"./chunk-VCKKDUWG.js";import"./chunk-E5E7XQIN.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-DWYDDN7J.js";import"./chunk-OKBGHUCY.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";import*as n from"fs";import*as a from"path";var S=[".maestro","maestro"];function k(){console.log(`
3
3
  sootsim maestro \u2014 run maestro YAML flows against sootsim (drop-in)
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b}from"./chunk-3MQAPPOW.js";import"./chunk-ACNSMZSP.js";export{a as loadOptionalDemoApps,b as optionalDemoAppsSync};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-2N5FR2CU.js";import{resolve as c,dirname as m}from"path";import{fileURLToPath as a}from"url";var t=m(a(import.meta.resolve("sootsim-engine/package.json")));async function g(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-ACNSMZSP.js";import{resolve as c,dirname as m}from"path";import{fileURLToPath as a}from"url";var t=m(a(import.meta.resolve("sootsim-engine/package.json")));async function g(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
3
3
  sootsim preview \u2014 production-like preview
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as s,c as i,d as t,e as n,f as c}from"./chunk-HAJPACUR.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";function f(){console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as s,c as i,d as t,e as n,f as c}from"./chunk-MI7BLMGH.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";function f(){console.log(`
3
3
  sootsim profile \u2014 manage isolated storage profiles
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as w,e as b,h as m,i as f}from"./chunk-IIY2O6LJ.js";import"./chunk-ESGMJNNM.js";import"./chunk-6YEVWYSG.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";function h(){console.log(`
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as w,e as b,h as m,i as f}from"./chunk-ZLZ3R452.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";function h(){console.log(`
3
3
  sootsim react \u2014 inspect React component render cost in the tenant worker
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as P}from"./chunk-TGNYK2JI.js";import"./chunk-5IXQLSHV.js";import{d as Z,f as ee}from"./chunk-FNUHS7EZ.js";import"./chunk-BZS6I346.js";import"./chunk-6WWYHNYI.js";import{c as b,e as v,f as Y}from"./chunk-IIY2O6LJ.js";import"./chunk-RAS5AWIY.js";import{d as X}from"./chunk-43R7N2HR.js";import{b as Q}from"./chunk-ESGMJNNM.js";import"./chunk-EV5NG4AO.js";import"./chunk-ALSMTP6C.js";import"./chunk-6YEVWYSG.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";import{existsSync as we,mkdirSync as E,readdirSync as he,readFileSync as be,rmSync as J,writeFileSync as I}from"fs";import{homedir as ve,tmpdir as ye}from"os";import{dirname as W,extname as oe,join as N,resolve as Se}from"path";var z=24e4,Re=9e4,$e=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+$e);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as P}from"./chunk-ELHNXEJI.js";import"./chunk-27CWE62K.js";import{d as Z,f as ee}from"./chunk-WXFUXFY7.js";import"./chunk-JDFPPPPS.js";import"./chunk-47JNNTYQ.js";import{c as b,e as v,f as Y}from"./chunk-ZLZ3R452.js";import"./chunk-7P6CUODK.js";import{d as Q}from"./chunk-PDPBZD5O.js";import"./chunk-OGH3OCGP.js";import"./chunk-DM2EOTY5.js";import"./chunk-U7LLQDO4.js";import{b as X}from"./chunk-D6QVHHDU.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";import{existsSync as we,mkdirSync as E,readdirSync as he,readFileSync as be,rmSync as J,writeFileSync as I}from"fs";import{homedir as ve,tmpdir as ye}from"os";import{dirname as W,extname as oe,join as N,resolve as Se}from"path";var z=24e4,Re=9e4,$e=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+$e);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
3
3
  the capture lock auto-releases, so simply retry the recording.
4
4
  if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording/i.test(s)&&(console.error(` ${o} failed: ${s}
5
5
  a prior recording was abandoned and its capture is still
@@ -7,7 +7,7 @@ import{a as P}from"./chunk-TGNYK2JI.js";import"./chunk-5IXQLSHV.js";import{d as
7
7
  \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),xe=new Set(["start","stop","cancel","status","prelude-start"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return xe.has(o)?{name:o,index:r}:null}return null}function ke(){let e=process.env,r=(e.SOOT_BRANCH||e.GITHUB_HEAD_REF||e.GITHUB_REF_NAME||"").trim(),o=(e.SOOT_SHA||e.GITHUB_SHA||"").trim(),i=(e.SOOT_PR_NUMBER||"").trim(),t=i?Number.parseInt(i,10):Number.NaN,n=(e.SOOT_PR_TITLE||"").trim();return{branch:r||void 0,commitSha:o||void 0,pullRequestNumber:Number.isFinite(t)&&t>0?t:void 0,pullRequestTitle:n||void 0}}function re(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function qe(e,r){let o=Oe(e);if(o){let c=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(c,r);return}if(o.name==="prelude-start"){await Ne(c,r);return}if(o.name==="stop"){await Pe(c,r);return}if(o.name==="cancel"){await Fe(c,r);return}await Ae(c,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=ie(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let d=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let m=600;a>m&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${m}s (10m) maximum`),process.exit(1));let u=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let c=Number(p);(!Number.isInteger(c)||c<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),j=l(e,"--max-width")?Number(l(e,"--max-width")):void 0,g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),pe=re(e);if(t==="live"||t==="combined"){d&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:K,allowGitHubAuth:!0});let c=v({...i,commandTimeoutMs:6e4});try{await q(c),await ae(c,t),t==="combined"&&await B(c),await de(c,K,pe);let $=await ce(c,t,t==="combined"?n:void 0);$.ok||(console.error(` start failed: recording store refused to start (${t})`+($.error?`: ${$.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await le(c);let O=await ue(c);me(O,x,t)}finally{c.close()}return}let C=p?Number(p):null,S=Te(s,d,C);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await te(h),await B(h),S==="png"){let R=C??10,w=U(d,`sootsim-frames-${M()}`);d&&oe(d)&&console.log(` note: --frames writes multiple pngs, so --output "${d}" is a directory \u2014 frame-NNN.png files land inside it`),E(w,{recursive:!0});for(let f of he(w))/^frame-\d+\.png$/.test(f)&&J(N(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let y=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!y.ok||!y.requestId)&&(console.error(` frame capture start failed: ${y.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let fe=Date.now()+Math.max(5e3,g),A=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${y.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),A=f.frames??[];break}Date.now()>=fe&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(F=>setTimeout(F,100))}A.forEach((f,F)=>{let ge=`${w}/frame-${String(F+1).padStart(3,"0")}.png`;I(ge,Buffer.from(f.data,"base64"))}),console.log(` saved ${A.length} frames`);return}if(S==="gif"){let R=C??Math.max(10,Math.round(a*u/3)),w=U(d,`sootsim-${M()}.gif`);E(W(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let y=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${j?`, maxWidth: ${j}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);y||(console.error(" gif capture returned no frames"),process.exit(1)),I(w,Buffer.from(y.data,"base64")),console.log(` saved: ${w} (${G(y.size)})`);return}let c=U(d,`sootsim-${M()}.${S}`);E(W(c),{recursive:!0});let $={format:S,fps:u,durationMs:g};n&&($.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify($)})`,`${S} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${S} for ${a}s \u2192 ${c}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${S} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ne(h,c),console.log(` saved: ${c} (${G(_.size)})`)}finally{h.close()}}var Ee=6e3;async function L(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function te(e){await L(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Y(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
8
8
  would be throttled to ~1fps and produce a frozen-looking file.
9
9
  bring the chrome window to the foreground (un-minimize / switch to
10
- its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ne(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=oe(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Te(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function M(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Me(){let e=N(ve(),".sootsim","recordings");return E(e,{recursive:!0}),e}function U(e,r){return e?Se(process.cwd(),e):N(Me(),r)}function G(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function ie(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function H(){return N(ye(),`sootsim-recording-${Q()}.json`)}function T(){let e=H();if(!we(e))return null;try{return{mode:"video",...JSON.parse(be(e,"utf8"))}}catch{return J(e,{force:!0}),null}}function Ue(e){I(H(),JSON.stringify(e,null,2))}function k(){J(H(),{force:!0})}function V(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
10
+ its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ne(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=oe(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Te(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function M(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Me(){let e=N(ve(),".sootsim","recordings");return E(e,{recursive:!0}),e}function U(e,r){return e?Se(process.cwd(),e):N(Me(),r)}function G(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function ie(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function H(){return N(ye(),`sootsim-recording-${X()}.json`)}function T(){let e=H();if(!we(e))return null;try{return{mode:"video",...JSON.parse(be(e,"utf8"))}}catch{return J(e,{force:!0}),null}}function Ue(e){I(H(),JSON.stringify(e,null,2))}function k(){J(H(),{force:!0})}function V(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
11
11
  requested sim ${e}. record state is global (not per-sim);
12
12
  this command acts on that session regardless of --sim.`)}async function Ie(e,r){let o=T();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin","--owner","--repo"]}),t=ie(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format"),d=s==="mp4"?"mp4":"webm";s&&d!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: sootsim record --format ${s} --duration <s>`),process.exit(1));let a=Number(l(e,"--fps")??"30"),m=re(e),u=v({...i,commandTimeoutMs:t==="live"||t==="combined"?Re:15e3});try{if(t==="live"||t==="combined"){n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:l(e,"--origin"),allowGitHubAuth:!0}),await q(u),await ae(u,t),t==="combined"&&await B(u),await de(u,l(e,"--origin"),m);let p=await ce(u,t,t==="combined"?n:void 0);p.ok||(console.error(` start failed: recording store refused to start (${t})`+(p.error?`: ${p.error}`:"")),process.exit(1))}else{await te(u),await B(u);let p={format:d,fps:a};n&&(p.layers=n);let x=await u.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(p)})`});x.ok||(console.error(` start failed: ${x.error??"unknown error"}`),process.exit(1))}Ue({simId:i.simId??null,mode:t,format:d,fps:a,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${d} @ ${a}fps${n?` (${n})`:""} \u2014 run \`sootsim record stop --output <path>\` when done`:` recording ${t} \u2014 run \`sootsim record stop\` when done (add --open to launch the preview URL)`)}finally{u.close()}}async function Ne(e,r){let o=T();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=v({...i,commandTimeoutMs:15e3});try{if(await q(t),await B(t),!await t.send({type:"evaluate",code:`(() => {
13
13
  const start = window.SootSim?.bridges?.startRecordingPrelude
@@ -67,4 +67,4 @@ import{a as P}from"./chunk-TGNYK2JI.js";import"./chunk-5IXQLSHV.js";import{d as
67
67
  })()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`sootsim open --new`); if it persists, update sootsim."),process.exit(1))}async function ce(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function le(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function ue(e){let r=Date.now()+z;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${z/1e3}s`}}function me(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
68
68
  replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
69
69
  nothing to replay. Video will play the captured screen recording.`:` note: this live recording captured no events \u2014 the preview has nothing
70
- to replay and will boot a fresh interactive session instead.`),r&&X(e.previewUrl)}export{Be as extToFormat,Te as resolveFormat,qe as runRecord,l as valueOf};
70
+ to replay and will boot a fresh interactive session instead.`),r&&Q(e.previewUrl)}export{Be as extToFormat,Te as resolveFormat,qe as runRecord,l as valueOf};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-3RHECMKV.js";import"./chunk-ZLZ3R452.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-KCETAALD.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";export{a as runRuntime};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.165 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-AJD3G3DQ.js";import"./chunk-EGBFMW45.js";import"./chunk-2N5FR2CU.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,d as SOOTSIM_CHANGELOG_URL,m as checkRuntimeUpToDate,i as fetchRuntimeManifest,k as installRuntime,e as resolveRuntimeCdnOrigin,f as resolveRuntimeChannel,j as resolveRuntimeVersion,g as runtimeManifestUrl,h as runtimeTarballUrl,l as updateRuntimeToLatest};
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-KCETAALD.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,d as SOOTSIM_CHANGELOG_URL,m as checkRuntimeUpToDate,i as fetchRuntimeManifest,k as installRuntime,e as resolveRuntimeCdnOrigin,f as resolveRuntimeChannel,j as resolveRuntimeVersion,g as runtimeManifestUrl,h as runtimeTarballUrl,l as updateRuntimeToLatest};
@@ -0,0 +1,35 @@
1
+ /*! sootsim v0.1.167 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as E}from"./chunk-EIMDQRZS.js";import"./chunk-HHOQMAVJ.js";import{a as R}from"./chunk-UC7LRLPE.js";import{r as _}from"./chunk-AB6TZFIE.js";import{c as y,d as x,e as v,f as S,h as b}from"./chunk-ZLZ3R452.js";import"./chunk-VCKKDUWG.js";import"./chunk-U7LLQDO4.js";import"./chunk-D6QVHHDU.js";import"./chunk-DWYDDN7J.js";import{g as w}from"./chunk-OKBGHUCY.js";import"./chunk-TFF3KXNC.js";import"./chunk-ACNSMZSP.js";import{mkdirSync as $,writeFileSync as A}from"fs";import{dirname as M,resolve as F}from"path";async function Q(t,o){let e=q(t);(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
+ sootsim screenshot \u2014 capture the canvas as a PNG
4
+
5
+ usage:
6
+ sootsim screenshot [output] [options]
7
+ sootsim screenshot [options] --output <path>
8
+
9
+ options:
10
+ --output <path> output file path (default: /tmp/sootsim-inspect.png)
11
+ first positional arg works too: \`screenshot /tmp/x.png\`
12
+ --with-frame wrap the captured screen in a tight device frame
13
+ --no-frame capture the raw screen bitmap (default)
14
+ --no-shell tenant-only capture (no status bar, keyboard, toasts,
15
+ notification center, or other shell overlays). use for
16
+ clean app screenshots when a shell surface is in the way.
17
+ --shell-only capture only the shell chrome, no tenant content
18
+ --area x,y,w,h crop to a logical sootsim rect
19
+ --id <testID> crop to a node's bounding box
20
+ --text <text> crop to a node found by text content
21
+ --gallery crawl and capture multiple screens as HTML gallery
22
+ --themes capture light and dark variants
23
+
24
+ examples:
25
+ sootsim screenshot
26
+ sootsim screenshot --no-shell --output app.png
27
+ sootsim screenshot --with-frame --output framed.png
28
+ sootsim screenshot --area 0,200,393,400 --output hero.png
29
+ sootsim screenshot --id loginButton --output button.png
30
+ `),process.exit(0));let r=V(e);if(r.length>0){for(let{flag:a,suggestion:m}of r)console.error(m?` unknown flag: ${a} (did you mean ${m}?)`:` unknown flag: ${a}`);console.error(" run `sootsim screenshot --help` for the list of supported flags"),process.exit(1)}let s=e.includes("--gallery"),n=e.includes("--themes"),u=G(e),c=U(e);if(s||n)return u&&(console.error(" --with-frame is not supported with --gallery / --themes"),process.exit(1)),T(e,o);u&&e.some(a=>a==="--area"||a==="--id"||a==="--text")&&(console.error(" --with-frame only supports full-screen capture for now"),console.error(" remove --area / --id / --text, or capture raw and compose later"),process.exit(1));let i=y(e,{port:o.port,stripBooleanFlags:["--with-frame","--no-frame","--no-shell","--shell-only"],stripValueFlags:["--output","--area","--id","--text"]}),l=O(e),p=await D(e);if(await N(i.wsPort)){try{await L(i,l,p,u,c)}catch(a){console.error(` screenshot failed: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}return}u&&(console.error(" --with-frame requires a running sootsim bridge"),console.error(" open the app in a live sim first, then rerun the command"),process.exit(1)),p&&(console.error(" --area / --id / --text require a running sootsim bridge"),console.error(" start one with `sootsim server`, `sootsim electron`, or your project dev server"),process.exit(1)),await T(e,o)}async function N(t){let o=x(t,{commandTimeoutMs:1e3});try{return await o.listSims(),!0}catch{return!1}finally{o.close()}}async function D(t){let o=t.find((s,n)=>t[n-1]==="--area");if(o){let s=o.split(",").map(l=>Number(l.trim()));if(s.length!==4||s.some(l=>!Number.isFinite(l)))throw new Error(`--area expects x,y,w,h (got "${o}")`);let[n,u,c,i]=s;return{x:n,y:u,w:c,h:i}}let e=t.find((s,n)=>t[n-1]==="--id"),r=t.find((s,n)=>t[n-1]==="--text");return e||r?{__matcher:{id:e,text:r}}:null}async function L(t,o,e,r,s){let n=v({...t,commandTimeoutMs:45e3});try{(await S(n)).hidden&&process.stderr.write(` \u26A0 screenshot will capture the LAST PAINTED canvas \u2014 likely stale.
31
+ navigation/\`shell\` commands sent before this screenshot may not
32
+ have repainted yet. focus the tab manually or \`sootsim --sim <id>\`
33
+ to target a visible sim before capturing.
34
+
35
+ `);let c=Number(process.env.SOOT_SCREENSHOT_READY_MAX_MS)||9e4,i=await _(n,c);if(!i.ready)throw new Error(`app not ready to capture after ${Math.round(i.elapsedMs/1e3)}s`+(i.loadingText?` (still showing "${i.loadingText}")`:"")+"; refusing to capture the boot/loading card. retry once the app paints.");let l=e,p=e?.__matcher;if(p){let h=await n.send({type:"evaluate",code:R(p)});if(!h)throw new Error(p.id?`no node with id "${p.id}"`:`no node matching text "${p.text}"`);l=h}let d=l?{x:l.x,y:l.y,w:l.w,h:l.h}:void 0,a={type:"screenshot"};s&&(a.layers=s),d&&(a.crop=d);let k=(await n.send(a)).replace(/^data:image\/png;base64,/,"");d&&console.log(` area: x=${d.x} y=${d.y} w=${d.w} h=${d.h}`),s&&console.log(` layers: ${s}`);let f=F(process.cwd(),o||"/tmp/sootsim-inspect.png");$(M(f),{recursive:!0});let g=Buffer.from(k,"base64");if(r){let h=await C(n);if(!h)throw new Error("could not read current device model from the target sim");let P=await E(g,h);A(f,P),console.log(` frame: ${h}`)}else A(f,g);console.log(` saved: ${f}`)}finally{n.close()}}async function C(t){let o=await b(t,"SootSim.bridges.settings.get")??{deviceModel:null},e=typeof o.deviceModel=="string"?o.deviceModel:null;return!e||!(e in w)?null:e}function G(t){let o=!1;for(let e of t)e==="--with-frame"&&(o=!0),e==="--no-frame"&&(o=!1);return o}function U(t){if(t.includes("--shell-only"))return"shell";if(t.includes("--no-shell"))return"tenant"}var H=new Set(["--help","-h","--verbose","-v","--with-frame","--no-frame","--no-shell","--shell-only","--gallery","--themes"]),B=new Set(["--output","--area","--id","--text","--url","--port","--timeout","--sim"]),I={"--rect":"--area","--crop":"--area","--region":"--area","--bounds":"--area","--box":"--area","--xywh":"--area","--out":"--output","-o":"--output","--file":"--output","--path":"--output","--testid":"--id","--test-id":"--id","--test_id":"--id"};function q(t){let o=[],e={"-o":"--output","--out":"--output","--file":"--output","--path":"--output","--testid":"--id","--test-id":"--id","--test_id":"--id","--rect":"--area","--crop":"--area","--region":"--area","--bounds":"--area","--box":"--area","--xywh":"--area"};for(let r of t){let s=e[r];o.push(s??r)}return o}function V(t){let o=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.startsWith("-")){if(B.has(r)){e++;continue}H.has(r)||o.push({flag:r,suggestion:I[r]})}}return o}function O(t){let o=t.find((e,r)=>t[r-1]==="--output");if(o)return o;for(let e=0;e<t.length;e++){let r=t[e];if(r.startsWith("-")){B.has(r)&&e++;continue}return r}}async function T(t,o){let e=O(t)||"sootsim-screenshot.png",r=t.includes("--gallery"),s=t.find((c,i)=>t[i-1]==="--url")||`http://localhost:${o.port||5173}`,{chromium:n}=await import("playwright"),u=await n.launch({channel:"chrome",headless:!0});try{if(r)console.log(" capturing gallery..."),console.log(" (gallery mode not yet implemented)");else{let c=await u.newPage({viewport:{width:500,height:900}});await c.goto(s,{waitUntil:"networkidle"}),await c.waitForTimeout(2e3);let i=F(process.cwd(),e);$(M(i),{recursive:!0}),await c.screenshot({path:i}),console.log(` saved: ${i}`),await c.close()}}catch(c){console.error(` screenshot failed: ${c.message}`),process.exitCode=1}finally{await u.close()}}export{Q as runScreenshot};