sootsim 0.1.82 → 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 (138) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-3C6Z6YXA.js → agent-MQ7GLVIB.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-7Z4UFACX.js → agent-wrapper-7KAFDQCN.js} +2 -2
  4. package/dist-cli/chunks/{assert-XYBIZRDK.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-BVXP2GDN.js → chunk-277XAALA.js} +3 -3
  8. package/dist-cli/chunks/{chunk-PYDAVGCZ.js → chunk-2AWQ7OB2.js} +1 -1
  9. package/dist-cli/chunks/chunk-2OIBDYHW.js +1 -0
  10. package/dist-cli/chunks/{chunk-2JQIKL3B.js → chunk-2PY3UZVO.js} +2 -2
  11. package/dist-cli/chunks/{chunk-EJGEDUOC.js → chunk-4LS5MZAI.js} +3 -3
  12. package/dist-cli/chunks/{chunk-GI5MF6LP.js → chunk-572VSFNP.js} +1 -1
  13. package/dist-cli/chunks/{chunk-QPDWMYCA.js → chunk-5DJXZIFZ.js} +1 -1
  14. package/dist-cli/chunks/chunk-6BNLVMXA.js +1 -0
  15. package/dist-cli/chunks/{chunk-EX6IOT23.js → chunk-6NN2D4EJ.js} +2 -2
  16. package/dist-cli/chunks/{chunk-C7JOLDDQ.js → chunk-6TNANCQC.js} +2 -2
  17. package/dist-cli/chunks/chunk-6XD6CBJM.js +2 -0
  18. package/dist-cli/chunks/{chunk-IZ2OO47Y.js → chunk-6XZOEBTZ.js} +2 -2
  19. package/dist-cli/chunks/chunk-CHQTO426.js +1 -0
  20. package/dist-cli/chunks/{chunk-JVNGH5S7.js → chunk-CJY3AVI7.js} +1 -1
  21. package/dist-cli/chunks/{chunk-MQXYJTXM.js → chunk-CYV6Y6YV.js} +2 -2
  22. package/dist-cli/chunks/{chunk-QTJJHBCI.js → chunk-DM6WT7QM.js} +1 -1
  23. package/dist-cli/chunks/{chunk-Z6G5SDG7.js → chunk-DP7O5MHK.js} +2 -2
  24. package/dist-cli/chunks/{chunk-PO64TMRT.js → chunk-ECJBV65H.js} +2 -2
  25. package/dist-cli/chunks/{chunk-H6NBDJIO.js → chunk-F3HP444U.js} +1 -1
  26. package/dist-cli/chunks/{chunk-27HBWBE6.js → chunk-FAPYGVIU.js} +2 -2
  27. package/dist-cli/chunks/{chunk-2EFQQWEC.js → chunk-FJYT7XL2.js} +2 -2
  28. package/dist-cli/chunks/{chunk-BISEHRNE.js → chunk-FRM355UL.js} +2 -2
  29. package/dist-cli/chunks/{chunk-U3XCDQRH.js → chunk-HAWOAQAG.js} +3 -3
  30. package/dist-cli/chunks/{chunk-UOWBKSSI.js → chunk-HNWEELAE.js} +1 -1
  31. package/dist-cli/chunks/{chunk-DSYW2NOW.js → chunk-IBNRRAES.js} +2 -2
  32. package/dist-cli/chunks/{chunk-JUDJXJSE.js → chunk-IP3QJLRH.js} +1 -1
  33. package/dist-cli/chunks/{chunk-4QUAOBUB.js → chunk-J2GYISVJ.js} +2 -2
  34. package/dist-cli/chunks/{chunk-ZN2C7V5R.js → chunk-JHJNODXN.js} +2 -2
  35. package/dist-cli/chunks/{chunk-JUCV3VHM.js → chunk-JQ7ZXOXJ.js} +2 -2
  36. package/dist-cli/chunks/{chunk-7SCQEPXK.js → chunk-KASUZ5XV.js} +1 -1
  37. package/dist-cli/chunks/{chunk-Q4JNA5VO.js → chunk-NXATOWWF.js} +1 -1
  38. package/dist-cli/chunks/{chunk-WZLKUS54.js → chunk-OYMFNU3M.js} +1 -1
  39. package/dist-cli/chunks/{chunk-2W5C5J4O.js → chunk-PEHFE3LG.js} +2 -2
  40. package/dist-cli/chunks/{chunk-DCFGNIJC.js → chunk-PM5NVKLP.js} +2 -2
  41. package/dist-cli/chunks/{chunk-TR7NIFSL.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-D3SM2JYB.js → chunk-VMXWC2JO.js} +2 -2
  45. package/dist-cli/chunks/{chunk-M3OULYY3.js → chunk-WN7M3QON.js} +2 -2
  46. package/dist-cli/chunks/{chunk-M4ERVRM4.js → chunk-WTKTOL3C.js} +2 -2
  47. package/dist-cli/chunks/{chunk-7YLCK5HG.js → chunk-XFQL74PF.js} +2 -2
  48. package/dist-cli/chunks/chunk-Y2VJBRSP.js +119 -0
  49. package/dist-cli/chunks/{chunk-2XULSYS6.js → chunk-Y4BUVURT.js} +2 -2
  50. package/dist-cli/chunks/{chunk-O3AOQP3V.js → chunk-YUELRHGB.js} +2 -2
  51. package/dist-cli/chunks/cli-version-PWF6I6LY.js +2 -0
  52. package/dist-cli/chunks/{compat-2DVSCCR7.js → compat-QLLWBTS3.js} +3 -3
  53. package/dist-cli/chunks/{config-YDX4Q4XM.js → config-2DSLDCXV.js} +2 -2
  54. package/dist-cli/chunks/{control-EAK2OPGB.js → control-UIOXGYXU.js} +2 -2
  55. package/dist-cli/chunks/{cpu-profile-GU62WVZZ.js → cpu-profile-GEIKHCPC.js} +2 -2
  56. package/dist-cli/chunks/{daemon-V5NLDTSB.js → daemon-4EBUFN4D.js} +2 -2
  57. package/dist-cli/chunks/{debug-HAOCONNB.js → debug-WGD6XWOF.js} +3 -3
  58. package/dist-cli/chunks/demo-app-registry-G3BDOFWC.js +2 -0
  59. package/dist-cli/chunks/{detox-YLC4DLXB.js → detox-LNKGRZU6.js} +2 -2
  60. package/dist-cli/chunks/{device-ZQ4DN4H6.js → device-AYKXKVIQ.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-HNUO3Z5F.js → diagnose-TMXSDOOC.js} +2 -2
  62. package/dist-cli/chunks/drivers-IDQF34HP.js +2 -0
  63. package/dist-cli/chunks/{electron-ZAASAHSW.js → electron-QFPF7TBY.js} +3 -3
  64. package/dist-cli/chunks/flow-3JN3Y7RF.js +2 -0
  65. package/dist-cli/chunks/{hints-BA3GE5W5.js → hints-MXKRR4TG.js} +2 -2
  66. package/dist-cli/chunks/{home-paths-MQXRHBTW.js → home-paths-REMWQDAO.js} +2 -2
  67. package/dist-cli/chunks/{inspect-T4RMS5KX.js → inspect-XGSQNFV7.js} +3 -3
  68. package/dist-cli/chunks/install-2N3YOOSN.js +2 -0
  69. package/dist-cli/chunks/{install-desktop-MH26VONS.js → install-desktop-NQG3RZSA.js} +3 -3
  70. package/dist-cli/chunks/{keys-IELIDRGB.js → keys-5QZWXL3F.js} +2 -2
  71. package/dist-cli/chunks/{launch-VMT3OWOB.js → launch-SBXOZWKO.js} +3 -3
  72. package/dist-cli/chunks/{login-VZBANVLU.js → login-EACQXE24.js} +4 -4
  73. package/dist-cli/chunks/{logout-GWXBTQ4H.js → logout-IBQLMUML.js} +2 -2
  74. package/dist-cli/chunks/{maestro-JYHR4HFR.js → maestro-LFYXUX7O.js} +2 -2
  75. package/dist-cli/chunks/{preview-RPZ4UQ2B.js → preview-U4SBOEGQ.js} +2 -2
  76. package/dist-cli/chunks/{profile-7FLDF2AP.js → profile-GWS5ECMY.js} +2 -2
  77. package/dist-cli/chunks/{react-3RC4CNDZ.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-Z7I2KIRB.js → runtime-delivery-G7L6RVZ7.js} +2 -2
  81. package/dist-cli/chunks/{screenshot-GRCZ6AM4.js → screenshot-T2HBA3VI.js} +2 -2
  82. package/dist-cli/chunks/{screenshot-mode-E4YHXHH5.js → screenshot-mode-EG5HMIH3.js} +2 -2
  83. package/dist-cli/chunks/{screenshots-7SXMX2AY.js → screenshots-S52AFHTV.js} +2 -2
  84. package/dist-cli/chunks/{server-GDJ2TCRV.js → server-MFFVYUGG.js} +2 -2
  85. package/dist-cli/chunks/setup-repo-YOF7NV5D.js +2 -0
  86. package/dist-cli/chunks/{skills-62E7NDRC.js → skills-HQGWBS2O.js} +2 -2
  87. package/dist-cli/chunks/{start-Y7KR5ZQ3.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-IYMSUPVC.js → test-ZY3EF62K.js} +3 -3
  91. package/dist-cli/chunks/{three-mode-QKKXCCC2.js → three-mode-WSPKQCJ5.js} +2 -2
  92. package/dist-cli/chunks/{timeline-PF6NQ7RT.js → timeline-3XAB5EWZ.js} +2 -2
  93. package/dist-cli/chunks/{upgrade-CE2Y3TAN.js → upgrade-WNENPFM5.js} +2 -2
  94. package/dist-cli/chunks/upload-YLJ4RA73.js +2 -0
  95. package/dist-cli/chunks/{web-XEO3ZCPF.js → web-D2AOZY44.js} +2 -2
  96. package/dist-cli/chunks/{what-happened-372J7YF7.js → what-happened-F43KNSG6.js} +2 -2
  97. package/dist-cli/chunks/{whoami-B4E7KCT5.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 +1 -1
  110. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  112. package/dist-lib/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 +1 -1
  117. package/dist-lib/vite.cjs +1 -1
  118. package/package.json +1 -1
  119. package/dist-cli/chunks/auto-bootstrap-D2EQVL7R.js +0 -2
  120. package/dist-cli/chunks/beta-VHPXECZY.js +0 -2
  121. package/dist-cli/chunks/chunk-3OH4VCJA.js +0 -1
  122. package/dist-cli/chunks/chunk-45HLFQRI.js +0 -2
  123. package/dist-cli/chunks/chunk-BRDUKIZI.js +0 -119
  124. package/dist-cli/chunks/chunk-GADW2Q5S.js +0 -1
  125. package/dist-cli/chunks/chunk-HST43CVE.js +0 -2
  126. package/dist-cli/chunks/chunk-QJBQOGTK.js +0 -73
  127. package/dist-cli/chunks/chunk-V26REV7G.js +0 -1
  128. package/dist-cli/chunks/cli-version-WF7T6IKI.js +0 -2
  129. package/dist-cli/chunks/demo-app-registry-52A2MI72.js +0 -2
  130. package/dist-cli/chunks/drivers-B4QPIZ4B.js +0 -2
  131. package/dist-cli/chunks/flow-PFLHFNVM.js +0 -2
  132. package/dist-cli/chunks/install-ZCPEMK6U.js +0 -2
  133. package/dist-cli/chunks/record-CZ33G5FT.js +0 -70
  134. package/dist-cli/chunks/runtime-AZKHZHJ4.js +0 -2
  135. package/dist-cli/chunks/setup-repo-3Y2QAZRK.js +0 -2
  136. package/dist-cli/chunks/store-TDTFZMGA.js +0 -2
  137. package/dist-cli/chunks/telemetry-G3NIU5NP.js +0 -2
  138. package/dist-cli/chunks/upload-CLWFS7IL.js +0 -2
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- var t="http://localhost:5173/";export{t as a};
@@ -1,73 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as re,e as se,f as oe}from"./chunk-Z6G5SDG7.js";import{d as ee}from"./chunk-QPDWMYCA.js";import{a as Z,b as w}from"./chunk-D3SM2JYB.js";import{a as X}from"./chunk-2JQIKL3B.js";import{c as te,e as ne,g as v}from"./chunk-O3AOQP3V.js";import{createHash as Se}from"crypto";import{readFileSync as le}from"fs";import{gzipSync as ue}from"zlib";function ie(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}function V(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function Ue(e){let t=V(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${r.status}: ${s.slice(0,200)}`)}}async function Pe(e,t=8,r){let s=0,o=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;s<a;){let u=e[s++];await Ue(u),o++,r?.(o,a)}}))}function Re(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let u=r.get(a.urlhash);u&&o.push({url:a.putUrl,contentType:a.contentType,bytes:u})}return e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),o}function xe(e){return e.replace(/\/+$/,"")}var z=class extends Error{constructor(r,s,o,a=""){super(r);this.status=s;this.phase=o;this.responseText=a;this.name="PresignedUploadError"}};async function ae(e){let t=xe(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let s=V(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let h=await o.text().catch(()=>"");throw new z(`init failed: ${o.status} ${h.slice(0,200)}`,o.status,"init",h)}let a=await o.json(),u=Re(a,e.bundleBytes,e.filesByHash,e.extras);await Pe(u,e.concurrency??8,e.onPutProgress);let T=V(3e4,"finalize"),p;try{p=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:T.signal})}finally{T.cancel()}if(!p.ok){let h=await p.text().catch(()=>"");throw new z(`finalize failed: ${p.status} ${h.slice(0,200)}`,p.status,"finalize",h)}let O=await p.json();return{init:a,finalize:O}}function Oe(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}var ge=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",fe=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",q="http://localhost:3000";async function _e(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${q}/api/preview/upload/init`,{method:"OPTIONS"});if(t.ok||t.status===204||t.status===405)return q}catch{}return ge}function R(e){return e.replace(/\/$/,"")}function $e(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function ke(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Ee(e,t){return t?R(t):process.env.SOOTSIM_PREVIEW_ORIGIN?R(process.env.SOOTSIM_PREVIEW_ORIGIN):$e(e)?R(e):ke(e)?R(fe):R(e)}function ze(){console.log(`
3
- sootsim upload \u2014 publish the current bundle as a /preview/<id> link
4
-
5
- usage:
6
- sootsim upload [--origin <url>] [--public-origin <url>] [--events <path>] [--sim <sim>] [--open] [--assets-only]
7
-
8
- options:
9
- --origin <url> upload target (default: auto)
10
- prefers ${q} when available, otherwise
11
- falls back to ${ge}
12
- override with SOOTSIM_UPLOAD_ORIGIN env var
13
- --public-origin <url>
14
- public /preview link origin (default: ${fe}
15
- for prod uploads, upload origin for localhost/custom origins).
16
- override with SOOTSIM_PREVIEW_ORIGIN env var
17
- --events <path> path to a gzipped events .jsonl.gz file to attach
18
- --video <path> path to a webm/mp4/gif flow recording. embedded inline
19
- in the pr sticky comment served at
20
- /api/preview/flow-video?id=<share-id>
21
- --video-duration-ms <ms>
22
- duration hint for attached flow video
23
- --sim <sim> target a specific sim (see: sootsim list)
24
- --open open the resulting /preview/<id> url in the browser
25
- --assets-only drop API/JSON/HTML records before upload; keep images,
26
- fonts, css, js, and binary blobs. live-data demos hit
27
- the real network at replay time instead of serving
28
- recorded API snapshots
29
- -h, --help
30
-
31
- examples:
32
- sootsim upload
33
- sootsim upload --origin http://localhost:3000 --open
34
- sootsim upload --events ./my-session.jsonl.gz
35
- sootsim upload --video /tmp/soot-flow.webm
36
- `)}function S(e,t){let r=e.findIndex(o=>o===t);if(r<0)return;let s=e[r+1];return e.splice(r,2),s}function ce(e,t){let r=e.findIndex(s=>s===t);return r<0?!1:(e.splice(r,1),!0)}function de(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function pe(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function Ae(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function Le(e){try{let t=new URL(e);return t.searchParams.get("lazy")==="true"?(t.searchParams.set("lazy","false"),t.toString()):e}catch{return e}}async function He(e,t){let s=[];for(let o=0;o<t;o+=15e5){let a=Math.min(o+15e5,t),u=await v(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${o}, ${a})`);if(typeof u!="string")return null;s.push(u)}return s.join("")}function D(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function Qe(e,t){(e.includes("--help")||e.includes("-h"))&&(ze(),process.exit(0));let r=[...e],s=await _e(S(r,"--origin")),o=Ee(s,S(r,"--public-origin")),a=S(r,"--events"),u=S(r,"--video"),T=S(r,"--video-duration-ms"),p=ce(r,"--open"),O=ce(r,"--assets-only"),h=te(r,{stripBooleanFlags:[],stripValueFlags:[]}),y=ne(h),l,j=[],g=[],A=null;try{if(l=await v(y,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[i,C]=await Promise.all([v(y,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),v(y,`(async () => {
37
- const list = window.__sootsimListWorkerFetchRecorder
38
- return typeof list === 'function'
39
- ? await list(${JSON.stringify(n)})
40
- : []
41
- })()`)]);j=D([...i,...C]).filter(c=>{try{return!new URL(c.url).pathname.startsWith("/api/")}catch{return!0}});let x=await v(y,`(async () => {
42
- const rec = window.__sootsimPreviewRecorder
43
- const workerList = window.__sootsimListWorkerFetchRecorder
44
- return {
45
- main: rec?.list ? rec.list() : [],
46
- worker: typeof workerList === 'function' ? await workerList() : [],
47
- }
48
- })()`),U=(x?D([...x.main,...x.worker]):[]).filter(c=>{try{return new URL(c.url).origin!==n}catch{return!1}}),b=U.length>0?{count:U.length,totalBytes:U.reduce((c,P)=>c+(P.size||0),0)}:null;if(b&&b.count>0){console.log(` ${b.count} recorded cross-origin responses (${(b.totalBytes/1024).toFixed(1)} KiB)`);let c=await v(y,`(async () => {
49
- const rec = window.__sootsimPreviewRecorder
50
- const workerDump = window.__sootsimDumpWorkerFetchRecorder
51
- const bundleUrl = ${JSON.stringify(l.bundleUrl)}
52
- const keep = (r) => {
53
- try {
54
- const u = new URL(r.url)
55
- if (u.origin !== ${JSON.stringify(n)}) return true
56
- // bundle-origin api responses came from the rewritten
57
- // /__app-api proxy at record time (re-keyed by the
58
- // recorder's unwrap step). they need bodies attached the
59
- // same way as cross-origin records \u2014 direct re-fetch from
60
- // the dev server lacks the bundle's session cookies.
61
- if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
62
- return false
63
- } catch { return false }
64
- }
65
- return {
66
- main: rec?.dump ? rec.dump().filter(keep) : [],
67
- worker: typeof workerDump === 'function'
68
- ? (await workerDump()).filter(keep)
69
- : [],
70
- }
71
- })()`);if(g=D([...c.main,...c.worker]),O){let P=g.length;g=g.filter(W=>de(W.contentType));let N=b.totalBytes-g.reduce((W,Ie)=>W+(Ie.size||0),0);console.log(` --assets-only: kept ${g.length}/${P} records (dropped ${(N/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(A=await He(y,l.transformedBundle.byteLength))}finally{y.close()}l||(console.error(" could not read bundle snapshot \u2014 is sootsim running and is the bundle loaded?"),process.exit(2)),l.bundleUrl||(console.error(` no ?bundle= URL on the current sootsim tab.
72
- open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let d,L=!1;if(A!==null)d=new TextEncoder().encode(A),L=!0,console.log(` using post-transform bundle: ${(d.byteLength/1024).toFixed(1)} KiB`);else{let n=Le(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),d=await pe(n),console.log(` main bundle: ${(d.byteLength/1024).toFixed(1)} KiB`)}let _=j.filter(n=>n.url!==l.bundleUrl);O&&(_=_.filter(n=>de(n.contentType))),console.log(` fetching ${_.length} extra files\u2026`);let $=(await Promise.all(_.map(async n=>{try{let i=await pe(n.url);return{...n,bytes:i}}catch(i){return console.error(` warning: failed to re-fetch ${n.url}: ${i instanceof Error?i.message:i}`),null}}))).filter(n=>!!n),he=$.reduce((n,i)=>n+i.bytes.byteLength,0);console.log(` ${$.length} extra files: ${(he/1024).toFixed(1)} KiB`);let m;a&&(m=le(a));let f,k,G;if(u){if(f=le(u),k=u.endsWith(".mp4")?"video/mp4":u.endsWith(".gif")?"image/gif":"video/webm",T){let n=Number(T);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${T}`),await w(),process.exit(1)),G=Math.round(n)}console.log(` attaching flow video: ${(f.byteLength/1024).toFixed(1)} KiB (${k})`)}let B=re(),I=oe(B),ye=X();Z({event:"preview_upload_started",identity:{userId:B?.kind==="session"?ye?.user?.id??null:null,repoId:I?.repoId??null,installationId:I?.installationId??null},properties:{origin:s,hasAuth:!!B,authMode:B?.kind??"none",bundleBytes:d.byteLength,isTransformed:L,extraFiles:$.length,recordedFetches:g.length,hasEvents:!!m,hasVideo:!!f}}),B||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await w(),process.exit(1));let me=se(B),be=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),J=(n,i,C,x,Q,U,b,c)=>{let P=ie(U),N=P?ue(n):n;return{url:i,urlhash:C,method:x,bodyHash:Q,requestVaryHash:c,contentType:U,responseHeaders:b,bytes:N,encoding:P?"gzip":void 0}},H=[...$.map(n=>J(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...g.map(n=>J(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash))],F=ue(d),we=Se("sha256").update(d).digest("hex");console.log(` bundle raw=${(d.byteLength/1024).toFixed(1)} KiB gz=${(F.byteLength/1024).toFixed(1)} KiB`);let ve={contentHash:we,bundleSizeBytes:d.byteLength,bundleContentType:Ae(l.bundleUrl),bundleEncoding:"gzip",bundleOrigin:be,entry:l.entry,isTransformed:L,deviceSpec:l.deviceSpec,installationId:I?.installationId??void 0,repoId:I?.repoId,owner:I?.owner,repo:I?.repo,files:H.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,requestVaryHash:n.requestVaryHash,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:m?{sizeBytes:m.byteLength}:void 0,flowVideo:f&&k?{sizeBytes:f.byteLength,contentType:k,durationMs:G}:void 0},K=new Map;for(let n of H)K.set(n.urlhash,n.bytes);let Te=Date.now(),E=F.byteLength;for(let n of H)E+=n.bytes.byteLength;m&&(E+=m.byteLength),f&&(E+=f.byteLength);let Be=`${R(s)}/api/preview/upload/init`;console.log(` init: ${Be}`);let M;try{let n=await ae({originBase:s,initBody:ve,bundleBytes:F,filesByHash:K,extras:{eventsBytes:m,videoBytes:f},authHeader:me,concurrency:16});M=n.finalize;let i=1+n.init.files.length+(n.init.events?1:0)+(n.init.flowVideo?1:0);console.log(` PUT ${i} objects in ${Date.now()-Te}ms (${(E/1024).toFixed(1)} KiB)`)}catch(n){let i=n;i.phase==="init"&&i.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await w(),process.exit(1)),i.status===402&&(console.error(` ${Oe(i.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await w(),process.exit(1)),console.error(` ${i.message??`${i.phase??"upload"} failed: ${String(n)}`}`),await w(),process.exit(1)}let Y=`${o}${M.url}`;console.log(`
73
- stored ${M.filesStored??0} extra files`),console.log(` preview: ${Y}`),p&&await ee(Y),await w()}export{_e as a,Ee as b,Qe as c};
@@ -1 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-7SCQEPXK.js";import"./chunk-WZLKUS54.js";export{a as getCliVersion};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-2W5C5J4O.js";import"./chunk-WZLKUS54.js";export{a as APPS};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-3OH4VCJA.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-MQXYJTXM.js";import"./chunk-EX6IOT23.js";import"./chunk-GADW2Q5S.js";import"./chunk-2EFQQWEC.js";import"./chunk-QPDWMYCA.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.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,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as c,b as d,c as e,d as f}from"./chunk-BVXP2GDN.js";import"./chunk-BISEHRNE.js";import"./chunk-V26REV7G.js";import"./chunk-2XULSYS6.js";import"./chunk-QJBQOGTK.js";import"./chunk-Z6G5SDG7.js";import{d as a,e as b}from"./chunk-IZ2OO47Y.js";import"./chunk-ZN2C7V5R.js";import"./chunk-7YLCK5HG.js";import"./chunk-DSYW2NOW.js";import"./chunk-TR7NIFSL.js";import"./chunk-2W5C5J4O.js";import"./chunk-MQXYJTXM.js";import"./chunk-EX6IOT23.js";import"./chunk-GADW2Q5S.js";import"./chunk-2EFQQWEC.js";import"./chunk-QPDWMYCA.js";import"./chunk-PO64TMRT.js";import"./chunk-HST43CVE.js";import"./chunk-D3SM2JYB.js";import"./chunk-2JQIKL3B.js";import"./chunk-M3OULYY3.js";import"./chunk-Q4JNA5VO.js";import"./chunk-O3AOQP3V.js";import"./chunk-UOWBKSSI.js";import"./chunk-45HLFQRI.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as o}from"./chunk-4QUAOBUB.js";import"./chunk-H6NBDJIO.js";import"./chunk-EJGEDUOC.js";import"./chunk-D3SM2JYB.js";import"./chunk-2JQIKL3B.js";import"./chunk-O3AOQP3V.js";import"./chunk-UOWBKSSI.js";import"./chunk-45HLFQRI.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.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,70 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as P}from"./chunk-2XULSYS6.js";import"./chunk-QJBQOGTK.js";import{d as Y,f as Z}from"./chunk-Z6G5SDG7.js";import"./chunk-GADW2Q5S.js";import{d as K}from"./chunk-QPDWMYCA.js";import"./chunk-D3SM2JYB.js";import"./chunk-2JQIKL3B.js";import{c as h,e as b,f as Q}from"./chunk-O3AOQP3V.js";import{b as X}from"./chunk-UOWBKSSI.js";import"./chunk-45HLFQRI.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.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.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-U3XCDQRH.js";import"./chunk-O3AOQP3V.js";import"./chunk-UOWBKSSI.js";import"./chunk-45HLFQRI.js";import"./chunk-M4ERVRM4.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.js";export{a as runRuntime};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-4QUAOBUB.js";import"./chunk-H6NBDJIO.js";import"./chunk-EJGEDUOC.js";import"./chunk-D3SM2JYB.js";import"./chunk-2JQIKL3B.js";import"./chunk-O3AOQP3V.js";import"./chunk-UOWBKSSI.js";import"./chunk-45HLFQRI.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.js";export{a as runSetupRepo};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a}from"./chunk-M3OULYY3.js";import"./chunk-Q4JNA5VO.js";import"./chunk-WZLKUS54.js";export{a as settingsStore};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b}from"./chunk-D3SM2JYB.js";import"./chunk-2JQIKL3B.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,2 +0,0 @@
1
- /*! sootsim v0.1.82 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a,b,c}from"./chunk-QJBQOGTK.js";import"./chunk-Z6G5SDG7.js";import"./chunk-GADW2Q5S.js";import"./chunk-QPDWMYCA.js";import"./chunk-D3SM2JYB.js";import"./chunk-2JQIKL3B.js";import"./chunk-O3AOQP3V.js";import"./chunk-UOWBKSSI.js";import"./chunk-45HLFQRI.js";import"./chunk-PYDAVGCZ.js";import"./chunk-WZLKUS54.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};