sootsim 0.1.121 → 0.1.122

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 (150) hide show
  1. package/dist-cli/bin.js +4 -4
  2. package/dist-cli/chunks/{agent-NZ4A6JKO.js → agent-LICWL6DE.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-CYQ5L2YH.js → agent-wrapper-KK5TEI3F.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-2DF4NW5D.js → app-fonts-UZXW5FWC.js} +2 -2
  5. package/dist-cli/chunks/{assert-PASM5PLL.js → assert-UZGKOSWO.js} +2 -2
  6. package/dist-cli/chunks/auto-bootstrap-GCRCFYH5.js +2 -0
  7. package/dist-cli/chunks/beta-6BJEGCY4.js +2 -0
  8. package/dist-cli/chunks/{chunk-7CA63OS4.js → chunk-2KKPINU2.js} +1 -1
  9. package/dist-cli/chunks/{chunk-MSU27JEW.js → chunk-2XDZ42A6.js} +2 -2
  10. package/dist-cli/chunks/{chunk-SF6W3FRS.js → chunk-366ZIBQX.js} +1 -1
  11. package/dist-cli/chunks/{chunk-LT2X5ISU.js → chunk-36BDR3DE.js} +2 -2
  12. package/dist-cli/chunks/{chunk-OBYYAT4F.js → chunk-3BCXNVBN.js} +2 -2
  13. package/dist-cli/chunks/{chunk-3WDN2S2A.js → chunk-3JHF4F55.js} +2 -2
  14. package/dist-cli/chunks/{chunk-W3FBNBTX.js → chunk-3MKNANBV.js} +2 -2
  15. package/dist-cli/chunks/chunk-3P4C6X6M.js +1 -0
  16. package/dist-cli/chunks/{chunk-7RXO4KKF.js → chunk-5GQJWYO7.js} +1 -1
  17. package/dist-cli/chunks/{chunk-PMAKUYYK.js → chunk-6NW6PC3P.js} +2 -2
  18. package/dist-cli/chunks/{chunk-X4LYRBLZ.js → chunk-6PKYLQ36.js} +1 -1
  19. package/dist-cli/chunks/{chunk-OEV7EOMC.js → chunk-7AXDJ2RV.js} +2 -2
  20. package/dist-cli/chunks/chunk-7OVVG4L6.js +4 -0
  21. package/dist-cli/chunks/{chunk-CGB6KRKN.js → chunk-AK2PW7XZ.js} +5 -5
  22. package/dist-cli/chunks/{chunk-KTE2VIXH.js → chunk-BII2H2BR.js} +3 -3
  23. package/dist-cli/chunks/{chunk-Y7ZMV3PG.js → chunk-D5VB3SJP.js} +1 -1
  24. package/dist-cli/chunks/chunk-EGFZLSP4.js +1 -0
  25. package/dist-cli/chunks/{chunk-I26R4PE2.js → chunk-ESUDARF7.js} +1 -1
  26. package/dist-cli/chunks/{chunk-2U4CGOD6.js → chunk-FFMAP2HL.js} +2 -2
  27. package/dist-cli/chunks/{chunk-QNQO5VHO.js → chunk-G6Z5E4KX.js} +2 -2
  28. package/dist-cli/chunks/{chunk-DORQQNP4.js → chunk-GLVNMGFD.js} +2 -2
  29. package/dist-cli/chunks/{chunk-3DDNLPIH.js → chunk-GNWVN4MO.js} +2 -2
  30. package/dist-cli/chunks/{chunk-VSKLWCFM.js → chunk-GX2FFJV6.js} +2 -2
  31. package/dist-cli/chunks/{chunk-SRA2TVCG.js → chunk-IBEQOTJK.js} +1 -1
  32. package/dist-cli/chunks/{chunk-VSRV5LFU.js → chunk-IRSVHE5W.js} +1 -1
  33. package/dist-cli/chunks/{chunk-MUTDER75.js → chunk-ITGWJM6W.js} +2 -2
  34. package/dist-cli/chunks/{chunk-NQ4EDJV4.js → chunk-J27RHTWH.js} +6 -6
  35. package/dist-cli/chunks/chunk-KWXV47VS.js +2 -0
  36. package/dist-cli/chunks/{chunk-GU3MWKJY.js → chunk-LKSAMFVM.js} +1 -1
  37. package/dist-cli/chunks/chunk-LYZ3GSCB.js +1 -0
  38. package/dist-cli/chunks/{chunk-VX5CAWLC.js → chunk-M6ML3LBZ.js} +2 -2
  39. package/dist-cli/chunks/{chunk-3A7SRWSQ.js → chunk-NIL4WJUK.js} +2 -2
  40. package/dist-cli/chunks/{chunk-5OA35LZX.js → chunk-QD5YATLL.js} +2 -2
  41. package/dist-cli/chunks/{chunk-WHL7FMLG.js → chunk-RBWDMEWN.js} +1 -1
  42. package/dist-cli/chunks/{chunk-Z47GWZMZ.js → chunk-RH3GHGRZ.js} +3 -3
  43. package/dist-cli/chunks/{chunk-VALW4SKE.js → chunk-S2RR2IZC.js} +1 -1
  44. package/dist-cli/chunks/{chunk-B77PWTHR.js → chunk-S5KZH7JJ.js} +2 -2
  45. package/dist-cli/chunks/{chunk-4UQMPWDA.js → chunk-SUQAFFJO.js} +2 -2
  46. package/dist-cli/chunks/{chunk-4BXESMZ7.js → chunk-T2YYBRII.js} +1 -1
  47. package/dist-cli/chunks/chunk-TZLLRML5.js +33 -0
  48. package/dist-cli/chunks/{chunk-KY6NY6WN.js → chunk-UQHBJ2L2.js} +1 -1
  49. package/dist-cli/chunks/{chunk-RVWJ3TAE.js → chunk-V4OEITZA.js} +2 -2
  50. package/dist-cli/chunks/{chunk-SA5RP334.js → chunk-VHPYIZ3U.js} +2 -2
  51. package/dist-cli/chunks/{chunk-IQNZPHGD.js → chunk-X6PIQ3OM.js} +2 -2
  52. package/dist-cli/chunks/cli-version-4BVXR3IU.js +2 -0
  53. package/dist-cli/chunks/{compat-FMBQL2CX.js → compat-QFC2IVZI.js} +3 -3
  54. package/dist-cli/chunks/{config-JD23SW7N.js → config-LU3HYSGJ.js} +2 -2
  55. package/dist-cli/chunks/control-L4C43O4N.js +2 -0
  56. package/dist-cli/chunks/{cpu-profile-2Z4KGCAE.js → cpu-profile-SJV2ERLS.js} +2 -2
  57. package/dist-cli/chunks/{daemon-NDO6JPDH.js → daemon-TMW3WV27.js} +2 -2
  58. package/dist-cli/chunks/{debug-RBVMEH33.js → debug-PBM4L52R.js} +3 -3
  59. package/dist-cli/chunks/{detox-TBJAZEBB.js → detox-VANQVBBM.js} +2 -2
  60. package/dist-cli/chunks/{device-26YM4HM7.js → device-VIMOCLKX.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-PW7FGUOI.js → diagnose-CRCRKGLQ.js} +2 -2
  62. package/dist-cli/chunks/drivers-OUO3WJ3H.js +2 -0
  63. package/dist-cli/chunks/{electron-TBMZ3C5I.js → electron-SWTX2DO7.js} +3 -3
  64. package/dist-cli/chunks/flow-RGF7ZOD4.js +2 -0
  65. package/dist-cli/chunks/help-OTY4AGCS.js +2 -0
  66. package/dist-cli/chunks/{hints-Q3I4PXMT.js → hints-KM6DYEYZ.js} +2 -2
  67. package/dist-cli/chunks/{home-paths-P5GMZADH.js → home-paths-VON247XB.js} +2 -2
  68. package/dist-cli/chunks/{inspect-UTHL2UK4.js → inspect-Z3KYGCZ4.js} +3 -3
  69. package/dist-cli/chunks/install-HHP7GSJ4.js +2 -0
  70. package/dist-cli/chunks/{install-desktop-XQYE3QYC.js → install-desktop-XDZLXMC2.js} +3 -3
  71. package/dist-cli/chunks/{keys-75OBQ7OF.js → keys-KEPNUBCA.js} +2 -2
  72. package/dist-cli/chunks/{launch-TFE3CZZ3.js → launch-S2H6FBFG.js} +3 -3
  73. package/dist-cli/chunks/{login-EIL5PLK4.js → login-RDMQ4LGI.js} +4 -4
  74. package/dist-cli/chunks/{logout-2DXPOPWE.js → logout-HDPMIRMV.js} +2 -2
  75. package/dist-cli/chunks/{maestro-Q27CNJGT.js → maestro-A3QGVBQW.js} +2 -2
  76. package/dist-cli/chunks/{preview-ZGVCXKQZ.js → preview-HXMXXPPF.js} +2 -2
  77. package/dist-cli/chunks/{profile-TCX6GYV5.js → profile-CXIPWQLZ.js} +2 -2
  78. package/dist-cli/chunks/{react-24D26RLU.js → react-PNVZTDPA.js} +2 -2
  79. package/dist-cli/chunks/{record-3MODR5RQ.js → record-LALIKJN2.js} +2 -2
  80. package/dist-cli/chunks/runtime-OQQOJSTS.js +2 -0
  81. package/dist-cli/chunks/runtime-delivery-IU6INVF7.js +2 -0
  82. package/dist-cli/chunks/{screenshot-4A6JTLUV.js → screenshot-RITJ6BZH.js} +2 -2
  83. package/dist-cli/chunks/{screenshot-mode-KVMXLFJ4.js → screenshot-mode-4ZMTOYNG.js} +2 -2
  84. package/dist-cli/chunks/{screenshots-XGG6PNXW.js → screenshots-LDJZ4CFO.js} +2 -2
  85. package/dist-cli/chunks/{server-MRLLYDV7.js → server-2Q6HJBRG.js} +3 -3
  86. package/dist-cli/chunks/setup-repo-3JXYJESB.js +2 -0
  87. package/dist-cli/chunks/{skills-COR2GQRN.js → skills-7HSB6DOQ.js} +2 -2
  88. package/dist-cli/chunks/{start-SD27AJ7E.js → start-MM3GHFNB.js} +4 -4
  89. package/dist-cli/chunks/store-EOS7PN7Y.js +2 -0
  90. package/dist-cli/chunks/telemetry-MJ2ZVNZG.js +2 -0
  91. package/dist-cli/chunks/{test-4N6K3C5R.js → test-JVZONK7Z.js} +3 -3
  92. package/dist-cli/chunks/{three-mode-PJQGXIP4.js → three-mode-5LHS72VD.js} +2 -2
  93. package/dist-cli/chunks/{timeline-C7JSMHCV.js → timeline-AN3WAGXK.js} +2 -2
  94. package/dist-cli/chunks/{upgrade-SFUV6KPW.js → upgrade-LES72FX4.js} +2 -2
  95. package/dist-cli/chunks/upload-JE2ORZSH.js +2 -0
  96. package/dist-cli/chunks/version-SKCJLX5C.js +4 -0
  97. package/dist-cli/chunks/{web-GK27H4NM.js → web-AWRFEEZU.js} +2 -2
  98. package/dist-cli/chunks/{what-happened-GAY54LBV.js → what-happened-JNCZGYUL.js} +2 -2
  99. package/dist-cli/chunks/{whoami-C2WULTLS.js → whoami-HYV4EQ5D.js} +2 -2
  100. package/dist-lib/agent-daemon-client.cjs +1 -1
  101. package/dist-lib/agent-events.cjs +1 -1
  102. package/dist-lib/agent-sessions.cjs +1 -1
  103. package/dist-lib/attached-projects.cjs +1 -1
  104. package/dist-lib/auth/shared-session.cjs +1 -1
  105. package/dist-lib/backend-origin.cjs +1 -1
  106. package/dist-lib/beta.cjs +1 -1
  107. package/dist-lib/beta.mjs +1 -1
  108. package/dist-lib/bridge-constants.cjs +1 -1
  109. package/dist-lib/cli-constants.cjs +1 -1
  110. package/dist-lib/config.cjs +1 -1
  111. package/dist-lib/detox/index.cjs +1 -1
  112. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  113. package/dist-lib/home-paths.cjs +1 -1
  114. package/dist-lib/host/bridge-host.cjs +1 -1
  115. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  116. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  117. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  118. package/dist-lib/host/websocket-proxy.cjs +1 -1
  119. package/dist-lib/index.cjs +1 -1
  120. package/dist-lib/metro.cjs +1 -1
  121. package/dist-lib/profiles.cjs +1 -1
  122. package/dist-lib/render-mode.cjs +1 -1
  123. package/dist-lib/scripts/demo-app-registry.cjs +1 -1
  124. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  125. package/dist-lib/sdk.cjs +1 -1
  126. package/dist-lib/sdk.mjs +1 -1
  127. package/dist-lib/skills.cjs +1 -1
  128. package/dist-lib/vite.cjs +1 -1
  129. package/package.json +1 -1
  130. package/src/runtime-delivery.ts +100 -0
  131. package/dist-cli/chunks/auto-bootstrap-IPNK6GF7.js +0 -2
  132. package/dist-cli/chunks/beta-RG7JT6HD.js +0 -2
  133. package/dist-cli/chunks/chunk-2FTVPI7F.js +0 -2
  134. package/dist-cli/chunks/chunk-BTWXWUDB.js +0 -1
  135. package/dist-cli/chunks/chunk-KXLYXKMA.js +0 -1
  136. package/dist-cli/chunks/chunk-QUEATUWT.js +0 -1
  137. package/dist-cli/chunks/chunk-VJPN6DQU.js +0 -4
  138. package/dist-cli/chunks/chunk-YQIFU3PB.js +0 -25
  139. package/dist-cli/chunks/cli-version-DPV7EKFK.js +0 -2
  140. package/dist-cli/chunks/control-IAHPU5HD.js +0 -2
  141. package/dist-cli/chunks/drivers-L6UY2JC6.js +0 -2
  142. package/dist-cli/chunks/flow-QSDMMKNZ.js +0 -2
  143. package/dist-cli/chunks/help-OC7HYZ5F.js +0 -2
  144. package/dist-cli/chunks/install-3UWGXX6F.js +0 -2
  145. package/dist-cli/chunks/runtime-5MJPHLRZ.js +0 -2
  146. package/dist-cli/chunks/runtime-delivery-NWSDCFAI.js +0 -2
  147. package/dist-cli/chunks/setup-repo-OUMNEC36.js +0 -2
  148. package/dist-cli/chunks/store-JVV7G7VY.js +0 -2
  149. package/dist-cli/chunks/telemetry-BMJNBZT6.js +0 -2
  150. package/dist-cli/chunks/upload-XQLVCUKI.js +0 -2
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{f,m as T}from"./chunk-QNQO5VHO.js";import{I as A,J as D,K as O,L as x,M as v}from"./chunk-WHL7FMLG.js";import{c as S,e as $,g as N}from"./chunk-NQ4EDJV4.js";import"./chunk-SF6W3FRS.js";import"./chunk-KY6NY6WN.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{f,m as T}from"./chunk-G6Z5E4KX.js";import{I as A,J as D,K as O,L as x,M as v}from"./chunk-RBWDMEWN.js";import{c as S,e as $,g as N}from"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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-UTHL2UK4.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-Z3KYGCZ4.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as S}from"./chunk-KTE2VIXH.js";import"./chunk-VX5CAWLC.js";import"./chunk-KXLYXKMA.js";import"./chunk-MUTDER75.js";import"./chunk-5OA35LZX.js";import"./chunk-OEV7EOMC.js";import"./chunk-CGB6KRKN.js";import"./chunk-MSU27JEW.js";import"./chunk-RVWJ3TAE.js";import"./chunk-QNQO5VHO.js";import"./chunk-WHL7FMLG.js";import"./chunk-4UQMPWDA.js";import"./chunk-NQ4EDJV4.js";import"./chunk-LT2X5ISU.js";import"./chunk-VALW4SKE.js";import"./chunk-QUEATUWT.js";import"./chunk-3A7SRWSQ.js";import"./chunk-VSRV5LFU.js";import"./chunk-SF6W3FRS.js";import"./chunk-OBYYAT4F.js";import"./chunk-SA5RP334.js";import"./chunk-W3FBNBTX.js";import"./chunk-2FTVPI7F.js";import"./chunk-KY6NY6WN.js";import"./chunk-PMAKUYYK.js";import"./chunk-X4LYRBLZ.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as S}from"./chunk-BII2H2BR.js";import"./chunk-M6ML3LBZ.js";import"./chunk-EGFZLSP4.js";import"./chunk-ITGWJM6W.js";import"./chunk-QD5YATLL.js";import"./chunk-7AXDJ2RV.js";import"./chunk-AK2PW7XZ.js";import"./chunk-2XDZ42A6.js";import"./chunk-V4OEITZA.js";import"./chunk-G6Z5E4KX.js";import"./chunk-RBWDMEWN.js";import"./chunk-SUQAFFJO.js";import"./chunk-J27RHTWH.js";import"./chunk-36BDR3DE.js";import"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import"./chunk-3MKNANBV.js";import"./chunk-KWXV47VS.js";import"./chunk-UQHBJ2L2.js";import"./chunk-6NW6PC3P.js";import"./chunk-6PKYLQ36.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-KXLYXKMA.js";import{c as d,e as l,h as a}from"./chunk-NQ4EDJV4.js";import"./chunk-SF6W3FRS.js";import"./chunk-W3FBNBTX.js";import"./chunk-KY6NY6WN.js";import"./chunk-PMAKUYYK.js";import{f as c,g as r,h as g}from"./chunk-X4LYRBLZ.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";function h(){console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-EGFZLSP4.js";import{c as d,e as l,h as a}from"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-3MKNANBV.js";import"./chunk-UQHBJ2L2.js";import"./chunk-6NW6PC3P.js";import{f as c,g as r,h as g}from"./chunk-6PKYLQ36.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as E,e as R,h as b}from"./chunk-NQ4EDJV4.js";import{b as v}from"./chunk-SF6W3FRS.js";import"./chunk-KY6NY6WN.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as E,e as R,h as b}from"./chunk-J27RHTWH.js";import{b as v}from"./chunk-366ZIBQX.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-3P4C6X6M.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-36BDR3DE.js";import"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-I26R4PE2.js";import"./chunk-BTWXWUDB.js";import{a as v,g as h}from"./chunk-MSU27JEW.js";import"./chunk-RVWJ3TAE.js";import"./chunk-QNQO5VHO.js";import"./chunk-WHL7FMLG.js";import"./chunk-4UQMPWDA.js";import"./chunk-NQ4EDJV4.js";import{b as f,g as u}from"./chunk-LT2X5ISU.js";import{a as p}from"./chunk-VALW4SKE.js";import"./chunk-QUEATUWT.js";import{c as m}from"./chunk-3A7SRWSQ.js";import"./chunk-VSRV5LFU.js";import"./chunk-SF6W3FRS.js";import"./chunk-2FTVPI7F.js";import"./chunk-KY6NY6WN.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-ESUDARF7.js";import"./chunk-3P4C6X6M.js";import{a as v,g as h}from"./chunk-2XDZ42A6.js";import"./chunk-V4OEITZA.js";import"./chunk-G6Z5E4KX.js";import"./chunk-RBWDMEWN.js";import"./chunk-SUQAFFJO.js";import"./chunk-J27RHTWH.js";import{b as f,g as u}from"./chunk-36BDR3DE.js";import{a as p}from"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import{c as m}from"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import"./chunk-KWXV47VS.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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-XQYE3QYC.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-XDZLXMC2.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as c,b as d,c as e,d as f}from"./chunk-BII2H2BR.js";import"./chunk-M6ML3LBZ.js";import"./chunk-EGFZLSP4.js";import"./chunk-ITGWJM6W.js";import"./chunk-QD5YATLL.js";import"./chunk-7AXDJ2RV.js";import{d as a,e as b}from"./chunk-AK2PW7XZ.js";import"./chunk-2XDZ42A6.js";import"./chunk-V4OEITZA.js";import"./chunk-G6Z5E4KX.js";import"./chunk-RBWDMEWN.js";import"./chunk-SUQAFFJO.js";import"./chunk-J27RHTWH.js";import"./chunk-36BDR3DE.js";import"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import"./chunk-3MKNANBV.js";import"./chunk-KWXV47VS.js";import"./chunk-UQHBJ2L2.js";import"./chunk-6NW6PC3P.js";import"./chunk-6PKYLQ36.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-X6PIQ3OM.js";import"./chunk-3MKNANBV.js";import"./chunk-FFMAP2HL.js";import"./chunk-KWXV47VS.js";import"./chunk-UQHBJ2L2.js";import"./chunk-LKSAMFVM.js";import"./chunk-D5VB3SJP.js";import"./chunk-6PKYLQ36.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as n,c as r,d as l}from"./chunk-VSKLWCFM.js";import"./chunk-SF6W3FRS.js";import"./chunk-SRA2TVCG.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as n,c as r,d as l}from"./chunk-GX2FFJV6.js";import"./chunk-366ZIBQX.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,D as activeRuntimeDir,j as activeRuntimeFile,r as cacheDir,H as claimDaemonLockfile,C as compareSemver,t as configFilePath,p as daemonAppBundlePath,o as daemonAppDir,q as daemonAppLauncherPath,s as daemonLockfilePath,k as electronDir,l as electronUserDataDir,m as electronVersionDir,y as ensureSootsimHome,F as isDaemonLockfileFresh,g as isSootsimDevCheckout,B as listInstalledRuntimes,n as profilesDir,z as readActiveRuntime,E as readDaemonLockfile,u as readSharedConfig,w as readTelemetryEnabled,I as removeDaemonLockfile,i as runtimeDir,h as runtimesDir,f as sootsimHomeDir,A as writeActiveRuntime,G as writeDaemonLockfile,v as writeSharedConfig,x as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,D as activeRuntimeDir,j as activeRuntimeFile,r as cacheDir,H as claimDaemonLockfile,C as compareSemver,t as configFilePath,p as daemonAppBundlePath,o as daemonAppDir,q as daemonAppLauncherPath,s as daemonLockfilePath,k as electronDir,l as electronUserDataDir,m as electronVersionDir,y as ensureSootsimHome,F as isDaemonLockfileFresh,g as isSootsimDevCheckout,B as listInstalledRuntimes,n as profilesDir,z as readActiveRuntime,E as readDaemonLockfile,u as readSharedConfig,w as readTelemetryEnabled,I as removeDaemonLockfile,i as runtimeDir,h as runtimesDir,f as sootsimHomeDir,A as writeActiveRuntime,G as writeDaemonLockfile,v as writeSharedConfig,x as writeTelemetryEnabled};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as G}from"./chunk-VSKLWCFM.js";import{a as wt,b as xt}from"./chunk-7RXO4KKF.js";import{a as Ye,h as $e,k as ee}from"./chunk-CGB6KRKN.js";import{b as $t,c as St,j as vt}from"./chunk-MSU27JEW.js";import"./chunk-RVWJ3TAE.js";import{a as Z,b as A,c as P,d as Pe,e as re,f as Y,g as ce,h as pe,i as yt,j as ht,k as Re,l as bt}from"./chunk-QNQO5VHO.js";import{A as mt,E as pt,G as le,H as ft,N as gt,a as be,b as Ge,c as Xe,d as Ve,e as Qe,f as Ze,g as et,h as tt,i as ot,j as st,k as _e,l as Oe,p as Ae,q as nt,r as rt,s as we,t as it,u as xe,v as at,w as lt,x as ct,y as dt,z as ut}from"./chunk-WHL7FMLG.js";import"./chunk-4UQMPWDA.js";import{c as He,e as Ue,f as Ke,g as ze,h as Fe}from"./chunk-NQ4EDJV4.js";import"./chunk-LT2X5ISU.js";import"./chunk-VALW4SKE.js";import"./chunk-QUEATUWT.js";import"./chunk-3A7SRWSQ.js";import"./chunk-VSRV5LFU.js";import{b as qe}from"./chunk-SF6W3FRS.js";import{a as Je}from"./chunk-3WDN2S2A.js";import{a as Ie,c as Ne}from"./chunk-2U4CGOD6.js";import{a as We}from"./chunk-2FTVPI7F.js";import"./chunk-KY6NY6WN.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import{existsSync as co,mkdirSync as uo,readFileSync as mo,rmSync as kt,writeFileSync as po}from"fs";import{tmpdir as fo}from"os";import{dirname as go,join as yo,resolve as ho}from"path";var fe=1,bo="SOOTSIM_INSPECT_NOTICE_PATH",wo=300*1e3,xo=15e3;function Tt(){return ho(process.env[bo]||yo(fo(),"sootsim-inspect-notice-state.json"))}function $o(e,c){return Object.fromEntries(Object.entries(e).filter(([,n])=>typeof n?.signature=="string"&&Number.isFinite(n?.updatedAt)&&c-n.updatedAt<=wo))}function So(e){let c=Tt();if(!co(c))return{version:fe,entries:{}};try{let n=JSON.parse(mo(c,"utf8"));return n.version!==fe||!n.entries||typeof n.entries!="object"?(kt(c,{force:!0}),{version:fe,entries:{}}):{version:fe,entries:$o(n.entries,e)}}catch{return kt(c,{force:!0}),{version:fe,entries:{}}}}function vo(e){let c=Tt();uo(go(c),{recursive:!0}),po(c,JSON.stringify(e,null,2)+`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as G}from"./chunk-GX2FFJV6.js";import{a as wt,b as xt}from"./chunk-5GQJWYO7.js";import{a as Ye,h as $e,k as ee}from"./chunk-AK2PW7XZ.js";import{b as $t,c as St,j as vt}from"./chunk-2XDZ42A6.js";import"./chunk-V4OEITZA.js";import{a as Z,b as A,c as P,d as Pe,e as re,f as Y,g as ce,h as pe,i as yt,j as ht,k as Re,l as bt}from"./chunk-G6Z5E4KX.js";import{A as mt,E as pt,G as le,H as ft,N as gt,a as be,b as Ge,c as Xe,d as Ve,e as Qe,f as Ze,g as et,h as tt,i as ot,j as st,k as _e,l as Oe,p as Ae,q as nt,r as rt,s as we,t as it,u as xe,v as at,w as lt,x as ct,y as dt,z as ut}from"./chunk-RBWDMEWN.js";import"./chunk-SUQAFFJO.js";import{c as He,e as Ue,f as Ke,g as ze,h as Fe}from"./chunk-J27RHTWH.js";import"./chunk-36BDR3DE.js";import"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import{b as qe}from"./chunk-366ZIBQX.js";import{a as Je}from"./chunk-3JHF4F55.js";import{a as Ie,c as Ne}from"./chunk-FFMAP2HL.js";import{a as We}from"./chunk-KWXV47VS.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import{existsSync as co,mkdirSync as uo,readFileSync as mo,rmSync as kt,writeFileSync as po}from"fs";import{tmpdir as fo}from"os";import{dirname as go,join as yo,resolve as ho}from"path";var fe=1,bo="SOOTSIM_INSPECT_NOTICE_PATH",wo=300*1e3,xo=15e3;function Tt(){return ho(process.env[bo]||yo(fo(),"sootsim-inspect-notice-state.json"))}function $o(e,c){return Object.fromEntries(Object.entries(e).filter(([,n])=>typeof n?.signature=="string"&&Number.isFinite(n?.updatedAt)&&c-n.updatedAt<=wo))}function So(e){let c=Tt();if(!co(c))return{version:fe,entries:{}};try{let n=JSON.parse(mo(c,"utf8"));return n.version!==fe||!n.entries||typeof n.entries!="object"?(kt(c,{force:!0}),{version:fe,entries:{}}):{version:fe,entries:$o(n.entries,e)}}catch{return kt(c,{force:!0}),{version:fe,entries:{}}}}function vo(e){let c=Tt();uo(go(c),{recursive:!0}),po(c,JSON.stringify(e,null,2)+`
3
3
  `)}function ko(e,c){let n=c.trim()||"default";return`${e}:${n}`}function Ee(e,c,n,l={}){let m=l.nowMs??Date.now(),a=l.cooldownMs??xo,g=So(m),y=ko(e,c),T=g.entries[y];return T&&T.signature===n&&m-T.updatedAt<a?!1:(g.entries[y]={signature:n,updatedAt:m},vo(g),!0)}var To={initialWaitMs:3e3,deadlineMs:5e3,retryWaitMs:700},Mo={initialWaitMs:1200,deadlineMs:2500,retryWaitMs:700};function Io(e,c={}){return{...e?To:Mo,...c}}function de(e){return!(!e||e.hit===!1||e.ok===!1||e.pointerTapHandled===!1&&!e.keyboardOpened&&!e.isTextInput)}function No(e,c){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??c??null,type:e.target?.type??e.match?.type??e.node?.type??null}}async function ge(e,c){let n=Io(!!c.agent,c.timing),l=0,m=null,a=null;try{await ee({bridge:e,maxMs:n.initialWaitMs,pollMs:32,stablePolls:2})}catch{}let g=Date.now()+n.deadlineMs;for(;Date.now()<=g||l===0;){l++;let y=await c.resolve();if(m=y,y?.error==="bridge-not-ready"||y?.ambiguous||y?.nthOutOfRange)return{payload:y,result:null,attempts:l,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:No(y,c.textFallback)});if(a=M,de(M))return{payload:y,result:M,attempts:l}}let T=g-Date.now();if(T<=0)break;try{await ee({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:a,attempts:l,failure:m&&typeof m.cx=="number"?"missed":"not-found"}}async function Mt(e,c,n,l){return e.send({type:"tap",x:c,y:n,...l?{target:l}:{}})}async function It(e,c,n={}){let l=JSON.stringify(c);return ge(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
@@ -315,7 +315,7 @@ import{a as G}from"./chunk-VSKLWCFM.js";import{a as wt,b as xt}from"./chunk-7RXO
315
315
  `);console.log(`${t??""}
316
316
 
317
317
  ${s}
318
- `),process.exit(0)}let _=m.wsPort,I=m.simId,R=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-L6UY2JC6.js"),t=o();console.log(` available drivers (${t.length}):
318
+ `),process.exit(0)}let _=m.wsPort,I=m.simId,R=m.simIdSource,j=m.commandTimeoutMs;if(g==="list"&&l.some(o=>o==="--drivers"||o==="-D")){let{buildDriverListRows:o}=await import("./drivers-OUO3WJ3H.js"),t=o();console.log(` available drivers (${t.length}):
319
319
  `);let s=Math.max(...t.map(i=>i.id.length),6),r=Math.max(...t.map(i=>i.kind.length),4);for(let i of t){let u=i.available?"\u2713":"\u2717",p=i.id.padEnd(s),w=i.kind.padEnd(r);console.log(` ${u} ${p} ${w} ${i.description}`),i.available&&i.detail?console.log(` ${i.detail}`):!i.available&&i.reason&&console.log(` unavailable: ${i.reason}`)}return}let d=Ue(m),z=I||"default",B=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),C=200;function V(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(),i=/<body[^>]*>([\s\S]*?)<\//i.exec(o)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),u=r||i||"html error page";return`<html ${o.length}B> "${u}" (body elided \u2014 add --json for the full payload)`}return t.length<=C?t:`${t.slice(0,C)}\u2026 (+${t.length-C} more bytes)`}function te(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=ue()?5e3:1500;try{let{settled:s,elapsed:r}=await ee({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.
320
320
  `)}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 d.send({type:"evaluate",code:`(() => ({
321
321
  console: ${xe},
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-GLVNMGFD.js";import"./chunk-ESUDARF7.js";import"./chunk-RH3GHGRZ.js";import"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as b}from"./chunk-I26R4PE2.js";import{a as x}from"./chunk-VALW4SKE.js";import"./chunk-SRA2TVCG.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 k}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 _({url:n,dest:o,onProgress:e}){let s=await fetch(n,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${n})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");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 I(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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as b}from"./chunk-ESUDARF7.js";import{a as x}from"./chunk-S2RR2IZC.js";import"./chunk-IBEQOTJK.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 k}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 _({url:n,dest:o,onProgress:e}){let s=await fetch(n,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${n})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");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 I(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=k(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=k(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 G(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 b("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 _({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${I(r,m)}`))}})}catch(r){g(a,{recursive:!0,force:!0}),console.error(`
22
22
  download failed: ${r instanceof Error?r.message:String(r)}`),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-BMJNBZT6.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{G 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-MJ2ZVNZG.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{G as runInstallDesktop};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (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-OEV7EOMC.js";import{d as c}from"./chunk-SA5RP334.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.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.122 | (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-7AXDJ2RV.js";import{d as c}from"./chunk-VHPYIZ3U.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-BTWXWUDB.js";import{b as m}from"./chunk-LT2X5ISU.js";import{a as u}from"./chunk-VALW4SKE.js";import"./chunk-QUEATUWT.js";import"./chunk-3A7SRWSQ.js";import"./chunk-VSRV5LFU.js";import"./chunk-SF6W3FRS.js";import{D as c,E as r,F as l,y as s,z as a}from"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import{spawn as p}from"child_process";import{existsSync as h}from"fs";async function I(n){if(n.includes("--help")||n.includes("-h")){console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-3P4C6X6M.js";import{b as m}from"./chunk-36BDR3DE.js";import{a as u}from"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import{D as c,E as r,F as l,y as s,z as a}from"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import{spawn as p}from"child_process";import{existsSync as h}from"fs";async function I(n){if(n.includes("--help")||n.includes("-h")){console.log(`
3
3
  sootsim launch \u2014 one-shot: install runtime if needed, start daemon, open app
4
4
 
5
5
  usage:
@@ -13,4 +13,4 @@ options:
13
13
  examples:
14
14
  sootsim launch
15
15
  sootsim launch --version 1.2.3
16
- `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-5MJPHLRZ.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await t(["install",...o],{channel:n.channel})}async function d(){let n=r();if(l(n))return;console.log("sootsim: starting daemon");let e=w();p(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let t=Date.now()+8e3;for(;Date.now()<t;){let o=r();if(l(o))return;await g(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function x(){u()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await m.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function w(){let n=process.argv[1];return n&&h(n)?n:"sootsim"}function g(n){return new Promise(e=>setTimeout(e,n))}async function R(){s(),await d()}export{R as ensureDaemonRunning,I as runLaunch};
16
+ `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-OQQOJSTS.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await t(["install",...o],{channel:n.channel})}async function d(){let n=r();if(l(n))return;console.log("sootsim: starting daemon");let e=w();p(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let t=Date.now()+8e3;for(;Date.now()<t;){let o=r();if(l(o))return;await g(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function x(){u()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await m.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function w(){let n=process.argv[1];return n&&h(n)?n:"sootsim"}function g(n){return new Promise(e=>setTimeout(e,n))}async function R(){s(),await d()}export{R as ensureDaemonRunning,I as runLaunch};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as g,d as m}from"./chunk-SA5RP334.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as g,d as m}from"./chunk-VHPYIZ3U.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(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")}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-BMJNBZT6.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=$(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,O=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:O}),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")}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-MJ2ZVNZG.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=$(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,O=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:O}),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-BMJNBZT6.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-BMJNBZT6.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-MJ2ZVNZG.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-MJ2ZVNZG.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as r,b as i}from"./chunk-OBYYAT4F.js";import{a as t,c as o}from"./chunk-SA5RP334.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-3BCXNVBN.js";import{a as t,c as o}from"./chunk-VHPYIZ3U.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as h,c as w}from"./chunk-KTE2VIXH.js";import"./chunk-VX5CAWLC.js";import"./chunk-KXLYXKMA.js";import"./chunk-MUTDER75.js";import"./chunk-5OA35LZX.js";import"./chunk-OEV7EOMC.js";import"./chunk-CGB6KRKN.js";import"./chunk-MSU27JEW.js";import"./chunk-RVWJ3TAE.js";import"./chunk-QNQO5VHO.js";import"./chunk-WHL7FMLG.js";import"./chunk-4UQMPWDA.js";import"./chunk-NQ4EDJV4.js";import"./chunk-LT2X5ISU.js";import"./chunk-VALW4SKE.js";import"./chunk-QUEATUWT.js";import"./chunk-3A7SRWSQ.js";import"./chunk-VSRV5LFU.js";import"./chunk-SF6W3FRS.js";import"./chunk-OBYYAT4F.js";import"./chunk-SA5RP334.js";import"./chunk-W3FBNBTX.js";import"./chunk-2FTVPI7F.js";import"./chunk-KY6NY6WN.js";import"./chunk-PMAKUYYK.js";import"./chunk-X4LYRBLZ.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import*as i from"fs";import*as l from"path";var v=[".maestro","maestro"];function x(){console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as h,c as w}from"./chunk-BII2H2BR.js";import"./chunk-M6ML3LBZ.js";import"./chunk-EGFZLSP4.js";import"./chunk-ITGWJM6W.js";import"./chunk-QD5YATLL.js";import"./chunk-7AXDJ2RV.js";import"./chunk-AK2PW7XZ.js";import"./chunk-2XDZ42A6.js";import"./chunk-V4OEITZA.js";import"./chunk-G6Z5E4KX.js";import"./chunk-RBWDMEWN.js";import"./chunk-SUQAFFJO.js";import"./chunk-J27RHTWH.js";import"./chunk-36BDR3DE.js";import"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import"./chunk-3MKNANBV.js";import"./chunk-KWXV47VS.js";import"./chunk-UQHBJ2L2.js";import"./chunk-6NW6PC3P.js";import"./chunk-6PKYLQ36.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import*as i from"fs";import*as l from"path";var v=[".maestro","maestro"];function x(){console.log(`
3
3
  sootsim maestro \u2014 run maestro YAML flows against sootsim (drop-in)
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-SRA2TVCG.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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-IBEQOTJK.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.121 | (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-3A7SRWSQ.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";function f(){console.log(`
1
+ /*! sootsim v0.1.122 | (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-NIL4WJUK.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as w,e as b,h as m,i as f}from"./chunk-NQ4EDJV4.js";import"./chunk-SF6W3FRS.js";import"./chunk-KY6NY6WN.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";function h(){console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as w,e as b,h as m,i as f}from"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.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.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as P}from"./chunk-MUTDER75.js";import"./chunk-5OA35LZX.js";import{d as Z,f as ee}from"./chunk-OEV7EOMC.js";import"./chunk-4UQMPWDA.js";import{c as b,e as v,f as Y}from"./chunk-NQ4EDJV4.js";import"./chunk-QUEATUWT.js";import{d as X}from"./chunk-VSRV5LFU.js";import{b as Q}from"./chunk-SF6W3FRS.js";import"./chunk-OBYYAT4F.js";import"./chunk-SA5RP334.js";import"./chunk-KY6NY6WN.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import{existsSync as we,mkdirSync as B,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 D,extname as oe,join as N,resolve as Se}from"path";var z=24e4,Re=3e4;async function W(e,r,o,i){let t=Math.max(2e4,i+Re);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.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as P}from"./chunk-ITGWJM6W.js";import"./chunk-QD5YATLL.js";import{d as Z,f as ee}from"./chunk-7AXDJ2RV.js";import"./chunk-SUQAFFJO.js";import{c as b,e as v,f as Y}from"./chunk-J27RHTWH.js";import"./chunk-LYZ3GSCB.js";import{d as X}from"./chunk-IRSVHE5W.js";import{b as Q}from"./chunk-366ZIBQX.js";import"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import{existsSync as we,mkdirSync as B,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 D,extname as oe,join as N,resolve as Se}from"path";var z=24e4,Re=3e4;async function W(e,r,o,i){let t=Math.max(2e4,i+Re);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
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b}from"./chunk-TZLLRML5.js";import"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-UQHBJ2L2.js";import"./chunk-7OVVG4L6.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";export{b as formatReleaseEntry,a as runRuntime};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-7OVVG4L6.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";export{a as DEFAULT_RUNTIME_CDN_ORIGIN,b as RUNTIME_CDN_ORIGIN_ENV,c as RUNTIME_CHANNEL_ENV,n as checkRuntimeUpToDate,h as fetchRuntimeManifest,j as fetchRuntimeReleases,l as installRuntime,d as resolveRuntimeCdnOrigin,e as resolveRuntimeChannel,k as resolveRuntimeVersion,f as runtimeManifestUrl,i as runtimeReleasesUrl,g as runtimeTarballUrl,m as updateRuntimeToLatest};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as S}from"./chunk-VX5CAWLC.js";import"./chunk-KXLYXKMA.js";import{a as b}from"./chunk-7RXO4KKF.js";import{c as g,d as w,e as y,f as v,h as x}from"./chunk-NQ4EDJV4.js";import"./chunk-SF6W3FRS.js";import"./chunk-W3FBNBTX.js";import"./chunk-KY6NY6WN.js";import"./chunk-PMAKUYYK.js";import{f as m}from"./chunk-X4LYRBLZ.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import{mkdirSync as A,writeFileSync as R}from"fs";import{dirname as E,resolve as F}from"path";async function J(t,o){let e=U(t);(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as S}from"./chunk-M6ML3LBZ.js";import"./chunk-EGFZLSP4.js";import{a as b}from"./chunk-5GQJWYO7.js";import{c as g,d as w,e as y,f as v,h as x}from"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-3MKNANBV.js";import"./chunk-UQHBJ2L2.js";import"./chunk-6NW6PC3P.js";import{f as m}from"./chunk-6PKYLQ36.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import{mkdirSync as A,writeFileSync as R}from"fs";import{dirname as E,resolve as F}from"path";async function J(t,o){let e=U(t);(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim screenshot \u2014 capture the canvas as a PNG
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as o}from"./chunk-B77PWTHR.js";import"./chunk-NQ4EDJV4.js";import"./chunk-SF6W3FRS.js";import"./chunk-KY6NY6WN.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";async function n(e,s){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-S5KZH7JJ.js";import"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";async function n(e,s){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim screenshot-mode \u2014 toggle the screenshot-mode chrome overlay
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as Y}from"./chunk-KTE2VIXH.js";import{b as j}from"./chunk-VX5CAWLC.js";import"./chunk-KXLYXKMA.js";import"./chunk-MUTDER75.js";import"./chunk-5OA35LZX.js";import"./chunk-OEV7EOMC.js";import{b as O}from"./chunk-CGB6KRKN.js";import"./chunk-MSU27JEW.js";import"./chunk-RVWJ3TAE.js";import"./chunk-QNQO5VHO.js";import"./chunk-WHL7FMLG.js";import"./chunk-4UQMPWDA.js";import"./chunk-NQ4EDJV4.js";import"./chunk-LT2X5ISU.js";import"./chunk-VALW4SKE.js";import"./chunk-QUEATUWT.js";import"./chunk-3A7SRWSQ.js";import"./chunk-VSRV5LFU.js";import"./chunk-SF6W3FRS.js";import"./chunk-OBYYAT4F.js";import"./chunk-SA5RP334.js";import"./chunk-W3FBNBTX.js";import"./chunk-2FTVPI7F.js";import"./chunk-KY6NY6WN.js";import"./chunk-PMAKUYYK.js";import{a as w,b as D,c as k,d as z,e as x,f as T}from"./chunk-X4LYRBLZ.js";import"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import{mkdirSync as B,readFileSync as pe,writeFileSync as G}from"fs";import{tmpdir as je}from"os";import C from"path";import{mkdirSync as I,readFileSync as Q,writeFileSync as H}from"fs";import F from"path";function _(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function v(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ee(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function M(e,t){let o=ee(e),i=Math.max(0,Math.min(1,t)),n=o.match(/^#([0-9a-f]{6})$/i);if(n){let s=n[1],r=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),u=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${u}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function te(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function re(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${M(t,.46)} 0%, ${M(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function A(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";case"straight":default:return"none"}}function L(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function E(e){let t=M(e.color,e.opacity),o=M(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function R(e,t){return!t.glow||e.color&&e.color!==w.color?e:{...e,color:t.glow}}function oe(e,t){if(e==="editorial-left"){let n=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),c=a.pose||r.pose||"tilted-right",m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.18)+l}px`,`left:${Math.round(t.width*.56)}px`,`width:${p}px`,"transform-origin:center center",`transform:${A(c)}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let n=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),c=a.pose||r.pose,m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${L("translateX(-50%)",A(c))}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,s,r)=>{let a=t.name==="ipad-13"?.54:.64,u=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,c=R(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${u}px`,"transform-origin:center top",`transform:${L("translateX(-50%)",A(l))}`,`filter:${E(c)}`,"z-index:2"].join(";")}}}function ne({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=oe(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),u=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${v(o.headline)}</div>`:"",p=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${v(o.subheadline)}</div>`:"",l=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${v(o.eyebrow)}</div></div>`:"";return`<!doctype html>
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as Y}from"./chunk-BII2H2BR.js";import{b as j}from"./chunk-M6ML3LBZ.js";import"./chunk-EGFZLSP4.js";import"./chunk-ITGWJM6W.js";import"./chunk-QD5YATLL.js";import"./chunk-7AXDJ2RV.js";import{b as O}from"./chunk-AK2PW7XZ.js";import"./chunk-2XDZ42A6.js";import"./chunk-V4OEITZA.js";import"./chunk-G6Z5E4KX.js";import"./chunk-RBWDMEWN.js";import"./chunk-SUQAFFJO.js";import"./chunk-J27RHTWH.js";import"./chunk-36BDR3DE.js";import"./chunk-S2RR2IZC.js";import"./chunk-LYZ3GSCB.js";import"./chunk-NIL4WJUK.js";import"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import"./chunk-3MKNANBV.js";import"./chunk-KWXV47VS.js";import"./chunk-UQHBJ2L2.js";import"./chunk-6NW6PC3P.js";import{a as w,b as D,c as k,d as z,e as x,f as T}from"./chunk-6PKYLQ36.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import{mkdirSync as B,readFileSync as pe,writeFileSync as G}from"fs";import{tmpdir as je}from"os";import C from"path";import{mkdirSync as I,readFileSync as Q,writeFileSync as H}from"fs";import F from"path";function _(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function v(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ee(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function M(e,t){let o=ee(e),i=Math.max(0,Math.min(1,t)),n=o.match(/^#([0-9a-f]{6})$/i);if(n){let s=n[1],r=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),u=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${u}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function te(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function re(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${M(t,.46)} 0%, ${M(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function A(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";case"straight":default:return"none"}}function L(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function E(e){let t=M(e.color,e.opacity),o=M(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function R(e,t){return!t.glow||e.color&&e.color!==w.color?e:{...e,color:t.glow}}function oe(e,t){if(e==="editorial-left"){let n=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),c=a.pose||r.pose||"tilted-right",m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.18)+l}px`,`left:${Math.round(t.width*.56)}px`,`width:${p}px`,"transform-origin:center center",`transform:${A(c)}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let n=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,a,u)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),c=a.pose||r.pose,m=R(r.shadow,u);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${L("translateX(-50%)",A(c))}`,`filter:${E(m)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,s,r)=>{let a=t.name==="ipad-13"?.54:.64,u=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,c=R(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${u}px`,"transform-origin:center top",`transform:${L("translateX(-50%)",A(l))}`,`filter:${E(c)}`,"z-index:2"].join(";")}}}function ne({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=oe(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),u=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${v(o.headline)}</div>`:"",p=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${v(o.subheadline)}</div>`:"",l=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${v(o.eyebrow)}</div></div>`:"";return`<!doctype html>
3
3
  <html>
4
4
  <head>
5
5
  <meta charset="utf-8" />
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as ne,c as M,d as se,e as F,f as oe,h as ae,i as C,j as ce,k as de,l as le,p as ue,s as T,t as pe,u as he,v as me,w as fe}from"./chunk-3DDNLPIH.js";import"./chunk-7CA63OS4.js";import{a as re}from"./chunk-5OA35LZX.js";import"./chunk-OEV7EOMC.js";import{f as P}from"./chunk-RVWJ3TAE.js";import"./chunk-4UQMPWDA.js";import"./chunk-NQ4EDJV4.js";import"./chunk-QUEATUWT.js";import{d as te}from"./chunk-VSRV5LFU.js";import"./chunk-SF6W3FRS.js";import{a as X,b as Y}from"./chunk-OBYYAT4F.js";import"./chunk-SA5RP334.js";import{a as Q,b as ee}from"./chunk-KY6NY6WN.js";import{a as Z}from"./chunk-GU3MWKJY.js";import{k as ie}from"./chunk-VJPN6DQU.js";import{A as J,B as H,D as K,E as V,F as G,G as q,H as z,I as U,u as D,v as j,y as I,z as $}from"./chunk-4BXESMZ7.js";import"./chunk-SRA2TVCG.js";import{spawn as ze}from"child_process";import A from"fs";import{createServer as Xe}from"http";import S from"path";import{WebSocket as m,WebSocketServer as Ye}from"ws";import ge from"node:fs";import R from"node:path";var x=1;function Ie(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var O=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof T?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await le()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as ne,c as M,d as se,e as F,f as oe,h as ae,i as C,j as ce,k as de,l as le,p as ue,s as T,t as pe,u as he,v as me,w as fe}from"./chunk-GNWVN4MO.js";import"./chunk-2KKPINU2.js";import{a as re}from"./chunk-QD5YATLL.js";import"./chunk-7AXDJ2RV.js";import{f as P}from"./chunk-V4OEITZA.js";import"./chunk-SUQAFFJO.js";import"./chunk-J27RHTWH.js";import"./chunk-LYZ3GSCB.js";import{d as te}from"./chunk-IRSVHE5W.js";import"./chunk-366ZIBQX.js";import{a as X,b as Y}from"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import{a as Q,b as ee}from"./chunk-UQHBJ2L2.js";import{a as Z}from"./chunk-LKSAMFVM.js";import{m as ie}from"./chunk-7OVVG4L6.js";import{A as J,B as H,D as K,E as V,F as G,G as q,H as z,I as U,u as D,v as j,y as I,z as $}from"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";import{spawn as ze}from"child_process";import A from"fs";import{createServer as Xe}from"http";import S from"path";import{WebSocket as m,WebSocketServer as Ye}from"ws";import ge from"node:fs";import R from"node:path";var x=1;function Ie(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_POSTGRES||7432),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var O=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof T?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await le()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
3
3
  `)}}close(){for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return F();case"agent:upsert-project":return M(i.input??{});case"agent:delete-project":return ae(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return ce(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-prompt":{let n=String(i.sessionId),a=C(n);if(!a)throw new T("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await he(n,r),this.notePromptAccepted(n,r,a.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await me(String(i.sessionId));let s=C(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new T("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async doStartSession(e){if(!se(e.projectId))throw new T("NO_PROJECT",`no project: ${e.projectId}`);let i=await pe(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??Ie(),a=(await P({excludePorts:s})).find(d=>String(d.port)===i);if(!a||!a.cwd)return{project:null};let r=F().find(d=>d.cwd===a.cwd)??null,c=Array.from(new Set([...r?.knownBundleUrls??[],a.bundleUrl,t]));return{project:M({cwd:a.cwd,name:a.projectName??R.basename(a.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[a.cwd],knownBundleUrls:c,framework:r?.framework??Pe(a.framework),bundleId:a.bundleId??r?.bundleId})}}getTranscript(e){let t=ue(e);return ge.existsSync(t)?ge.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=ne();return{userDataDir:e,storeFile:R.join(e,"attached-projects.json"),sessionsDir:R.join(e,"sessions"),transcriptsDir:R.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=fe(t,a=>{let r=this.coalescePromptEcho(t,a);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),a.type==="turn-completed"){let c=C(t);if(c)try{oe(c.projectId,{usd:a.costUsd,ts:a.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
4
4
  `)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let a=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,a);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:a>1,pendingTurns:a,queueDepth:Math.max(0,a-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){de(e,t);let i=C(e);i&&this.broadcastSessionStatus(i)}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===x)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===x)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===x)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===x)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function Pe(o){return o==="expo"?"expo":o==="one"||o==="vxrn"?"one":"unknown"}import Oe from"http";import _e from"https";var W="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",Re=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"}}];function xe(o){let e=o.toLowerCase();for(let t of Re)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t.headers;return{}}function Se(o){return{"accept-encoding":"identity","user-agent":W,...xe(o.hostname)}}var Le=new Set(["host","origin","referer","user-agent","accept-encoding","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),Be={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"},Ne=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function E(o){for(let[e,t]of Object.entries(Be))o.setHeader(e,t)}function De(o,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return o.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function He(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Le.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?Se(e):{"user-agent":W}),t}function Ue(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(Ne.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function ye(o){return o?.startsWith("/__fetch-proxy?")||o?.startsWith("/__proxy?")||!1}function be(o){return o?!!(o.startsWith("/__app-api?")||o.startsWith("/__app-api/")):!1}async function ve(o,e){if(o.method==="OPTIONS"){E(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((o.url||"").split("?")[1]||"").get("url");if(!i){E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{E(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n=He(o.headers,s),a;if(o.method!=="GET"&&o.method!=="HEAD"){let d=[];for await(let u of o)d.push(Buffer.isBuffer(u)?u:Buffer.from(u));d.length>0&&(a=Buffer.concat(d))}let r;try{r=await fetch(s.href,{method:o.method,headers:n,body:a,redirect:"follow"})}catch(d){E(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${De(s.href,d)}`);return}r.headers.forEach((d,u)=>{let p=u.toLowerCase();p==="content-encoding"||p==="transfer-encoding"||p==="content-length"||p==="set-cookie"||p.startsWith("access-control-")||e.setHeader(u,d)}),E(e);let c=r.headers.getSetCookie?.()??[];c.length>0&&e.setHeader("x-sootsim-set-cookie",c.join(", ")),e.statusCode=r.status;let l=Buffer.from(await r.arrayBuffer());e.end(l)}function we(o,e){let t=o.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(o.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let a=n.protocol==="https:"?_e:Oe,r=Ue(o.headers,n),c=a.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:o.method,headers:r},l=>{let d=Object.keys(l.headers).filter(u=>{let p=u.toLowerCase();return!p.startsWith("access-control-")&&p!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":o.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return c.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),o.pipe(c),!0}import{WebSocket as k,WebSocketServer as Me}from"ws";var Fe="/__websocket-proxy",We=new Set(["host","connection","upgrade","transfer-encoding","content-length","sec-websocket-accept","sec-websocket-extensions","sec-websocket-key","sec-websocket-protocol","sec-websocket-version"]);function w(o,e,t){try{o.write(`HTTP/1.1 ${e} ${t}\r
5
5
  Connection: close\r
@@ -11,7 +11,7 @@ ${t}`)}catch{}o.destroy()}function je(o){let e=o.headers.origin,t=o.headers.host
11
11
  `)}}throw new Error(`could not bind ws bridge after ${this.portFallbackCount} attempts starting at ${this.preferredPort}`)}bindOnce(e,t){return new Promise((i,s)=>{let n=Xe((c,l)=>this.handleHttpRequest(c,l)),a=!1,r=c=>{if(!a){a=!0;try{n.close()}catch{}this.httpServer=null,this.wss=null,s(c)}};n.once("error",r),n.listen(e,"127.0.0.1",()=>{a||(a=!0,n.removeListener("error",r),n.on("error",c=>{process.stderr.write(`ws bridge http error: ${String(c)}
12
12
  `)}),this.httpServer=n,this.wss=new Ye({noServer:!0}),this.wireWebSocketServer(),n.on("upgrade",(c,l,d)=>{ke(c,l,d)||this.wss?.handleUpgrade(c,l,d,u=>{this.wss?.emit("connection",u,c)})}),i())})})}wireWebSocketServer(){this.wss&&this.wss.on("connection",(e,t)=>{let i=t.headers.origin,s=i?"sim":"cli",n=null;if(e.on("error",()=>{}),this.wsIsAlive.set(e,!0),e.on("pong",()=>{this.wsIsAlive.set(e,!0)}),this.agentHost.registerSocket(e),s==="sim")n={id:this.allocateSimId(),ws:e,origin:i,connectedAt:Date.now(),lastSeenAt:Date.now(),lastActiveAt:0,recentActions:[]},this.sims.set(n.id,n),this.shouldPromoteSim(n)&&(this.primarySimId=n.id),this.broadcastSimAssignments(),this.broadcastSimClientStates();else{let a=`ws-${this.nextCliFallbackId++}`;this.cliIdentityKeyBySocket.set(e,a)}e.on("message",a=>{let r;try{r=JSON.parse(a.toString())}catch{return}if(!(!r||typeof r!="object")){if(typeof r.type=="string"&&r.type.startsWith("agent:")){this.agentHost.handleMessage(e,r);return}if(r.type==="runtime:list"){let c=H(),l=this.getActiveRuntime(),d={type:"runtime:list:ok",id:r.id,installed:c,active:l.version,activeRuntimeDir:l.runtimeDir};try{e.send(JSON.stringify(d))}catch{}return}if(r.type==="runtime:use"){let c=typeof r.version=="string"?r.version:"";if(!H().includes(c)){try{e.send(JSON.stringify({type:"runtime:use:error",id:r.id,error:`runtime ${c||"(missing)"} is not installed`}))}catch{}return}let d=this.setActiveRuntime(c);try{e.send(JSON.stringify({type:"runtime:use:ok",id:r.id,version:d.version,runtimeDir:d.runtimeDir}))}catch{}return}if(r.type==="runtime:get"){let c=this.getActiveRuntime();try{e.send(JSON.stringify({type:"runtime:get:ok",id:r.id,active:c.version,activeRuntimeDir:c.runtimeDir}))}catch{}return}if(s==="sim"){if(n&&(n.lastSeenAt=Date.now()),r.type==="bridge:register"&&n){let d=r,u=this.tryRestoreSimId(n,d.simId);n.url=d.url,n.title=d.title,n.userAgent=d.userAgent,typeof d.kind=="string"&&d.kind.trim()&&(n.kind=d.kind.trim()),d.meta&&typeof d.meta=="object"&&(n.meta=d.meta);let p=this.primarySimId!==n.id&&this.shouldPromoteSim(n);p&&(this.primarySimId=n.id),(u||p)&&(this.broadcastSimAssignments(),this.broadcastSimClientStates());return}if(r.type==="bridge:user-focus-state"&&n){let d=r;this.updateUserFocusLease(n,d);return}if(r.type==="bridge:user-interact"&&n){this.updateUserActivity(n);return}if(r.type==="bridge:write-shared-config"){let d=r.patch&&typeof r.patch=="object"?r.patch:null;if(!d)return;let u;try{u=j(d)}catch(h){process.stderr.write(`sootsim: bridge:write-shared-config failed: ${h instanceof Error?h.message:String(h)}
13
13
  `);return}let p=JSON.stringify({type:"bridge:shared-config-changed",config:u});for(let h of this.sims.values())if(h.ws.readyState===m.OPEN)try{h.ws.send(p)}catch{}return}if(r.type==="bridge:open-path"){let d=typeof r.path=="string"?r.path:"",u=typeof r.line=="number"&&Number.isFinite(r.line)?r.line:void 0,p=typeof r.column=="number"&&Number.isFinite(r.column)?r.column:void 0;d&&this.openPathInEditor(d,u,p);return}if(r.type==="bridge:boot-clients"&&n){let d=[];for(let[p,h]of this.cliSimBySocket)h===n.id&&d.push(p);for(let p of d){this.cliSimBySocket.delete(p);try{p.close(1e3,"booted by sim")}catch{}}let u=!!n.cliLease;n.cliLease={kind:"user-active",cliIdentityKey:"__user-active__",cliLabel:"active user",expiresAt:Date.now()+o.USER_BOOT_LEASE_TTL_MS},process.stderr.write(`sootsim booted ${d.length} cli client(s)${u?" (overrode prior lease)":""}; held sim for user [${n.id}]
14
- `),this.recordSimAction(n.id,"sim booted cli clients"),this.broadcastSimClientStates();return}let c=this.pendingCommands.get(r.id);if(c){this.pendingCommands.delete(r.id),r.error?c.reject(new Error(r.error)):c.resolve(r.result);return}let l=this.cliBySentId.get(r.id);if(l&&(this.cliBySentId.delete(r.id),l.ws.readyState===m.OPEN)){let d=this.getOtherCliIdentityCount(l.ws,l.simId),u=d>0?{...r,id:l.originalId,i:d}:{...r,id:l.originalId};l.ws.send(JSON.stringify(u))}return}(async()=>{this.cliLastCommandAt.set(e,Date.now());try{if(r.type==="bridge:bye"){let p=this.cliSimBySocket.delete(e);this.cliLastCommandAt.delete(e),this.cliIdentityKeyBySocket.delete(e),this.cliLabelBySocket.delete(e);for(let[h,f]of this.cliBySentId)f.ws===e&&this.cliBySentId.delete(h);p&&this.broadcastSimClientStates();return}if(r.type==="bridge:hello"){let p=typeof r.cliIdentityKey=="string"&&r.cliIdentityKey.trim()?r.cliIdentityKey.trim():this.cliIdentityKeyBySocket.get(e)||`ws-${this.nextCliFallbackId++}`;this.cliIdentityKeyBySocket.set(e,p),typeof r.cliLabel=="string"&&r.cliLabel.trim()&&this.cliLabelBySocket.set(e,r.cliLabel.trim()),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{cliIdentityKey:p,leaseTtlMs:o.CLI_LEASE_TTL_MS,leasing:!0}}));return}if(r.type==="bridge:list-sims"){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:this.listSims()}));return}if(r.type==="bridge:open"){if(typeof r.url!="string"||!r.url)throw new Error("bridge:open requires a url");await this.openUrl(r.url,{newWindow:r.newWindow===!0}),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{ok:!0,url:r.url}}));return}if(r.type==="bridge:claim"){let p=await this.waitForSim(r.simId),h=this.tryAcquireLease(e,p,{force:r.force===!0});if(!h.granted){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:`sim ${p.id} is locked by another cli`,o:h.lock}));return}this.setCliSimTarget(e,p.id),this.recordSimAction(p.id,h.bootedCount>0?`cli force-claimed sim (booted ${h.bootedCount})`:"cli claimed sim"),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{simId:p.id,lockedBy:h.lease.cliIdentityKey,lockExpiresAt:h.lease.expiresAt,bootedCount:h.bootedCount}}));return}let c=await this.waitForSim(r.simId);if(tt(r)){let p=this.tryAcquireLease(e,c);if(!p.granted){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:`sim ${c.id} is locked by another cli \u2014 use \`sootsim claim ${c.id} --force\` or \`sootsim open --new\``,o:p.lock}));return}}else this.ensureCliIdentityKey(e);this.setCliSimTarget(e,c.id),this.recordSimAction(c.id,this.describeForwardedCommand(r));let l=this.nextCommandId++;this.cliBySentId.set(l,{simId:c.id,ws:e,originalId:r.id});let{simId:d,...u}=r;if(c.ws.send(JSON.stringify({...u,id:l})),u.type==="close"){this.cliBySentId.delete(l),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{requested:!0,simId:c.id}}));let p=c.ws,h=setTimeout(()=>{this.closeSimSocketFromHost(p)},Qe);Ce(h)}}catch(c){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:c instanceof Error?c.message:String(c)}))}})()}}),e.on("close",()=>{if(this.agentHost.unregisterSocket(e),s==="sim"&&n){this.rememberDisconnectedSim(n),this.primarySimId===n.id&&(this.primarySimId=this.getOpenSim()?.id??null);for(let[a,r]of this.pendingCommands)r.simId===n.id&&(r.reject(new Error("sim disconnected")),this.pendingCommands.delete(a));for(let[a,r]of this.cliBySentId)r.simId===n.id&&(r.ws.readyState===m.OPEN&&r.ws.send(JSON.stringify({id:r.originalId,error:"sim disconnected before responding"})),this.cliBySentId.delete(a));this.broadcastSimAssignments(),this.broadcastSimClientStates()}else if(s==="cli"){let a=this.cliSimBySocket.delete(e);this.cliLastCommandAt.delete(e),this.cliIdentityKeyBySocket.delete(e),this.cliLabelBySocket.delete(e);for(let[r,c]of this.cliBySentId)c.ws===e&&this.cliBySentId.delete(r);a&&this.broadcastSimClientStates()}})})}afterBind(){if(process.stderr.write(`ws bridge listening on port ${this.port}
14
+ `),this.recordSimAction(n.id,"sim booted cli clients"),this.broadcastSimClientStates();return}let c=this.pendingCommands.get(r.id);if(c){this.pendingCommands.delete(r.id),r.error?c.reject(new Error(r.error)):c.resolve(r.result);return}let l=this.cliBySentId.get(r.id);if(l&&(this.cliBySentId.delete(r.id),l.ws.readyState===m.OPEN)){let d=this.getOtherCliIdentityCount(l.ws,l.simId),u=d>0?{...r,id:l.originalId,_otherCliCount:d}:{...r,id:l.originalId};l.ws.send(JSON.stringify(u))}return}(async()=>{this.cliLastCommandAt.set(e,Date.now());try{if(r.type==="bridge:bye"){let p=this.cliSimBySocket.delete(e);this.cliLastCommandAt.delete(e),this.cliIdentityKeyBySocket.delete(e),this.cliLabelBySocket.delete(e);for(let[h,f]of this.cliBySentId)f.ws===e&&this.cliBySentId.delete(h);p&&this.broadcastSimClientStates();return}if(r.type==="bridge:hello"){let p=typeof r.cliIdentityKey=="string"&&r.cliIdentityKey.trim()?r.cliIdentityKey.trim():this.cliIdentityKeyBySocket.get(e)||`ws-${this.nextCliFallbackId++}`;this.cliIdentityKeyBySocket.set(e,p),typeof r.cliLabel=="string"&&r.cliLabel.trim()&&this.cliLabelBySocket.set(e,r.cliLabel.trim()),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{cliIdentityKey:p,leaseTtlMs:o.CLI_LEASE_TTL_MS,leasing:!0}}));return}if(r.type==="bridge:list-sims"){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:this.listSims()}));return}if(r.type==="bridge:open"){if(typeof r.url!="string"||!r.url)throw new Error("bridge:open requires a url");await this.openUrl(r.url,{newWindow:r.newWindow===!0}),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{ok:!0,url:r.url}}));return}if(r.type==="bridge:claim"){let p=await this.waitForSim(r.simId),h=this.tryAcquireLease(e,p,{force:r.force===!0});if(!h.granted){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:`sim ${p.id} is locked by another cli`,_locked:h.lock}));return}this.setCliSimTarget(e,p.id),this.recordSimAction(p.id,h.bootedCount>0?`cli force-claimed sim (booted ${h.bootedCount})`:"cli claimed sim"),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{simId:p.id,lockedBy:h.lease.cliIdentityKey,lockExpiresAt:h.lease.expiresAt,bootedCount:h.bootedCount}}));return}let c=await this.waitForSim(r.simId);if(tt(r)){let p=this.tryAcquireLease(e,c);if(!p.granted){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:`sim ${c.id} is locked by another cli \u2014 use \`sootsim claim ${c.id} --force\` or \`sootsim open --new\``,_locked:p.lock}));return}}else this.ensureCliIdentityKey(e);this.setCliSimTarget(e,c.id),this.recordSimAction(c.id,this.describeForwardedCommand(r));let l=this.nextCommandId++;this.cliBySentId.set(l,{simId:c.id,ws:e,originalId:r.id});let{simId:d,...u}=r;if(c.ws.send(JSON.stringify({...u,id:l})),u.type==="close"){this.cliBySentId.delete(l),e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,result:{requested:!0,simId:c.id}}));let p=c.ws,h=setTimeout(()=>{this.closeSimSocketFromHost(p)},Qe);Ce(h)}}catch(c){e.readyState===m.OPEN&&e.send(JSON.stringify({id:r.id,error:c instanceof Error?c.message:String(c)}))}})()}}),e.on("close",()=>{if(this.agentHost.unregisterSocket(e),s==="sim"&&n){this.rememberDisconnectedSim(n),this.primarySimId===n.id&&(this.primarySimId=this.getOpenSim()?.id??null);for(let[a,r]of this.pendingCommands)r.simId===n.id&&(r.reject(new Error("sim disconnected")),this.pendingCommands.delete(a));for(let[a,r]of this.cliBySentId)r.simId===n.id&&(r.ws.readyState===m.OPEN&&r.ws.send(JSON.stringify({id:r.originalId,error:"sim disconnected before responding"})),this.cliBySentId.delete(a));this.broadcastSimAssignments(),this.broadcastSimClientStates()}else if(s==="cli"){let a=this.cliSimBySocket.delete(e);this.cliLastCommandAt.delete(e),this.cliIdentityKeyBySocket.delete(e),this.cliLabelBySocket.delete(e);for(let[r,c]of this.cliBySentId)c.ws===e&&this.cliBySentId.delete(r);a&&this.broadcastSimClientStates()}})})}afterBind(){if(process.stderr.write(`ws bridge listening on port ${this.port}
15
15
  `),this.cliIdleTimer=setInterval(()=>this.sweepIdleCliClients(),3e4),this.cliIdleTimer.unref(),this.wsHeartbeatTimer=setInterval(()=>this.sweepDeadWebSockets(),o.WS_HEARTBEAT_INTERVAL_MS),this.wsHeartbeatTimer.unref(),this.shouldWriteLockfile){try{if(I(),!z(this.buildLockfileSnapshot()))throw new Error("another sootsim daemon wrote the lockfile during startup \u2014 aborting")}catch(e){throw process.stderr.write(`ws bridge failed to claim daemon lockfile: ${String(e)}
16
16
  `),e}this.heartbeatTimer=setInterval(()=>{try{this.writeLockfileSnapshot()}catch{}},it),this.heartbeatTimer.unref(),this.startRuntimeUpdater()}this.agentHost.seedOnBoot()}bootstrapping=!0;buildLockfileSnapshot(){return{schema:1,pid:process.pid,platform:process.platform,bridgePort:this.effectivePort,runtimePort:this.effectivePort,activeRuntime:this.activeRuntimeVersion,activeRuntimeDir:this.activeRuntimeDirPath,startedAt:this.startedAt,heartbeatAt:Date.now(),bootstrapping:this.bootstrapping}}writeLockfileSnapshot(){q(this.buildLockfileSnapshot())}refreshActiveRuntime(){this.activeRuntimeVersion=$(),this.activeRuntimeDirPath=K()}runServerScan(){if(this.inflightScan)return this.inflightScan;let e=this.effectivePort>0?[this.effectivePort]:[];return this.inflightScan=P({excludePorts:e,buildIconProxyUrl:t=>`/__bundle-proxy?url=${encodeURIComponent(t)}`}).then(t=>(this.scanCache=t,this.scanCacheAt=Date.now(),t)).catch(t=>{let i=t instanceof Error?t.message:String(t);return console.error("[sootsim] /__server-scan failed:",i),this.scanCache??[]}).finally(()=>{this.inflightScan=null}),this.inflightScan}handleServerScan(e){let t=s=>{e.writeHead(200,{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}),e.end(JSON.stringify(s))},i=Date.now()-this.scanCacheAt;if(this.scanCache&&i<o.SCAN_FRESH_MS){t(this.scanCache);return}if(this.scanCache){t(this.scanCache),this.runServerScan().catch(()=>{});return}this.runServerScan().then(s=>t(s))}resolveRuntimeUpdateIntervalMs(){let e=Number(process.env[nt]);return Number.isFinite(e)&&e>0?Math.max(100,Math.round(e)):rt}startRuntimeUpdater(){if(!this.shouldWriteLockfile||this.runtimeUpdateTimer)return;this.runRuntimeUpdate("startup");let e=this.resolveRuntimeUpdateIntervalMs();this.runtimeUpdateTimer=setInterval(()=>{this.runRuntimeUpdate("periodic")},e),this.runtimeUpdateTimer.unref()}runRuntimeUpdate(e){return this.runtimeUpdateInFlight?this.runtimeUpdateInFlight:(this.runtimeUpdateInFlight=(async()=>{try{e==="startup"&&process.stderr.write(`sootsim: checking for runtime updates\u2026
17
17
  `);let t=await ie();if(!t.updated||!t.latestVersion){e==="startup"&&process.stderr.write(`sootsim: runtime ${this.activeRuntimeVersion??"(none)"} is current
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-GLVNMGFD.js";import"./chunk-ESUDARF7.js";import"./chunk-RH3GHGRZ.js";import"./chunk-J27RHTWH.js";import"./chunk-366ZIBQX.js";import"./chunk-3BCXNVBN.js";import"./chunk-VHPYIZ3U.js";import"./chunk-UQHBJ2L2.js";import"./chunk-T2YYBRII.js";import"./chunk-IBEQOTJK.js";export{a as runSetupRepo};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.121 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-SRA2TVCG.js";import*as l from"fs";import*as i from"path";import{fileURLToPath as f}from"url";function g(){try{let s=f(import.meta.resolve("sootsim/package.json"));return i.join(i.dirname(s),"skills")}catch{let s=i.dirname(f(import.meta.url));return i.resolve(s,"../../skills")}}var m=g();function d(s){let n=s.match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let e=n[1],o=e.match(/^name:\s*(.+)$/m),r=e.match(/^description:\s*(.+)$/m);return o?{name:o[1].trim(),description:r?.[1]?.trim()||""}:null}function p(){if(!l.existsSync(m))return[];let s=l.readdirSync(m).filter(e=>e.endsWith(".md")),n=[];for(let e of s){let o=l.readFileSync(i.join(m,e),"utf8"),r=d(o);r&&n.push({...r,filename:e})}return n}function u(s,n){let e=i.join(m,s.filename),o=i.join(n,s.filename);l.copyFileSync(e,o),console.log(` copied ${s.name} \u2192 ${o}`)}async function h(s){if(s.includes("--list")||s.includes("-l")||s.length===0){let t=p();if(t.length===0){console.log(" no skills found");return}console.log(`
1
+ /*! sootsim v0.1.122 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-IBEQOTJK.js";import*as l from"fs";import*as i from"path";import{fileURLToPath as f}from"url";function g(){try{let s=f(import.meta.resolve("sootsim/package.json"));return i.join(i.dirname(s),"skills")}catch{let s=i.dirname(f(import.meta.url));return i.resolve(s,"../../skills")}}var m=g();function d(s){let n=s.match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let e=n[1],o=e.match(/^name:\s*(.+)$/m),r=e.match(/^description:\s*(.+)$/m);return o?{name:o[1].trim(),description:r?.[1]?.trim()||""}:null}function p(){if(!l.existsSync(m))return[];let s=l.readdirSync(m).filter(e=>e.endsWith(".md")),n=[];for(let e of s){let o=l.readFileSync(i.join(m,e),"utf8"),r=d(o);r&&n.push({...r,filename:e})}return n}function u(s,n){let e=i.join(m,s.filename),o=i.join(n,s.filename);l.copyFileSync(e,o),console.log(` copied ${s.name} \u2192 ${o}`)}async function h(s){if(s.includes("--list")||s.includes("-l")||s.length===0){let t=p();if(t.length===0){console.log(" no skills found");return}console.log(`
3
3
  available skills:
4
4
  `);for(let c of t)console.log(` ${c.name}`),console.log(` ${c.description}
5
5
  `);console.log(" usage: sootsim skills <target-dir> [skill-name...]"),console.log(" example: sootsim skills ./my-project"),console.log(` example: sootsim skills ./my-project debug perf