sootsim 0.1.293 → 0.1.294

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 (165) hide show
  1. package/detox/expectations.ts +4 -3
  2. package/detox/index.ts +2 -4
  3. package/dist-cli/bin.js +7 -5
  4. package/dist-cli/chunks/{agent-YWI2NWL7.js → agent-GDFF6G7N.js} +4 -2
  5. package/dist-cli/chunks/{agent-wrapper-IYJ7UZOA.js → agent-wrapper-ZUKQUOD2.js} +4 -2
  6. package/dist-cli/chunks/{app-fonts-FQFUC4LR.js → app-fonts-IMYBO6AQ.js} +4 -2
  7. package/dist-cli/chunks/{assert-XUCELWAC.js → assert-GXOGZUKO.js} +4 -2
  8. package/dist-cli/chunks/{auth-4DQTV3OW.js → auth-P7FAKLHQ.js} +4 -2
  9. package/dist-cli/chunks/beta-RXT5RU3A.js +4 -0
  10. package/dist-cli/chunks/{camera-RYOHBVZA.js → camera-RNVAC4IO.js} +4 -2
  11. package/dist-cli/chunks/{chunk-2XYCSFGN.js → chunk-24BJFJFB.js} +26 -24
  12. package/dist-cli/chunks/{chunk-WVMYRKSS.js → chunk-2M7OZ6Y4.js} +4 -2
  13. package/dist-cli/chunks/chunk-37ZXWXM3.js +4 -0
  14. package/dist-cli/chunks/{chunk-UOHGYYSO.js → chunk-3F2GAJ4Z.js} +3 -1
  15. package/dist-cli/chunks/{chunk-KC5SCOGS.js → chunk-4Z4URZOG.js} +4 -2
  16. package/dist-cli/chunks/{chunk-LOQLZFRK.js → chunk-5S3GPTX7.js} +4 -2
  17. package/dist-cli/chunks/chunk-6YN3IAWJ.js +4 -0
  18. package/dist-cli/chunks/{chunk-YRFWATLA.js → chunk-7HVMAGDK.js} +4 -2
  19. package/dist-cli/chunks/{chunk-4B4VFT73.js → chunk-7Q77LTPT.js} +7 -5
  20. package/dist-cli/chunks/{chunk-RKXHQ2Q3.js → chunk-AFLGWOX3.js} +18 -16
  21. package/dist-cli/chunks/{chunk-LA5DIO33.js → chunk-AMKQUZA2.js} +3 -1
  22. package/dist-cli/chunks/{chunk-TJS5IMOH.js → chunk-AO65WEF7.js} +3 -1
  23. package/dist-cli/chunks/{chunk-BQT5YDTV.js → chunk-BBVBMGTT.js} +5 -3
  24. package/dist-cli/chunks/{chunk-WPPMUUML.js → chunk-BXO2PTNM.js} +4 -2
  25. package/dist-cli/chunks/{chunk-2VKTOZQ5.js → chunk-CTMPC5DN.js} +4 -2
  26. package/dist-cli/chunks/{chunk-RV67J726.js → chunk-D2R7PDN5.js} +3 -1
  27. package/dist-cli/chunks/{chunk-RMLJXP7T.js → chunk-DI55E6CS.js} +4 -2
  28. package/dist-cli/chunks/chunk-DUHBRW7J.js +4 -0
  29. package/dist-cli/chunks/chunk-EXTV6NWM.js +74 -0
  30. package/dist-cli/chunks/{chunk-6IFJLHDA.js → chunk-FNCSUHUR.js} +3 -1
  31. package/dist-cli/chunks/{chunk-DE4ZA3NL.js → chunk-FSRRJGYC.js} +4 -2
  32. package/dist-cli/chunks/{chunk-UPKYK52K.js → chunk-I233T2T4.js} +4 -2
  33. package/dist-cli/chunks/{chunk-E5WYXRGV.js → chunk-ISJ4ACWL.js} +28 -26
  34. package/dist-cli/chunks/{chunk-AFRXWKTA.js → chunk-JFWEDISV.js} +3 -1
  35. package/dist-cli/chunks/chunk-JGGXQHXH.js +10 -0
  36. package/dist-cli/chunks/chunk-JUOQ4ZPA.js +7 -0
  37. package/dist-cli/chunks/{chunk-2M57EAWS.js → chunk-K53YCAQM.js} +3 -1
  38. package/dist-cli/chunks/{chunk-7B6RGFTM.js → chunk-KWIURH7N.js} +4 -2
  39. package/dist-cli/chunks/{chunk-VO74GDXL.js → chunk-N4MT5KEB.js} +5 -3
  40. package/dist-cli/chunks/{chunk-VZ44FQDG.js → chunk-O6I5ZGMY.js} +3 -1
  41. package/dist-cli/chunks/chunk-OKSGM6IG.js +4 -0
  42. package/dist-cli/chunks/chunk-OYYQQBKP.js +3 -0
  43. package/dist-cli/chunks/{chunk-NCCMRFXU.js → chunk-PSOUSJSZ.js} +3 -1
  44. package/dist-cli/chunks/{chunk-J6P2UPXH.js → chunk-PZTKQG6H.js} +4 -2
  45. package/dist-cli/chunks/{chunk-B7TX4WFB.js → chunk-RWUNC66S.js} +4 -2
  46. package/dist-cli/chunks/{chunk-547W23BB.js → chunk-SLMUW2WU.js} +4 -2
  47. package/dist-cli/chunks/{chunk-WI36YJ23.js → chunk-SPQKJDIK.js} +3 -1
  48. package/dist-cli/chunks/{chunk-PCAPHXN3.js → chunk-V2MYTL4C.js} +4 -2
  49. package/dist-cli/chunks/{chunk-JOPKZVOW.js → chunk-VVVORIQI.js} +3 -1
  50. package/dist-cli/chunks/chunk-VXGCZUX4.js +5 -0
  51. package/dist-cli/chunks/chunk-W44PDEQH.js +4 -0
  52. package/dist-cli/chunks/{chunk-WOWLO4LL.js → chunk-WQL3BLFD.js} +3 -1
  53. package/dist-cli/chunks/{chunk-U3564F2Y.js → chunk-WYRLRNIP.js} +4 -2
  54. package/dist-cli/chunks/{chunk-WP3TFHFL.js → chunk-XYFP466E.js} +4 -2
  55. package/dist-cli/chunks/chunk-ZFMJFX27.js +4 -0
  56. package/dist-cli/chunks/{chunk-67CIS55C.js → chunk-ZUX5PIGI.js} +3 -1
  57. package/dist-cli/chunks/{cleanup-BLFDJSFS.js → cleanup-74SKOD2P.js} +4 -2
  58. package/dist-cli/chunks/cli-version-2JGMYL4O.js +4 -0
  59. package/dist-cli/chunks/{compat-Q3WCSTB7.js → compat-ME6HXEEU.js} +5 -3
  60. package/dist-cli/chunks/{config-NHNMRRNB.js → config-PM67EWT3.js} +4 -2
  61. package/dist-cli/chunks/control-HV7GZXAH.js +4 -0
  62. package/dist-cli/chunks/daemon-LKRHF5OK.js +4 -0
  63. package/dist-cli/chunks/{debug-PGRMZFXA.js → debug-XUGWZLIW.js} +5 -3
  64. package/dist-cli/chunks/{desktop-NVTQ37LH.js → desktop-IO5HPX5Z.js} +5 -3
  65. package/dist-cli/chunks/{detox-W3JDXS76.js → detox-E42OEJJZ.js} +4 -2
  66. package/dist-cli/chunks/{device-KQYN3EVK.js → device-XA67L2EB.js} +4 -2
  67. package/dist-cli/chunks/{diagnose-CPUKSGNO.js → diagnose-36FD6ECF.js} +4 -2
  68. package/dist-cli/chunks/disk-cleanup-DDCFGFWK.js +4 -0
  69. package/dist-cli/chunks/drivers-C2SH3DWS.js +4 -0
  70. package/dist-cli/chunks/{film-VZGAZ2YY.js → film-XARTGFIZ.js} +11 -24
  71. package/dist-cli/chunks/flow-E64G5LF3.js +4 -0
  72. package/dist-cli/chunks/help-4ZSRG4F4.js +4 -0
  73. package/dist-cli/chunks/{hidden-runtime-alias-KWHABCNZ.js → hidden-runtime-alias-T4ZALBE2.js} +4 -2
  74. package/dist-cli/chunks/{home-paths-O4CGYVHF.js → home-paths-5L7N2FLS.js} +4 -2
  75. package/dist-cli/chunks/inspect-U2SV25ER.js +4 -0
  76. package/dist-cli/chunks/install-desktop-LTGVT7ID.js +4 -0
  77. package/dist-cli/chunks/{login-KPN4Z26Q.js → login-GF6WVVER.js} +6 -4
  78. package/dist-cli/chunks/logout-6F6UKUNI.js +4 -0
  79. package/dist-cli/chunks/{maestro-PYA4AHTS.js → maestro-FMPKHEMX.js} +13 -11
  80. package/dist-cli/chunks/{maestro-generate-KCMYWPWL.js → maestro-generate-QGPGNXI6.js} +5 -3
  81. package/dist-cli/chunks/{mode-AEB7G2SJ.js → mode-JSNMAHDZ.js} +4 -2
  82. package/dist-cli/chunks/optional-demo-registry-K4VERLJV.js +4 -0
  83. package/dist-cli/chunks/{perf-YLXGZI3E.js → perf-PO7ARUTG.js} +4 -2
  84. package/dist-cli/chunks/{permissions-7VMVZOUV.js → permissions-XI2QUAEZ.js} +4 -2
  85. package/dist-cli/chunks/{record-AVQO45PE.js → record-4CJCJAFD.js} +5 -3
  86. package/dist-cli/chunks/runtime-SN2RWDES.js +4 -0
  87. package/dist-cli/chunks/{screenshot-command-LACQLA4N.js → screenshot-command-NDVULWMZ.js} +5 -3
  88. package/dist-cli/chunks/{screenshots-capture-PROOBSGB.js → screenshots-capture-Q7UTXF3V.js} +4 -2
  89. package/dist-cli/chunks/{serve-FJN2FRGW.js → serve-UEUIBHCK.js} +4 -2
  90. package/dist-cli/chunks/{setup-IVV4NRYQ.js → setup-ZEEWYK4B.js} +5 -3
  91. package/dist-cli/chunks/{skills-WYR3PJOH.js → skills-NFG6VAO5.js} +4 -2
  92. package/dist-cli/chunks/{storage-GM7K4MGM.js → storage-POWCOUCQ.js} +4 -2
  93. package/dist-cli/chunks/store-BJK7V7FL.js +4 -0
  94. package/dist-cli/chunks/telemetry-EJP5EW7K.js +4 -0
  95. package/dist-cli/chunks/{timeline-R5UL3N4T.js → timeline-MNHZCVAL.js} +4 -2
  96. package/dist-cli/chunks/{upgrade-RWHSFZRX.js → upgrade-X57SIG7L.js} +4 -2
  97. package/dist-cli/chunks/upload-JABM3ITZ.js +4 -0
  98. package/dist-cli/chunks/{version-7K6TVQOW.js → version-V4IKIDX7.js} +4 -2
  99. package/dist-cli/chunks/web-F5CLF34I.js +4 -0
  100. package/dist-cli/chunks/{what-happened-K24TSJZX.js → what-happened-H74HHGRK.js} +4 -2
  101. package/dist-lib/agent-daemon-client.cjs +1 -1
  102. package/dist-lib/agent-events.cjs +1 -1
  103. package/dist-lib/agent-identity.cjs +3 -3
  104. package/dist-lib/agent-sessions.cjs +1 -1
  105. package/dist-lib/attached-projects.cjs +1 -1
  106. package/dist-lib/auth/shared-session.cjs +1 -1
  107. package/dist-lib/backend-origin.cjs +1 -1
  108. package/dist-lib/beta.cjs +1 -1
  109. package/dist-lib/beta.mjs +1 -1
  110. package/dist-lib/bridge-constants.cjs +1 -1
  111. package/dist-lib/cli-constants.cjs +1 -1
  112. package/dist-lib/config.cjs +1 -1
  113. package/dist-lib/detox/index.cjs +5 -4
  114. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  115. package/dist-lib/home-paths.cjs +1 -1
  116. package/dist-lib/host/bridge-host.cjs +3 -3
  117. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  118. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  119. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  120. package/dist-lib/host/websocket-proxy.cjs +1 -1
  121. package/dist-lib/index.cjs +1 -1
  122. package/dist-lib/jump-to-source-babel.cjs +1 -1
  123. package/dist-lib/menu.cjs +45 -4
  124. package/dist-lib/menu.mjs +42 -4
  125. package/dist-lib/metro.cjs +1 -1
  126. package/dist-lib/profiles.cjs +1 -1
  127. package/dist-lib/render-mode.cjs +1 -1
  128. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  129. package/dist-lib/sdk.cjs +5 -2
  130. package/dist-lib/sdk.mjs +4 -2
  131. package/dist-lib/skills.cjs +325 -182
  132. package/dist-lib/vite.cjs +1 -1
  133. package/package.json +6 -1
  134. package/scripts/postinstall.cjs +11 -2
  135. package/src/agent-identity.ts +2 -2
  136. package/src/menu.ts +53 -4
  137. package/src/vite-plugin.ts +102 -2
  138. package/dist-cli/chunks/beta-CFDAW6UN.js +0 -2
  139. package/dist-cli/chunks/chunk-3UX6AY2B.js +0 -2
  140. package/dist-cli/chunks/chunk-6VVLDYPV.js +0 -8
  141. package/dist-cli/chunks/chunk-7H34H74K.js +0 -72
  142. package/dist-cli/chunks/chunk-7H5G4HUK.js +0 -2
  143. package/dist-cli/chunks/chunk-ACSTEPSD.js +0 -2
  144. package/dist-cli/chunks/chunk-HKMWUN7F.js +0 -2
  145. package/dist-cli/chunks/chunk-K5JEUI5G.js +0 -5
  146. package/dist-cli/chunks/chunk-MOU2WLO4.js +0 -2
  147. package/dist-cli/chunks/chunk-QXDXUDJD.js +0 -1
  148. package/dist-cli/chunks/chunk-USJTVC7T.js +0 -2
  149. package/dist-cli/chunks/chunk-YNG4C3ZS.js +0 -2
  150. package/dist-cli/chunks/cli-version-TQHZOK4L.js +0 -2
  151. package/dist-cli/chunks/control-I7YBDRJT.js +0 -2
  152. package/dist-cli/chunks/daemon-4R3SZLZY.js +0 -2
  153. package/dist-cli/chunks/disk-cleanup-2COWZWBC.js +0 -2
  154. package/dist-cli/chunks/drivers-RRZM6E72.js +0 -2
  155. package/dist-cli/chunks/flow-VH6DFDQ4.js +0 -2
  156. package/dist-cli/chunks/help-3HQ2RINO.js +0 -2
  157. package/dist-cli/chunks/inspect-PKMJGXDH.js +0 -2
  158. package/dist-cli/chunks/install-desktop-K5TP3ZHJ.js +0 -2
  159. package/dist-cli/chunks/logout-E3UCJAMC.js +0 -2
  160. package/dist-cli/chunks/optional-demo-registry-AIWOBAAA.js +0 -2
  161. package/dist-cli/chunks/runtime-HOGETVVD.js +0 -2
  162. package/dist-cli/chunks/store-YLVHPKG7.js +0 -2
  163. package/dist-cli/chunks/telemetry-MQKB6PFX.js +0 -2
  164. package/dist-cli/chunks/upload-RBH4XGJ2.js +0 -2
  165. package/dist-cli/chunks/web-46ZPQCAL.js +0 -2
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{f,m as T}from"./chunk-B7TX4WFB.js";import{K as S,L as $,M as N,N as A,O as v}from"./chunk-RKXHQ2Q3.js";import{g as D,i as O,k as x}from"./chunk-J6P2UPXH.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{f,m as T}from"./chunk-RWUNC66S.js";import{L as S,M as $,N,O as A,P as v}from"./chunk-AFLGWOX3.js";import{g as D,i as O,k as x}from"./chunk-PZTKQG6H.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
3
5
  sootsim debug \u2014 drive __sootsimDebug from the terminal
