sootsim 0.1.66 → 0.1.68

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 (152) hide show
  1. package/dist-cli/bin.js +7 -28
  2. package/dist-cli/chunks/agent-RWWC5VLR.js +46 -0
  3. package/dist-cli/chunks/{agent-wrapper-5DJBERZP.js → agent-wrapper-AZ2TWUZV.js} +2 -2
  4. package/dist-cli/chunks/{assert-RHILK3WR.js → assert-YVADDYYY.js} +2 -2
  5. package/dist-cli/chunks/auto-bootstrap-E62IXD2G.js +2 -0
  6. package/dist-cli/chunks/beta-7MI67AHK.js +2 -0
  7. package/dist-cli/chunks/{chunk-XZ5SQJM2.js → chunk-2HVRBEOU.js} +128 -36
  8. package/dist-cli/chunks/chunk-2NFRZQ3K.js +73 -0
  9. package/dist-cli/chunks/{chunk-22CO2ZE3.js → chunk-3HF6BNSA.js} +2 -2
  10. package/dist-cli/chunks/{chunk-GDCMTHEU.js → chunk-3NNUNABL.js} +1 -1
  11. package/dist-cli/chunks/{chunk-BD76YSRN.js → chunk-3QA6YYSG.js} +2 -2
  12. package/dist-cli/chunks/{chunk-T4YLDM5C.js → chunk-52QFCYGQ.js} +3 -3
  13. package/dist-cli/chunks/chunk-5LDGAVAV.js +23 -0
  14. package/dist-cli/chunks/{chunk-LRBMW2WC.js → chunk-5QUYJKLU.js} +2 -2
  15. package/dist-cli/chunks/chunk-5SGAFI2M.js +23 -0
  16. package/dist-cli/chunks/{chunk-VRV2X4X2.js → chunk-6453CCSA.js} +1 -1
  17. package/dist-cli/chunks/{chunk-FXF2FHPI.js → chunk-6JGI2JVM.js} +2 -2
  18. package/dist-cli/chunks/chunk-6TQ2IBH6.js +2 -0
  19. package/dist-cli/chunks/chunk-72Y42WVX.js +186 -0
  20. package/dist-cli/chunks/{chunk-4LYNJPUM.js → chunk-BQLKO6NP.js} +2 -2
  21. package/dist-cli/chunks/{chunk-AYBGSHQK.js → chunk-C3R25CWY.js} +2 -2
  22. package/dist-cli/chunks/{chunk-TJEP4DBA.js → chunk-CFR6W2AH.js} +2 -2
  23. package/dist-cli/chunks/chunk-CMEWLMED.js +1 -0
  24. package/dist-cli/chunks/chunk-CZWZG7GL.js +2 -0
  25. package/dist-cli/chunks/chunk-D5LXWWGN.js +12 -0
  26. package/dist-cli/chunks/{chunk-EIQLQDKX.js → chunk-E7FCGYB5.js} +2 -2
  27. package/dist-cli/chunks/{chunk-DEQ7RED3.js → chunk-FBO7YRJM.js} +2 -2
  28. package/dist-cli/chunks/chunk-FITG7BVA.js +1 -0
  29. package/dist-cli/chunks/{chunk-BEQD2DSK.js → chunk-G3WXMB3Z.js} +1 -1
  30. package/dist-cli/chunks/chunk-GFXFPPNR.js +35 -0
  31. package/dist-cli/chunks/chunk-H6YUT7HX.js +372 -0
  32. package/dist-cli/chunks/{chunk-D4VEI6MI.js → chunk-HC43PTFD.js} +1 -1
  33. package/dist-cli/chunks/chunk-HPFXTPOD.js +1 -0
  34. package/dist-cli/chunks/{chunk-V4SZERWD.js → chunk-J7XCQWQI.js} +14 -14
  35. package/dist-cli/chunks/{chunk-HIN5TAAL.js → chunk-K6N6DEL5.js} +1 -1
  36. package/dist-cli/chunks/{chunk-6AP6LXVV.js → chunk-KKK4RTBP.js} +1 -1
  37. package/dist-cli/chunks/{chunk-NCSGLZRV.js → chunk-OFTI3N27.js} +2 -2
  38. package/dist-cli/chunks/{chunk-BTHB3PMG.js → chunk-QHAZOOK2.js} +3 -3
  39. package/dist-cli/chunks/{chunk-4NT6VRUU.js → chunk-QYFPV5YO.js} +1 -1
  40. package/dist-cli/chunks/chunk-TBVBPZRF.js +3 -0
  41. package/dist-cli/chunks/{chunk-LVFWALS4.js → chunk-TKDMCYGS.js} +2 -2
  42. package/dist-cli/chunks/{chunk-LCKLQSZX.js → chunk-TY5CBM3C.js} +2 -2
  43. package/dist-cli/chunks/{chunk-WAOLC7WV.js → chunk-TZYXNQHA.js} +1 -1
  44. package/dist-cli/chunks/chunk-U7KUAZJB.js +119 -0
  45. package/dist-cli/chunks/{chunk-M2Q4FXRE.js → chunk-WHJFB6AK.js} +1 -1
  46. package/dist-cli/chunks/{chunk-HWCZYW6M.js → chunk-WIW3G6HS.js} +2 -2
  47. package/dist-cli/chunks/chunk-WXISHMXL.js +2 -0
  48. package/dist-cli/chunks/{chunk-UMXVWFST.js → chunk-YSDIOWNN.js} +1 -1
  49. package/dist-cli/chunks/{chunk-EEMGSSWY.js → chunk-Z6BCORBY.js} +2 -2
  50. package/dist-cli/chunks/{chunk-UNSLXX7V.js → chunk-ZP7YYRHI.js} +2 -2
  51. package/dist-cli/chunks/cli-version-LM6OBGUK.js +2 -0
  52. package/dist-cli/chunks/{compat-I7JXYUJN.js → compat-Z3IFUQ73.js} +3 -3
  53. package/dist-cli/chunks/{config-3HR5RKVH.js → config-XBERIMLW.js} +2 -2
  54. package/dist-cli/chunks/control-SWOP3KB7.js +2 -0
  55. package/dist-cli/chunks/{cpu-profile-ZVHMTVAU.js → cpu-profile-SNX23Q5V.js} +2 -2
  56. package/dist-cli/chunks/daemon-QQPC4GOV.js +65 -0
  57. package/dist-cli/chunks/{debug-CQ6Y7GJ2.js → debug-WENYS45R.js} +5 -5
  58. package/dist-cli/chunks/demo-app-registry-QWOGX5C2.js +2 -0
  59. package/dist-cli/chunks/{detox-7ZKTGLDR.js → detox-P4N47V6P.js} +2 -2
  60. package/dist-cli/chunks/{device-4M6Z7E2N.js → device-5WWFV22H.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-SMQLYGNX.js → diagnose-HJ4F3ER7.js} +2 -2
  62. package/dist-cli/chunks/drivers-GAEMIY75.js +2 -0
  63. package/dist-cli/chunks/{electron-6N2MIN5W.js → electron-JHFA2OGV.js} +3 -3
  64. package/dist-cli/chunks/flow-J67STV2Q.js +2 -0
  65. package/dist-cli/chunks/{hints-RJCZS2E3.js → hints-UHQ2T2RX.js} +2 -2
  66. package/dist-cli/chunks/{home-paths-DCUNA3CD.js → home-paths-NWDFFIX4.js} +2 -2
  67. package/dist-cli/chunks/inspect-O34RH4AE.js +970 -0
  68. package/dist-cli/chunks/install-ZB2AGO44.js +2 -0
  69. package/dist-cli/chunks/{install-desktop-C7424OSW.js → install-desktop-RYP35PHA.js} +3 -3
  70. package/dist-cli/chunks/{keys-TXUQOAZ3.js → keys-U5YI77TK.js} +2 -2
  71. package/dist-cli/chunks/{launch-MVA44QTC.js → launch-UFOGCQWO.js} +3 -3
  72. package/dist-cli/chunks/{login-NHO2WTHC.js → login-SPX6IK6Q.js} +4 -4
  73. package/dist-cli/chunks/{logout-SRRWADCE.js → logout-I6UE3XYL.js} +2 -2
  74. package/dist-cli/chunks/{maestro-UHNXEZAN.js → maestro-IPEULAUZ.js} +2 -2
  75. package/dist-cli/chunks/{preview-ETIUP7KC.js → preview-CE27FPGG.js} +2 -2
  76. package/dist-cli/chunks/{profile-MY5JFVIF.js → profile-JZSFMO2Y.js} +2 -2
  77. package/dist-cli/chunks/{react-KCMC4GL3.js → react-6IJQG4V3.js} +2 -2
  78. package/dist-cli/chunks/record-6WDKEBXL.js +70 -0
  79. package/dist-cli/chunks/runtime-P54OGI57.js +2 -0
  80. package/dist-cli/chunks/{runtime-delivery-LQZIWQU6.js → runtime-delivery-C4KG6ISS.js} +2 -2
  81. package/dist-cli/chunks/screenshot-VQTI6G32.js +33 -0
  82. package/dist-cli/chunks/{screenshot-mode-USPWASI3.js → screenshot-mode-JBDCHRSS.js} +2 -2
  83. package/dist-cli/chunks/{screenshots-EPEDNA6H.js → screenshots-HLMGN2OX.js} +2 -2
  84. package/dist-cli/chunks/{server-222QT33M.js → server-U3QLKQDX.js} +6 -6
  85. package/dist-cli/chunks/setup-repo-TZULA5RK.js +2 -0
  86. package/dist-cli/chunks/{skills-6XRREE2M.js → skills-SMML5DJP.js} +2 -2
  87. package/dist-cli/chunks/{start-YCAZBZEX.js → start-7SCU4I64.js} +4 -4
  88. package/dist-cli/chunks/store-WEIVIM3L.js +2 -0
  89. package/dist-cli/chunks/telemetry-U3BBVPLJ.js +2 -0
  90. package/dist-cli/chunks/{test-6TNRHSWC.js → test-UWFHFDN7.js} +3 -3
  91. package/dist-cli/chunks/{three-mode-MDOLHGXW.js → three-mode-CJUNGCIF.js} +2 -2
  92. package/dist-cli/chunks/{timeline-72MWE44G.js → timeline-DIRXVM6R.js} +3 -3
  93. package/dist-cli/chunks/{upgrade-IHZ4DFAE.js → upgrade-LQQU4GSZ.js} +2 -2
  94. package/dist-cli/chunks/upload-SSAFKJGF.js +2 -0
  95. package/dist-cli/chunks/web-AJU6QA43.js +2 -0
  96. package/dist-cli/chunks/what-happened-QFXDQ6VU.js +22 -0
  97. package/dist-cli/chunks/{whoami-2EYGCRDQ.js → whoami-HWXPDZEF.js} +2 -2
  98. package/dist-lib/agent-daemon-client.cjs +1 -1
  99. package/dist-lib/agent-events.cjs +1 -1
  100. package/dist-lib/agent-sessions.cjs +1 -1
  101. package/dist-lib/attached-projects.cjs +1 -1
  102. package/dist-lib/auth/shared-session.cjs +1 -1
  103. package/dist-lib/backend-origin.cjs +1 -1
  104. package/dist-lib/bridge-constants.cjs +1 -1
  105. package/dist-lib/cli-constants.cjs +1 -1
  106. package/dist-lib/config.cjs +1 -1
  107. package/dist-lib/dev-bundle-resolution.cjs +9 -2
  108. package/dist-lib/home-paths.cjs +1 -1
  109. package/dist-lib/host/bridge-host.cjs +23 -7
  110. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  112. package/dist-lib/index.cjs +1 -1
  113. package/dist-lib/metro.cjs +1 -1
  114. package/dist-lib/profiles.cjs +1 -1
  115. package/dist-lib/render-mode.cjs +1 -1
  116. package/dist-lib/vite-base.cjs +23 -7
  117. package/dist-lib/vite.cjs +1 -1
  118. package/package.json +1 -1
  119. package/dist-cli/chunks/agent-IW7CCSSI.js +0 -61
  120. package/dist-cli/chunks/auto-bootstrap-PS2UDBP7.js +0 -2
  121. package/dist-cli/chunks/beta-XLYWSKEA.js +0 -2
  122. package/dist-cli/chunks/chunk-5MVFADNH.js +0 -3
  123. package/dist-cli/chunks/chunk-7NYW73Q6.js +0 -2
  124. package/dist-cli/chunks/chunk-EMMX6RF7.js +0 -73
  125. package/dist-cli/chunks/chunk-FIIBCY5I.js +0 -3
  126. package/dist-cli/chunks/chunk-G4VWDOWB.js +0 -17
  127. package/dist-cli/chunks/chunk-GMKGJHVG.js +0 -1
  128. package/dist-cli/chunks/chunk-M3ZEZHOB.js +0 -34
  129. package/dist-cli/chunks/chunk-MWTMLNGM.js +0 -348
  130. package/dist-cli/chunks/chunk-NQKBIKUZ.js +0 -1
  131. package/dist-cli/chunks/chunk-QMRXLBPN.js +0 -11
  132. package/dist-cli/chunks/chunk-X4HQLK4V.js +0 -119
  133. package/dist-cli/chunks/chunk-XOTJSR4T.js +0 -2
  134. package/dist-cli/chunks/chunk-YSQV4D7P.js +0 -1
  135. package/dist-cli/chunks/chunk-Z6HSVZIO.js +0 -100
  136. package/dist-cli/chunks/cli-version-ESQ2S6N5.js +0 -2
  137. package/dist-cli/chunks/control-TDZXFNVT.js +0 -2
  138. package/dist-cli/chunks/daemon-VYRTYH55.js +0 -83
  139. package/dist-cli/chunks/demo-app-registry-JAYU7BBM.js +0 -2
  140. package/dist-cli/chunks/drivers-SIY6JBEM.js +0 -2
  141. package/dist-cli/chunks/flow-BZEWL7UQ.js +0 -2
  142. package/dist-cli/chunks/inspect-T5NC7HHB.js +0 -1025
  143. package/dist-cli/chunks/install-YTJI5RS7.js +0 -2
  144. package/dist-cli/chunks/record-DHDSXC2Y.js +0 -51
  145. package/dist-cli/chunks/runtime-AJP6V5LM.js +0 -2
  146. package/dist-cli/chunks/screenshot-4KPEEI6I.js +0 -28
  147. package/dist-cli/chunks/setup-repo-D56L3CEB.js +0 -2
  148. package/dist-cli/chunks/store-Z32KZ34K.js +0 -2
  149. package/dist-cli/chunks/telemetry-RFTX2BZK.js +0 -2
  150. package/dist-cli/chunks/upload-G5C7LJWG.js +0 -2
  151. package/dist-cli/chunks/web-JLJSJUS2.js +0 -2
  152. package/dist-cli/chunks/what-happened-BUXSJ3QS.js +0 -15
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as o}from"./chunk-TJEP4DBA.js";import"./chunk-6AP6LXVV.js";import"./chunk-BTHB3PMG.js";import"./chunk-DEQ7RED3.js";import"./chunk-EIQLQDKX.js";import"./chunk-G4VWDOWB.js";import"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";async function t(n){console.error(" note: `sootsim install` is now `sootsim setup-repo`. forwarding\u2026\n"),await o(n)}export{t as runInstall};
@@ -1,51 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as C}from"./chunk-4LYNJPUM.js";import"./chunk-EMMX6RF7.js";import{d as X}from"./chunk-EEMGSSWY.js";import"./chunk-NQKBIKUZ.js";import{d as H}from"./chunk-HIN5TAAL.js";import"./chunk-DEQ7RED3.js";import"./chunk-EIQLQDKX.js";import{c as w,e as h}from"./chunk-G4VWDOWB.js";import{b as K}from"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";import{existsSync as ue,mkdirSync as O,readdirSync as me,readFileSync as fe,rmSync as W,writeFileSync as U}from"fs";import{homedir as pe,tmpdir as ge}from"os";import{dirname as P,extname as Y,join as E,resolve as we}from"path";var Q=6e4,he=3e4;async function N(e,r,o,i){let t=Math.max(2e4,i+he);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
- the capture lock auto-releases, so simply retry the recording.
4
- if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording/i.test(s)&&(console.error(` ${o} failed: ${s}
5
- a prior recording was abandoned and its capture is still
6
- releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
7
- \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var be=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin"]),ve=new Set(["start","stop","cancel","status","prelude-start"]);function ye(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){be.has(o)&&r++;continue}return ve.has(o)?{name:o,index:r}:null}return null}async function De(e,r){let o=ye(e);if(o){let a=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await ke(a,r);return}if(o.name==="prelude-start"){await Oe(a,r);return}if(o.name==="stop"){await Ie(a,r);return}if(o.name==="cancel"){await Me(a,r);return}await Be(a,r);return}let i=w(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin"]}),t=oe(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(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=u(e,"--output"),d=Number(u(e,"--duration")??"10");(!Number.isFinite(d)||d<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let l=1800;d>l&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${l}s (30m) maximum`),process.exit(1));let f=Number(u(e,"--fps")??"30"),b=u(e,"--frames");if(b!==void 0){let a=Number(b);(!Number.isInteger(a)||a<=0)&&(console.error(` invalid --frames "${b}" \u2014 expected a positive integer count`),process.exit(1))}let V=e.includes("--open"),j=u(e,"--max-width")?Number(u(e,"--max-width")):void 0,p=Math.max(100,Math.round(d*1e3)),q=u(e,"--origin");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 C("record",{originOverride:q,allowGitHubAuth:!0});let a=h({...i,commandTimeoutMs:6e4});try{await G(a),await te(a,t),await ne(a,q);let R=await ie(a,t,t==="combined"?n:void 0);R.ok||(console.error(` start failed: recording store refused to start (${t})`+(R.error?`: ${R.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${d}s`),await new Promise(x=>setTimeout(x,p)),await se(a);let _=await ae(a);de(_,V,t)}finally{a.close()}return}let A=b?Number(b):null,$=Re(s,c,A);V&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let v=h({...i,commandTimeoutMs:6e4});try{if(await Z(v),$==="png"){let S=A??10,g=I(c,`sootsim-frames-${M()}`);c&&Y(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),O(g,{recursive:!0});for(let m of me(g))/^frame-\d+\.png$/.test(m)&&W(E(g,m),{force:!0});console.log(` sampling ${S} frames over ${d}s \u2192 ${g}`);let y=await v.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${S}, durationMs: ${p}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!y.ok||!y.requestId)&&(console.error(` frame capture start failed: ${y.error??"unknown error"}`),process.exit(1)),await new Promise(m=>setTimeout(m,p));let ce=Date.now()+Math.max(5e3,p),F=null;for(;;){let m=await v.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${y.requestId})`});if(m||(console.error(" frame capture result missing"),process.exit(1)),m.done){m.ok||(console.error(` frame capture failed: ${m.error??"unknown error"}`),process.exit(1)),F=m.frames??[];break}Date.now()>=ce&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(T=>setTimeout(T,100))}F.forEach((m,T)=>{let le=`${g}/frame-${String(T+1).padStart(3,"0")}.png`;U(le,Buffer.from(m.data,"base64"))}),console.log(` saved ${F.length} frames`);return}if($==="gif"){let S=A??Math.max(10,Math.round(d*f/3)),g=I(c,`sootsim-${M()}.gif`);O(P(g),{recursive:!0}),console.log(` encoding gif: ${S} frames over ${d}s \u2192 ${g}`);let y=await N(v,`window.__sootsimRecorder.captureGif({ frames: ${S}, durationMs: ${p}${j?`, maxWidth: ${j}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",p);y||(console.error(" gif capture returned no frames"),process.exit(1)),U(g,Buffer.from(y.data,"base64")),console.log(` saved: ${g} (${D(y.size)})`);return}let a=I(c,`sootsim-${M()}.${$}`);O(P(a),{recursive:!0});let R={format:$,fps:f,durationMs:p};n&&(R.layers=n);let _=await N(v,`window.__sootsimRecorder.start(${JSON.stringify(R)})`,`${$} start`,p);_.ok||(console.error(` start failed: ${_.error??"unknown error"}`),/render host not available|already streaming|already recording/i.test(_.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 ${d}s \u2192 ${a}`),await new Promise(S=>setTimeout(S,p));let x=await N(v,"window.__sootsimRecorder.stop()",`${$} encode/flush`,p);x.ok||(console.error(` stop failed: ${x.error??"unknown error"}`),process.exit(1)),x.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ee(v,a),console.log(` saved: ${a} (${D(x.size)})`)}finally{v.close()}}var $e=6e3;async function z(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:$e})}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 Z(e){await z(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function ee(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}U(r,Buffer.concat(o))}function u(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Se(e){if(!e)return;let r=Y(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Re(e,r,o){return e||(o!=null?"png":Se(r)??"webm")}function M(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function xe(){let e=E(pe(),".sootsim","recordings");return O(e,{recursive:!0}),e}function I(e,r){return e?we(process.cwd(),e):E(xe(),r)}function D(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function oe(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 J(){return E(ge(),`sootsim-recording-${K()}.json`)}function B(){let e=J();if(!ue(e))return null;try{return{mode:"video",...JSON.parse(fe(e,"utf8"))}}catch{return W(e,{force:!0}),null}}function _e(e){U(J(),JSON.stringify(e,null,2))}function k(){W(J(),{force:!0})}function L(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
8
- requested sim ${e}. record state is global (not per-sim);
9
- this command acts on that session regardless of --sim.`)}async function ke(e,r){let o=B();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=w(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin"]}),t=oe(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format"),c=s==="mp4"?"mp4":"webm";s&&c!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: sootsim record --format ${s} --duration <s>`),process.exit(1));let d=Number(u(e,"--fps")??"30"),l=h({...i,commandTimeoutMs:15e3});try{if(t==="live"||t==="combined"){n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await C("record",{originOverride:u(e,"--origin"),allowGitHubAuth:!0}),await G(l),await te(l,t),await ne(l,u(e,"--origin"));let f=await ie(l,t,t==="combined"?n:void 0);f.ok||(console.error(` start failed: recording store refused to start (${t})`+(f.error?`: ${f.error}`:"")),process.exit(1))}else{await Z(l);let f={format:c,fps:d};n&&(f.layers=n);let b=await l.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(f)})`});b.ok||(console.error(` start failed: ${b.error??"unknown error"}`),process.exit(1))}_e({simId:i.simId??null,mode:t,format:c,fps:d,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${c} @ ${d}fps${n?` (${n})`:""} \u2014 run \`sootsim record stop --output <path>\` when done`:` recording ${t} \u2014 run \`sootsim record stop\` when done (add --open to launch the preview URL)`)}finally{l.close()}}async function Oe(e,r){let o=B();o&&(console.error(` recording already in progress (started ${o.startedAt}, sim ${o.simId??"?"}). run \`sootsim record stop\` first, or \`sootsim record cancel\` to discard.`),process.exit(1));let i=w(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=h({...i,commandTimeoutMs:15e3});try{if(await G(t),!await t.send({type:"evaluate",code:`(() => {
10
- const start = window.SootSim?.bridges?.startRecordingPrelude
11
- if (typeof start !== 'function') return false
12
- return Promise.resolve(start()).then((value) => value === true)
13
- })()`})){let s=await t.send({type:"evaluate",code:`(() => {
14
- const getError = window.SootSim?.bridges?.getRecordingStartError
15
- return typeof getError === 'function' ? getError() : null
16
- })()`}).catch(()=>null);console.error(` prelude start failed: recording store refused to start${typeof s=="string"&&s?` (${s})`:""}`),process.exit(1)}console.log(" recording preview prelude \u2014 run `sootsim record start --mode combined` when the visible proof segment is ready")}finally{t.close()}}async function re(e){try{let r=await e.send({type:"evaluate",code:`(() => {
17
- const store = window.SootSim?.bridges?.getRecordingState?.();
18
- const headless = window.__sootsimRecorder?.state?.();
19
- return { store: store ? store.state : undefined, headless };
20
- })()`});return r?r.store==="recording"||r.headless==="recording"?"recording":r.store==="processing"?"processing":r.store==="idle"||r.headless==="idle"?"idle":null:null}catch{return null}}async function Be(e,r){let o=B();if(o){L(w(e,{port:r.port}).simId,o),o.mode==="video"?console.log(` recording ${o.mode} (${o.format} @ ${o.fps}fps) on sim ${o.simId??"?"} since ${o.startedAt}`):console.log(` recording ${o.mode} on sim ${o.simId??"?"} since ${o.startedAt}`);return}let i=w(e,{port:r.port}),t=h({...i,commandTimeoutMs:8e3});try{let n=await re(t);console.log(n==="recording"||n==="processing"?` a recording is in progress (engine state: ${n}), but not via
21
- \`record start\` \u2014 it was started by an atomic \`record --duration\`
22
- run or the in-browser record button, which own their own lifecycle.
23
- if that controlling run is still alive it will finish on its own
24
- (atomic \`--mode video/gif/png\` writes a local file from that
25
- process; live/combined upload to /preview/<id>). if the run was
26
- killed, the recording is abandoned and will NOT finish \u2014 reclaim
27
- it now with \`sootsim record cancel\`, or it auto-reclaims when the
28
- abandoned capture's deadline lapses.`:" no recording in progress")}finally{t.close()}}async function Me(e,r){let o=B();if(!o){let s=w(e,{port:r.port}),c=h({...s,commandTimeoutMs:8e3});try{let d=await re(c);if(d==="recording"||d==="processing"){let l=await c.send({type:"evaluate",code:`(async () => {
29
- const r = window.__sootsimRecorder;
30
- if (r && typeof r.forceRelease === 'function') return await r.forceRelease();
31
- return false;
32
- })()`}).catch(()=>!1);console.log(l?" reclaimed an abandoned recording (started by an atomic\n `record --duration` run or the record button whose owner is\n gone). the recorder is idle again \u2014 live/combined can start.":" a recording is in progress and still owned by a live atomic\n `record --duration` run or the in-browser record button \u2014 it\n will finish on its own and nothing was reclaimed.")}else console.log(" no recording in progress")}finally{c.close()}return}let i=w(e,{port:r.port});L(i.simId,o);let t=o.simId??i.simId??void 0,n=h({...i,simId:t,commandTimeoutMs:15e3});try{o.mode==="live"||o.mode==="combined"?await n.send({type:"evaluate",code:"void window.SootSim?.bridges?.cancelRecording?.()"}):await n.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"})}catch{}finally{k(),n.close()}console.log(" recording cancelled")}async function Ie(e,r){let o=B();o||(console.error(" no recording in progress. start one with `sootsim record start`."),process.exit(1));let i=w(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});L(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=h({...i,simId:t,commandTimeoutMs:6e4});try{if(o.mode==="live"||o.mode==="combined"){await se(s);let f=await ae(s);k(),de(f,n,o.mode);return}let c=u(e,"--output"),d=I(c,`sootsim-${M()}.${o.format}`);O(P(d),{recursive:!0});let l=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});l.ok||(console.error(` stop failed: ${l.error??"unknown error"}`),k(),process.exit(1)),l.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),k(),process.exit(1)),await ee(s,d),k(),console.log(` saved: ${d} (${D(l.size)})`)}finally{s.close()}}async function G(e){await z(e,'typeof window.SootSim?.bridges?.startRecording === "function" && typeof window.SootSim?.bridges?.stopRecording === "function"')||(console.error(" SootSim.bridges.startRecording missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function te(e,r){await z(e,`(() => {
33
- const fn = window.__sootsimCaptureBundle
34
- if (typeof fn !== 'function') return false
35
- const snap = fn()
36
- return !!(snap && snap.bundleUrl)
37
- })()`)||(console.error(` --mode ${r} needs a guest app bundle to upload to /preview/<id>,
38
- but this sim has no bundle loaded (a built-in shell screen like
39
- photos/settings/home has none). open a metro/guest app first, or
40
- use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function ne(e,r){let o=X();if(!o)return;let i=o.kind==="api-key"?o.secret:o.token,t=o.kind==="github"?{repoId:o.repoId,installationId:o.installationId}:null,n=r?r.replace(/\/$/,""):null;await e.send({type:"evaluate",code:`(() => {
41
- const set = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.setSession
42
- if (typeof set !== 'function') return false
43
- set({ token: ${JSON.stringify(i)}, user: null })
44
- window.__sootsimPreviewUploadIdentity = ${JSON.stringify(t)}
45
- window.__sootsimPreviewUseInjectedBearer = true
46
- ${n?`window.__sootsimUploadOrigin = ${JSON.stringify(n)}`:"delete window.__sootsimUploadOrigin"}
47
- return true
48
- })()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`sootsim open --new`); if it persists, update sootsim."),process.exit(1))}async function ie(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function se(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function ae(e){let r=Date.now()+Q;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${Q/1e3}s`}}function de(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
49
- replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
50
- nothing to replay, and the Video tab may stall with no events to drive it.`:` note: this live recording captured no events \u2014 the preview has nothing
51
- to replay and will boot a fresh interactive session instead.`),r&&H(e.previewUrl)}export{Se as extToFormat,Re as resolveFormat,De as runRecord,u as valueOf};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-T4YLDM5C.js";import"./chunk-G4VWDOWB.js";import"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-NCSGLZRV.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";export{a as runRuntime};
@@ -1,28 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as S}from"./chunk-LVFWALS4.js";import"./chunk-YSQV4D7P.js";import{a as x}from"./chunk-WAOLC7WV.js";import"./chunk-UNSLXX7V.js";import"./chunk-LRBMW2WC.js";import{f as m}from"./chunk-FXF2FHPI.js";import{c as h,d as g,e as w,h as y}from"./chunk-G4VWDOWB.js";import"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";import{mkdirSync as R,writeFileSync as v}from"fs";import{dirname as _,resolve as $}from"path";async function W(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
- sootsim screenshot \u2014 capture the canvas as a PNG
4
-
5
- usage:
6
- sootsim screenshot [output] [options]
7
- sootsim screenshot [options] --output <path>
8
-
9
- options:
10
- --output <path> output file path (default: /tmp/sootsim-inspect.png)
11
- first positional arg works too: \`screenshot /tmp/x.png\`
12
- --with-frame wrap the captured screen in a tight device frame
13
- --no-frame capture the raw screen bitmap (default)
14
- --no-shell exclude the simulated iOS chrome (status bar, keyboard,
15
- toasts) \u2014 captures the tenant surfaces only
16
- --shell-only capture only the shell chrome, no tenant content
17
- --area x,y,w,h crop to a logical sootsim rect
18
- --id <testID> crop to a node's bounding box
19
- --text <text> crop to a node found by text content
20
- --gallery crawl and capture multiple screens as HTML gallery
21
- --themes capture light and dark variants
22
-
23
- examples:
24
- sootsim screenshot
25
- sootsim screenshot --with-frame --output framed.png
26
- sootsim screenshot --area 0,200,393,400 --output hero.png
27
- sootsim screenshot --id loginButton --output button.png
28
- `),process.exit(0));let t=D(e);if(t.length>0){for(let{flag:l,suggestion:p}of t)console.error(p?` unknown flag: ${l} (did you mean ${p}?)`:` unknown flag: ${l}`);console.error(" run `sootsim screenshot --help` for the list of supported flags"),process.exit(1)}let r=e.includes("--gallery"),a=e.includes("--themes"),n=M(e),c=L(e);if(r||a)return n&&(console.error(" --with-frame is not supported with --gallery / --themes"),process.exit(1)),b(e,o);n&&e.some(l=>l==="--area"||l==="--id"||l==="--text")&&(console.error(" --with-frame only supports full-screen capture for now"),console.error(" remove --area / --id / --text, or capture raw and compose later"),process.exit(1));let s=h(e,{port:o.port,stripBooleanFlags:["--with-frame","--no-frame","--no-shell","--shell-only"],stripValueFlags:["--output","--area","--id","--text"]}),i=E(e),u=await P(e);if(await O(s.wsPort)){try{await T(s,i,u,n,c)}catch(l){console.error(` screenshot failed: ${l instanceof Error?l.message:String(l)}`),process.exit(1)}return}n&&(console.error(" --with-frame requires a running sootsim bridge"),console.error(" open the app in a live sim first, then rerun the command"),process.exit(1)),u&&(console.error(" --area / --id / --text require a running sootsim bridge"),console.error(" start one with `sootsim server`, `sootsim electron`, or your project dev server"),process.exit(1)),await b(e,o)}async function O(e){let o=g(e,{commandTimeoutMs:1e3});try{return await o.listSims(),!0}catch{return!1}finally{o.close()}}async function P(e){let o=e.find((a,n)=>e[n-1]==="--area");if(o){let a=o.split(",").map(u=>Number(u.trim()));if(a.length!==4||a.some(u=>!Number.isFinite(u)))throw new Error(`--area expects x,y,w,h (got "${o}")`);let[n,c,s,i]=a;return{x:n,y:c,w:s,h:i}}let t=e.find((a,n)=>e[n-1]==="--id"),r=e.find((a,n)=>e[n-1]==="--text");return t||r?{__matcher:{id:t,text:r}}:null}async function T(e,o,t,r,a){let n=w({...e,commandTimeoutMs:1e4});try{let c=t,s=t?.__matcher;if(s){let d=await n.send({type:"evaluate",code:x(s)});if(!d)throw new Error(s.id?`no node with id "${s.id}"`:`no node matching text "${s.text}"`);c=d}let i=c?{x:c.x,y:c.y,w:c.w,h:c.h}:void 0,u={type:"screenshot"};a&&(u.layers=a),i&&(u.crop=i);let l=(await n.send(u)).replace(/^data:image\/png;base64,/,"");i&&console.log(` area: x=${i.x} y=${i.y} w=${i.w} h=${i.h}`),a&&console.log(` layers: ${a}`);let p=$(process.cwd(),o||"/tmp/sootsim-inspect.png");R(_(p),{recursive:!0});let f=Buffer.from(l,"base64");if(r){let d=await k(n);if(!d)throw new Error("could not read current device model from the target sim");let A=await S(f,d);v(p,A),console.log(` frame: ${d}`)}else v(p,f);console.log(` saved: ${p}`)}finally{n.close()}}async function k(e){let o=await y(e,"SootSim.bridges.settings.get")??{deviceModel:null},t=typeof o.deviceModel=="string"?o.deviceModel:null;return!t||!(t in m)?null:t}function M(e){let o=!1;for(let t of e)t==="--with-frame"&&(o=!0),t==="--no-frame"&&(o=!1);return o}function L(e){if(e.includes("--shell-only"))return"shell";if(e.includes("--no-shell"))return"tenant"}var N=new Set(["--help","-h","--verbose","-v","--with-frame","--no-frame","--no-shell","--shell-only","--gallery","--themes"]),B=new Set(["--output","--area","--id","--text","--url","--port","--timeout","--sim"]),C={"--rect":"--area","--crop":"--area","--region":"--area","--bounds":"--area","--box":"--area","--xywh":"--area","--out":"--output","-o":"--output","--file":"--output","--path":"--output","--testid":"--id","--test-id":"--id","--test_id":"--id"};function D(e){let o=[];for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("-")){if(B.has(r)){t++;continue}N.has(r)||o.push({flag:r,suggestion:C[r]})}}return o}function E(e){let o=e.find((t,r)=>e[r-1]==="--output");if(o)return o;for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("-")){B.has(r)&&t++;continue}return r}}async function b(e,o){let t=E(e)||"sootsim-screenshot.png",r=e.includes("--gallery"),a=e.find((s,i)=>e[i-1]==="--url")||`http://localhost:${o.port||5173}`,{chromium:n}=await import("playwright"),c=await n.launch({channel:"chrome",headless:!0});try{if(r)console.log(" capturing gallery..."),console.log(" (gallery mode not yet implemented)");else{let s=await c.newPage({viewport:{width:500,height:900}});await s.goto(a,{waitUntil:"networkidle"}),await s.waitForTimeout(2e3);let i=$(process.cwd(),t);R(_(i),{recursive:!0}),await s.screenshot({path:i}),console.log(` saved: ${i}`),await s.close()}}catch(s){console.error(` screenshot failed: ${s.message}`),process.exitCode=1}finally{await c.close()}}export{W as runScreenshot};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-TJEP4DBA.js";import"./chunk-6AP6LXVV.js";import"./chunk-BTHB3PMG.js";import"./chunk-DEQ7RED3.js";import"./chunk-EIQLQDKX.js";import"./chunk-G4VWDOWB.js";import"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";export{a as runSetupRepo};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-LRBMW2WC.js";import"./chunk-FXF2FHPI.js";import"./chunk-D4VEI6MI.js";export{a as settingsStore};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b}from"./chunk-DEQ7RED3.js";import"./chunk-EIQLQDKX.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.66 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b,c}from"./chunk-EMMX6RF7.js";import"./chunk-EEMGSSWY.js";import"./chunk-NQKBIKUZ.js";import"./chunk-HIN5TAAL.js";import"./chunk-DEQ7RED3.js";import"./chunk-EIQLQDKX.js";import"./chunk-G4VWDOWB.js";import"./chunk-VRV2X4X2.js";import"./chunk-7NYW73Q6.js";import"./chunk-BEQD2DSK.js";import"./chunk-D4VEI6MI.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};