sootsim 0.1.81 → 0.1.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-UJBKYOCB.js → agent-MQ7GLVIB.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-PQAB6NSJ.js → agent-wrapper-7KAFDQCN.js} +2 -2
  4. package/dist-cli/chunks/{assert-KCFN2HRU.js → assert-TV46GUNU.js} +2 -2
  5. package/dist-cli/chunks/auto-bootstrap-FQS4ZD2K.js +2 -0
  6. package/dist-cli/chunks/beta-VG7CDY2U.js +2 -0
  7. package/dist-cli/chunks/{chunk-MMHH4PMP.js → chunk-277XAALA.js} +3 -3
  8. package/dist-cli/chunks/{chunk-XZCOVJSW.js → chunk-2AWQ7OB2.js} +1 -1
  9. package/dist-cli/chunks/chunk-2OIBDYHW.js +1 -0
  10. package/dist-cli/chunks/{chunk-G7OOSA3T.js → chunk-2PY3UZVO.js} +2 -2
  11. package/dist-cli/chunks/{chunk-EQXJOORV.js → chunk-4LS5MZAI.js} +3 -3
  12. package/dist-cli/chunks/{chunk-XCV5NWEP.js → chunk-572VSFNP.js} +1 -1
  13. package/dist-cli/chunks/{chunk-J4CA4F74.js → chunk-5DJXZIFZ.js} +1 -1
  14. package/dist-cli/chunks/chunk-6BNLVMXA.js +1 -0
  15. package/dist-cli/chunks/{chunk-M2T6GWZU.js → chunk-6NN2D4EJ.js} +2 -2
  16. package/dist-cli/chunks/{chunk-GFLMBF36.js → chunk-6TNANCQC.js} +2 -2
  17. package/dist-cli/chunks/chunk-6XD6CBJM.js +2 -0
  18. package/dist-cli/chunks/{chunk-3ITP5DCL.js → chunk-6XZOEBTZ.js} +2 -2
  19. package/dist-cli/chunks/chunk-CHQTO426.js +1 -0
  20. package/dist-cli/chunks/{chunk-VY2IT7TQ.js → chunk-CJY3AVI7.js} +1 -1
  21. package/dist-cli/chunks/{chunk-II5KVWDI.js → chunk-CYV6Y6YV.js} +53 -15
  22. package/dist-cli/chunks/{chunk-PC4TGQYJ.js → chunk-DM6WT7QM.js} +1 -1
  23. package/dist-cli/chunks/{chunk-25TQ7F5P.js → chunk-DP7O5MHK.js} +2 -2
  24. package/dist-cli/chunks/{chunk-P5KW7CBY.js → chunk-ECJBV65H.js} +2 -2
  25. package/dist-cli/chunks/{chunk-ZK7QY7ST.js → chunk-F3HP444U.js} +1 -1
  26. package/dist-cli/chunks/{chunk-Q6TWLIUU.js → chunk-FAPYGVIU.js} +2 -2
  27. package/dist-cli/chunks/{chunk-YBA4MUAF.js → chunk-FJYT7XL2.js} +2 -2
  28. package/dist-cli/chunks/{chunk-ZRGZM4C4.js → chunk-FRM355UL.js} +2 -2
  29. package/dist-cli/chunks/{chunk-Q6RYI3ND.js → chunk-HAWOAQAG.js} +3 -3
  30. package/dist-cli/chunks/{chunk-BOFDWCQB.js → chunk-HNWEELAE.js} +1 -1
  31. package/dist-cli/chunks/{chunk-ADIYZB6J.js → chunk-IBNRRAES.js} +2 -2
  32. package/dist-cli/chunks/{chunk-JPP34M72.js → chunk-IP3QJLRH.js} +1 -1
  33. package/dist-cli/chunks/{chunk-PB4HZQET.js → chunk-J2GYISVJ.js} +2 -2
  34. package/dist-cli/chunks/{chunk-YRSS436D.js → chunk-JHJNODXN.js} +2 -2
  35. package/dist-cli/chunks/{chunk-BAPYWOQJ.js → chunk-JQ7ZXOXJ.js} +2 -2
  36. package/dist-cli/chunks/{chunk-GJ645NI4.js → chunk-KASUZ5XV.js} +1 -1
  37. package/dist-cli/chunks/{chunk-T63O6JUH.js → chunk-NXATOWWF.js} +1 -1
  38. package/dist-cli/chunks/{chunk-WB5NVHYB.js → chunk-OYMFNU3M.js} +1 -1
  39. package/dist-cli/chunks/{chunk-M7T4E7GA.js → chunk-PEHFE3LG.js} +2 -2
  40. package/dist-cli/chunks/{chunk-2IPRONLT.js → chunk-PM5NVKLP.js} +2 -2
  41. package/dist-cli/chunks/{chunk-GQTUQIQ4.js → chunk-RH4F2TF7.js} +1 -1
  42. package/dist-cli/chunks/chunk-RXH2SLKF.js +2 -0
  43. package/dist-cli/chunks/chunk-UXQWC5ZR.js +79 -0
  44. package/dist-cli/chunks/{chunk-Q3IYWRN6.js → chunk-VMXWC2JO.js} +2 -2
  45. package/dist-cli/chunks/{chunk-Q3JHBOX2.js → chunk-WN7M3QON.js} +2 -2
  46. package/dist-cli/chunks/{chunk-IWIHTU2Q.js → chunk-WTKTOL3C.js} +2 -2
  47. package/dist-cli/chunks/chunk-XFQL74PF.js +5 -0
  48. package/dist-cli/chunks/chunk-Y2VJBRSP.js +119 -0
  49. package/dist-cli/chunks/{chunk-CIYIOZPN.js → chunk-Y4BUVURT.js} +2 -2
  50. package/dist-cli/chunks/{chunk-GLWFGEVP.js → chunk-YUELRHGB.js} +2 -2
  51. package/dist-cli/chunks/cli-version-PWF6I6LY.js +2 -0
  52. package/dist-cli/chunks/{compat-WAEGXXEW.js → compat-QLLWBTS3.js} +3 -3
  53. package/dist-cli/chunks/{config-3QXYGCBQ.js → config-2DSLDCXV.js} +2 -2
  54. package/dist-cli/chunks/{control-WZZJAPR3.js → control-UIOXGYXU.js} +2 -2
  55. package/dist-cli/chunks/{cpu-profile-KO62GNV5.js → cpu-profile-GEIKHCPC.js} +2 -2
  56. package/dist-cli/chunks/daemon-4EBUFN4D.js +66 -0
  57. package/dist-cli/chunks/{debug-FAOUHIAG.js → debug-WGD6XWOF.js} +3 -3
  58. package/dist-cli/chunks/demo-app-registry-G3BDOFWC.js +2 -0
  59. package/dist-cli/chunks/{detox-Q3W7JS3H.js → detox-LNKGRZU6.js} +2 -2
  60. package/dist-cli/chunks/{device-42VLA5W5.js → device-AYKXKVIQ.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-ZNWJM4X6.js → diagnose-TMXSDOOC.js} +2 -2
  62. package/dist-cli/chunks/drivers-IDQF34HP.js +2 -0
  63. package/dist-cli/chunks/{electron-PLULBHHF.js → electron-QFPF7TBY.js} +3 -3
  64. package/dist-cli/chunks/flow-3JN3Y7RF.js +2 -0
  65. package/dist-cli/chunks/{hints-PP6G2PN7.js → hints-MXKRR4TG.js} +2 -2
  66. package/dist-cli/chunks/{home-paths-L5MBP4Z6.js → home-paths-REMWQDAO.js} +2 -2
  67. package/dist-cli/chunks/{inspect-NXJZOWDT.js → inspect-XGSQNFV7.js} +3 -3
  68. package/dist-cli/chunks/install-2N3YOOSN.js +2 -0
  69. package/dist-cli/chunks/install-desktop-NQG3RZSA.js +23 -0
  70. package/dist-cli/chunks/{keys-YPWK4LKD.js → keys-5QZWXL3F.js} +2 -2
  71. package/dist-cli/chunks/{launch-D3SSPM33.js → launch-SBXOZWKO.js} +3 -3
  72. package/dist-cli/chunks/login-EACQXE24.js +26 -0
  73. package/dist-cli/chunks/{logout-FZRRJKOJ.js → logout-IBQLMUML.js} +2 -2
  74. package/dist-cli/chunks/{maestro-DU2TXXRN.js → maestro-LFYXUX7O.js} +2 -2
  75. package/dist-cli/chunks/{preview-2UYWMTZ6.js → preview-U4SBOEGQ.js} +2 -2
  76. package/dist-cli/chunks/{profile-A566ICHG.js → profile-GWS5ECMY.js} +2 -2
  77. package/dist-cli/chunks/{react-2JDBFLZ6.js → react-QDHLMVYL.js} +2 -2
  78. package/dist-cli/chunks/record-BUEUWPDI.js +70 -0
  79. package/dist-cli/chunks/runtime-PVB4VGUH.js +2 -0
  80. package/dist-cli/chunks/{runtime-delivery-NCGNIHC3.js → runtime-delivery-G7L6RVZ7.js} +2 -2
  81. package/dist-cli/chunks/{screenshot-LTDSU7XO.js → screenshot-T2HBA3VI.js} +2 -2
  82. package/dist-cli/chunks/{screenshot-mode-QFNEHHTX.js → screenshot-mode-EG5HMIH3.js} +2 -2
  83. package/dist-cli/chunks/{screenshots-ODDRHWKW.js → screenshots-S52AFHTV.js} +2 -2
  84. package/dist-cli/chunks/{server-AB6B475P.js → server-MFFVYUGG.js} +2 -2
  85. package/dist-cli/chunks/setup-repo-YOF7NV5D.js +2 -0
  86. package/dist-cli/chunks/{skills-VT2LYFIC.js → skills-HQGWBS2O.js} +2 -2
  87. package/dist-cli/chunks/{start-TLBKZDB6.js → start-E3DRYY7W.js} +4 -4
  88. package/dist-cli/chunks/store-MAI6D3UO.js +2 -0
  89. package/dist-cli/chunks/telemetry-RCQKCJTH.js +2 -0
  90. package/dist-cli/chunks/{test-GKMCKD65.js → test-ZY3EF62K.js} +3 -3
  91. package/dist-cli/chunks/{three-mode-6KODH5Y6.js → three-mode-WSPKQCJ5.js} +2 -2
  92. package/dist-cli/chunks/{timeline-U3IY6NK5.js → timeline-3XAB5EWZ.js} +2 -2
  93. package/dist-cli/chunks/{upgrade-W24MFLUR.js → upgrade-WNENPFM5.js} +2 -2
  94. package/dist-cli/chunks/upload-YLJ4RA73.js +2 -0
  95. package/dist-cli/chunks/{web-VT7LAGMK.js → web-D2AOZY44.js} +2 -2
  96. package/dist-cli/chunks/{what-happened-4DHTJYYO.js → what-happened-F43KNSG6.js} +2 -2
  97. package/dist-cli/chunks/{whoami-CM775PTS.js → whoami-T22VBR7C.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 +1 -1
  108. package/dist-lib/home-paths.cjs +1 -1
  109. package/dist-lib/host/bridge-host.cjs +21 -21
  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 +21 -21
  117. package/dist-lib/vite.cjs +1 -1
  118. package/package.json +1 -1
  119. package/dist-cli/chunks/auto-bootstrap-MAZA7QWP.js +0 -2
  120. package/dist-cli/chunks/beta-KO7G2QIW.js +0 -2
  121. package/dist-cli/chunks/chunk-2UBJ3CHB.js +0 -2
  122. package/dist-cli/chunks/chunk-APWBBUFX.js +0 -1
  123. package/dist-cli/chunks/chunk-BXC7K7RO.js +0 -1
  124. package/dist-cli/chunks/chunk-JPSDR2TX.js +0 -5
  125. package/dist-cli/chunks/chunk-N55OF7E4.js +0 -73
  126. package/dist-cli/chunks/chunk-ST2OBG6U.js +0 -1
  127. package/dist-cli/chunks/chunk-T4B5WH56.js +0 -119
  128. package/dist-cli/chunks/chunk-TRDL6X6C.js +0 -2
  129. package/dist-cli/chunks/cli-version-IHSZB57Q.js +0 -2
  130. package/dist-cli/chunks/daemon-ZYFVG5SF.js +0 -65
  131. package/dist-cli/chunks/demo-app-registry-2S3DCN2E.js +0 -2
  132. package/dist-cli/chunks/drivers-IESTOEEK.js +0 -2
  133. package/dist-cli/chunks/flow-OM3O5RPO.js +0 -2
  134. package/dist-cli/chunks/install-QFV6HS2J.js +0 -2
  135. package/dist-cli/chunks/install-desktop-44KTEOAW.js +0 -23
  136. package/dist-cli/chunks/login-3Q2JNIX7.js +0 -26
  137. package/dist-cli/chunks/record-4VJZKPDS.js +0 -70
  138. package/dist-cli/chunks/runtime-V7KTEZGZ.js +0 -2
  139. package/dist-cli/chunks/setup-repo-KKZWDQDU.js +0 -2
  140. package/dist-cli/chunks/store-J26S54GN.js +0 -2
  141. package/dist-cli/chunks/telemetry-KD6452TY.js +0 -2
  142. package/dist-cli/chunks/upload-3CEQY7UP.js +0 -2
@@ -1,70 +0,0 @@
1
- /*! sootsim v0.1.81 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as P}from"./chunk-CIYIOZPN.js";import"./chunk-N55OF7E4.js";import{d as Y,f as Z}from"./chunk-25TQ7F5P.js";import"./chunk-BXC7K7RO.js";import{d as K}from"./chunk-J4CA4F74.js";import"./chunk-Q3IYWRN6.js";import"./chunk-G7OOSA3T.js";import{c as h,e as b,f as Q}from"./chunk-GLWFGEVP.js";import{b as X}from"./chunk-BOFDWCQB.js";import"./chunk-TRDL6X6C.js";import"./chunk-XZCOVJSW.js";import"./chunk-WB5NVHYB.js";import{existsSync as pe,mkdirSync as O,readdirSync as ge,readFileSync as we,rmSync as z,writeFileSync as I}from"fs";import{homedir as he,tmpdir as be}from"os";import{dirname as W,extname as oe,join as C,resolve as ve}from"path";var ee=24e4,ye=3e4;async function N(e,r,o,i){let t=Math.max(2e4,i+ye);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 Se=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin"]),$e=new Set(["start","stop","cancel","status","prelude-start"]);function Re(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){Se.has(o)&&r++;continue}return $e.has(o)?{name:o,index:r}:null}return null}async function Le(e,r){let o=Re(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ee(d,r);return}if(o.name==="prelude-start"){await Me(d,r);return}if(o.name==="stop"){await Ae(d,r);return}if(o.name==="cancel"){await Ce(d,r);return}await Ie(d,r);return}let i=h(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin"]}),t=ne(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 l=u(e,"--output"),a=Number(u(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let c=1800;a>c&&(console.error(` invalid --duration "${u(e,"--duration")}" \u2014 exceeds the ${c}s (30m) maximum`),process.exit(1));let f=Number(u(e,"--fps")??"30"),v=u(e,"--frames");if(v!==void 0){let d=Number(v);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${v}" \u2014 expected a positive integer count`),process.exit(1))}let j=e.includes("--open"),H=u(e,"--max-width")?Number(u(e,"--max-width")):void 0,p=Math.max(100,Math.round(a*1e3)),q=u(e,"--origin");if(t==="live"||t==="combined"){l&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:q,allowGitHubAuth:!0});let d=b({...i,commandTimeoutMs:6e4});try{await G(d),await se(d,t),t==="combined"&&await B(d),await ae(d,q);let R=await de(d,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 ${a}s`),await new Promise(x=>setTimeout(x,p)),await ce(d);let _=await le(d);ue(_,j,t)}finally{d.close()}return}let A=v?Number(v):null,S=ke(s,l,A);j&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let w=b({...i,commandTimeoutMs:6e4});try{if(await re(w),await B(w),S==="png"){let $=A??10,g=U(l,`sootsim-frames-${M()}`);l&&oe(l)&&console.log(` note: --frames writes multiple pngs, so --output "${l}" is a directory \u2014 frame-NNN.png files land inside it`),O(g,{recursive:!0});for(let m of ge(g))/^frame-\d+\.png$/.test(m)&&z(C(g,m),{force:!0});console.log(` sampling ${$} frames over ${a}s \u2192 ${g}`);let y=await w.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${$}, 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 me=Date.now()+Math.max(5e3,p),F=null;for(;;){let m=await w.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()>=me&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(T=>setTimeout(T,100))}F.forEach((m,T)=>{let fe=`${g}/frame-${String(T+1).padStart(3,"0")}.png`;I(fe,Buffer.from(m.data,"base64"))}),console.log(` saved ${F.length} frames`);return}if(S==="gif"){let $=A??Math.max(10,Math.round(a*f/3)),g=U(l,`sootsim-${M()}.gif`);O(W(g),{recursive:!0}),console.log(` encoding gif: ${$} frames over ${a}s \u2192 ${g}`);let y=await N(w,`window.__sootsimRecorder.captureGif({ frames: ${$}, durationMs: ${p}${H?`, maxWidth: ${H}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",p);y||(console.error(" gif capture returned no frames"),process.exit(1)),I(g,Buffer.from(y.data,"base64")),console.log(` saved: ${g} (${D(y.size)})`);return}let d=U(l,`sootsim-${M()}.${S}`);O(W(d),{recursive:!0});let R={format:S,fps:f,durationMs:p};n&&(R.layers=n);let _=await N(w,`window.__sootsimRecorder.start(${JSON.stringify(R)})`,`${S} 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 ${S} for ${a}s \u2192 ${d}`),await new Promise($=>setTimeout($,p));let x=await N(w,"window.__sootsimRecorder.stop()",`${S} 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 te(w,d),console.log(` saved: ${d} (${D(x.size)})`)}finally{w.close()}}var xe=6e3;async function J(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:xe})}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 re(e){await J(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
8
- would be throttled to ~1fps and produce a frozen-looking file.
9
- bring the chrome window to the foreground (un-minimize / switch to
10
- its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function te(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function u(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function _e(e){if(!e)return;let r=oe(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function ke(e,r,o){return e||(o!=null?"png":_e(r)??"webm")}function M(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Oe(){let e=C(he(),".sootsim","recordings");return O(e,{recursive:!0}),e}function U(e,r){return e?ve(process.cwd(),e):C(Oe(),r)}function D(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function ne(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 L(){return C(be(),`sootsim-recording-${X()}.json`)}function E(){let e=L();if(!pe(e))return null;try{return{mode:"video",...JSON.parse(we(e,"utf8"))}}catch{return z(e,{force:!0}),null}}function Be(e){I(L(),JSON.stringify(e,null,2))}function k(){z(L(),{force:!0})}function V(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
11
- requested sim ${e}. record state is global (not per-sim);
12
- this command acts on that session regardless of --sim.`)}async function Ee(e,r){let o=E();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=h(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only"],stripValueFlags:["--mode","--fps","--format","--max-width","--origin"]}),t=ne(u(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=u(e,"--format"),l=s==="mp4"?"mp4":"webm";s&&l!==s&&(console.error(` record start only supports webm or mp4 (got: ${s}). for gif/png use atomic mode: sootsim record --format ${s} --duration <s>`),process.exit(1));let a=Number(u(e,"--fps")??"30"),c=b({...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 P("record",{originOverride:u(e,"--origin"),allowGitHubAuth:!0}),await G(c),await se(c,t),t==="combined"&&await B(c),await ae(c,u(e,"--origin"));let f=await de(c,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 re(c),await B(c);let f={format:l,fps:a};n&&(f.layers=n);let v=await c.send({type:"evaluate",code:`window.__sootsimRecorder.start(${JSON.stringify(f)})`});v.ok||(console.error(` start failed: ${v.error??"unknown error"}`),process.exit(1))}Be({simId:i.simId??null,mode:t,format:l,fps:a,layers:n,startedAt:new Date().toISOString()}),console.log(t==="video"?` recording ${l} @ ${a}fps${n?` (${n})`:""} \u2014 run \`sootsim record stop --output <path>\` when done`:` recording ${t} \u2014 run \`sootsim record stop\` when done (add --open to launch the preview URL)`)}finally{c.close()}}async function Me(e,r){let o=E();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=h(e,{port:r.port,stripBooleanFlags:[],stripValueFlags:["--origin"]}),t=b({...i,commandTimeoutMs:15e3});try{if(await G(t),await B(t),!await t.send({type:"evaluate",code:`(() => {
13
- const start = window.SootSim?.bridges?.startRecordingPrelude
14
- if (typeof start !== 'function') return false
15
- return Promise.resolve(start()).then((value) => value === true)
16
- })()`})){let s=await t.send({type:"evaluate",code:`(() => {
17
- const getError = window.SootSim?.bridges?.getRecordingStartError
18
- return typeof getError === 'function' ? getError() : null
19
- })()`}).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 ie(e){try{let r=await e.send({type:"evaluate",code:`(() => {
20
- const store = window.SootSim?.bridges?.getRecordingState?.();
21
- const headless = window.__sootsimRecorder?.state?.();
22
- const eventRecorder = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder;
23
- const eventRecording =
24
- typeof eventRecorder?.isRecording === 'function'
25
- ? eventRecorder.isRecording() === true
26
- : false;
27
- return { store: store ? store.state : undefined, headless, eventRecording };
28
- })()`});return r?r.store==="recording"||r.headless==="recording"?"recording":r.store==="processing"?"processing":r.eventRecording?"prelude":r.store==="idle"||r.headless==="idle"?"idle":null:null}catch{return null}}async function Ue(e){let r=await e.send({type:"evaluate",code:`(() => {
29
- const store = window.SootSim?.bridges?.getRecordingState?.();
30
- const eventRecorder = window.SootSim?.bridges?.eventRecorder ?? window.__sootsimEventRecorder;
31
- const hadStoreRecording = store && store.state !== 'idle';
32
- const hadEventRecording =
33
- typeof eventRecorder?.isRecording === 'function'
34
- ? eventRecorder.isRecording() === true
35
- : false;
36
- const cancel = window.SootSim?.bridges?.cancelRecording;
37
- if (typeof cancel === 'function') cancel();
38
- return Boolean(hadStoreRecording || hadEventRecording);
39
- })()`}).catch(()=>!1),o=await e.send({type:"evaluate",code:`(async () => {
40
- const r = window.__sootsimRecorder;
41
- if (r && typeof r.forceRelease === 'function') return await r.forceRelease();
42
- return false;
43
- })()`}).catch(()=>!1);return{store:r,headless:o}}async function Ie(e,r){let o=E();if(o){V(h(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=h(e,{port:r.port}),t=b({...i,commandTimeoutMs:8e3});try{let n=await ie(t);if(n==="recording"||n==="processing"||n==="prelude"){if(n==="prelude"){console.log(" a recording preview prelude is active. hidden setup is being\n captured for the next live/combined preview recording. finish\n it with `sootsim record start --mode combined`, or discard it\n with `sootsim record cancel`.");return}console.log(` a recording is in progress (engine state: ${n}), but not via
44
- \`record start\` \u2014 it was started by an atomic \`record --duration\`
45
- run or the in-browser record button, which own their own lifecycle.
46
- if that controlling run is still alive it will finish on its own
47
- (atomic \`--mode video/gif/png\` writes a local file from that
48
- process; live/combined upload to /preview/<id>). if the run was
49
- killed, the recording is abandoned and will NOT finish \u2014 reclaim
50
- it now with \`sootsim record cancel\`, or it auto-reclaims when the
51
- abandoned capture's deadline lapses.`)}else console.log(" no recording in progress")}finally{t.close()}}async function Ce(e,r){let o=E();if(!o){let s=h(e,{port:r.port}),l=b({...s,commandTimeoutMs:8e3});try{let a=await ie(l);if(a==="recording"||a==="processing"||a==="prelude"){let c=await Ue(l);c.store&&a==="prelude"?console.log(" recording preview prelude cancelled"):c.store||c.headless?console.log(" reclaimed an abandoned recording (started by an atomic\n `record --duration` run or the record button whose owner is\n gone). the recorder is idle again \u2014 live/combined can start."):console.log(" a recording is in progress and still owned by a live atomic\n `record --duration` run or the in-browser record button \u2014 it\n will finish on its own and nothing was reclaimed.")}else console.log(" no recording in progress")}finally{l.close()}return}let i=h(e,{port:r.port});V(i.simId,o);let t=o.simId??i.simId??void 0,n=b({...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 Ae(e,r){let o=E();o||(console.error(" no recording in progress. start one with `sootsim record start`."),process.exit(1));let i=h(e,{port:r.port,stripBooleanFlags:["--open"],stripValueFlags:["--output"]});V(i.simId,o);let t=o.simId??i.simId??void 0,n=e.includes("--open"),s=b({...i,simId:t,commandTimeoutMs:6e4});try{if(o.mode==="live"||o.mode==="combined"){await ce(s);let f=await le(s);k(),ue(f,n,o.mode);return}let l=u(e,"--output"),a=U(l,`sootsim-${M()}.${o.format}`);O(W(a),{recursive:!0});let c=await s.send({type:"evaluate",code:"window.__sootsimRecorder.stop()"});c.ok||(console.error(` stop failed: ${c.error??"unknown error"}`),k(),process.exit(1)),c.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),k(),process.exit(1)),await te(s,a),k(),console.log(` saved: ${a} (${D(c.size)})`)}finally{s.close()}}async function G(e){await J(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 se(e,r){await J(e,`(() => {
52
- const fn = window.__sootsimCaptureBundle
53
- if (typeof fn !== 'function') return false
54
- const snap = fn()
55
- return !!(snap && snap.bundleUrl)
56
- })()`)||(console.error(` --mode ${r} needs a guest app bundle to upload to /preview/<id>,
57
- but this sim has no bundle loaded (a built-in shell screen like
58
- photos/settings/home has none). open a metro/guest app first, or
59
- use \`--mode video\` for a local screen recording with no upload.`),process.exit(1))}async function ae(e,r){let o=Y();if(!o)return;let i=o.kind==="api-key"?o.secret:o.token,t=o.kind==="github"?Z(o):null,n=r?r.replace(/\/$/,""):null;await e.send({type:"evaluate",code:`(() => {
60
- const set = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.setSession
61
- if (typeof set !== 'function') return false
62
- set({ token: ${JSON.stringify(i)}, user: null })
63
- window.__sootsimPreviewUploadIdentity = ${JSON.stringify(t)}
64
- window.__sootsimPreviewUseInjectedBearer = true
65
- ${n?`window.__sootsimUploadOrigin = ${JSON.stringify(n)}`:"delete window.__sootsimUploadOrigin"}
66
- return true
67
- })()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`sootsim open --new`); if it persists, update sootsim."),process.exit(1))}async function de(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 ce(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function le(e){let r=Date.now()+ee;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 ${ee/1e3}s`}}function ue(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
68
- replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
69
- 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
70
- to replay and will boot a fresh interactive session instead.`),r&&K(e.previewUrl)}export{_e as extToFormat,ke as resolveFormat,Le as runRecord,u as valueOf};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.81 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-Q6RYI3ND.js";import"./chunk-GLWFGEVP.js";import"./chunk-BOFDWCQB.js";import"./chunk-TRDL6X6C.js";import"./chunk-IWIHTU2Q.js";import"./chunk-XZCOVJSW.js";import"./chunk-WB5NVHYB.js";export{a as runRuntime};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.81 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-PB4HZQET.js";import"./chunk-ZK7QY7ST.js";import"./chunk-EQXJOORV.js";import"./chunk-Q3IYWRN6.js";import"./chunk-G7OOSA3T.js";import"./chunk-GLWFGEVP.js";import"./chunk-BOFDWCQB.js";import"./chunk-TRDL6X6C.js";import"./chunk-XZCOVJSW.js";import"./chunk-WB5NVHYB.js";export{a as runSetupRepo};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.81 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-Q3JHBOX2.js";import"./chunk-T63O6JUH.js";import"./chunk-WB5NVHYB.js";export{a as settingsStore};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.81 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b}from"./chunk-Q3IYWRN6.js";import"./chunk-G7OOSA3T.js";import"./chunk-XZCOVJSW.js";import"./chunk-WB5NVHYB.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.81 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b,c}from"./chunk-N55OF7E4.js";import"./chunk-25TQ7F5P.js";import"./chunk-BXC7K7RO.js";import"./chunk-J4CA4F74.js";import"./chunk-Q3IYWRN6.js";import"./chunk-G7OOSA3T.js";import"./chunk-GLWFGEVP.js";import"./chunk-BOFDWCQB.js";import"./chunk-TRDL6X6C.js";import"./chunk-XZCOVJSW.js";import"./chunk-WB5NVHYB.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};