4
6
 
5
7
  usage:
@@ -170,7 +172,7 @@ examples:
170
172
  } : null,
171
173
  samples,
172
174
  }
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-PKMJGXDH.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,...]>
175
+ })()`}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-U2SV25ER.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
176
  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
177
  const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
176
178
  if (!d) return null;
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-VO74GDXL.js";import"./chunk-QXDXUDJD.js";import{a as v,h as k}from"./chunk-4B4VFT73.js";import"./chunk-WP3TFHFL.js";import"./chunk-67CIS55C.js";import"./chunk-B7TX4WFB.js";import{b as m,g as f,l as h}from"./chunk-7B6RGFTM.js";import{a as c}from"./chunk-LA5DIO33.js";import"./chunk-RKXHQ2Q3.js";import"./chunk-ACSTEPSD.js";import"./chunk-MOU2WLO4.js";import"./chunk-JOPKZVOW.js";import"./chunk-HKMWUN7F.js";import"./chunk-6IFJLHDA.js";import{a as u}from"./chunk-UOHGYYSO.js";import"./chunk-J6P2UPXH.js";import"./chunk-TJS5IMOH.js";import"./chunk-RMLJXP7T.js";import"./chunk-YNG4C3ZS.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.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.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as g}from"./chunk-N4MT5KEB.js";import"./chunk-OYYQQBKP.js";import{a as v,h as k}from"./chunk-7Q77LTPT.js";import"./chunk-XYFP466E.js";import"./chunk-ZUX5PIGI.js";import"./chunk-RWUNC66S.js";import{b as m,g as f,l as h}from"./chunk-KWIURH7N.js";import{a as c}from"./chunk-AMKQUZA2.js";import"./chunk-AFLGWOX3.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import"./chunk-VVVORIQI.js";import"./chunk-W44PDEQH.js";import"./chunk-FNCSUHUR.js";import{a as u}from"./chunk-3F2GAJ4Z.js";import"./chunk-PZTKQG6H.js";import"./chunk-AO65WEF7.js";import"./chunk-DI55E6CS.js";import"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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
5
  sootsim desktop \u2014 launch the desktop companion
4
6
 
5
7
  usage:
@@ -16,7 +18,7 @@ examples:
16
18
  sootsim desktop --port 5173
17
19
  sootsim desktop --profile qa
18
20
  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-K5TP3ZHJ.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(`
21
+ `),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-LTGVT7ID.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
22
  sootsim desktop \u2014 launch or install the desktop companion
21
23
 
22
24
  usage:
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{e as $}from"./chunk-E5WYXRGV.js";import"./chunk-YRFWATLA.js";import"./chunk-2M57EAWS.js";import"./chunk-2XYCSFGN.js";import"./chunk-U3564F2Y.js";import{c as F,d as M,e as E}from"./chunk-WPPMUUML.js";import{a as P}from"./chunk-DE4ZA3NL.js";import"./chunk-4B4VFT73.js";import"./chunk-WP3TFHFL.js";import"./chunk-67CIS55C.js";import"./chunk-B7TX4WFB.js";import"./chunk-7B6RGFTM.js";import"./chunk-LA5DIO33.js";import"./chunk-RKXHQ2Q3.js";import"./chunk-ACSTEPSD.js";import"./chunk-MOU2WLO4.js";import"./chunk-JOPKZVOW.js";import"./chunk-HKMWUN7F.js";import"./chunk-6IFJLHDA.js";import"./chunk-J6P2UPXH.js";import"./chunk-WI36YJ23.js";import"./chunk-7H5G4HUK.js";import"./chunk-547W23BB.js";import"./chunk-TJS5IMOH.js";import"./chunk-KC5SCOGS.js";import"./chunk-RMLJXP7T.js";import"./chunk-YNG4C3ZS.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-AFRXWKTA.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";import{spawn as G}from"child_process";import{existsSync as x,mkdirSync as W,readFileSync as B,writeFileSync as y,unlinkSync as U}from"fs";import{tmpdir as N}from"os";import{dirname as C,resolve as c,join as J,relative as q}from"path";function H(){try{let t=import.meta.resolve("sootsim/detox");return C(t.startsWith("file://")?t.slice(7):t)}catch{return c(import.meta.dirname,"..","..","detox")}}var V=`
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{e as $}from"./chunk-ISJ4ACWL.js";import"./chunk-7HVMAGDK.js";import"./chunk-K53YCAQM.js";import"./chunk-24BJFJFB.js";import"./chunk-WYRLRNIP.js";import{c as F,d as M,e as E}from"./chunk-BXO2PTNM.js";import{a as P}from"./chunk-FSRRJGYC.js";import"./chunk-7Q77LTPT.js";import"./chunk-XYFP466E.js";import"./chunk-ZUX5PIGI.js";import"./chunk-RWUNC66S.js";import"./chunk-KWIURH7N.js";import"./chunk-AMKQUZA2.js";import"./chunk-AFLGWOX3.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import"./chunk-VVVORIQI.js";import"./chunk-W44PDEQH.js";import"./chunk-FNCSUHUR.js";import"./chunk-PZTKQG6H.js";import"./chunk-SPQKJDIK.js";import"./chunk-ZFMJFX27.js";import"./chunk-SLMUW2WU.js";import"./chunk-AO65WEF7.js";import"./chunk-4Z4URZOG.js";import"./chunk-DI55E6CS.js";import"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-JFWEDISV.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";import{spawn as G}from"child_process";import{existsSync as x,mkdirSync as W,readFileSync as B,writeFileSync as y,unlinkSync as U}from"fs";import{tmpdir as N}from"os";import{dirname as C,resolve as c,join as J,relative as q}from"path";function H(){try{let t=import.meta.resolve("sootsim/detox");return C(t.startsWith("file://")?t.slice(7):t)}catch{return c(import.meta.dirname,"..","..","detox")}}var V=`
3
5
  sootsim detox \u2014 run detox-style tests against a sootsim shell
4
6
 
