sootsim 0.1.235 → 0.1.236

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 (142) hide show
  1. package/dist-cli/bin.js +4 -4
  2. package/dist-cli/chunks/{agent-VY6XJQDL.js → agent-CU7Q5K22.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-NSBHSS3Y.js → agent-wrapper-FCUDUV52.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-BRTQV44M.js → app-fonts-SPA6U6OA.js} +2 -2
  5. package/dist-cli/chunks/{assert-WOOZQZ67.js → assert-MZVVW7DV.js} +2 -2
  6. package/dist-cli/chunks/{auth-7J7WDEFG.js → auth-FV3CIFG6.js} +2 -2
  7. package/dist-cli/chunks/beta-7X7N2CB2.js +2 -0
  8. package/dist-cli/chunks/{camera-KWI4FUYT.js → camera-ALWQVYHU.js} +2 -2
  9. package/dist-cli/chunks/{chunk-UMRMWSAM.js → chunk-3PLNSSEF.js} +1 -1
  10. package/dist-cli/chunks/{chunk-TR25YKVI.js → chunk-4Z3JQFES.js} +1 -1
  11. package/dist-cli/chunks/{chunk-JPXFE6M4.js → chunk-54UQB2TW.js} +2 -2
  12. package/dist-cli/chunks/{chunk-VZQLOXV4.js → chunk-5E24H5Z5.js} +2 -2
  13. package/dist-cli/chunks/{chunk-EB52ZQ3B.js → chunk-6ALJUG36.js} +2 -2
  14. package/dist-cli/chunks/chunk-6NWVRY7I.js +1 -0
  15. package/dist-cli/chunks/{chunk-AQ6HSRGZ.js → chunk-7KGIZCO3.js} +2 -2
  16. package/dist-cli/chunks/{chunk-HVKLAOZM.js → chunk-7NCUVJSZ.js} +3 -3
  17. package/dist-cli/chunks/{chunk-YAX25DGN.js → chunk-APQFVJDK.js} +1 -1
  18. package/dist-cli/chunks/{chunk-BZPJSFSP.js → chunk-BA4Q3KRH.js} +2 -2
  19. package/dist-cli/chunks/{chunk-APBFMXMM.js → chunk-BDL6UO36.js} +1 -1
  20. package/dist-cli/chunks/{chunk-XUJDCVTH.js → chunk-BGW73A3C.js} +2 -2
  21. package/dist-cli/chunks/{chunk-ZVVEXBEJ.js → chunk-DKGKL6KP.js} +2 -2
  22. package/dist-cli/chunks/{chunk-YYW4JGGL.js → chunk-DUCTVOTV.js} +1 -1
  23. package/dist-cli/chunks/{chunk-TEEK6DLL.js → chunk-EURBYQXU.js} +2 -2
  24. package/dist-cli/chunks/{chunk-K3Q4FEMG.js → chunk-FK57ISRW.js} +1 -1
  25. package/dist-cli/chunks/{chunk-R7RUIOMK.js → chunk-G3EZ5KVE.js} +1 -1
  26. package/dist-cli/chunks/{chunk-YXP22OFA.js → chunk-G3MVPZBK.js} +2 -2
  27. package/dist-cli/chunks/{chunk-Z7TEEXRM.js → chunk-GB3IT6AN.js} +1 -1
  28. package/dist-cli/chunks/{chunk-RJ5ZTFTF.js → chunk-HBQ7CCHG.js} +1 -1
  29. package/dist-cli/chunks/{chunk-ITU3SFQX.js → chunk-I664RIMB.js} +2 -2
  30. package/dist-cli/chunks/{chunk-WQ5DQ5X7.js → chunk-IQ2IFKZ4.js} +2 -2
  31. package/dist-cli/chunks/{chunk-CFIAG2RO.js → chunk-KWNVZ2LX.js} +1 -1
  32. package/dist-cli/chunks/chunk-LBXFCH5I.js +118 -0
  33. package/dist-cli/chunks/{chunk-4IGHCZBZ.js → chunk-NX4NOT7Z.js} +1 -1
  34. package/dist-cli/chunks/{chunk-YLSEQMQK.js → chunk-ORSIJ76W.js} +1 -1
  35. package/dist-cli/chunks/{chunk-2NTPCZNI.js → chunk-PEFAS7Q4.js} +2 -2
  36. package/dist-cli/chunks/{chunk-XWRHHNOK.js → chunk-PGLRJ4GA.js} +1 -1
  37. package/dist-cli/chunks/{chunk-TZJ6V6E3.js → chunk-PUH4S4CC.js} +2 -2
  38. package/dist-cli/chunks/{chunk-P3IXWUXV.js → chunk-Q2X3WO5X.js} +2 -2
  39. package/dist-cli/chunks/{chunk-6EZX7YXZ.js → chunk-QPZYFSTW.js} +1 -1
  40. package/dist-cli/chunks/{chunk-PULCBYY6.js → chunk-RBDWTH6O.js} +2 -2
  41. package/dist-cli/chunks/{chunk-G4VPOKCZ.js → chunk-RGDT3EBF.js} +11 -3
  42. package/dist-cli/chunks/{chunk-OUZCXC3F.js → chunk-SACUEZZP.js} +1 -1
  43. package/dist-cli/chunks/{chunk-4WKY22WY.js → chunk-SXENH4HF.js} +3 -3
  44. package/dist-cli/chunks/{chunk-MSXVV6JQ.js → chunk-T7KUJUST.js} +3 -3
  45. package/dist-cli/chunks/{chunk-GD6LJ2CR.js → chunk-TB7CIKZ3.js} +2 -2
  46. package/dist-cli/chunks/{chunk-YQDB5ODC.js → chunk-UGRYC3HL.js} +1 -1
  47. package/dist-cli/chunks/{chunk-KEZZHUOP.js → chunk-V5LQP2JL.js} +35 -33
  48. package/dist-cli/chunks/{chunk-7DV3AEBI.js → chunk-VKJ4BFFU.js} +2 -2
  49. package/dist-cli/chunks/{chunk-IZGWQAPR.js → chunk-VQKTMX3M.js} +1 -1
  50. package/dist-cli/chunks/{chunk-6XLP5EB5.js → chunk-VRXFBWBW.js} +2 -2
  51. package/dist-cli/chunks/{chunk-EOUBCSIZ.js → chunk-W7H4OAY4.js} +2 -2
  52. package/dist-cli/chunks/chunk-ZYEIV7ZN.js +1 -0
  53. package/dist-cli/chunks/cli-version-457KT7IL.js +2 -0
  54. package/dist-cli/chunks/{compat-7NLJUPG6.js → compat-JCUMIY6N.js} +3 -3
  55. package/dist-cli/chunks/{config-LODVAH4H.js → config-3RHULBQA.js} +2 -2
  56. package/dist-cli/chunks/{control-H4RVHEDW.js → control-NZJHUGDA.js} +2 -2
  57. package/dist-cli/chunks/daemon-4WYYSXCN.js +2 -0
  58. package/dist-cli/chunks/{debug-PM3WQ2Z5.js → debug-FXTGTIA4.js} +3 -3
  59. package/dist-cli/chunks/{desktop-MF4ZQA2W.js → desktop-4Z3DFJZ3.js} +3 -3
  60. package/dist-cli/chunks/{detox-IFKFVHIT.js → detox-ZHVRCYVV.js} +2 -2
  61. package/dist-cli/chunks/{device-6EQ2R5CO.js → device-B7RJOTO2.js} +2 -2
  62. package/dist-cli/chunks/{diagnose-AKWL66RQ.js → diagnose-TWMUMITQ.js} +2 -2
  63. package/dist-cli/chunks/drivers-AK6KP6X4.js +2 -0
  64. package/dist-cli/chunks/{film-NIR3F3EQ.js → film-DGR6ALQ2.js} +3 -3
  65. package/dist-cli/chunks/flow-RYMDNC4V.js +2 -0
  66. package/dist-cli/chunks/help-JVO6L7HS.js +2 -0
  67. package/dist-cli/chunks/{hidden-runtime-alias-QT52GUMS.js → hidden-runtime-alias-XM5Z6GME.js} +2 -2
  68. package/dist-cli/chunks/{home-paths-TZFWKT7O.js → home-paths-BVXLMDUT.js} +2 -2
  69. package/dist-cli/chunks/inspect-TBOCLFLQ.js +2 -0
  70. package/dist-cli/chunks/install-desktop-N6IVQZBG.js +2 -0
  71. package/dist-cli/chunks/{login-553MMERY.js → login-CTAICT4D.js} +4 -4
  72. package/dist-cli/chunks/{logout-UX4PNMDO.js → logout-X4T57OXG.js} +2 -2
  73. package/dist-cli/chunks/{maestro-XVWZ37YC.js → maestro-ZQYSFWKY.js} +3 -3
  74. package/dist-cli/chunks/{maestro-generate-O3J2XRQD.js → maestro-generate-Y25ETFOO.js} +3 -3
  75. package/dist-cli/chunks/{mode-S7PO7F4H.js → mode-KBQ2HTV2.js} +2 -2
  76. package/dist-cli/chunks/optional-demo-registry-G6FLEREA.js +2 -0
  77. package/dist-cli/chunks/{perf-SQD72526.js → perf-MRGDCXKC.js} +2 -2
  78. package/dist-cli/chunks/{record-TFIQZHAO.js → record-6JMMR3DI.js} +8 -8
  79. package/dist-cli/chunks/runtime-3EJHJAAM.js +2 -0
  80. package/dist-cli/chunks/{screenshot-command-TCUSGETC.js → screenshot-command-SEHNB5PW.js} +3 -3
  81. package/dist-cli/chunks/{screenshots-capture-TUGNPCWG.js → screenshots-capture-GAZMPQ2T.js} +2 -2
  82. package/dist-cli/chunks/{serve-JAKYFLDC.js → serve-HQAJCUJP.js} +2 -2
  83. package/dist-cli/chunks/{setup-WBQ5PYMM.js → setup-A3PIKOJA.js} +3 -3
  84. package/dist-cli/chunks/{skills-U5NQ6Y2O.js → skills-4522XNAV.js} +2 -2
  85. package/dist-cli/chunks/{storage-X6CEYBPL.js → storage-VC4FO3X4.js} +2 -2
  86. package/dist-cli/chunks/store-Y6DYP7EA.js +2 -0
  87. package/dist-cli/chunks/telemetry-3M5Y7GDR.js +2 -0
  88. package/dist-cli/chunks/{timeline-RUVDOAYG.js → timeline-AU6ZXEJY.js} +2 -2
  89. package/dist-cli/chunks/{upgrade-X52FGN22.js → upgrade-M5V7P7HI.js} +2 -2
  90. package/dist-cli/chunks/upload-F47SYC4Y.js +2 -0
  91. package/dist-cli/chunks/{version-SMQW5VNI.js → version-BIWUB3OU.js} +2 -2
  92. package/dist-cli/chunks/{web-2NTSSKPW.js → web-Y2HUWQL6.js} +2 -2
  93. package/dist-cli/chunks/{what-happened-3AXYUGTU.js → what-happened-TTM4T2XG.js} +2 -2
  94. package/dist-lib/agent-daemon-client.cjs +1 -1
  95. package/dist-lib/agent-events.cjs +1 -1
  96. package/dist-lib/agent-identity.cjs +1 -1
  97. package/dist-lib/agent-sessions.cjs +1 -1
  98. package/dist-lib/attached-projects.cjs +1 -1
  99. package/dist-lib/auth/shared-session.cjs +1 -1
  100. package/dist-lib/backend-origin.cjs +1 -1
  101. package/dist-lib/beta.cjs +1 -1
  102. package/dist-lib/beta.mjs +1 -1
  103. package/dist-lib/bridge-constants.cjs +1 -1
  104. package/dist-lib/cli-constants.cjs +1 -1
  105. package/dist-lib/config.cjs +1 -1
  106. package/dist-lib/detox/index.cjs +1 -1
  107. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  108. package/dist-lib/home-paths.cjs +1 -1
  109. package/dist-lib/host/bridge-host.cjs +1 -1
  110. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  112. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  113. package/dist-lib/host/websocket-proxy.cjs +1 -1
  114. package/dist-lib/index.cjs +1 -1
  115. package/dist-lib/jump-to-source-babel.cjs +1 -1
  116. package/dist-lib/menu.cjs +1 -1
  117. package/dist-lib/menu.mjs +1 -1
  118. package/dist-lib/metro.cjs +1 -1
  119. package/dist-lib/profiles.cjs +1 -1
  120. package/dist-lib/render-mode.cjs +1 -1
  121. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  122. package/dist-lib/sdk.cjs +1 -1
  123. package/dist-lib/sdk.mjs +1 -1
  124. package/dist-lib/skills.cjs +1 -1
  125. package/dist-lib/vite.cjs +1 -1
  126. package/package.json +1 -1
  127. package/dist-cli/chunks/beta-E3A3FN5N.js +0 -2
  128. package/dist-cli/chunks/chunk-ANOU6P4R.js +0 -1
  129. package/dist-cli/chunks/chunk-TA6OIGXV.js +0 -118
  130. package/dist-cli/chunks/chunk-Z3BORSD4.js +0 -1
  131. package/dist-cli/chunks/cli-version-YYFAD5AQ.js +0 -2
  132. package/dist-cli/chunks/daemon-NQ5RDWC4.js +0 -2
  133. package/dist-cli/chunks/drivers-5NKXLGOH.js +0 -2
  134. package/dist-cli/chunks/flow-DYOXMN3T.js +0 -2
  135. package/dist-cli/chunks/help-ZEEVDVCV.js +0 -2
  136. package/dist-cli/chunks/inspect-KSPWBUAB.js +0 -2
  137. package/dist-cli/chunks/install-desktop-4GT67C5I.js +0 -2
  138. package/dist-cli/chunks/optional-demo-registry-BVQUDY4V.js +0 -2
  139. package/dist-cli/chunks/runtime-XCEDZMMB.js +0 -2
  140. package/dist-cli/chunks/store-Z2X4OFEM.js +0 -2
  141. package/dist-cli/chunks/telemetry-NWD6GLRC.js +0 -2
  142. package/dist-cli/chunks/upload-ZUHYO36E.js +0 -2
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{f,m as T}from"./chunk-WQ5DQ5X7.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-XWRHHNOK.js";import{g as D,i as O,k as x}from"./chunk-XUJDCVTH.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{f,m as T}from"./chunk-IQ2IFKZ4.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-PGLRJ4GA.js";import{g as D,i as O,k as x}from"./chunk-BGW73A3C.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
3
3
  sootsim debug \u2014 drive __sootsimDebug from the terminal