5
7
  usage:
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-67CIS55C.js";import"./chunk-HKMWUN7F.js";import{g as d,i as l,l as a}from"./chunk-J6P2UPXH.js";import"./chunk-RMLJXP7T.js";import{b as c,c as r,d as g}from"./chunk-YNG4C3ZS.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";function h(){console.log(`
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import"./chunk-ZUX5PIGI.js";import"./chunk-W44PDEQH.js";import{g as d,i as l,l as a}from"./chunk-PZTKQG6H.js";import"./chunk-DI55E6CS.js";import{b as c,c as r,d as g}from"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";function h(){console.log(`
3
5
  sootsim device \u2014 inspect or change the live device preset for a sim
4
6
 
5
7
  usage:
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as E,i as R,l as b}from"./chunk-J6P2UPXH.js";import"./chunk-3UX6AY2B.js";import{c as v}from"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.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.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{g as E,i as R,l as b}from"./chunk-PZTKQG6H.js";import"./chunk-OKSGM6IG.js";import{c as v}from"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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
5
  sootsim get diagnosis \u2014 compact "what just went wrong?" report
4
6
 
5
7
  usage:
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c,d,e}from"./chunk-5S3GPTX7.js";import"./chunk-CTMPC5DN.js";import"./chunk-AO65WEF7.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";export{e as applyAutomaticSootsimCleanup,d as applySootsimCleanup,b as formatSootsimBytes,a as isAutomaticSootsimCleanupComplete,c as planSootsimCleanup};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import"./chunk-OYYQQBKP.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-KWIURH7N.js";import"./chunk-AMKQUZA2.js";import"./chunk-VVVORIQI.js";import"./chunk-AO65WEF7.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as L,d as T}from"./chunk-PCAPHXN3.js";import{g as $,i as R,m as b}from"./chunk-J6P2UPXH.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.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.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as L,d as T}from"./chunk-V2MYTL4C.js";import{g as A,i as R,m as b}from"./chunk-PZTKQG6H.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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 j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),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(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
3
5
  sootsim film \u2014 record a flow flat, replay it on the 3d stage, save a clip
4
6
 
5
7
  usage:
@@ -32,25 +34,10 @@ examples:
32
34
  sootsim film flows/feed-scroll.yaml
33
35
  sootsim film flows/swap.yaml --script hero-arc --background gradient-tide --out ~/Desktop/swap-3d.mp4
34
36
  sootsim film flows/login.yaml --colorway deep-blue --environment on --env-shape pane --room on
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-VH6DFDQ4.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
- 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
- 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
- const entitled = () =>
40
- window.__sootsimSharedAuth?.current?.entitlements?.threeModeAdvancedControls === true
41
- if (entitled()) return true
42
- const chip = Array.from(document.querySelectorAll('*')).find(
43
- (e) => e.childElementCount === 0 && e.textContent?.trim() === 'DevLogin',
44
- )
45
- if (!chip) return entitled()
46
- chip.click()
47
- const deadline = Date.now() + 20000
48
- while (Date.now() < deadline) {
49
- if (entitled()) return true
50
- await new Promise((r) => setTimeout(r, 300))
51
- }
52
- return entitled()
53
- })()`,3e4)||console.log(" film: decor entitlement not unlocked \u2014 stage uses the default look");let p=T(t);delete p.script,p.resetPose=!0,await b(e,"SootSim.bridges.threeMode.configure",p),await s(2400),console.log(` film: filming the 3d stage (script: ${h})`);let M=await r(e,`(() => {
37
+ `),0;let s=e.find(d=>!d.startsWith("--")&&/\.ya?ml$/.test(d));if(!s||!V(I(s)))return console.error(` film: flow file not found: ${s??"(none given)"}`),1;let P=Number.parseInt(c(e,"--fps")??"30",10),h=c(e,"--script")??"hero-arc",z=e.includes("--keep-three"),v=s.replace(/^.*\//,"").replace(/\.ya?ml$/,""),O=c(e,"--out"),l=I(O??K(j(),"Desktop","sootsim-films",`${v}.webm`)),S=H(l).toLowerCase()===".mp4";if(S&&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 C=A(e,{port:a.port,stripValueFlags:[...X,...Q],stripBooleanFlags:J}),t=R({...C,commandTimeoutMs:6e4});try{let d=await r(t,`(() => { const s = window.SootSim?.bridges?.settings?.get?.() || {}
38
+ return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(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 D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-E64G5LF3.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
39
+ return { state: s?.state, hasBlob: !!s?.lastVideoBlob } })()`);if(i?.state==="idle"&&i.hasBlob){F=!0;break}}if(!F)return console.error(" film: flow recording never produced a video blob"),1;console.log(` film: flow captured (${(u/1e3).toFixed(1)}s)`),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeMode', true)"),await L(t),await n(1400),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', true)");let _=!1;for(let o=0;o<60;o++)if(await n(250),await r(t,`(() => { const rs = window.SootSim?.replayStore
40
+ return rs?.value?.preview?.surface === 'video' && !!rs?.value?.preview?.flowVideoUrl })()`)){_=!0;break}if(!_)return console.error(" film: recording editor did not seed the replay store"),1;let p=T(e);delete p.script,p.resetPose=!0,await b(t,"SootSim.bridges.threeMode.configure",p),await n(2400),console.log(` film: filming the 3d stage (script: ${h})`);let M=await r(t,`(() => {
54
41
  const c = window.SootSim?.bridges?.threeMode?.getCanvas?.()
55
42
  if (!c || !c.captureStream) return { ok: false, error: 'no stage canvas' }
56
43
  let mime = 'video/webm;codecs=vp9'
@@ -68,7 +55,7 @@ examples:
68
55
  window.__sootsimFilm = st
69
56
  mr.start(200)
70
57
  return { ok: true }
71
- })()`);if(!M?.ok)return console.error(` film: stage capture failed: ${M?.error??"unknown"}`),1;await r(e,`((dur) => {
58
+ })()`);if(!M?.ok)return console.error(` film: stage capture failed: ${M?.error??"unknown"}`),1;await r(t,`((dur) => {
72
59
  const rs = window.SootSim?.replayStore
73
60
  if (!rs) return false
74
61
  const probed = rs.value?.playback?.durationMs
@@ -81,7 +68,7 @@ examples:
81
68
  }
82
69
  requestAnimationFrame(tick)
83
70
  return true
84
- })(${u})`),await b(e,"SootSim.bridges.threeMode.configure",{script:{id:h,progress:1,animate:!0,slow:!0}}),await s(u+700),await r(e,"(() => { const s = window.__sootsimFilm; if (s?.mr?.state === 'recording') s.mr.stop(); return true })()");let w=0;for(let o=0;o<60;o++){await s(500);let i=await r(e,"(() => { const s = window.__sootsimFilm; return { ready: !!(s && s.b64), size: s && s.b64 ? s.b64.length : 0 } })()");if(i?.ready&&i.size>0){w=i.size;break}}if(!w)return console.error(" film: stage recording never finished encoding"),1;let B=24e5,A="";for(let o=0;o<w;o+=B){let i=await r(e,`(() => ({ data: window.__sootsimFilm.b64.substr(${o}, ${B}) }))()`);A+=i.data}await r(e,"(() => { try { delete window.__sootsimFilm } catch {} return true })()");let g=Buffer.from(A,"base64");if(W(j(l),{recursive:!0}),y){let o=`${l}.tmp.webm`;E(o,g);let i=x("ffmpeg",["-y","-i",o,"-c:v","libx264","-vf","scale=trunc(iw/2)*2:trunc(ih/2)*2","-pix_fmt","yuv420p","-movflags","+faststart",l],{stdio:["ignore","ignore","pipe"]});if(i.status!==0){let U=String(i.stderr??"").split(`
71
+ })(${u})`),await b(t,"SootSim.bridges.threeMode.configure",{script:{id:h,progress:1,animate:!0,slow:!0}}),await n(u+700),await r(t,"(() => { const s = window.__sootsimFilm; if (s?.mr?.state === 'recording') s.mr.stop(); return true })()");let w=0;for(let o=0;o<60;o++){await n(500);let i=await r(t,"(() => { const s = window.__sootsimFilm; return { ready: !!(s && s.b64), size: s && s.b64 ? s.b64.length : 0 } })()");if(i?.ready&&i.size>0){w=i.size;break}}if(!w)return console.error(" film: stage recording never finished encoding"),1;let B=24e5,$="";for(let o=0;o<w;o+=B){let i=await r(t,`(() => ({ data: window.__sootsimFilm.b64.substr(${o}, ${B}) }))()`);$+=i.data}await r(t,"(() => { try { delete window.__sootsimFilm } catch {} return true })()");let g=Buffer.from($,"base64");if(W(q(l),{recursive:!0}),S){let o=`${l}.tmp.webm`;E(o,g);let i=x("ffmpeg",["-y","-i",o,"-c:v","libx264","-vf","scale=trunc(iw/2)*2:trunc(ih/2)*2","-pix_fmt","yuv420p","-movflags","+faststart",l],{stdio:["ignore","ignore","pipe"]});if(i.status!==0){let U=String(i.stderr??"").split(`
85
72
  `).filter(Boolean).slice(-4).join(`
86
73
  `);return console.error(` film: ffmpeg transcode failed:
87
- ${U}`),console.error(` film: source kept at ${o}`),1}N(o)}else E(l,g);return D||(d?.editor||await r(e,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', false)"),d?.threeMode||await r(e,"window.SootSim?.bridges?.settings?.set?.('threeMode', false)")),console.log(` film: saved ${l} (${(g.length/1e6).toFixed(1)}MB source)`),0}finally{e.close()}}export{le as runFilm};
74
+ ${U}`),console.error(` film: source kept at ${o}`),1}N(o)}else E(l,g);return z||(d?.editor||await r(t,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', false)"),d?.threeMode||await r(t,"window.SootSim?.bridges?.settings?.set?.('threeMode', false)")),console.log(` film: saved ${l} (${(g.length/1e6).toFixed(1)}MB source)`),0}finally{t.close()}}export{ae as runFilm};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c,d,e,f,g,h}from"./chunk-ISJ4ACWL.js";import"./chunk-7HVMAGDK.js";import"./chunk-K53YCAQM.js";import{c as a,d as b}from"./chunk-24BJFJFB.js";import"./chunk-WYRLRNIP.js";import"./chunk-BXO2PTNM.js";import"./chunk-FSRRJGYC.js";import"./chunk-7Q77LTPT.js";import"./chunk-XYFP466E.js";import"./chunk-ZUX5PIGI.js";import"./chunk-RWUNC66S.js";import"./chunk-KWIURH7N.js";import"./chunk-AMKQUZA2.js";import"./chunk-AFLGWOX3.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import"./chunk-VVVORIQI.js";import"./chunk-W44PDEQH.js";import"./chunk-FNCSUHUR.js";import"./chunk-PZTKQG6H.js";import"./chunk-SPQKJDIK.js";import"./chunk-ZFMJFX27.js";import"./chunk-SLMUW2WU.js";import"./chunk-AO65WEF7.js";import"./chunk-4Z4URZOG.js";import"./chunk-DI55E6CS.js";import"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-JFWEDISV.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c}from"./chunk-JGGXQHXH.js";import"./chunk-I233T2T4.js";import"./chunk-4Z4URZOG.js";import"./chunk-DI55E6CS.js";import"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-JFWEDISV.js";import"./chunk-WQL3BLFD.js";import"./chunk-PSOUSJSZ.js";import"./chunk-DUHBRW7J.js";import"./chunk-D2R7PDN5.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,2 +1,4 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as e,b as s}from"./chunk-AFRXWKTA.js";import"./chunk-RV67J726.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.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as e,b as s}from"./chunk-JFWEDISV.js";import"./chunk-D2R7PDN5.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,4 @@
1
- /*! sootsim v0.1.293 | (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,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-WOWLO4LL.js";import"./chunk-RV67J726.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,J as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,Q as claimDaemonLockfile,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,M as isDaemonLockfileFresh,N as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,q as profilesDir,H as readActiveRuntime,K as readDaemonLockfile,L as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,R as removeDaemonLockfile,S as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,O as writeDaemonLockfile,P as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,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-WQL3BLFD.js";import"./chunk-D2R7PDN5.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,J as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,Q as claimDaemonLockfile,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,M as isDaemonLockfileFresh,N as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,q as profilesDir,H as readActiveRuntime,K as readDaemonLockfile,L as readDevBridgeLockfile,B as readOrCreateAnonymousId,y as readSharedConfig,A as readTelemetryEnabled,R as removeDaemonLockfile,S as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,O as writeDaemonLockfile,P as writeDevBridgeLockfile,E as writeRuntimeUpgradeNotice,z as writeSharedConfig,C as writeTelemetryEnabled};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{j as a,k as b}from"./chunk-24BJFJFB.js";import"./chunk-WYRLRNIP.js";import"./chunk-7Q77LTPT.js";import"./chunk-XYFP466E.js";import"./chunk-ZUX5PIGI.js";import"./chunk-RWUNC66S.js";import"./chunk-KWIURH7N.js";import"./chunk-AMKQUZA2.js";import"./chunk-AFLGWOX3.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import"./chunk-VVVORIQI.js";import"./chunk-W44PDEQH.js";import"./chunk-FNCSUHUR.js";import"./chunk-PZTKQG6H.js";import"./chunk-SPQKJDIK.js";import"./chunk-AO65WEF7.js";import"./chunk-4Z4URZOG.js";import"./chunk-DI55E6CS.js";import"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-JFWEDISV.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";export{a as printShellPerfReport,b as runInspect};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a}from"./chunk-N4MT5KEB.js";import"./chunk-AMKQUZA2.js";import"./chunk-3F2GAJ4Z.js";import"./chunk-D2R7PDN5.js";export{a as runInstallDesktop};
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as k,d as v}from"./chunk-547W23BB.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.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="https://contrast.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.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{b as k,d as v}from"./chunk-SLMUW2WU.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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="https://contrast.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
5
  sootsim login \u2014 sign in so uploads can attach to your account
4
6
 
5
7
  usage:
@@ -21,6 +23,6 @@ options:
21
23
  <p style="color:#ccc">${r}</p>
22
24
  </div>
23
25
  </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-MQKB6PFX.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-MQKB6PFX.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:
26
+ </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-EJP5EW7K.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-EJP5EW7K.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
27
  ${n.toString()}
26
- `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-MQKB6PFX.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-MQKB6PFX.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};
28
+ `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-EJP5EW7K.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-EJP5EW7K.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};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as r,d as i}from"./chunk-ZFMJFX27.js";import{a as t,c as o}from"./chunk-SLMUW2WU.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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,7 @@
1
- /*! sootsim v0.1.293 | (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-E5WYXRGV.js";import"./chunk-YRFWATLA.js";import"./chunk-2M57EAWS.js";import{c as S}from"./chunk-2XYCSFGN.js";import{a as x}from"./chunk-U3564F2Y.js";import{b as A,c as $,d as F,e as T}from"./chunk-WPPMUUML.js";import{a as k}from"./chunk-DE4ZA3NL.js";import"./chunk-4B4VFT73.js";import"./chunk-WP3TFHFL.js";import"./chunk-67CIS55C.js";import"./chunk-B7TX4WFB.js";import"./chunk-7B6RGFTM.js";import"./chunk-LA5DIO33.js";import"./chunk-RKXHQ2Q3.js";import"./chunk-ACSTEPSD.js";import"./chunk-MOU2WLO4.js";import"./chunk-JOPKZVOW.js";import"./chunk-HKMWUN7F.js";import"./chunk-6IFJLHDA.js";import"./chunk-J6P2UPXH.js";import"./chunk-WI36YJ23.js";import"./chunk-7H5G4HUK.js";import"./chunk-547W23BB.js";import"./chunk-TJS5IMOH.js";import"./chunk-KC5SCOGS.js";import"./chunk-RMLJXP7T.js";import"./chunk-YNG4C3ZS.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-AFRXWKTA.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function P(){console.log(`
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as E,d as O,f as L,g as R,h as P}from"./chunk-ISJ4ACWL.js";import"./chunk-7HVMAGDK.js";import"./chunk-K53YCAQM.js";import{c as k}from"./chunk-24BJFJFB.js";import{a as S}from"./chunk-WYRLRNIP.js";import{b as $,c as F,d as T,e as M}from"./chunk-BXO2PTNM.js";import{a as A}from"./chunk-FSRRJGYC.js";import"./chunk-7Q77LTPT.js";import"./chunk-XYFP466E.js";import"./chunk-ZUX5PIGI.js";import"./chunk-RWUNC66S.js";import"./chunk-KWIURH7N.js";import"./chunk-AMKQUZA2.js";import"./chunk-AFLGWOX3.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import"./chunk-VVVORIQI.js";import"./chunk-W44PDEQH.js";import"./chunk-FNCSUHUR.js";import"./chunk-PZTKQG6H.js";import"./chunk-SPQKJDIK.js";import"./chunk-ZFMJFX27.js";import"./chunk-SLMUW2WU.js";import"./chunk-AO65WEF7.js";import"./chunk-4Z4URZOG.js";import"./chunk-DI55E6CS.js";import"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-JFWEDISV.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
3
5
  sootsim maestro \u2014 author and run Maestro YAML flows against sootsim
4
6
 
5
7
  usage:
@@ -35,7 +37,7 @@ examples:
35
37
  sootsim maestro end --output .maestro/login.yaml --validate
36
38
  sootsim maestro --env USERNAME=alice test .maestro/login.yaml
37
39
  sootsim maestro init
38
- `)}function W(){console.log(`
40
+ `)}function D(){console.log(`
39
41
  sootsim maestro \u2014 compatibility matrix
40
42
 
41
43
  supported verbs:
@@ -76,7 +78,7 @@ not yet implemented (will throw "unsupported maestro verb"):
76
78
  travel, setLocation, setAirplaneMode, killApp, faker,
77
79
  addMedia, startRecording, stopRecording (use --record flag),
78
80
  repeat.while (only repeat.times is supported).
79
- `)}function U(o){return o.startsWith("-")}function D(o){let n=[];for(let e=0;e<o.length;e++){if(o[e]==="--env"||o[e]==="-e"){let t=o[e+1];if(!t||!t.includes("="))throw new Error(`--env expects KEY=VALUE (got ${JSON.stringify(t??"")})`);let i=t.indexOf("="),u=t.slice(0,i),p=t.slice(i+1);process.env[u]=p,e+=1;continue}n.push(o[e])}return n}function Y(o){let n=[];for(let e=0;e<o.length;e++){let t=o[e];if(t==="--format"||t==="--output"||t==="--device"||t==="-d"){e+=1;continue}if(t==="--continuous"){console.warn(" warn: --continuous is not yet implemented in sootsim \u2014 running once");continue}n.push(t)}return n}function j(o){for(let n of I){let e=a.join(o,n);if(s.existsSync(e)&&s.statSync(e).isDirectory())return e}return null}function J(o){let n=s.statSync(o);if(n.isFile())return[o];if(!n.isDirectory())throw new Error(`not a file or directory: ${o}`);let e={},t=["config.yaml","config.yml"].map(l=>a.join(o,l)).find(l=>s.existsSync(l));if(t){let l=x.parse(s.readFileSync(t,"utf8"));l&&typeof l=="object"&&(e=l)}let i=Array.isArray(e.flows)&&e.flows.length>0?e.flows:["*"],u=l=>{let c=a.basename(l);return!(c.startsWith(".")||!c.endsWith(".yaml")&&!c.endsWith(".yml")||c==="config.yaml"||c==="config.yml")},p=new Set;for(let l of i)for(let c of s.globSync(l,{cwd:o})){if(!u(c))continue;let m=a.join(o,c);s.existsSync(m)&&s.statSync(m).isFile()&&p.add(m)}let d=[...p].sort(),w=Array.isArray(e.includeTags)?e.includeTags:[],h=Array.isArray(e.excludeTags)?e.excludeTags:[];return(w.length>0||h.length>0)&&(d=d.filter(l=>{let{frontmatter:c}=S(s.readFileSync(l,"utf8")),m=Array.isArray(c.tags)?c.tags:[];return!(w.length>0&&!m.some(r=>w.includes(r))||m.some(r=>h.includes(r)))})),d}async function N(o){let n=a.join(o,".maestro");s.mkdirSync(n,{recursive:!0});let e=a.join(n,"login.yaml");return s.existsSync(e)?(console.error(` error: ${e} already exists`),1):(s.writeFileSync(e,`# sootsim maestro starter flow \u2014 drop-in compatible with the maestro cli.
81
+ `)}function U(o){return o.startsWith("-")}function Y(o){let n=[];for(let e=0;e<o.length;e++){if(o[e]==="--env"||o[e]==="-e"){let t=o[e+1];if(!t||!t.includes("="))throw new Error(`--env expects KEY=VALUE (got ${JSON.stringify(t??"")})`);let i=t.indexOf("="),c=t.slice(0,i),u=t.slice(i+1);process.env[c]=u,e+=1;continue}n.push(o[e])}return n}function J(o){let n=[];for(let e=0;e<o.length;e++){let t=o[e];if(t==="--format"||t==="--output"||t==="--device"||t==="-d"){e+=1;continue}if(t==="--continuous"){console.warn(" warn: --continuous is not yet implemented in sootsim \u2014 running once");continue}n.push(t)}return n}function j(o){for(let n of I){let e=a.join(o,n);if(s.existsSync(e)&&s.statSync(e).isDirectory())return e}return null}function N(o){let n=s.statSync(o);if(n.isFile())return[o];if(!n.isDirectory())throw new Error(`not a file or directory: ${o}`);let e={},t=["config.yaml","config.yml"].map(l=>a.join(o,l)).find(l=>s.existsSync(l));if(t){let l=S.parse(s.readFileSync(t,"utf8"));l&&typeof l=="object"&&(e=l)}let i=Array.isArray(e.flows)&&e.flows.length>0?e.flows:["*"],c=l=>{let p=a.basename(l);return!(p.startsWith(".")||!p.endsWith(".yaml")&&!p.endsWith(".yml")||p==="config.yaml"||p==="config.yml")},u=new Set;for(let l of i)for(let p of s.globSync(l,{cwd:o})){if(!c(p))continue;let d=a.join(o,p);s.existsSync(d)&&s.statSync(d).isFile()&&u.add(d)}let m=[...u].sort(),y=Array.isArray(e.includeTags)?e.includeTags:[],w=Array.isArray(e.excludeTags)?e.excludeTags:[];return(y.length>0||w.length>0)&&(m=m.filter(l=>{let{frontmatter:p}=k(s.readFileSync(l,"utf8")),d=Array.isArray(p.tags)?p.tags:[];return!(y.length>0&&!d.some(h=>y.includes(h))||d.some(h=>w.includes(h)))})),m}async function _(o){let n=a.join(o,".maestro");s.mkdirSync(n,{recursive:!0});let e=a.join(n,"login.yaml");return s.existsSync(e)?(console.error(` error: ${e} already exists`),1):(s.writeFileSync(e,`# sootsim maestro starter flow \u2014 drop-in compatible with the maestro cli.
80
82
  # run: sootsim maestro test .maestro/login.yaml
81
83
  appId: com.example.app
82
84
  ---
@@ -89,14 +91,14 @@ appId: com.example.app
89
91
  - inputText: "secret123"
90
92
  - tapOn: "Sign in"
91
93
  - 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-KCMYWPWL.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(`
94
+ `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function Q(o,n={}){if(o.includes("--help")||o.includes("-h"))return W(),0;if(o.includes("--list-compat"))return D(),0;let e;try{e=Y(o)}catch(r){return console.error(` error: ${r.message}`),1}e=R(e);let t=process.cwd(),i=e[0];if(i==="init")return _(t);if(i==="generate"){let{runMaestroGenerate:r}=await import("./maestro-generate-QGPGNXI6.js");return r(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return P(e);e=J(e);let c=null,u;if(i==="test"){let r=e.slice(1).find(f=>!U(f));r?(c=a.resolve(t,r),u=e.slice(1).filter(f=>f!==r)):(c=j(t),u=e.slice(1))}else i&&!U(i)?(c=a.resolve(t,i),u=e.slice(1)):(c=j(t),u=e);if(!c)return console.error(`
93
95
  error: no maestro flows found.
94
96
  expected one of: ${I.map(r=>`./${r}/`).join(", ")}
95
97
  or pass a flow explicitly: sootsim maestro test path/to/flow.yaml
96
98
  or scaffold a starter flow: sootsim maestro init
97
- `),1;if(!s.existsSync(u))return console.error(` error: ${u} not found`),1;let d;try{d=J(u)}catch(r){return console.error(` error: ${r.message}`),1}if(d.length===0)return console.error(` error: no *.yaml or *.yml files found in ${u}`),1;console.log(`
98
- sootsim maestro \u2014 ${d.length} flow${d.length===1?"":"s"}
99
- root: ${a.relative(t,u)||"."}
100
- `);let w=k(),h=r=>{let f=p.indexOf(r);return f>=0?p[f+1]:void 0},l=await T(h("--preview-origin")??h("--origin")),c=0,m=[];for(let r of d){console.log(`
101
- \u25B6 ${a.relative(t,r)}`);let f=[r,...p];n.port&&!p.includes("--url")&&f.push("--url",String(n.port));let g=0,V=Date.now();try{g=await O(f)}catch(y){console.error(` x ${y.message}`),g=1}m.push({file:r,exit:g}),g!==0&&c===0&&(c=g);let b=M();if($({uploadedShare:!!b,auth:w})){let y=E(),C=y.find(K=>K.status==="failure"),v=await F({origin:l,kind:"maestro",name:a.relative(t,r),status:g===0?"passed":"failed",failureMessage:g===0?null:C?.error??"flow playback failed",previewShareId:b?.shareId??null,owner:h("--owner")??null,repo:h("--repo")??null,durationMs:Date.now()-V,...A(y),auth:w});v&&console.log(` run: ${v.id}${v.traceUrl?` \xB7 replay: ${v.traceUrl}`:""}`)}}if(d.length>1){console.log(`
102
- maestro summary:`);for(let f of m){let g=f.exit===0?"pass":"fail";console.log(` ${g} ${a.relative(t,f.file)}`)}let r=m.filter(f=>f.exit===0).length;console.log(` ${r}/${m.length} passed`)}return c}export{J as collectFlowFiles,z as runMaestro};
99
+ `),1;if(!s.existsSync(c))return console.error(` error: ${c} not found`),1;let m;try{m=N(c)}catch(r){return console.error(` error: ${r.message}`),1}if(m.length===0)return console.error(` error: no *.yaml or *.yml files found in ${c}`),1;console.log(`
100
+ sootsim maestro \u2014 ${m.length} flow${m.length===1?"":"s"}
101
+ root: ${a.relative(t,c)||"."}
102
+ `);let y=A(),w=r=>{let f=u.indexOf(r);return f>=0?u[f+1]:void 0},l=null,p=()=>l??=M(w("--preview-origin")??w("--origin")),d=0,h=[];for(let r of m){console.log(`
103
+ \u25B6 ${a.relative(t,r)}`);let f=[r,...u];n.port&&f.push("--port",String(n.port));let g=0,V=Date.now();try{g=await L(f)}catch(v){console.error(` x ${v.message}`),g=1}h.push({file:r,exit:g}),g!==0&&d===0&&(d=g);let x=E();if(F({uploadedShare:!!x,auth:y})){let v=O(),C=v.find(K=>K.status==="failure"),b=await T({origin:await p(),kind:"maestro",name:a.relative(t,r),status:g===0?"passed":"failed",failureMessage:g===0?null:C?.error??"flow playback failed",previewShareId:x?.shareId??null,owner:w("--owner")??null,repo:w("--repo")??null,durationMs:Date.now()-V,...$(v),auth:y});b&&console.log(` run: ${b.id}${b.traceUrl?` \xB7 replay: ${b.traceUrl}`:""}`)}}if(m.length>1){console.log(`
104
+ maestro summary:`);for(let f of h){let g=f.exit===0?"pass":"fail";console.log(` ${g} ${a.relative(t,f.file)}`)}let r=h.filter(f=>f.exit===0).length;console.log(` ${r}/${h.length} passed`)}return d}export{N as collectFlowFiles,Q as runMaestro};
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as v}from"./chunk-U3564F2Y.js";import{b as O,d as A,e as E}from"./chunk-WPPMUUML.js";import{a as x,b as T}from"./chunk-DE4ZA3NL.js";import{f as y}from"./chunk-RKXHQ2Q3.js";import"./chunk-ACSTEPSD.js";import"./chunk-MOU2WLO4.js";import"./chunk-JOPKZVOW.js";import{g as b,i as S}from"./chunk-J6P2UPXH.js";import"./chunk-7H5G4HUK.js";import"./chunk-547W23BB.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";import{mkdtempSync as R,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var P=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(P.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...P]}),i=S(o);try{let n=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as v}from"./chunk-WYRLRNIP.js";import{b as O,d as A,e as E}from"./chunk-BXO2PTNM.js";import{a as x,b as T}from"./chunk-FSRRJGYC.js";import{f as y}from"./chunk-AFLGWOX3.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import"./chunk-VVVORIQI.js";import{g as b,i as S}from"./chunk-PZTKQG6H.js";import"./chunk-ZFMJFX27.js";import"./chunk-SLMUW2WU.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";import{mkdtempSync as R,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var P=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(P.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...P]}),i=S(o);try{let n=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
3
5
  `);return s.length>_?s.slice(0,_)+`
4
6
  [tree truncated]`:s}finally{i.close()}}var K=`
5
7
  You write Maestro-compatible SootSim YAML flows from a user's plain-language test goal.
@@ -30,5 +32,5 @@ ${t||"[no tree available]"}
30
32
 
31
33
  Generate the shortest replayable flow that verifies the goal from this current state.
32
34
  `.trim()}async function W(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:K,messages:[{role:"user",content:z(e.prompt,e.describe),timestamp:Date.now()}]},options:{maxTokens:1800,temperature:.2},threadId:null}),signal:AbortSignal.timeout(j)});if(!t.ok||!t.body){let a=await t.text().catch(()=>"");throw new Error(`/api/llm ${t.status}${a?`: ${a}`:""}`)}let r=t.body.getReader(),o=new TextDecoder,i=[],n="",c=a=>{let l=a.trim();if(!l)return;let u=JSON.parse(l);if(u.type==="text_delta"&&u.delta)i.push(u.delta);else if(u.type==="error")throw new Error(u.errorMessage||"llm error")};for(;;){let{value:a,done:l}=await r.read();if(l)break;n+=o.decode(a,{stream:!0});let u;for(;(u=n.indexOf(`
33
- `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function X(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 M(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=X(e);if(!M(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((n,c)=>{if(!M(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:v.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=x();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 n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await W({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=R(k(C(),"sootsim-maestro-generate-")),m=k(u,"flow.yaml");N(m,l.yamlText),console.log(` flow: ${m}`);let F=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-VH6DFDQ4.js"),L=Q(e,o,m,c),w=await I(L),p=$(),h=D(),U=h.find(B=>B.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?U?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-F,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
35
+ `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function X(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 M(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=X(e);if(!M(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((n,c)=>{if(!M(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:v.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=x();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 n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await W({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=R(k(C(),"sootsim-maestro-generate-")),m=k(u,"flow.yaml");N(m,l.yamlText),console.log(` flow: ${m}`);let F=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-E64G5LF3.js"),L=Q(e,o,m,c),w=await I(L),p=$(),h=D(),U=h.find(B=>B.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?U?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-F,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
34
36
  result: ${g}`),d&&console.log(` run: ${d.id}`),p?.previewUrl&&console.log(` preview: ${p.previewUrl}`),d?.traceUrl&&console.log(` replay: ${d.traceUrl}`),w}export{le as runMaestroGenerate};
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as s,b as i}from"./chunk-PCAPHXN3.js";import"./chunk-J6P2UPXH.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as s,b as i}from"./chunk-V2MYTL4C.js";import"./chunk-PZTKQG6H.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
5
  sootsim mode screenshot \u2014 toggle the screenshot-mode chrome overlay
4
6
 
5
7
  usage:
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c}from"./chunk-FNCSUHUR.js";import"./chunk-D2R7PDN5.js";export{c as __withOptionalDemoAppsForTests,a as loadOptionalDemoApps,b as optionalDemoAppsSync};
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{k as x}from"./chunk-2XYCSFGN.js";import"./chunk-U3564F2Y.js";import"./chunk-4B4VFT73.js";import"./chunk-WP3TFHFL.js";import"./chunk-67CIS55C.js";import"./chunk-B7TX4WFB.js";import"./chunk-7B6RGFTM.js";import"./chunk-LA5DIO33.js";import"./chunk-RKXHQ2Q3.js";import"./chunk-ACSTEPSD.js";import"./chunk-MOU2WLO4.js";import"./chunk-JOPKZVOW.js";import"./chunk-HKMWUN7F.js";import"./chunk-6IFJLHDA.js";import{g as R,i as N,l as d,m as S}from"./chunk-J6P2UPXH.js";import"./chunk-WI36YJ23.js";import"./chunk-TJS5IMOH.js";import"./chunk-KC5SCOGS.js";import"./chunk-RMLJXP7T.js";import"./chunk-YNG4C3ZS.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-AFRXWKTA.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}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 B(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,a)=>{this.pending.set(n,{res:s,rej:a}),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(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(h(e,"--sample-interval")??"0.1"),n=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return E(n),1}let f=l.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: ${l.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),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(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 U(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 E(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 U(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,a=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(a,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function h(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.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{k as x}from"./chunk-24BJFJFB.js";import"./chunk-WYRLRNIP.js";import"./chunk-7Q77LTPT.js";import"./chunk-XYFP466E.js";import"./chunk-ZUX5PIGI.js";import"./chunk-RWUNC66S.js";import"./chunk-KWIURH7N.js";import"./chunk-AMKQUZA2.js";import"./chunk-AFLGWOX3.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import"./chunk-VVVORIQI.js";import"./chunk-W44PDEQH.js";import"./chunk-FNCSUHUR.js";import{g as R,i as N,l as d,m as S}from"./chunk-PZTKQG6H.js";import"./chunk-SPQKJDIK.js";import"./chunk-AO65WEF7.js";import"./chunk-4Z4URZOG.js";import"./chunk-DI55E6CS.js";import"./chunk-VXGCZUX4.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-JFWEDISV.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}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 B(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,a)=>{this.pending.set(n,{res:s,rej:a}),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(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(h(e,"--sample-interval")??"0.1"),n=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return E(n),1}let f=l.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: ${l.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),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(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 U(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 E(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 U(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,a=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(a,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
3
5
  sootsim perf react \u2014 inspect React component render cost in the tenant worker
4
6
 
5
7
  usage:
@@ -1,5 +1,7 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as h,i as w,l,m as u}from"./chunk-J6P2UPXH.js";import"./chunk-3UX6AY2B.js";import"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{g as h,i as w,l,m as u}from"./chunk-PZTKQG6H.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
3
5
  sootsim permissions \u2014 inspect and change simulated operating-system permissions
4
6
 
5
7
  usage:
@@ -1,10 +1,12 @@
1
- /*! sootsim v0.1.293 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as W}from"./chunk-YRFWATLA.js";import{a as oe}from"./chunk-WPPMUUML.js";import{a as Z,c as ee}from"./chunk-DE4ZA3NL.js";import"./chunk-ACSTEPSD.js";import"./chunk-MOU2WLO4.js";import{d as Y}from"./chunk-JOPKZVOW.js";import{g as b,i as v,j as Q}from"./chunk-J6P2UPXH.js";import"./chunk-7H5G4HUK.js";import"./chunk-547W23BB.js";import"./chunk-3UX6AY2B.js";import{c as X}from"./chunk-K5JEUI5G.js";import"./chunk-WOWLO4LL.js";import"./chunk-RV67J726.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.
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as W}from"./chunk-7HVMAGDK.js";import{a as oe}from"./chunk-BXO2PTNM.js";import{a as Z,c as ee}from"./chunk-FSRRJGYC.js";import"./chunk-6YN3IAWJ.js";import"./chunk-37ZXWXM3.js";import{d as Y}from"./chunk-VVVORIQI.js";import{g as b,i as v,j as Q}from"./chunk-PZTKQG6H.js";import"./chunk-ZFMJFX27.js";import"./chunk-SLMUW2WU.js";import"./chunk-OKSGM6IG.js";import{c as X}from"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.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
5
  the capture lock auto-releases, so simply retry the recording.
4
6
  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
7
  a prior recording was abandoned and its capture is still
6
8
  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 _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-RBH4XGJ2.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
9
+ \`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-JABM3ITZ.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
10
  would be throttled to ~1fps and produce a frozen-looking file.
9
11
  bring the chrome window to the foreground (un-minimize / switch to
10
12
  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
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.294 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a}from"./chunk-BBVBMGTT.js";import"./chunk-PZTKQG6H.js";import"./chunk-CTMPC5DN.js";import"./chunk-OKSGM6IG.js";import"./chunk-JUOQ4ZPA.js";import"./chunk-WQL3BLFD.js";import"./chunk-D2R7PDN5.js";export{a as runRuntime};