4
4
 
5
5
  usage:
@@ -170,7 +170,7 @@ examples:
170
170
  } : null,
171
171
  samples,
172
172
  }
173
- })()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-KSPWBUAB.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=O(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
173
+ })()`}async function c(i,l){return x(i,l)}async function Y(i,l){let g=D(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","memory","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-TBOCLFLQ.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=O(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
174
174
  known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await S(t);console.log(a(e,n));break}case"channels":{let e=await c(t,"window.__sootsimDebug.channels()");console.log(a(e,n));break}case"flags":{let e=await $(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
175
175
  const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
176
176
  if (!d) return null;
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-MSXVV6JQ.js";import"./chunk-ANOU6P4R.js";import{a as v,h as k}from"./chunk-GD6LJ2CR.js";import"./chunk-BZPJSFSP.js";import"./chunk-Z3BORSD4.js";import{b as m,g as f,l as h}from"./chunk-G4VPOKCZ.js";import{a as c}from"./chunk-Z7TEEXRM.js";import"./chunk-YAX25DGN.js";import"./chunk-YQDB5ODC.js";import"./chunk-TR25YKVI.js";import"./chunk-UMRMWSAM.js";import{a as u}from"./chunk-6EZX7YXZ.js";import"./chunk-WQ5DQ5X7.js";import"./chunk-XWRHHNOK.js";import"./chunk-XUJDCVTH.js";import"./chunk-YXP22OFA.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-JPXFE6M4.js";import"./chunk-APBFMXMM.js";import"./chunk-K3Q4FEMG.js";function I(e){let i=e.indexOf("--port");if(i<0)return;let o=e[i+1],t=o?Number(o):Number.NaN;return(!Number.isInteger(t)||t<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),t}async function O(e,i){let o=I(e)??i.port;return o?k(String(o)):void 0}async function w(e,i){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-T7KUJUST.js";import"./chunk-6NWVRY7I.js";import{a as v,h as k}from"./chunk-TB7CIKZ3.js";import"./chunk-BA4Q3KRH.js";import"./chunk-ZYEIV7ZN.js";import{b as m,g as f,l as h}from"./chunk-RGDT3EBF.js";import{a as c}from"./chunk-GB3IT6AN.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import"./chunk-3PLNSSEF.js";import{a as u}from"./chunk-QPZYFSTW.js";import"./chunk-IQ2IFKZ4.js";import"./chunk-PGLRJ4GA.js";import"./chunk-BGW73A3C.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";function I(e){let i=e.indexOf("--port");if(i<0)return;let o=e[i+1],t=o?Number(o):Number.NaN;return(!Number.isInteger(t)||t<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),t}async function O(e,i){let o=I(e)??i.port;return o?k(String(o)):void 0}async function w(e,i){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim desktop \u2014 launch the desktop companion
4
4
 
5
5
  usage:
@@ -16,7 +16,7 @@ examples:
16
16
  sootsim desktop --port 5173
17
17
  sootsim desktop --profile qa
18
18
  sootsim desktop --driver system
19
- `),process.exit(0));let o=e.indexOf("--driver"),t=o>=0?e[o+1]:void 0,n=e.find((r,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");n&&d&&(console.error(" sootsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let x=n?m(n).id:void 0,s=t||i.driver,l=f;if(s){let r=h(s);r||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=r}if(l.id==="electron"){let r=c();if(!r){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await u("run sootsim desktop install now?",!0)){console.log();let{runInstallDesktop:D}=await import("./install-desktop-4GT67C5I.js");await D(["--yes"]),r=c()}r||process.exit(1)}console.log(` launching ${r.path}`)}let b=await O(e,i),p=await l.launch({url:b,device:i.device,profileId:x,ephemeralProfile:d});p.launched||(console.error(` ${p.message}`),process.exit(1)),console.log(` ${p.message}`)}function y(){console.log(`
19
+ `),process.exit(0));let o=e.indexOf("--driver"),t=o>=0?e[o+1]:void 0,n=e.find((r,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");n&&d&&(console.error(" sootsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let x=n?m(n).id:void 0,s=t||i.driver,l=f;if(s){let r=h(s);r||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=r}if(l.id==="electron"){let r=c();if(!r){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await u("run sootsim desktop install now?",!0)){console.log();let{runInstallDesktop:D}=await import("./install-desktop-N6IVQZBG.js");await D(["--yes"]),r=c()}r||process.exit(1)}console.log(` launching ${r.path}`)}let b=await O(e,i),p=await l.launch({url:b,device:i.device,profileId:x,ephemeralProfile:d});p.launched||(console.error(` ${p.message}`),process.exit(1)),console.log(` ${p.message}`)}function y(){console.log(`
20
20
  sootsim desktop \u2014 launch or install the desktop companion
21
21
 
22
22
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{e as P}from"./chunk-HVKLAOZM.js";import"./chunk-6XLP5EB5.js";import"./chunk-YYW4JGGL.js";import"./chunk-KEZZHUOP.js";import"./chunk-TEEK6DLL.js";import{c as _,d as I,e as D}from"./chunk-2NTPCZNI.js";import{a as b}from"./chunk-ZVVEXBEJ.js";import"./chunk-GD6LJ2CR.js";import"./chunk-BZPJSFSP.js";import"./chunk-Z3BORSD4.js";import"./chunk-G4VPOKCZ.js";import"./chunk-Z7TEEXRM.js";import"./chunk-YAX25DGN.js";import"./chunk-YQDB5ODC.js";import"./chunk-TR25YKVI.js";import"./chunk-UMRMWSAM.js";import"./chunk-WQ5DQ5X7.js";import"./chunk-XWRHHNOK.js";import"./chunk-XUJDCVTH.js";import"./chunk-OUZCXC3F.js";import"./chunk-TZJ6V6E3.js";import"./chunk-P3IXWUXV.js";import"./chunk-EOUBCSIZ.js";import"./chunk-YXP22OFA.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-TA6OIGXV.js";import"./chunk-CFIAG2RO.js";import"./chunk-JPXFE6M4.js";import"./chunk-APBFMXMM.js";import"./chunk-K3Q4FEMG.js";import{spawn as N}from"child_process";import{existsSync as x,mkdirSync as k,readFileSync as A,writeFileSync as w,unlinkSync as M}from"fs";import{tmpdir as F}from"os";import{dirname as L,resolve as l,join as R,relative as C}from"path";function W(){try{let e=import.meta.resolve("sootsim/detox");return L(e.startsWith("file://")?e.slice(7):e)}catch{return l(import.meta.dirname,"..","..","detox")}}var B=`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{e as P}from"./chunk-7NCUVJSZ.js";import"./chunk-VRXFBWBW.js";import"./chunk-DUCTVOTV.js";import"./chunk-V5LQP2JL.js";import"./chunk-EURBYQXU.js";import{c as _,d as I,e as D}from"./chunk-PEFAS7Q4.js";import{a as b}from"./chunk-DKGKL6KP.js";import"./chunk-TB7CIKZ3.js";import"./chunk-BA4Q3KRH.js";import"./chunk-ZYEIV7ZN.js";import"./chunk-RGDT3EBF.js";import"./chunk-GB3IT6AN.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import"./chunk-3PLNSSEF.js";import"./chunk-IQ2IFKZ4.js";import"./chunk-PGLRJ4GA.js";import"./chunk-BGW73A3C.js";import"./chunk-SACUEZZP.js";import"./chunk-PUH4S4CC.js";import"./chunk-Q2X3WO5X.js";import"./chunk-W7H4OAY4.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-LBXFCH5I.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";import{spawn as N}from"child_process";import{existsSync as x,mkdirSync as k,readFileSync as A,writeFileSync as w,unlinkSync as M}from"fs";import{tmpdir as F}from"os";import{dirname as L,resolve as l,join as R,relative as C}from"path";function W(){try{let e=import.meta.resolve("sootsim/detox");return L(e.startsWith("file://")?e.slice(7):e)}catch{return l(import.meta.dirname,"..","..","detox")}}var B=`
3
3
  sootsim detox \u2014 run detox-style tests against a sootsim shell
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-Z3BORSD4.js";import{g as d,i as l,l as a}from"./chunk-XUJDCVTH.js";import"./chunk-YXP22OFA.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-JPXFE6M4.js";import{g as c,h as r,i as g}from"./chunk-APBFMXMM.js";import"./chunk-K3Q4FEMG.js";function h(){console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-ZYEIV7ZN.js";import{g as d,i as l,l as a}from"./chunk-BGW73A3C.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import{g as c,h as r,i as g}from"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.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.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as E,i as R,l as b}from"./chunk-XUJDCVTH.js";import"./chunk-R7RUIOMK.js";import{c as v}from"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.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.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as E,i as R,l as b}from"./chunk-BGW73A3C.js";import"./chunk-G3EZ5KVE.js";import{c as v}from"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
3
3
  sootsim get diagnosis \u2014 compact "what just went wrong?" report
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-6NWVRY7I.js";import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk-RGDT3EBF.js";import"./chunk-GB3IT6AN.js";import"./chunk-4Z3JQFES.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.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.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as L,d as T}from"./chunk-7DV3AEBI.js";import{g as $,i as R,m as b}from"./chunk-XUJDCVTH.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";import{spawnSync as x}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as q}from"node:os";import{dirname as j,extname as H,join as K,resolve as C}from"node:path";var s=t=>new Promise(a=>setTimeout(a,t)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(t,a){let n=t.indexOf(a);return n>=0?t[n+1]:void 0}async function r(t,a,n=3e4){return await t.send({type:"evaluate",code:a},{timeoutMs:n})}async function le(t,a){if(t.length===0||t.includes("--help")||t.includes("-h"))return console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as L,d as T}from"./chunk-VKJ4BFFU.js";import{g as $,i as R,m as b}from"./chunk-BGW73A3C.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";import{spawnSync as x}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as q}from"node:os";import{dirname as j,extname as H,join as K,resolve as C}from"node:path";var s=t=>new Promise(a=>setTimeout(a,t)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(t,a){let n=t.indexOf(a);return n>=0?t[n+1]:void 0}async function r(t,a,n=3e4){return await t.send({type:"evaluate",code:a},{timeoutMs:n})}async function le(t,a){if(t.length===0||t.includes("--help")||t.includes("-h"))return console.log(`
3
3
  sootsim film \u2014 record a flow flat, replay it on the 3d stage, save a clip
4
4
 
5
5
  usage:
@@ -33,7 +33,7 @@ examples:
33
33
  sootsim film flows/swap.yaml --script hero-arc --background gradient-tide --out ~/Desktop/swap-3d.mp4
34
34
  sootsim film flows/login.yaml --colorway deep-blue --environment on --env-shape pane --room on
35
35
  `),0;let n=t.find(d=>!d.startsWith("--")&&/\.ya?ml$/.test(d));if(!n||!V(C(n)))return console.error(` film: flow file not found: ${n??"(none given)"}`),1;let P=Number.parseInt(c(t,"--fps")??"30",10),h=c(t,"--script")??"hero-arc",D=t.includes("--keep-three"),v=n.replace(/^.*\//,"").replace(/\.ya?ml$/,""),I=c(t,"--out"),l=C(I??K(q(),"Desktop","sootsim-films",`${v}.webm`)),y=H(l).toLowerCase()===".mp4";if(y&&x("ffmpeg",["-version"]).status!==0)return console.error(" film: --out ends in .mp4 but ffmpeg is not installed"),console.error(" install ffmpeg or use a .webm output path"),1;let z=$(t,{port:a.port,stripValueFlags:[...X,...Q],stripBooleanFlags:J}),e=R({...z,commandTimeoutMs:6e4});try{let d=await r(e,`(() => { const s = window.SootSim?.bridges?.settings?.get?.() || {}
36
- return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(e,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let O=Date.now();await s(500);let{runFlowPlayback:G}=await import("./flow-DYOXMN3T.js"),m=[n],S=c(t,"--sim");S&&m.push("--sim",S);let k=c(t,"--slow");k&&m.push("--slow",k);let f=await G(m);await s(400);let u=Math.min(Date.now()-O,Y);if(await r(e,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let _=!1;for(let o=0;o<50;o++){await s(400);let i=await r(e,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
36
+ return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(e,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let O=Date.now();await s(500);let{runFlowPlayback:G}=await import("./flow-RYMDNC4V.js"),m=[n],S=c(t,"--sim");S&&m.push("--sim",S);let k=c(t,"--slow");k&&m.push("--slow",k);let f=await G(m);await s(400);let u=Math.min(Date.now()-O,Y);if(await r(e,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let _=!1;for(let o=0;o<50;o++){await s(400);let i=await r(e,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
37
37
  return { state: s?.state, hasBlob: !!s?.lastVideoBlob } })()`);if(i?.state==="idle"&&i.hasBlob){_=!0;break}}if(!_)return console.error(" film: flow recording never produced a video blob"),1;console.log(` film: flow captured (${(u/1e3).toFixed(1)}s)`),await r(e,"window.SootSim?.bridges?.settings?.set?.('threeMode', true)"),await L(e),await s(1400),await r(e,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', true)");let F=!1;for(let o=0;o<60;o++)if(await s(250),await r(e,`(() => { const rs = window.SootSim?.replayStore
38
38
  return rs?.value?.preview?.surface === 'video' && !!rs?.value?.preview?.flowVideoUrl })()`)){F=!0;break}if(!F)return console.error(" film: recording editor did not seed the replay store"),1;await r(e,`(async () => {
39
39
  const entitled = () =>
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c,d,e,f,g,h}from"./chunk-7NCUVJSZ.js";import"./chunk-VRXFBWBW.js";import"./chunk-DUCTVOTV.js";import{c as a,d as b}from"./chunk-V5LQP2JL.js";import"./chunk-EURBYQXU.js";import"./chunk-PEFAS7Q4.js";import"./chunk-DKGKL6KP.js";import"./chunk-TB7CIKZ3.js";import"./chunk-BA4Q3KRH.js";import"./chunk-ZYEIV7ZN.js";import"./chunk-RGDT3EBF.js";import"./chunk-GB3IT6AN.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import"./chunk-3PLNSSEF.js";import"./chunk-IQ2IFKZ4.js";import"./chunk-PGLRJ4GA.js";import"./chunk-BGW73A3C.js";import"./chunk-SACUEZZP.js";import"./chunk-PUH4S4CC.js";import"./chunk-Q2X3WO5X.js";import"./chunk-W7H4OAY4.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-LBXFCH5I.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";export{e as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,g as hoistLeadingSimFlag,a as parseFlowFile,f as runFlowPlayback,h as runMaestroAuthoring,b as validateFlowFile};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c}from"./chunk-7KGIZCO3.js";import"./chunk-RBDWTH6O.js";import"./chunk-W7H4OAY4.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-LBXFCH5I.js";import"./chunk-KWNVZ2LX.js";import"./chunk-VQKTMX3M.js";import"./chunk-HBQ7CCHG.js";import"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as e,b as s}from"./chunk-TA6OIGXV.js";import"./chunk-K3Q4FEMG.js";var n=[{title:"Overview",route:"/docs/sootsim/cli"},...e.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/sootsim/cli/${o.slug}`}))];var i=["do","get"];function g(o){if(o.command)return o;let t=o.commandArgs.find(r=>!r.startsWith("-"));if(!t)return o;for(let r of i)if(s(r,t))return{...o,command:r};return o}export{g as resolveHiddenRuntimeAlias};
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as e,b as s}from"./chunk-LBXFCH5I.js";import"./chunk-FK57ISRW.js";var n=[{title:"Overview",route:"/docs/sootsim/cli"},...e.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/sootsim/cli/${o.slug}`}))];var i=["do","get"];function g(o){if(o.command)return o;let t=o.commandArgs.find(r=>!r.startsWith("-"));if(!t)return o;for(let r of i)if(s(r,t))return{...o,command:r};return o}export{g as resolveHiddenRuntimeAlias};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,L as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,S as claimDaemonLockfile,K as compareSemver,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,O as isDaemonLockfileFresh,P as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,J as listInstalledRuntimes,q as profilesDir,H as readActiveRuntime,M as readDaemonLockfile,N as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,T as removeDaemonLockfile,U as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,Q as writeDaemonLockfile,R as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,L as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,S as claimDaemonLockfile,K as compareSemver,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,O as isDaemonLockfileFresh,P as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,J as listInstalledRuntimes,q as profilesDir,H as readActiveRuntime,M as readDaemonLockfile,N as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,T as removeDaemonLockfile,U as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,Q as writeDaemonLockfile,R as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{j as a,k as b}from"./chunk-V5LQP2JL.js";import"./chunk-EURBYQXU.js";import"./chunk-TB7CIKZ3.js";import"./chunk-BA4Q3KRH.js";import"./chunk-ZYEIV7ZN.js";import"./chunk-RGDT3EBF.js";import"./chunk-GB3IT6AN.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import"./chunk-3PLNSSEF.js";import"./chunk-IQ2IFKZ4.js";import"./chunk-PGLRJ4GA.js";import"./chunk-BGW73A3C.js";import"./chunk-SACUEZZP.js";import"./chunk-W7H4OAY4.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-LBXFCH5I.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";export{a as printShellPerfReport,b as runInspect};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-T7KUJUST.js";import"./chunk-GB3IT6AN.js";import"./chunk-QPZYFSTW.js";import"./chunk-FK57ISRW.js";export{a as runInstallDesktop};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as k,d as v}from"./chunk-P3IXWUXV.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="http://localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as k,d as v}from"./chunk-Q2X3WO5X.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="http://localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
3
3
  sootsim login \u2014 sign in so uploads can attach to your account
4
4
 
5
5
  usage:
@@ -21,6 +21,6 @@ options:
21
21
  <p style="color:#ccc">${r}</p>
22
22
  </div>
23
23
  </body>
24
- </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-NWD6GLRC.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-NWD6GLRC.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("contrast",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
24
+ </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-3M5Y7GDR.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-3M5Y7GDR.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("contrast",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
25
25
  ${n.toString()}
26
- `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-NWD6GLRC.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-NWD6GLRC.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
26
+ `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-3M5Y7GDR.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-3M5Y7GDR.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as r,b as i}from"./chunk-TZJ6V6E3.js";import{a as t,c as o}from"./chunk-P3IXWUXV.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.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.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-PUH4S4CC.js";import{a as t,c as o}from"./chunk-Q2X3WO5X.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.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.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as M,d as E,f as O,g as L,h as R}from"./chunk-HVKLAOZM.js";import"./chunk-6XLP5EB5.js";import"./chunk-YYW4JGGL.js";import{c as S}from"./chunk-KEZZHUOP.js";import{a as x}from"./chunk-TEEK6DLL.js";import{b as A,c as $,d as F,e as T}from"./chunk-2NTPCZNI.js";import{a as k}from"./chunk-ZVVEXBEJ.js";import"./chunk-GD6LJ2CR.js";import"./chunk-BZPJSFSP.js";import"./chunk-Z3BORSD4.js";import"./chunk-G4VPOKCZ.js";import"./chunk-Z7TEEXRM.js";import"./chunk-YAX25DGN.js";import"./chunk-YQDB5ODC.js";import"./chunk-TR25YKVI.js";import"./chunk-UMRMWSAM.js";import"./chunk-WQ5DQ5X7.js";import"./chunk-XWRHHNOK.js";import"./chunk-XUJDCVTH.js";import"./chunk-OUZCXC3F.js";import"./chunk-TZJ6V6E3.js";import"./chunk-P3IXWUXV.js";import"./chunk-EOUBCSIZ.js";import"./chunk-YXP22OFA.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-TA6OIGXV.js";import"./chunk-CFIAG2RO.js";import"./chunk-JPXFE6M4.js";import"./chunk-APBFMXMM.js";import"./chunk-K3Q4FEMG.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function P(){console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as M,d as E,f as O,g as L,h as R}from"./chunk-7NCUVJSZ.js";import"./chunk-VRXFBWBW.js";import"./chunk-DUCTVOTV.js";import{c as S}from"./chunk-V5LQP2JL.js";import{a as x}from"./chunk-EURBYQXU.js";import{b as A,c as $,d as F,e as T}from"./chunk-PEFAS7Q4.js";import{a as k}from"./chunk-DKGKL6KP.js";import"./chunk-TB7CIKZ3.js";import"./chunk-BA4Q3KRH.js";import"./chunk-ZYEIV7ZN.js";import"./chunk-RGDT3EBF.js";import"./chunk-GB3IT6AN.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import"./chunk-3PLNSSEF.js";import"./chunk-IQ2IFKZ4.js";import"./chunk-PGLRJ4GA.js";import"./chunk-BGW73A3C.js";import"./chunk-SACUEZZP.js";import"./chunk-PUH4S4CC.js";import"./chunk-Q2X3WO5X.js";import"./chunk-W7H4OAY4.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-LBXFCH5I.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function P(){console.log(`
3
3
  sootsim maestro \u2014 author and run Maestro YAML flows against sootsim
4
4
 
5
5
  usage:
@@ -89,7 +89,7 @@ appId: com.example.app
89
89
  - inputText: "secret123"
90
90
  - tapOn: "Sign in"
91
91
  - assertVisible: "Welcome"
92
- `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function z(o,n={}){if(o.includes("--help")||o.includes("-h"))return P(),0;if(o.includes("--list-compat"))return W(),0;let e;try{e=D(o)}catch(r){return console.error(` error: ${r.message}`),1}e=L(e);let t=process.cwd(),i=e[0];if(i==="init")return N(t);if(i==="generate"){let{runMaestroGenerate:r}=await import("./maestro-generate-O3J2XRQD.js");return r(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return R(e);e=Y(e);let u=null,p;if(i==="test"){let r=e.slice(1).find(f=>!U(f));r?(u=a.resolve(t,r),p=e.slice(1).filter(f=>f!==r)):(u=j(t),p=e.slice(1))}else i&&!U(i)?(u=a.resolve(t,i),p=e.slice(1)):(u=j(t),p=e);if(!u)return console.error(`
92
+ `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function z(o,n={}){if(o.includes("--help")||o.includes("-h"))return P(),0;if(o.includes("--list-compat"))return W(),0;let e;try{e=D(o)}catch(r){return console.error(` error: ${r.message}`),1}e=L(e);let t=process.cwd(),i=e[0];if(i==="init")return N(t);if(i==="generate"){let{runMaestroGenerate:r}=await import("./maestro-generate-Y25ETFOO.js");return r(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return R(e);e=Y(e);let u=null,p;if(i==="test"){let r=e.slice(1).find(f=>!U(f));r?(u=a.resolve(t,r),p=e.slice(1).filter(f=>f!==r)):(u=j(t),p=e.slice(1))}else i&&!U(i)?(u=a.resolve(t,i),p=e.slice(1)):(u=j(t),p=e);if(!u)return console.error(`
93
93
  error: no maestro flows found.
94
94
  expected one of: ${I.map(r=>`./${r}/`).join(", ")}
95
95
  or pass a flow explicitly: sootsim maestro test path/to/flow.yaml
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as x}from"./chunk-TEEK6DLL.js";import{b as O,d as k,e as A}from"./chunk-2NTPCZNI.js";import{a as v,b as T}from"./chunk-ZVVEXBEJ.js";import"./chunk-YAX25DGN.js";import"./chunk-YQDB5ODC.js";import"./chunk-TR25YKVI.js";import{f as y}from"./chunk-XWRHHNOK.js";import{g as b,i as S}from"./chunk-XUJDCVTH.js";import"./chunk-TZJ6V6E3.js";import"./chunk-P3IXWUXV.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";import{mkdtempSync as j,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as E}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,V=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function G(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var F=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function H(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(F.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function Y(e,t){return e.filter((r,o)=>o!==t)}async function K(e,t){let r=Y(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...F]}),i=S(o);try{let s=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),a=[s.shell?`shell: ${JSON.stringify(s.shell)}`:"",s.keyboard?`keyboard: ${JSON.stringify(s.keyboard)}`:"",typeof s.nodeCount=="number"?`nodes: ${s.nodeCount}`:"",s.tree||""].filter(Boolean).join(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as x}from"./chunk-EURBYQXU.js";import{b as O,d as k,e as A}from"./chunk-PEFAS7Q4.js";import{a as v,b as T}from"./chunk-DKGKL6KP.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import{f as y}from"./chunk-PGLRJ4GA.js";import{g as b,i as S}from"./chunk-BGW73A3C.js";import"./chunk-PUH4S4CC.js";import"./chunk-Q2X3WO5X.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";import{mkdtempSync as j,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as E}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,V=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function G(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var F=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function H(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(F.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function Y(e,t){return e.filter((r,o)=>o!==t)}async function K(e,t){let r=Y(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...F]}),i=S(o);try{let s=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),a=[s.shell?`shell: ${JSON.stringify(s.shell)}`:"",s.keyboard?`keyboard: ${JSON.stringify(s.keyboard)}`:"",typeof s.nodeCount=="number"?`nodes: ${s.nodeCount}`:"",s.tree||""].filter(Boolean).join(`
3
3
  `);return a.length>_?a.slice(0,_)+`
4
4
  [tree truncated]`:a}finally{i.close()}}var z=`
5
5
  You write Maestro-compatible SootSim YAML flows from a user's plain-language test goal.
@@ -30,5 +30,5 @@ ${t||"[no tree available]"}
30
30
 
31
31
  Generate the shortest replayable flow that verifies the goal from this current state.
32
32
  `.trim()}function M(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>t&&typeof t=="object"&&t.type==="text"?String(t.text??""):"").join(""):""}async function X(e){let t=await fetch(`${e.origin.replace(/\/$/,"")}/api/llm`,{method:"POST",headers:{"content-type":"application/json",authorization:e.authHeader},body:JSON.stringify({modelId:J,context:{systemPrompt:z,messages:[{role:"user",content:W(e.prompt,e.describe),timestamp:Date.now()}]},options:{maxTokens:1800,temperature:.2},threadId:null}),signal:AbortSignal.timeout(V)});if(!t.ok||!t.body){let c=await t.text().catch(()=>"");throw new Error(`/api/llm ${t.status}${c?`: ${c}`:""}`)}let r=t.body.getReader(),o=new TextDecoder,i=[],s="",l="",a=c=>{let d=c.trim();if(!d)return;let n=JSON.parse(d);if(n.type==="text_delta"&&n.delta)i.push(n.delta);else if(n.type==="text_end"&&n.content)s=n.content;else if(n.type==="done")s=M(n.message?.content);else if(n.type==="error")throw new Error(n.error?.errorMessage||M(n.error?.content)||"llm error")};for(;;){let{value:c,done:d}=await r.read();if(d)break;l+=o.decode(c,{stream:!0});let n;for(;(n=l.indexOf(`
33
- `))>=0;)a(l.slice(0,n)),l=l.slice(n+1)}l+=o.decode(),l.trim()&&a(l);let u=(s||i.join("")).trim();if(!u)throw new Error("llm returned an empty test flow");return u}function q(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function P(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function Q(e){let t=q(e);if(!P(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"SootSim generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((s,l)=>{if(!P(s))throw new Error(`flow step ${l+1} is not an object`);return s});return{summary:r,steps:i,yamlText:x.stringify(i)}}function Z(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],s=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),l=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let a=0;a<e.length;a++){if(a===t)continue;let u=e[a];if(u==="--origin"||u==="--preview-origin"){a+=1;continue}if(u==="--public-origin"){let c=e[a+1];c&&i.push("--preview-public-origin",c),a+=1;continue}if(s.has(u)){let c=e[a+1];c&&i.push(u,c),a+=1;continue}l.has(u)&&i.push(u)}return i}async function ce(e){let t=H(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=v();if(!i||i.kind==="github")return console.error(' sootsim maestro generate "<goal>" needs a login or SOOTSIM_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let s=T(i),l=await A(G(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let a=await K(e,o);console.log(" generating Maestro flow\u2026");let u=await X({prompt:r,describe:a,origin:l,authHeader:s}),c=Q(u),d=j(E(C(),"sootsim-maestro-generate-")),n=E(d,"flow.yaml");N(n,c.yamlText),console.log(` flow: ${n}`);let I=Date.now(),{runFlowPlayback:$,getLastFlowPreviewUploadResult:D,getLastFlowTraceSteps:L}=await import("./flow-DYOXMN3T.js"),U=Z(e,o,n,l),w=await $(U),p=D(),h=L(),B=h.find(R=>R.status==="failure"),g=w===0?"passed":"failed",m=await k({origin:l,kind:"maestro",prompt:r,summary:c.summary,status:g,failureMessage:g==="failed"?B?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-I,flowYamlSizeBytes:Buffer.byteLength(c.yamlText,"utf8"),...O(h),auth:i});return console.log(`
33
+ `))>=0;)a(l.slice(0,n)),l=l.slice(n+1)}l+=o.decode(),l.trim()&&a(l);let u=(s||i.join("")).trim();if(!u)throw new Error("llm returned an empty test flow");return u}function q(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function P(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function Q(e){let t=q(e);if(!P(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"SootSim generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((s,l)=>{if(!P(s))throw new Error(`flow step ${l+1} is not an object`);return s});return{summary:r,steps:i,yamlText:x.stringify(i)}}function Z(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],s=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),l=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let a=0;a<e.length;a++){if(a===t)continue;let u=e[a];if(u==="--origin"||u==="--preview-origin"){a+=1;continue}if(u==="--public-origin"){let c=e[a+1];c&&i.push("--preview-public-origin",c),a+=1;continue}if(s.has(u)){let c=e[a+1];c&&i.push(u,c),a+=1;continue}l.has(u)&&i.push(u)}return i}async function ce(e){let t=H(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=v();if(!i||i.kind==="github")return console.error(' sootsim maestro generate "<goal>" needs a login or SOOTSIM_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let s=T(i),l=await A(G(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let a=await K(e,o);console.log(" generating Maestro flow\u2026");let u=await X({prompt:r,describe:a,origin:l,authHeader:s}),c=Q(u),d=j(E(C(),"sootsim-maestro-generate-")),n=E(d,"flow.yaml");N(n,c.yamlText),console.log(` flow: ${n}`);let I=Date.now(),{runFlowPlayback:$,getLastFlowPreviewUploadResult:D,getLastFlowTraceSteps:L}=await import("./flow-RYMDNC4V.js"),U=Z(e,o,n,l),w=await $(U),p=D(),h=L(),B=h.find(R=>R.status==="failure"),g=w===0?"passed":"failed",m=await k({origin:l,kind:"maestro",prompt:r,summary:c.summary,status:g,failureMessage:g==="failed"?B?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-I,flowYamlSizeBytes:Buffer.byteLength(c.yamlText,"utf8"),...O(h),auth:i});return console.log(`
34
34
  result: ${g}`),m&&console.log(` run: ${m.id}`),p?.previewUrl&&console.log(` preview: ${p.previewUrl}`),m?.traceUrl&&console.log(` replay: ${m.traceUrl}`),w}export{ce as runMaestroGenerate};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as s,b as i}from"./chunk-7DV3AEBI.js";import"./chunk-XUJDCVTH.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s,b as i}from"./chunk-VKJ4BFFU.js";import"./chunk-BGW73A3C.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim mode screenshot \u2014 toggle the screenshot-mode chrome overlay
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b}from"./chunk-3PLNSSEF.js";import"./chunk-FK57ISRW.js";export{a as loadOptionalDemoApps,b as optionalDemoAppsSync};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{k as x}from"./chunk-KEZZHUOP.js";import"./chunk-TEEK6DLL.js";import"./chunk-GD6LJ2CR.js";import"./chunk-BZPJSFSP.js";import"./chunk-Z3BORSD4.js";import"./chunk-G4VPOKCZ.js";import"./chunk-Z7TEEXRM.js";import"./chunk-YAX25DGN.js";import"./chunk-YQDB5ODC.js";import"./chunk-TR25YKVI.js";import"./chunk-UMRMWSAM.js";import"./chunk-WQ5DQ5X7.js";import"./chunk-XWRHHNOK.js";import{g as R,i as N,l as d,m as S}from"./chunk-XUJDCVTH.js";import"./chunk-OUZCXC3F.js";import"./chunk-EOUBCSIZ.js";import"./chunk-YXP22OFA.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-TA6OIGXV.js";import"./chunk-CFIAG2RO.js";import"./chunk-JPXFE6M4.js";import"./chunk-APBFMXMM.js";import"./chunk-K3Q4FEMG.js";import{mkdirSync as W,writeFileSync as A}from"fs";import{dirname as J,resolve as B}from"path";import{WebSocket as E}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),v=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new E(o,{maxPayload:1<<28}),this.ready=new Promise((r,t)=>{this.ws.once("open",()=>r()),this.ws.once("error",t)}),this.ws.on("message",r=>{let t=JSON.parse(r.toString());if(t.id&&this.pending.has(t.id)){let{res:n,rej:s}=this.pending.get(t.id);this.pending.delete(t.id),t.error?s(new Error(JSON.stringify(t.error))):n(t.result)}else if(t.method)for(let n of this.listeners)n(t.method,t.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},t){let n=this.nextId++;return new Promise((s,l)=>{this.pending.set(n,{res:s,rej:l}),this.ws.send(JSON.stringify({id:n,method:o,params:r,...t?{sessionId:t}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(w(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(w(e,"--sample-interval")??"0.1"),n=Number(w(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=w(e,"--match")??"/rn/",l=w(e,"--output")??w(e,"-o"),i=B(process.cwd(),l??"/tmp/sootsim.cpuprofile"),a=[];try{a=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return U(n),1}let f=a.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${n}`),console.error(` open targets: ${a.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new v(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:t*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),W(J(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(A(y,JSON.stringify(c.profile)),console.log(` ${P(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of _(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function U(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function P(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function _(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,l=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(l)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(l,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function w(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{k as x}from"./chunk-V5LQP2JL.js";import"./chunk-EURBYQXU.js";import"./chunk-TB7CIKZ3.js";import"./chunk-BA4Q3KRH.js";import"./chunk-ZYEIV7ZN.js";import"./chunk-RGDT3EBF.js";import"./chunk-GB3IT6AN.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import"./chunk-3PLNSSEF.js";import"./chunk-IQ2IFKZ4.js";import"./chunk-PGLRJ4GA.js";import{g as R,i as N,l as d,m as S}from"./chunk-BGW73A3C.js";import"./chunk-SACUEZZP.js";import"./chunk-W7H4OAY4.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-LBXFCH5I.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";import{mkdirSync as W,writeFileSync as A}from"fs";import{dirname as J,resolve as B}from"path";import{WebSocket as E}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),v=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new E(o,{maxPayload:1<<28}),this.ready=new Promise((r,t)=>{this.ws.once("open",()=>r()),this.ws.once("error",t)}),this.ws.on("message",r=>{let t=JSON.parse(r.toString());if(t.id&&this.pending.has(t.id)){let{res:n,rej:s}=this.pending.get(t.id);this.pending.delete(t.id),t.error?s(new Error(JSON.stringify(t.error))):n(t.result)}else if(t.method)for(let n of this.listeners)n(t.method,t.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},t){let n=this.nextId++;return new Promise((s,l)=>{this.pending.set(n,{res:s,rej:l}),this.ws.send(JSON.stringify({id:n,method:o,params:r,...t?{sessionId:t}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(w(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(w(e,"--sample-interval")??"0.1"),n=Number(w(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=w(e,"--match")??"/rn/",l=w(e,"--output")??w(e,"-o"),i=B(process.cwd(),l??"/tmp/sootsim.cpuprofile"),a=[];try{a=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return U(n),1}let f=a.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${n}`),console.error(` open targets: ${a.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new v(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:t*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),W(J(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(A(y,JSON.stringify(c.profile)),console.log(` ${P(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of _(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function U(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function P(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function _(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,l=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(l)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(l,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function w(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
3
3
  sootsim perf react \u2014 inspect React component render cost in the tenant worker
4
4
 
5
5
  usage:
@@ -1,15 +1,15 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as P}from"./chunk-6XLP5EB5.js";import{a as oe}from"./chunk-2NTPCZNI.js";import{a as Z,c as ee}from"./chunk-ZVVEXBEJ.js";import"./chunk-YAX25DGN.js";import"./chunk-YQDB5ODC.js";import{d as Y}from"./chunk-TR25YKVI.js";import{g as b,i as v,j as Q}from"./chunk-XUJDCVTH.js";import"./chunk-TZJ6V6E3.js";import"./chunk-P3IXWUXV.js";import"./chunk-R7RUIOMK.js";import{c as X}from"./chunk-YLSEQMQK.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";import{existsSync as he,mkdirSync as E,readdirSync as be,readFileSync as ve,rmSync as L,writeFileSync as I}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as D,extname as re,join as C,resolve as $e}from"path";var z=24e4,Re=9e4,_e=3e4;async function W(e,r,o,i){let t=Math.max(2e4,i+_e);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as W}from"./chunk-VRXFBWBW.js";import{a as oe}from"./chunk-PEFAS7Q4.js";import{a as Z,c as ee}from"./chunk-DKGKL6KP.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import{d as Y}from"./chunk-4Z3JQFES.js";import{g as b,i as v,j as Q}from"./chunk-BGW73A3C.js";import"./chunk-PUH4S4CC.js";import"./chunk-Q2X3WO5X.js";import"./chunk-G3EZ5KVE.js";import{c as X}from"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";import{existsSync as he,mkdirSync as B,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as C}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as A,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);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|lock already held/i.test(s)&&(console.error(` ${o} failed: ${s}
5
5
  a prior recording was abandoned and its capture is still
6
6
  releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
7
- \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var xe=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){xe.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(d,r);return}if(o.name==="prelude-start"){await Ce(d,r);return}if(o.name==="upload"){let{runUpload:y}=await import("./upload-ZUHYO36E.js");await y(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Fe(d,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let u=600;a>u&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${u}s (10m) maximum`),process.exit(1));let m=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),H=l(e,"--max-width")?Number(l(e,"--max-width")):void 0,g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:K,allowGitHubAuth:!0});let d=v({...i,commandTimeoutMs:6e4});try{await j(d),await de(d,t),t==="combined"&&await B(d),await ce(d,K,fe);let y=await le(d,t,t==="combined"?n:void 0);y.ok||(console.error(` start failed: recording store refused to start (${t})`+(y.error?`: ${y.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await ue(d);let k=await me(d);pe(k,x,t)}finally{d.close()}return}let A=p?Number(p):null,$=Me(s,c,A);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await ne(h),await B(h),$==="png"){let R=A??10,w=T(c,`sootsim-frames-${U()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),E(w,{recursive:!0});for(let f of be(w))/^frame-\d+\.png$/.test(f)&&L(C(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let S=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!S.ok||!S.requestId)&&(console.error(` frame capture start failed: ${S.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let ge=Date.now()+Math.max(5e3,g),F=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${S.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),F=f.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(N=>setTimeout(N,100))}F.forEach((f,N)=>{let we=`${w}/frame-${String(N+1).padStart(3,"0")}.png`;I(we,Buffer.from(f.data,"base64"))}),console.log(` saved ${F.length} frames`);return}if($==="gif"){let R=A??Math.max(10,Math.round(a*m/3)),w=T(c,`sootsim-${U()}.gif`);E(D(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let S=await W(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${H?`, maxWidth: ${H}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);S||(console.error(" gif capture returned no frames"),process.exit(1)),I(w,Buffer.from(S.data,"base64")),console.log(` saved: ${w} (${J(S.size)})`);return}let d=T(c,`sootsim-${U()}.${$}`);E(D(d),{recursive:!0});let y={format:$,fps:m,durationMs:g};n&&(y.layers=n);let k=await W(h,`window.__sootsimRecorder.start(${JSON.stringify(y)})`,`${$} start`,g);k.ok||(console.error(` start failed: ${k.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(k.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${$} for ${a}s \u2192 ${d}`),await new Promise(R=>setTimeout(R,g));let _=await W(h,"window.__sootsimRecorder.stop()",`${$} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(h,d),console.log(` saved: ${d} (${J(_.size)})`)}finally{h.close()}}var Ee=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
7
+ \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(d,r);return}if(o.name==="prelude-start"){await Ce(d,r);return}if(o.name==="upload"){let{runUpload:y}=await import("./upload-F47SYC4Y.js");await y(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Fe(d,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let u=600;a>u&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${u}s (10m) maximum`),process.exit(1));let m=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),k=l(e,"--max-width")?Number(l(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=v({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await M(d),await ce(d,K,fe);let y=await le(d,t,t==="combined"?n:void 0);y.ok||(console.error(` start failed: recording store refused to start (${t})`+(y.error?`: ${y.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await ue(d);let O=await me(d);pe(O,x,t)}finally{d.close()}return}let F=p?Number(p):null,$=Me(s,c,F);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await ne(h),await M(h),$==="png"){let R=F??10,w=I(c,`sootsim-frames-${T()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),B(w,{recursive:!0});for(let f of be(w))/^frame-\d+\.png$/.test(f)&&q(A(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let S=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!S.ok||!S.requestId)&&(console.error(` frame capture start failed: ${S.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let ge=Date.now()+Math.max(5e3,g),N=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${S.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),N=f.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((f,P)=>{let we=`${w}/frame-${String(P+1).padStart(3,"0")}.png`;C(we,Buffer.from(f.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if($==="gif"){let R=F??Math.max(10,Math.round(a*m/3)),w=I(c,`sootsim-${T()}.gif`);B(z(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let S=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);S||(console.error(" gif capture returned no frames"),process.exit(1)),C(w,Buffer.from(S.data,"base64")),console.log(` saved: ${w} (${L(S.size)})`);return}let d=I(c,`sootsim-${T()}.${$}`);B(z(d),{recursive:!0});let y={format:$,fps:m,durationMs:g};n&&(y.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify(y)})`,`${$} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${$} for ${a}s \u2192 ${d}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${$} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(h,d),console.log(` saved: ${d} (${L(_.size)})`)}finally{h.close()}}var Ee=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function M(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
8
8
  would be throttled to ~1fps and produce a frozen-looking file.
9
9
  bring the chrome window to the foreground (un-minimize / switch to
10
- its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ie(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=re(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Me(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function U(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Ue(){let e=C(ye(),".sootsim","recordings");return E(e,{recursive:!0}),e}function T(e,r){return e?$e(process.cwd(),e):C(Ue(),r)}function J(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function se(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function q(){return C(Se(),`sootsim-recording-${X()}.json`)}function M(){let e=q();if(!he(e))return null;try{return{mode:"video",...JSON.parse(ve(e,"utf8"))}}catch{return L(e,{force:!0}),null}}function Te(e){I(q(),JSON.stringify(e,null,2))}function O(){L(q(),{force:!0})}function G(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
10
+ its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ie(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}C(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=re(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Me(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function T(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Ue(){let e=A(ye(),".sootsim","recordings");return B(e,{recursive:!0}),e}function I(e,r){return e?$e(process.cwd(),e):A(Ue(),r)}function L(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function se(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function G(){return A(Se(),`sootsim-recording-${X()}.json`)}function U(){let e=G();if(!he(e))return null;try{return{mode:"video",...JSON.parse(ve(e,"utf8"))}}catch{return q(e,{force:!0}),null}}function Te(e){C(G(),JSON.stringify(e,null,2))}function E(){q(G(),{force:!0})}function j(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
11
11
  requested sim ${e}. record state is global (not per-sim);
12
- this command acts on that session regardless of --sim.`)}async function Ie(e,r){let o=M();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format"),c=s==="mp4"?"mp4":"webm";s&&c!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: sootsim record --format ${s} --duration <s>`),process.exit(1));let a=Number(l(e,"--fps")??"30"),u=te(e),m=v({...i,commandTimeoutMs:t==="live"||t==="combined"?Re:15e3});try{if(t==="live"||t==="combined"){n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:l(e,"--origin"),allowGitHubAuth:!0}),await j(m),await de(m,t),t==="combined"&&await B(m),await ce(m,l(e,"--origin"),u);let p=await le(m,t,t==="combined"?n:void 0);p.ok||(console.error(` start failed: recording store refused to start (${t})`+(p.error?`: ${p.error}`:"")),process.exit(1))}else{await ne(m),await B(m);let p={format:c,fps:a};n&&(p.layers=n);let x=await m.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(p)})`});x.ok||(console.error(` start failed: ${x.error??"unknown error"}`),process.exit(1))}Te({simId:i.simId??null,mode:t,format:c,fps:a,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${c} @ ${a}fps${n?` (${n})`:""} \u2014 run \`sootsim record stop --output <path>\` when done`:` recording ${t} \u2014 run \`sootsim record stop\` when done (add --open to launch the preview URL)`)}finally{m.close()}}async function Ce(e,r){let o=M();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=v({...i,commandTimeoutMs:15e3});try{if(await j(t),await B(t),!await t.send({type:"evaluate",code:`(() => {
12
+ this command acts on that session regardless of --sim.`)}async function Ie(e,r){let o=U();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--lockstep"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format"),c=s==="mp4"?"mp4":"webm";s&&c!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: sootsim record --format ${s} --duration <s>`),process.exit(1));let a=Number(l(e,"--fps")??"30"),u=te(e),m=v({...i,commandTimeoutMs:t==="live"||t==="combined"?Re:15e3});try{if(t==="live"||t==="combined"){n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:l(e,"--origin"),allowGitHubAuth:!0}),await H(m),await de(m,t),t==="combined"&&await M(m),await ce(m,l(e,"--origin"),u);let p=await le(m,t,t==="combined"?n:void 0);p.ok||(console.error(` start failed: recording store refused to start (${t})`+(p.error?`: ${p.error}`:"")),process.exit(1))}else{await ne(m),await M(m);let p=e.includes("--lockstep");p&&c!=="mp4"&&(console.error(" --lockstep requires --format mp4 (webm is realtime-clocked)"),process.exit(1));let x={format:c,fps:a};n&&(x.layers=n),p&&(x.lockstep=!0);let k=await m.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(x)})`});k.ok||(console.error(` start failed: ${k.error??"unknown error"}`),process.exit(1))}Te({simId:i.simId??null,mode:t,format:c,fps:a,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${c} @ ${a}fps${n?` (${n})`:""} \u2014 run \`sootsim record stop --output <path>\` when done`:` recording ${t} \u2014 run \`sootsim record stop\` when done (add --open to launch the preview URL)`)}finally{m.close()}}async function Ce(e,r){let o=U();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=v({...i,commandTimeoutMs:15e3});try{if(await H(t),await M(t),!await t.send({type:"evaluate",code:`(() => {
13
13
  const start = window.SootSim?.bridges?.startRecordingPrelude
14
14
  if (typeof start !== 'function') return false
15
15
  return Promise.resolve(start()).then((value) => value === true)
@@ -40,7 +40,7 @@ import{a as P}from"./chunk-6XLP5EB5.js";import{a as oe}from"./chunk-2NTPCZNI.js"
40
40
  const r = window.__sootsimRecorder;
41
41
  if (r && typeof r.forceRelease === 'function') return await r.forceRelease();
42
42
  return false;
43
- })()`}).catch(()=>!1);return{store:r,headless:o}}async function Fe(e,r){let o=M();if(o){G(b(e,{port:r.port}).simId,o),o.mode==="video"?console.log(` recording ${o.mode} (${o.format} @ ${o.fps}fps) on sim ${o.simId??"?"} since ${o.startedAt}`):console.log(` recording ${o.mode} on sim ${o.simId??"?"} since ${o.startedAt}`);return}let i=b(e,{port:r.port}),t=v({...i,commandTimeoutMs:8e3});try{let n=await ae(t);if(n==="recording"||n==="processing"||n==="prelude"){if(n==="prelude"){console.log(" a recording preview prelude is active. hidden setup is being\n captured for the next live/combined preview recording. finish\n it with `sootsim record start --mode combined`, or discard it\n with `sootsim record cancel`.");return}console.log(` a recording is in progress (engine state: ${n}), but not via
43
+ })()`}).catch(()=>!1);return{store:r,headless:o}}async function Fe(e,r){let o=U();if(o){j(b(e,{port:r.port}).simId,o),o.mode==="video"?console.log(` recording ${o.mode} (${o.format} @ ${o.fps}fps) on sim ${o.simId??"?"} since ${o.startedAt}`):console.log(` recording ${o.mode} on sim ${o.simId??"?"} since ${o.startedAt}`);return}let i=b(e,{port:r.port}),t=v({...i,commandTimeoutMs:8e3});try{let n=await ae(t);if(n==="recording"||n==="processing"||n==="prelude"){if(n==="prelude"){console.log(" a recording preview prelude is active. hidden setup is being\n captured for the next live/combined preview recording. finish\n it with `sootsim record start --mode combined`, or discard it\n with `sootsim record cancel`.");return}console.log(` a recording is in progress (engine state: ${n}), but not via
44
44
  \`record start\` \u2014 it was started by an atomic \`record --duration\`
45
45
  run or the in-browser record button, which own their own lifecycle.
46
46
  if that controlling run is still alive it will finish on its own
@@ -48,7 +48,7 @@ import{a as P}from"./chunk-6XLP5EB5.js";import{a as oe}from"./chunk-2NTPCZNI.js"
48
48
  process; live/combined upload to /preview/<id>). if the run was
49
49
  killed, the recording is abandoned and will NOT finish \u2014 reclaim
50
50
  it now with \`sootsim record cancel\`, or it auto-reclaims when the
51
- abandoned capture's deadline lapses.`)}else console.log(" no recording in progress")}finally{t.close()}}async function Ne(e,r){let o=M();if(!o){let s=b(e,{port:r.port}),c=v({...s,commandTimeoutMs:8e3});try{let a=await ae(c);if(a==="recording"||a==="processing"||a==="prelude"){let u=await Ae(c);u.store&&a==="prelude"?console.log(" recording preview prelude cancelled"):u.store||u.headless?console.log(" reclaimed an abandoned recording (started by an atomic\n `record --duration` run or the record button whose owner is\n gone). the recorder is idle again \u2014 live/combined can start."):console.log(" a recording is in progress and still owned by a live atomic\n `record --duration` run or the in-browser record button \u2014 it\n will finish on its own and nothing was reclaimed.")}else console.log(" no recording in progress")}finally{c.close()}return}let i=b(e,{port:r.port});G(i.simId,o);let t=o.simId??i.simId??void 0,n=v({...i,simId:t,commandTimeoutMs:15e3});try{o.mode==="live"||o.mode==="combined"?await n.send({type:"evaluate",code:"void window.SootSim?.bridges?.cancelRecording?.()"}):await n.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"})}catch{}finally{O(),n.close()}console.log(" recording cancelled")}async function Pe(e,r){let o=M();o||(console.error(" no recording in progress. start one with `sootsim record start`."),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});G(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=v({...i,simId:t,commandTimeoutMs:o.mode==="live"||o.mode==="combined"?z:6e4});try{if(o.mode==="live"||o.mode==="combined"){await ue(s);let m=await me(s);O(),pe(m,n,o.mode);return}let c=l(e,"--output"),a=T(c,`sootsim-${U()}.${o.format}`);E(D(a),{recursive:!0});let u=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});u.ok||(console.error(` stop failed: ${u.error??"unknown error"}`),O(),process.exit(1)),u.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),O(),process.exit(1)),await ie(s,a),O(),console.log(` saved: ${a} (${J(u.size)})`)}finally{s.close()}}async function j(e){await V(e,'typeof window.SootSim?.bridges?.startRecording === "function" && typeof window.SootSim?.bridges?.stopRecording === "function"')||(console.error(" SootSim.bridges.startRecording missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function de(e,r){await V(e,`(() => {
51
+ abandoned capture's deadline lapses.`)}else console.log(" no recording in progress")}finally{t.close()}}async function Ne(e,r){let o=U();if(!o){let s=b(e,{port:r.port}),c=v({...s,commandTimeoutMs:8e3});try{let a=await ae(c);if(a==="recording"||a==="processing"||a==="prelude"){let u=await Ae(c);u.store&&a==="prelude"?console.log(" recording preview prelude cancelled"):u.store||u.headless?console.log(" reclaimed an abandoned recording (started by an atomic\n `record --duration` run or the record button whose owner is\n gone). the recorder is idle again \u2014 live/combined can start."):console.log(" a recording is in progress and still owned by a live atomic\n `record --duration` run or the in-browser record button \u2014 it\n will finish on its own and nothing was reclaimed.")}else console.log(" no recording in progress")}finally{c.close()}return}let i=b(e,{port:r.port});j(i.simId,o);let t=o.simId??i.simId??void 0,n=v({...i,simId:t,commandTimeoutMs:15e3});try{o.mode==="live"||o.mode==="combined"?await n.send({type:"evaluate",code:"void window.SootSim?.bridges?.cancelRecording?.()"}):await n.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"})}catch{}finally{E(),n.close()}console.log(" recording cancelled")}async function Pe(e,r){let o=U();o||(console.error(" no recording in progress. start one with `sootsim record start`."),process.exit(1));let i=b(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});j(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=v({...i,simId:t,commandTimeoutMs:o.mode==="live"||o.mode==="combined"?J:6e4});try{if(o.mode==="live"||o.mode==="combined"){await ue(s);let m=await me(s);E(),pe(m,n,o.mode);return}let c=l(e,"--output"),a=I(c,`sootsim-${T()}.${o.format}`);B(z(a),{recursive:!0});let u=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});u.ok||(console.error(` stop failed: ${u.error??"unknown error"}`),E(),process.exit(1)),u.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),E(),process.exit(1)),await ie(s,a),E(),console.log(` saved: ${a} (${L(u.size)})`)}finally{s.close()}}async function H(e){await V(e,'typeof window.SootSim?.bridges?.startRecording === "function" && typeof window.SootSim?.bridges?.stopRecording === "function"')||(console.error(" SootSim.bridges.startRecording missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function de(e,r){await V(e,`(() => {
52
52
  const fn = window.__sootsimCaptureBundle
53
53
  if (typeof fn !== 'function') return false
54
54
  const snap = fn()
@@ -64,7 +64,7 @@ import{a as P}from"./chunk-6XLP5EB5.js";import{a as oe}from"./chunk-2NTPCZNI.js"
64
64
  window.__sootsimPreviewUseInjectedBearer = true
65
65
  ${a?`window.__sootsimUploadOrigin = ${JSON.stringify(a)}`:"delete window.__sootsimUploadOrigin"}
66
66
  return true
67
- })()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`sootsim open --new`); if it persists, update sootsim."),process.exit(1))}async function le(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function ue(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function me(e){let r=Date.now()+z;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${z/1e3}s`}}function pe(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
67
+ })()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`sootsim open --new`); if it persists, update sootsim."),process.exit(1))}async function le(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function ue(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function me(e){let r=Date.now()+J;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${J/1e3}s`}}function pe(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
68
68
  replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
69
69
  nothing to replay. Video will play the captured screen recording.`:` note: this live recording captured no events \u2014 the preview has nothing
70
70
  to replay and will boot a fresh interactive session instead.`),r&&Y(e.previewUrl)}export{Be as extToFormat,Me as resolveFormat,He as runRecord,l as valueOf};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-SXENH4HF.js";import"./chunk-I664RIMB.js";import"./chunk-BGW73A3C.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";export{a as runRuntime};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as re,b as ne,f as se}from"./chunk-HVKLAOZM.js";import"./chunk-6XLP5EB5.js";import{a as k}from"./chunk-YYW4JGGL.js";import{b as Q}from"./chunk-KEZZHUOP.js";import{a as ee}from"./chunk-TEEK6DLL.js";import"./chunk-2NTPCZNI.js";import{a as te,b as oe}from"./chunk-ZVVEXBEJ.js";import"./chunk-GD6LJ2CR.js";import"./chunk-BZPJSFSP.js";import"./chunk-Z3BORSD4.js";import"./chunk-G4VPOKCZ.js";import"./chunk-Z7TEEXRM.js";import"./chunk-YAX25DGN.js";import"./chunk-YQDB5ODC.js";import"./chunk-TR25YKVI.js";import"./chunk-UMRMWSAM.js";import"./chunk-WQ5DQ5X7.js";import{r as K}from"./chunk-XWRHHNOK.js";import{g as A,h as X,i as R,j as J,k as Z,l as M,m as $}from"./chunk-XUJDCVTH.js";import"./chunk-OUZCXC3F.js";import"./chunk-TZJ6V6E3.js";import"./chunk-P3IXWUXV.js";import"./chunk-EOUBCSIZ.js";import"./chunk-YXP22OFA.js";import"./chunk-R7RUIOMK.js";import"./chunk-YLSEQMQK.js";import"./chunk-TA6OIGXV.js";import"./chunk-CFIAG2RO.js";import"./chunk-JPXFE6M4.js";import{a as x,b as j,c as I,d as L,e as U,f as F,g as E}from"./chunk-APBFMXMM.js";import"./chunk-K3Q4FEMG.js";import{mkdirSync as le,writeFileSync as ie}from"fs";import{dirname as ce,resolve as ue}from"path";async function de(e,t){let o=Ie(e);(o.includes("--help")||o.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as re,b as ne,f as se}from"./chunk-7NCUVJSZ.js";import"./chunk-VRXFBWBW.js";import{a as k}from"./chunk-DUCTVOTV.js";import{b as Q}from"./chunk-V5LQP2JL.js";import{a as ee}from"./chunk-EURBYQXU.js";import"./chunk-PEFAS7Q4.js";import{a as te,b as oe}from"./chunk-DKGKL6KP.js";import"./chunk-TB7CIKZ3.js";import"./chunk-BA4Q3KRH.js";import"./chunk-ZYEIV7ZN.js";import"./chunk-RGDT3EBF.js";import"./chunk-GB3IT6AN.js";import"./chunk-APQFVJDK.js";import"./chunk-UGRYC3HL.js";import"./chunk-4Z3JQFES.js";import"./chunk-3PLNSSEF.js";import"./chunk-IQ2IFKZ4.js";import{r as K}from"./chunk-PGLRJ4GA.js";import{g as A,h as X,i as R,j as J,k as Z,l as M,m as $}from"./chunk-BGW73A3C.js";import"./chunk-SACUEZZP.js";import"./chunk-PUH4S4CC.js";import"./chunk-Q2X3WO5X.js";import"./chunk-W7H4OAY4.js";import"./chunk-G3MVPZBK.js";import"./chunk-G3EZ5KVE.js";import"./chunk-ORSIJ76W.js";import"./chunk-LBXFCH5I.js";import"./chunk-KWNVZ2LX.js";import"./chunk-54UQB2TW.js";import{a as x,b as j,c as I,d as L,e as U,f as F,g as E}from"./chunk-BDL6UO36.js";import"./chunk-FK57ISRW.js";import{mkdirSync as le,writeFileSync as ie}from"fs";import{dirname as ce,resolve as ue}from"path";async function de(e,t){let o=Ie(e);(o.includes("--help")||o.includes("-h"))&&(console.log(`
3
3
  sootsim screenshot \u2014 capture the canvas as a PNG
4
4
 
5
5
  usage:
@@ -150,4 +150,4 @@ examples:
150
150
  await new Promise((r) => setTimeout(r, 40))
151
151
  }
152
152
  return false
153
- })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function wt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let o=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",r=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${r} [${o}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function yt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function Fe(e,t){if(e.includes("--help")||e.includes("-h")){console.log(pt);return}let{rest:o,values:i,json:r}=ht(e),s=A(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=ft(s.positional[1]),l=R(s),u=c=>{r?console.log(JSON.stringify(c,null,2)):wt(c)};try{switch(await gt(l),n){case"list":{u(await M(l,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: sootsim screenshot slides set <n> --title \u2026 (see --help)");let c={};for(let d of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[d]!=null&&(c[d]=i[d]);if(Object.keys(c).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");u(await $(l,"SootSim.bridges.screenshotControl.setSlide",a,c));break}case"add":{u(await $(l,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");u(await $(l,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");u(await $(l,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await $(l,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let c=await $(l,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(c);break}case"export":{let c=i.out?ut(i.out)?i.out:dt(process.cwd(),i.out):Ne(process.cwd(),"screenshots"),d=await M(l,"SootSim.bridges.screenshotControl.getState"),g=a!=null?d.slides.filter(m=>m.index===a||m.id===a):d.slides.filter(m=>m.captured);if(g.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let h=[];for(let m of g){let p=await M(l,"SootSim.bridges.screenshotControl.exportSlide",m.index),y=Ne(c,p.name);at(ct(y),{recursive:!0}),lt(y,yt(p.dataUrl)),h.push(y),console.log(` saved: ${y} (${p.width}\xD7${p.height})`)}r&&console.log(JSON.stringify({written:h},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see sootsim screenshot slides --help`)}}finally{l.close()}}var bt=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout"]),St=new Set(["capture","slides","appstore"]);function Ee(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){bt.has(o)&&t++;continue}return St.has(o)?{name:o,index:t}:null}return null}function _(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function xt(e){let t=[];for(let o=0;o<e.length;o++){if(e[o]==="--sim"){o++;continue}t.push(e[o])}return t}async function xo(e,t){let o=Ee(e);if(!o||o.name==="capture"){await de(o?_(e,o.index):e,t);return}if(o.name==="slides"){await Fe(_(e,o.index),t);return}let i=_(e,o.index),r=Ee(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-TUGNPCWG.js");return await s(xt(_(i,r.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the sootsim workspace (playwright is not shipped with the published CLI)."),1;throw s}return De(i,t)}export{xo as runScreenshotCommand};
153
+ })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function wt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let o=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",r=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${r} [${o}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function yt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function Fe(e,t){if(e.includes("--help")||e.includes("-h")){console.log(pt);return}let{rest:o,values:i,json:r}=ht(e),s=A(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=ft(s.positional[1]),l=R(s),u=c=>{r?console.log(JSON.stringify(c,null,2)):wt(c)};try{switch(await gt(l),n){case"list":{u(await M(l,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: sootsim screenshot slides set <n> --title \u2026 (see --help)");let c={};for(let d of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[d]!=null&&(c[d]=i[d]);if(Object.keys(c).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");u(await $(l,"SootSim.bridges.screenshotControl.setSlide",a,c));break}case"add":{u(await $(l,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");u(await $(l,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");u(await $(l,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await $(l,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let c=await $(l,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(c);break}case"export":{let c=i.out?ut(i.out)?i.out:dt(process.cwd(),i.out):Ne(process.cwd(),"screenshots"),d=await M(l,"SootSim.bridges.screenshotControl.getState"),g=a!=null?d.slides.filter(m=>m.index===a||m.id===a):d.slides.filter(m=>m.captured);if(g.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let h=[];for(let m of g){let p=await M(l,"SootSim.bridges.screenshotControl.exportSlide",m.index),y=Ne(c,p.name);at(ct(y),{recursive:!0}),lt(y,yt(p.dataUrl)),h.push(y),console.log(` saved: ${y} (${p.width}\xD7${p.height})`)}r&&console.log(JSON.stringify({written:h},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see sootsim screenshot slides --help`)}}finally{l.close()}}var bt=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout"]),St=new Set(["capture","slides","appstore"]);function Ee(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){bt.has(o)&&t++;continue}return St.has(o)?{name:o,index:t}:null}return null}function _(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function xt(e){let t=[];for(let o=0;o<e.length;o++){if(e[o]==="--sim"){o++;continue}t.push(e[o])}return t}async function xo(e,t){let o=Ee(e);if(!o||o.name==="capture"){await de(o?_(e,o.index):e,t);return}if(o.name==="slides"){await Fe(_(e,o.index),t);return}let i=_(e,o.index),r=Ee(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-GAZMPQ2T.js");return await s(xt(_(i,r.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the sootsim workspace (playwright is not shipped with the published CLI)."),1;throw s}return De(i,t)}export{xo as runScreenshotCommand};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.235 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-YYW4JGGL.js";import{a as x}from"./chunk-ZVVEXBEJ.js";import"./chunk-P3IXWUXV.js";import"./chunk-CFIAG2RO.js";import"./chunk-K3Q4FEMG.js";import{execSync as T}from"node:child_process";import{mkdirSync as D,mkdtempSync as O,rmSync as E,writeFileSync as j}from"node:fs";import{tmpdir as G}from"node:os";import{dirname as q,isAbsolute as B,join as U,resolve as L}from"node:path";import{chromium as W}from"playwright-core";var z=`
1
+ /*! sootsim v0.1.236 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-DUCTVOTV.js";import{a as x}from"./chunk-DKGKL6KP.js";import"./chunk-Q2X3WO5X.js";import"./chunk-KWNVZ2LX.js";import"./chunk-FK57ISRW.js";import{execSync as T}from"node:child_process";import{mkdirSync as D,mkdtempSync as O,rmSync as E,writeFileSync as j}from"node:fs";import{tmpdir as G}from"node:os";import{dirname as q,isAbsolute as B,join as U,resolve as L}from"node:path";import{chromium as W}from"playwright-core";var z=`
3
3
  sootsim screenshot appstore capture \u2014 headlessly capture + upload App Store slides
4
4
 
5
5
  usage: