sootsim 0.1.301 → 0.1.303

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 (156) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-DWXNDXDJ.js → agent-NKFJH2RJ.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-DTPQFEMR.js → agent-wrapper-WEA3TGWF.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-MKW6UNBO.js → app-fonts-L5JXOKIF.js} +2 -2
  5. package/dist-cli/chunks/{assert-GN4KR5TI.js → assert-ZG65AUNK.js} +2 -2
  6. package/dist-cli/chunks/{auth-HLOV4GZN.js → auth-RMFBZQIW.js} +2 -2
  7. package/dist-cli/chunks/{beta-DP7K4JVJ.js → beta-RR6TCDCJ.js} +2 -2
  8. package/dist-cli/chunks/{camera-SH6FT7ZA.js → camera-JWOAFE6U.js} +2 -2
  9. package/dist-cli/chunks/{chunk-4PKUB2QX.js → chunk-2LMSJNAH.js} +2 -2
  10. package/dist-cli/chunks/{chunk-WKSX2VHB.js → chunk-3I647BPF.js} +1 -1
  11. package/dist-cli/chunks/{chunk-HEPIUAFX.js → chunk-3YYCMGOR.js} +3 -3
  12. package/dist-cli/chunks/{chunk-SOBEJUH4.js → chunk-4F7VUXKY.js} +2 -2
  13. package/dist-cli/chunks/{chunk-KYGB26L4.js → chunk-5NHCBHYZ.js} +2 -2
  14. package/dist-cli/chunks/{chunk-4MNKKMYG.js → chunk-657GXEAT.js} +2 -2
  15. package/dist-cli/chunks/{chunk-VXRYV6G6.js → chunk-6Q5PHS4F.js} +1 -1
  16. package/dist-cli/chunks/{chunk-M33LQWC2.js → chunk-APBN2B6C.js} +1 -1
  17. package/dist-cli/chunks/{chunk-NWM62KI3.js → chunk-ATRV3MGB.js} +2 -2
  18. package/dist-cli/chunks/{chunk-KEFBMDYK.js → chunk-AWE4ZKR3.js} +1 -1
  19. package/dist-cli/chunks/{chunk-MKQNHDDF.js → chunk-AXDVKOGM.js} +2 -2
  20. package/dist-cli/chunks/{chunk-V2SZPQJF.js → chunk-BDZ7GDAA.js} +1 -1
  21. package/dist-cli/chunks/{chunk-IRNRCBRW.js → chunk-BQLQCPXE.js} +1 -1
  22. package/dist-cli/chunks/{chunk-FVNWUEK2.js → chunk-BYCMWKNX.js} +3 -3
  23. package/dist-cli/chunks/{chunk-STF4UH5I.js → chunk-CQEK4J75.js} +2 -2
  24. package/dist-cli/chunks/{chunk-7RU45W2O.js → chunk-CVRPU5KX.js} +1 -1
  25. package/dist-cli/chunks/{chunk-QNQP3WYV.js → chunk-DTQ4XGJP.js} +3 -3
  26. package/dist-cli/chunks/chunk-E3POCZJT.js +4 -0
  27. package/dist-cli/chunks/{chunk-4FCN3KOD.js → chunk-FLLDNYUC.js} +2 -2
  28. package/dist-cli/chunks/{chunk-Q4ZLYMUP.js → chunk-FQZQKJZ5.js} +1 -1
  29. package/dist-cli/chunks/{chunk-YTUW6DGN.js → chunk-G4B2PTUA.js} +2 -2
  30. package/dist-cli/chunks/{chunk-RW75MMQZ.js → chunk-GVC4ZNVM.js} +2 -2
  31. package/dist-cli/chunks/{chunk-YXRD4B4X.js → chunk-H3U7LAZG.js} +2 -2
  32. package/dist-cli/chunks/{chunk-4OZG2LQA.js → chunk-HKWQLGKK.js} +8 -8
  33. package/dist-cli/chunks/{chunk-7LULF3D2.js → chunk-JZZIA5BR.js} +21 -10
  34. package/dist-cli/chunks/{chunk-OVEH5OOR.js → chunk-LIK6FJNR.js} +1 -1
  35. package/dist-cli/chunks/{chunk-UK7X4OX3.js → chunk-LK63GSPB.js} +1 -1
  36. package/dist-cli/chunks/{chunk-J22XZAGG.js → chunk-M4SIQQDE.js} +2 -2
  37. package/dist-cli/chunks/{chunk-YIBVYNHV.js → chunk-MLHEWBGL.js} +1 -1
  38. package/dist-cli/chunks/{chunk-NEKVW4FE.js → chunk-MLX2UIH7.js} +2 -2
  39. package/dist-cli/chunks/{chunk-WE74HC52.js → chunk-NRPNLTJI.js} +2 -2
  40. package/dist-cli/chunks/{chunk-LE6JWEXU.js → chunk-OSCWNNYR.js} +1 -1
  41. package/dist-cli/chunks/{chunk-DNH4ZWVK.js → chunk-QR4A5JV3.js} +2 -2
  42. package/dist-cli/chunks/{chunk-JDQ5AJJ4.js → chunk-SSGGUPY7.js} +2 -2
  43. package/dist-cli/chunks/{chunk-MFLCDFRS.js → chunk-TDM4IQS3.js} +2 -2
  44. package/dist-cli/chunks/{chunk-TABUERS3.js → chunk-TFWWL3HI.js} +1 -1
  45. package/dist-cli/chunks/{chunk-MPDBF324.js → chunk-TL6D2L7C.js} +2 -2
  46. package/dist-cli/chunks/{chunk-EODC7ZE7.js → chunk-U7GJF4CQ.js} +2 -2
  47. package/dist-cli/chunks/{chunk-RCH5EVVP.js → chunk-UJIGVLKD.js} +1 -1
  48. package/dist-cli/chunks/{chunk-Y4EES4A2.js → chunk-VGNEIUJ7.js} +2 -2
  49. package/dist-cli/chunks/{chunk-P2HUPEXS.js → chunk-VLLTUTO5.js} +2 -2
  50. package/dist-cli/chunks/{chunk-BGY7U4IH.js → chunk-WI5GVQ6M.js} +2 -2
  51. package/dist-cli/chunks/{chunk-SDBIR5ON.js → chunk-XAHT6BRW.js} +1 -1
  52. package/dist-cli/chunks/{chunk-YOLPZLST.js → chunk-XE2DUF5Z.js} +1 -1
  53. package/dist-cli/chunks/{chunk-6MFFAN7Q.js → chunk-YOV3CQIH.js} +1 -1
  54. package/dist-cli/chunks/{chunk-PPD77GEP.js → chunk-YPZDXYHV.js} +2 -2
  55. package/dist-cli/chunks/{chunk-3XC55LRK.js → chunk-YWAV3FQJ.js} +2 -2
  56. package/dist-cli/chunks/chunk-ZED5FLNC.js +125 -0
  57. package/dist-cli/chunks/{chunk-77CFHIGG.js → chunk-ZJ6EL5FU.js} +1 -1
  58. package/dist-cli/chunks/{cleanup-DIDGDPIX.js → cleanup-MTGLBGPQ.js} +2 -2
  59. package/dist-cli/chunks/{cli-version-K3UX3EWQ.js → cli-version-KF6SJ5QC.js} +2 -2
  60. package/dist-cli/chunks/{compat-CU5BZOTA.js → compat-NIROXTXH.js} +2 -2
  61. package/dist-cli/chunks/{config-ZDPMF7NT.js → config-GVI5ADMM.js} +2 -2
  62. package/dist-cli/chunks/{control-PKNXORO3.js → control-RLM3WBEH.js} +2 -2
  63. package/dist-cli/chunks/daemon-O2R2GEWR.js +4 -0
  64. package/dist-cli/chunks/{debug-FRVAHAUX.js → debug-QLQ6VFDL.js} +3 -3
  65. package/dist-cli/chunks/{desktop-RM4LA63P.js → desktop-4KAE6XGD.js} +3 -3
  66. package/dist-cli/chunks/{detox-XXPJIQFG.js → detox-XW4L3NAA.js} +2 -2
  67. package/dist-cli/chunks/{device-5CWUNYYM.js → device-IMVFXWBB.js} +2 -2
  68. package/dist-cli/chunks/{diagnose-7WHQUJOH.js → diagnose-JTFFK6SX.js} +2 -2
  69. package/dist-cli/chunks/disk-cleanup-3HBGT6XT.js +4 -0
  70. package/dist-cli/chunks/drivers-BHLLX7OX.js +4 -0
  71. package/dist-cli/chunks/{film-EEAFWERR.js → film-BTQI2ZPO.js} +3 -3
  72. package/dist-cli/chunks/flow-C7PWEH4C.js +4 -0
  73. package/dist-cli/chunks/help-LOC2M6FR.js +4 -0
  74. package/dist-cli/chunks/{hidden-runtime-alias-GEDAK5VD.js → hidden-runtime-alias-5Y3QDZ2L.js} +2 -2
  75. package/dist-cli/chunks/{home-paths-PE4236U4.js → home-paths-K2P3TAAX.js} +2 -2
  76. package/dist-cli/chunks/inspect-JH64MAHP.js +4 -0
  77. package/dist-cli/chunks/install-desktop-C6KE3OM5.js +4 -0
  78. package/dist-cli/chunks/{login-NBG6XEI2.js → login-DIHEERZB.js} +4 -4
  79. package/dist-cli/chunks/{logout-TLDRLFXP.js → logout-HXABB5BG.js} +2 -2
  80. package/dist-cli/chunks/{maestro-DHRICU2K.js → maestro-LF67TXN2.js} +3 -3
  81. package/dist-cli/chunks/{maestro-generate-QZAGYXXJ.js → maestro-generate-XU7IAT4W.js} +3 -3
  82. package/dist-cli/chunks/{mode-XOMKPZZG.js → mode-GJRNBJWL.js} +2 -2
  83. package/dist-cli/chunks/{optional-demo-registry-L66RRINW.js → optional-demo-registry-SXOSQMWZ.js} +2 -2
  84. package/dist-cli/chunks/{perf-GSKQKH3W.js → perf-IZY2XMUE.js} +2 -2
  85. package/dist-cli/chunks/{permissions-D4XQ4HBT.js → permissions-RLZXUFQU.js} +2 -2
  86. package/dist-cli/chunks/{record-QTA3IWSU.js → record-OBWLYFSP.js} +3 -3
  87. package/dist-cli/chunks/{report-issue-BVPBXZEM.js → report-issue-DU7TRHJK.js} +2 -2
  88. package/dist-cli/chunks/runtime-E7SIB4P3.js +4 -0
  89. package/dist-cli/chunks/screenshot-command-5IF4BSJ4.js +159 -0
  90. package/dist-cli/chunks/{screenshots-capture-NUVPCCYY.js → screenshots-capture-OFYWMTVR.js} +2 -2
  91. package/dist-cli/chunks/{serve-FR5M2RRQ.js → serve-DUES2MUY.js} +2 -2
  92. package/dist-cli/chunks/{setup-O4WMVQVP.js → setup-7JBMUE6Q.js} +2 -2
  93. package/dist-cli/chunks/{skills-RUYLHJED.js → skills-J5HVAM75.js} +2 -2
  94. package/dist-cli/chunks/{storage-OCCDGKMN.js → storage-EPTR6RW5.js} +2 -2
  95. package/dist-cli/chunks/store-W3YDQEZQ.js +4 -0
  96. package/dist-cli/chunks/telemetry-WXVIVQ4Y.js +4 -0
  97. package/dist-cli/chunks/{timeline-QWPHBXJ2.js → timeline-QR2474MZ.js} +2 -2
  98. package/dist-cli/chunks/{upgrade-WUQAUREZ.js → upgrade-MQL27HMQ.js} +2 -2
  99. package/dist-cli/chunks/upload-6IA2EKEH.js +4 -0
  100. package/dist-cli/chunks/{version-TCSZK3WH.js → version-ILGJD7EH.js} +2 -2
  101. package/dist-cli/chunks/{web-7P7SQTFS.js → web-NEPM3SZU.js} +2 -2
  102. package/dist-cli/chunks/{what-happened-KIUBAPFB.js → what-happened-KGOUXBW4.js} +2 -2
  103. package/dist-lib/agent-daemon-client.cjs +1 -1
  104. package/dist-lib/agent-events.cjs +1 -1
  105. package/dist-lib/agent-identity.cjs +1 -1
  106. package/dist-lib/agent-sessions.cjs +1 -1
  107. package/dist-lib/attached-projects.cjs +1 -1
  108. package/dist-lib/auth/shared-session.cjs +1 -1
  109. package/dist-lib/backend-origin.cjs +1 -1
  110. package/dist-lib/beta.cjs +1 -1
  111. package/dist-lib/beta.mjs +1 -1
  112. package/dist-lib/bridge-constants.cjs +1 -1
  113. package/dist-lib/cli-constants.cjs +1 -1
  114. package/dist-lib/config.cjs +1 -1
  115. package/dist-lib/detox/index.cjs +1 -1
  116. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  117. package/dist-lib/home-paths.cjs +1 -1
  118. package/dist-lib/host/bridge-host.cjs +1 -1
  119. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  120. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  121. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  122. package/dist-lib/host/websocket-proxy.cjs +1 -1
  123. package/dist-lib/index.cjs +1 -1
  124. package/dist-lib/jump-to-source-babel.cjs +1 -1
  125. package/dist-lib/menu.cjs +1 -1
  126. package/dist-lib/menu.mjs +1 -1
  127. package/dist-lib/metro.cjs +1 -1
  128. package/dist-lib/profiles.cjs +1 -1
  129. package/dist-lib/render-mode.cjs +1 -1
  130. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  131. package/dist-lib/sdk.cjs +18 -6
  132. package/dist-lib/sdk.mjs +18 -6
  133. package/dist-lib/skills.cjs +6 -2
  134. package/dist-lib/vite.cjs +1 -1
  135. package/package.json +2 -2
  136. package/skills/sootsim-debug/SKILL.md +6 -0
  137. package/skills/sootsim-setup/SKILL.md +26 -0
  138. package/src/attached-projects.ts +2 -2
  139. package/src/host/bridge-host.ts +2 -2
  140. package/src/runtime-assets.ts +1 -1
  141. package/src/runtime-delivery.ts +1 -1
  142. package/src/vite-plugin.ts +1 -1
  143. package/dist-cli/chunks/chunk-EKNSKDBI.js +0 -125
  144. package/dist-cli/chunks/chunk-NR2G2PSN.js +0 -4
  145. package/dist-cli/chunks/daemon-OXELSM3C.js +0 -4
  146. package/dist-cli/chunks/disk-cleanup-EGAZA7DS.js +0 -4
  147. package/dist-cli/chunks/drivers-JEAO6IWD.js +0 -4
  148. package/dist-cli/chunks/flow-DMSEJ526.js +0 -4
  149. package/dist-cli/chunks/help-BTYQFHMT.js +0 -4
  150. package/dist-cli/chunks/inspect-RKOCZZ2A.js +0 -4
  151. package/dist-cli/chunks/install-desktop-25G42KWB.js +0 -4
  152. package/dist-cli/chunks/runtime-UQY75DPC.js +0 -4
  153. package/dist-cli/chunks/screenshot-command-YWDQBPE6.js +0 -156
  154. package/dist-cli/chunks/store-56RG4ZWJ.js +0 -4
  155. package/dist-cli/chunks/telemetry-YSUNFE7N.js +0 -4
  156. package/dist-cli/chunks/upload-D5BXJTXK.js +0 -4
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{h as E,j as R,m as b}from"./chunk-KYGB26L4.js";import"./chunk-6MFFAN7Q.js";import{c as v}from"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
4
+ import{h as E,j as R,m as b}from"./chunk-5NHCBHYZ.js";import"./chunk-YOV3CQIH.js";import{c as v}from"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
5
5
  sootsim get diagnosis \u2014 compact "what just went wrong?" report
6
6
 
7
7
  usage:
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c,d,e}from"./chunk-U7GJF4CQ.js";import"./chunk-APBN2B6C.js";import"./chunk-NRPNLTJI.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";export{e as applyAutomaticSootsimCleanup,d as applySootsimCleanup,b as formatSootsimBytes,a as isAutomaticSootsimCleanupComplete,c as planSootsimCleanup};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import"./chunk-OSCWNNYR.js";import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i}from"./chunk-SSGGUPY7.js";import"./chunk-3I647BPF.js";import"./chunk-TFWWL3HI.js";import"./chunk-APBN2B6C.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.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,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as L,d as T}from"./chunk-Y4EES4A2.js";import{h as A,j as R,n as b}from"./chunk-KYGB26L4.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import{spawnSync as x}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
4
+ import{c as L,d as T}from"./chunk-VGNEIUJ7.js";import{h as A,j as R,n as b}from"./chunk-5NHCBHYZ.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{spawnSync as x}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
5
5
  sootsim film \u2014 record a flow flat, replay it on the 3d stage, save a clip
6
6
 
7
7
  usage:
@@ -35,7 +35,7 @@ examples:
35
35
  sootsim film flows/swap.yaml --script hero-arc --background gradient-tide --out ~/Desktop/swap-3d.mp4
36
36
  sootsim film flows/login.yaml --colorway deep-blue --environment on --env-shape pane --room on
37
37
  `),0;let s=e.find(d=>!d.startsWith("--")&&/\.ya?ml$/.test(d));if(!s||!V(I(s)))return console.error(` film: flow file not found: ${s??"(none given)"}`),1;let P=Number.parseInt(c(e,"--fps")??"30",10),h=c(e,"--script")??"hero-arc",z=e.includes("--keep-three"),v=s.replace(/^.*\//,"").replace(/\.ya?ml$/,""),O=c(e,"--out"),l=I(O??K(j(),"Desktop","sootsim-films",`${v}.webm`)),S=H(l).toLowerCase()===".mp4";if(S&&x("ffmpeg",["-version"]).status!==0)return console.error(" film: --out ends in .mp4 but ffmpeg is not installed"),console.error(" install ffmpeg or use a .webm output path"),1;let C=A(e,{port:a.port,stripValueFlags:[...X,...Q],stripBooleanFlags:J}),t=R({...C,commandTimeoutMs:6e4});try{let d=await r(t,`(() => { const s = window.SootSim?.bridges?.settings?.get?.() || {}
38
- return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-DMSEJ526.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
38
+ return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-C7PWEH4C.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
39
39
  return { state: s?.state, hasBlob: !!s?.lastVideoBlob } })()`);if(i?.state==="idle"&&i.hasBlob){F=!0;break}}if(!F)return console.error(" film: flow recording never produced a video blob"),1;console.log(` film: flow captured (${(u/1e3).toFixed(1)}s)`),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeMode', true)"),await L(t),await n(1400),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', true)");let _=!1;for(let o=0;o<60;o++)if(await n(250),await r(t,`(() => { const rs = window.SootSim?.replayStore
40
40
  return rs?.value?.preview?.surface === 'video' && !!rs?.value?.preview?.flowVideoUrl })()`)){_=!0;break}if(!_)return console.error(" film: recording editor did not seed the replay store"),1;let p=T(e);delete p.script,p.resetPose=!0,await b(t,"SootSim.bridges.threeMode.configure",p),await n(2400),console.log(` film: filming the 3d stage (script: ${h})`);let M=await r(t,`(() => {
41
41
  const c = window.SootSim?.bridges?.threeMode?.getCanvas?.()
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c,d,e,f,g,h}from"./chunk-DTQ4XGJP.js";import"./chunk-QR4A5JV3.js";import"./chunk-ZJ6EL5FU.js";import{c as a,d as b}from"./chunk-HKWQLGKK.js";import"./chunk-CQEK4J75.js";import"./chunk-VLLTUTO5.js";import"./chunk-G4B2PTUA.js";import"./chunk-GVC4ZNVM.js";import"./chunk-YWAV3FQJ.js";import"./chunk-MLHEWBGL.js";import"./chunk-ATRV3MGB.js";import"./chunk-JZZIA5BR.js";import"./chunk-SSGGUPY7.js";import"./chunk-3I647BPF.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-TL6D2L7C.js";import"./chunk-UJIGVLKD.js";import"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import"./chunk-AWE4ZKR3.js";import"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import"./chunk-APBN2B6C.js";import"./chunk-NRPNLTJI.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";export{e as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,g as hoistLeadingSimFlag,a as parseFlowFile,f as runFlowPlayback,h as runMaestroAuthoring,b as validateFlowFile};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a,b,c}from"./chunk-H3U7LAZG.js";import"./chunk-TDM4IQS3.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import"./chunk-LK63GSPB.js";import"./chunk-BDZ7GDAA.js";import"./chunk-FQZQKJZ5.js";import"./chunk-BQLQCPXE.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as e,b as s}from"./chunk-EKNSKDBI.js";import"./chunk-IRNRCBRW.js";var n=[{title:"Overview",route:"/docs/sootsim/cli"},...e.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/sootsim/cli/${o.slug}`}))];var i=["do","get"];function g(o){if(o.command)return o;let t=o.commandArgs.find(r=>!r.startsWith("-"));if(!t)return o;for(let r of i)if(s(r,t))return{...o,command:r};return o}export{g as resolveHiddenRuntimeAlias};
4
+ import{a as e,b as s}from"./chunk-ZED5FLNC.js";import"./chunk-BQLQCPXE.js";var n=[{title:"Overview",route:"/docs/sootsim/cli"},...e.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/sootsim/cli/${o.slug}`}))];var i=["do","get"];function g(o){if(o.command)return o;let t=o.commandArgs.find(r=>!r.startsWith("-"));if(!t)return o;for(let r of i)if(s(r,t))return{...o,command:r};return o}export{g as resolveHiddenRuntimeAlias};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,J as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,R as claimDaemonLockfile,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,M as isDaemonLockfileFresh,N as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,q as profilesDir,H as readActiveRuntime,K as readDaemonLockfile,L as readDevBridgeLockfile,O as readLiveRuntimeVersions,C as readOrCreateAnonymousId,A as readPrivacyPreferences,y as readSharedConfig,S as removeDaemonLockfile,T as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,P as writeDaemonLockfile,Q as writeDevBridgeLockfile,B as writePrivacyPreferences,E as writeRuntimeUpgradeNotice,z as writeSharedConfig};
4
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,J as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,R as claimDaemonLockfile,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,M as isDaemonLockfileFresh,N as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,q as profilesDir,H as readActiveRuntime,K as readDaemonLockfile,L as readDevBridgeLockfile,O as readLiveRuntimeVersions,C as readOrCreateAnonymousId,A as readPrivacyPreferences,y as readSharedConfig,S as removeDaemonLockfile,T as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,P as writeDaemonLockfile,Q as writeDevBridgeLockfile,B as writePrivacyPreferences,E as writeRuntimeUpgradeNotice,z as writeSharedConfig};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{j as a,k as b}from"./chunk-HKWQLGKK.js";import"./chunk-CQEK4J75.js";import"./chunk-GVC4ZNVM.js";import"./chunk-YWAV3FQJ.js";import"./chunk-MLHEWBGL.js";import"./chunk-ATRV3MGB.js";import"./chunk-JZZIA5BR.js";import"./chunk-SSGGUPY7.js";import"./chunk-3I647BPF.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-TL6D2L7C.js";import"./chunk-UJIGVLKD.js";import"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import"./chunk-AWE4ZKR3.js";import"./chunk-APBN2B6C.js";import"./chunk-NRPNLTJI.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";export{a as printShellPerfReport,b as runInspect};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a}from"./chunk-BYCMWKNX.js";import"./chunk-CVRPU5KX.js";import"./chunk-3I647BPF.js";import"./chunk-BQLQCPXE.js";export{a as runInstallDesktop};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as k,d as v}from"./chunk-4FCN3KOD.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
4
+ import{b as k,d as v}from"./chunk-FLLDNYUC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import x from"node:http";var b=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function P(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return b}function A(){console.log(`
5
5
  sootsim login \u2014 sign in so uploads can attach to your account
6
6
 
7
7
  usage:
@@ -23,6 +23,6 @@ options:
23
23
  <p style="color:#ccc">${r}</p>
24
24
  </div>
25
25
  </body>
26
- </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-YSUNFE7N.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-YSUNFE7N.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("contrast",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
26
+ </html>`}async function E(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function G(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function z(r){(r.includes("--help")||r.includes("-h"))&&(A(),process.exit(0));let e=[...r],t=await P(C(e,"--origin"));if(G(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let o=await E(t);if(o.ok){k({token:o.token,user:o.userId?{id:o.userId,email:o.email}:null,origin:t,source:"cli"});let i=await v(t),d=i?.user?.email||o.email||i?.user?.id||o.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-WXVIVQ4Y.js");a({event:"cli_login_succeeded",identity:{userId:o.userId??i?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${o.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-WXVIVQ4Y.js");o({event:"cli_login_started",properties:{origin:t}}),await i()}let m=300*1e3,s=await new Promise(o=>{let i,d=!1,a=c=>{d||(d=!0,clearTimeout(i),o(c),f.close())},f=x.createServer((c,n)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),_=l.searchParams.get("state"),y=l.searchParams.get("token"),$=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(_!==u){n.statusCode=404,n.end("not found");return}if(n.setHeader("content-type","text/html; charset=utf-8"),p){n.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){n.end(g("missing token. close this tab and retry `sootsim login`.")),a({ok:!1,error:"missing token"});return}n.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:$,userId:T})}catch(l){n.statusCode=500,n.end(g("sign-in callback failed. retry `sootsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});i=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `sootsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let n=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",u),n.searchParams.set("port",String(c.port)),n.searchParams.set("contrast",t),console.log(" opening browser for sootsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
27
27
  ${n.toString()}
28
- `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-YSUNFE7N.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-YSUNFE7N.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
28
+ `),U(n.toString())})});if(!s.ok){let{trackCliEvent:o,flushCliTelemetry:i}=await import("./telemetry-WXVIVQ4Y.js");o({event:"cli_login_failed",properties:{origin:t,error:s.error}}),await i(),console.error(` login failed: ${s.error}`),process.exit(1)}k({token:s.token,user:s.userId?{id:s.userId,email:s.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||s.email||h?.user?.id||s.userId,{trackCliEvent:O,flushCliTelemetry:S}=await import("./telemetry-WXVIVQ4Y.js");O({event:"cli_login_succeeded",identity:{userId:s.userId??h?.user?.id??null},properties:{origin:t}}),await S(),console.log(` signed in${I?` as ${I}`:""}`)}export{z as runLogin};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as r,d as i}from"./chunk-BGY7U4IH.js";import{a as t,c as o}from"./chunk-4FCN3KOD.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
4
+ import{c as r,d as i}from"./chunk-WI5GVQ6M.js";import{a as t,c as o}from"./chunk-FLLDNYUC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as E,d as O,f as L,g as R,h as P}from"./chunk-QNQP3WYV.js";import"./chunk-DNH4ZWVK.js";import"./chunk-77CFHIGG.js";import{c as k}from"./chunk-4OZG2LQA.js";import{a as S}from"./chunk-STF4UH5I.js";import{b as $,c as F,d as T,e as M}from"./chunk-P2HUPEXS.js";import{a as A}from"./chunk-YTUW6DGN.js";import"./chunk-RW75MMQZ.js";import"./chunk-3XC55LRK.js";import"./chunk-YIBVYNHV.js";import"./chunk-NWM62KI3.js";import"./chunk-7LULF3D2.js";import"./chunk-JDQ5AJJ4.js";import"./chunk-WKSX2VHB.js";import"./chunk-NEKVW4FE.js";import"./chunk-NR2G2PSN.js";import"./chunk-TABUERS3.js";import"./chunk-MPDBF324.js";import"./chunk-RCH5EVVP.js";import"./chunk-4PKUB2QX.js";import"./chunk-SDBIR5ON.js";import"./chunk-KYGB26L4.js";import"./chunk-KEFBMDYK.js";import"./chunk-BGY7U4IH.js";import"./chunk-4FCN3KOD.js";import"./chunk-M33LQWC2.js";import"./chunk-WE74HC52.js";import"./chunk-J22XZAGG.js";import"./chunk-SOBEJUH4.js";import"./chunk-4MNKKMYG.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-EKNSKDBI.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
4
+ import{c as E,d as O,f as L,g as R,h as P}from"./chunk-DTQ4XGJP.js";import"./chunk-QR4A5JV3.js";import"./chunk-ZJ6EL5FU.js";import{c as k}from"./chunk-HKWQLGKK.js";import{a as S}from"./chunk-CQEK4J75.js";import{b as $,c as F,d as T,e as M}from"./chunk-VLLTUTO5.js";import{a as A}from"./chunk-G4B2PTUA.js";import"./chunk-GVC4ZNVM.js";import"./chunk-YWAV3FQJ.js";import"./chunk-MLHEWBGL.js";import"./chunk-ATRV3MGB.js";import"./chunk-JZZIA5BR.js";import"./chunk-SSGGUPY7.js";import"./chunk-3I647BPF.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-TL6D2L7C.js";import"./chunk-UJIGVLKD.js";import"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import"./chunk-AWE4ZKR3.js";import"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import"./chunk-APBN2B6C.js";import"./chunk-NRPNLTJI.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import*as s from"fs";import*as a from"path";var I=[".maestro","maestro"];function W(){console.log(`
5
5
  sootsim maestro \u2014 author and run Maestro YAML flows against sootsim
6
6
 
7
7
  usage:
@@ -91,7 +91,7 @@ appId: com.example.app
91
91
  - inputText: "secret123"
92
92
  - tapOn: "Sign in"
93
93
  - assertVisible: "Welcome"
94
- `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function Q(o,n={}){if(o.includes("--help")||o.includes("-h"))return W(),0;if(o.includes("--list-compat"))return D(),0;let e;try{e=Y(o)}catch(r){return console.error(` error: ${r.message}`),1}e=R(e);let t=process.cwd(),i=e[0];if(i==="init")return _(t);if(i==="generate"){let{runMaestroGenerate:r}=await import("./maestro-generate-QZAGYXXJ.js");return r(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return P(e);e=J(e);let c=null,u;if(i==="test"){let r=e.slice(1).find(f=>!U(f));r?(c=a.resolve(t,r),u=e.slice(1).filter(f=>f!==r)):(c=j(t),u=e.slice(1))}else i&&!U(i)?(c=a.resolve(t,i),u=e.slice(1)):(c=j(t),u=e);if(!c)return console.error(`
94
+ `,"utf8"),console.log(` + wrote ${e}`),console.log(" next: sootsim maestro test .maestro/login.yaml"),0)}async function Q(o,n={}){if(o.includes("--help")||o.includes("-h"))return W(),0;if(o.includes("--list-compat"))return D(),0;let e;try{e=Y(o)}catch(r){return console.error(` error: ${r.message}`),1}e=R(e);let t=process.cwd(),i=e[0];if(i==="init")return _(t);if(i==="generate"){let{runMaestroGenerate:r}=await import("./maestro-generate-XU7IAT4W.js");return r(e.slice(1))}if(i==="start"||i==="keep"||i==="good"||i==="end"||i==="validate")return P(e);e=J(e);let c=null,u;if(i==="test"){let r=e.slice(1).find(f=>!U(f));r?(c=a.resolve(t,r),u=e.slice(1).filter(f=>f!==r)):(c=j(t),u=e.slice(1))}else i&&!U(i)?(c=a.resolve(t,i),u=e.slice(1)):(c=j(t),u=e);if(!c)return console.error(`
95
95
  error: no maestro flows found.
96
96
  expected one of: ${I.map(r=>`./${r}/`).join(", ")}
97
97
  or pass a flow explicitly: sootsim maestro test path/to/flow.yaml
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as v}from"./chunk-STF4UH5I.js";import{b as O,d as A,e as E}from"./chunk-P2HUPEXS.js";import{a as x,b as T}from"./chunk-YTUW6DGN.js";import{f as y}from"./chunk-7LULF3D2.js";import"./chunk-NEKVW4FE.js";import"./chunk-NR2G2PSN.js";import"./chunk-TABUERS3.js";import"./chunk-SDBIR5ON.js";import{h as b,j as S}from"./chunk-KYGB26L4.js";import"./chunk-BGY7U4IH.js";import"./chunk-4FCN3KOD.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import{mkdtempSync as R,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var P=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(P.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...P]}),i=S(o);try{let n=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
4
+ import{a as v}from"./chunk-CQEK4J75.js";import{b as O,d as A,e as E}from"./chunk-VLLTUTO5.js";import{a as x,b as T}from"./chunk-G4B2PTUA.js";import{f as y}from"./chunk-JZZIA5BR.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-XAHT6BRW.js";import{h as b,j as S}from"./chunk-5NHCBHYZ.js";import"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{mkdtempSync as R,writeFileSync as N}from"fs";import{tmpdir as C}from"os";import{join as k}from"path";var J=process.env.SOOTSIM_TEST_MODEL||"deepseek-v4-flash",_=18e3,j=18e4;function f(e,t){let r=e.indexOf(t);return r>=0?e[r+1]:void 0}function V(e,t){for(let r of t){let o=f(e,r);if(o)return o}}var P=new Set(["--origin","--preview-origin","--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]);function G(e){for(let t=0;t<e.length;t++){let r=e[t];if(r){if(P.has(r)){t+=1;continue}if(!r.startsWith("-"))return{prompt:r,index:t}}}return null}function H(e,t){return e.filter((r,o)=>o!==t)}async function Y(e,t){let r=H(e,t),o=b(r,{stripBooleanFlags:["--new","--headless","--headed","--electron","--preview-open"],stripValueFlags:[...P]}),i=S(o);try{let n=await y(i,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!0}),s=[n.shell?`shell: ${JSON.stringify(n.shell)}`:"",n.keyboard?`keyboard: ${JSON.stringify(n.keyboard)}`:"",typeof n.nodeCount=="number"?`nodes: ${n.nodeCount}`:"",n.tree||""].filter(Boolean).join(`
5
5
  `);return s.length>_?s.slice(0,_)+`
6
6
  [tree truncated]`:s}finally{i.close()}}var K=`
7
7
  You write Maestro-compatible SootSim YAML flows from a user's plain-language test goal.
@@ -32,5 +32,5 @@ ${t||"[no tree available]"}
32
32
 
33
33
  Generate the shortest replayable flow that verifies the goal from this current state.
34
34
  `.trim()}async function W(e){let t=await fetch(`${e.origin.replace(/\/$/,"")}/api/llm`,{method:"POST",headers:{"content-type":"application/json",authorization:e.authHeader},body:JSON.stringify({modelId:J,context:{systemPrompt:K,messages:[{role:"user",content:z(e.prompt,e.describe),timestamp:Date.now()}]},options:{maxTokens:1800,temperature:.2},threadId:null}),signal:AbortSignal.timeout(j)});if(!t.ok||!t.body){let a=await t.text().catch(()=>"");throw new Error(`/api/llm ${t.status}${a?`: ${a}`:""}`)}let r=t.body.getReader(),o=new TextDecoder,i=[],n="",c=a=>{let l=a.trim();if(!l)return;let u=JSON.parse(l);if(u.type==="text_delta"&&u.delta)i.push(u.delta);else if(u.type==="error")throw new Error(u.errorMessage||"llm error")};for(;;){let{value:a,done:l}=await r.read();if(l)break;n+=o.decode(a,{stream:!0});let u;for(;(u=n.indexOf(`
35
- `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function X(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function M(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=X(e);if(!M(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"SootSim generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!M(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:v.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=x();if(!i||i.kind==="github")return console.error(' sootsim maestro generate "<goal>" needs a login or SOOTSIM_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await W({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=R(k(C(),"sootsim-maestro-generate-")),m=k(u,"flow.yaml");N(m,l.yamlText),console.log(` flow: ${m}`);let F=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-DMSEJ526.js"),L=Q(e,o,m,c),w=await I(L),p=$(),h=D(),U=h.find(B=>B.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?U?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-F,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
35
+ `))>=0;)c(n.slice(0,u)),n=n.slice(u+1)}n+=o.decode(),n.trim()&&c(n);let s=i.join("").trim();if(!s)throw new Error("llm returned an empty test flow");return s}function X(e){let t=e.match(/```(?:json)?\s*([\s\S]*?)```/i),r=t?t[1]:e.slice(e.indexOf("{"),e.lastIndexOf("}")+1);return JSON.parse(r)}function M(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function q(e){let t=X(e);if(!M(t))throw new Error("llm did not return a JSON object");let r=typeof t.summary=="string"&&t.summary.trim()?t.summary.trim().slice(0,500):"SootSim generated test",o=t.steps;if(!Array.isArray(o)||o.length===0)throw new Error("llm returned no flow steps");let i=o.map((n,c)=>{if(!M(n))throw new Error(`flow step ${c+1} is not an object`);return n});return{summary:r,steps:i,yamlText:v.stringify(i)}}function Q(e,t,r,o){let i=[r,"--preview","--preview-origin",o,"--billing-kind","test_run"],n=new Set(["--public-origin","--preview-public-origin","--owner","--repo","--url","--driver","--sim","--device","--slow","--tail-wait","--remap","--replace"]),c=new Set(["--new","--headless","--headed","--electron","--preview-open","--no-shell","--shell-only"]);for(let s=0;s<e.length;s++){if(s===t)continue;let a=e[s];if(a==="--origin"||a==="--preview-origin"){s+=1;continue}if(a==="--public-origin"){let l=e[s+1];l&&i.push("--preview-public-origin",l),s+=1;continue}if(n.has(a)){let l=e[s+1];l&&i.push(a,l),s+=1;continue}c.has(a)&&i.push(a)}return i}async function le(e){let t=G(e);if(!t)return console.error(' usage: sootsim maestro generate "test goal"'),1;let{prompt:r,index:o}=t,i=x();if(!i||i.kind==="github")return console.error(' sootsim maestro generate "<goal>" needs a login or SOOTSIM_API_KEY.'),console.error(" API keys must include preview_upload and llm scopes."),1;let n=T(i),c=await E(V(e,["--origin","--preview-origin"]));console.log(" inspecting current sim\u2026");let s=await Y(e,o);console.log(" generating Maestro flow\u2026");let a=await W({prompt:r,describe:s,origin:c,authHeader:n}),l=q(a),u=R(k(C(),"sootsim-maestro-generate-")),m=k(u,"flow.yaml");N(m,l.yamlText),console.log(` flow: ${m}`);let F=Date.now(),{runFlowPlayback:I,getLastFlowPreviewUploadResult:$,getLastFlowTraceSteps:D}=await import("./flow-C7PWEH4C.js"),L=Q(e,o,m,c),w=await I(L),p=$(),h=D(),U=h.find(B=>B.status==="failure"),g=w===0?"passed":"failed",d=await A({origin:c,kind:"maestro",prompt:r,summary:l.summary,status:g,failureMessage:g==="failed"?U?.error??"flow playback failed":null,previewShareId:p?.shareId??null,owner:f(e,"--owner")??null,repo:f(e,"--repo")??null,durationMs:Date.now()-F,flowYamlSizeBytes:Buffer.byteLength(l.yamlText,"utf8"),...O(h),auth:i});return console.log(`
36
36
  result: ${g}`),d&&console.log(` run: ${d.id}`),p?.previewUrl&&console.log(` preview: ${p.previewUrl}`),d?.traceUrl&&console.log(` replay: ${d.traceUrl}`),w}export{le as runMaestroGenerate};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as s,b as i}from"./chunk-Y4EES4A2.js";import"./chunk-KYGB26L4.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
4
+ import{a as s,b as i}from"./chunk-VGNEIUJ7.js";import"./chunk-5NHCBHYZ.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";async function r(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
5
5
  sootsim mode screenshot \u2014 toggle the screenshot-mode chrome overlay
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a,b,c}from"./chunk-RCH5EVVP.js";import"./chunk-IRNRCBRW.js";export{c as __withOptionalDemoAppsForTests,a as loadOptionalDemoApps,b as optionalDemoAppsSync};
4
+ import{a,b,c}from"./chunk-UJIGVLKD.js";import"./chunk-BQLQCPXE.js";export{c as __withOptionalDemoAppsForTests,a as loadOptionalDemoApps,b as optionalDemoAppsSync};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{k as x}from"./chunk-4OZG2LQA.js";import"./chunk-STF4UH5I.js";import"./chunk-RW75MMQZ.js";import"./chunk-3XC55LRK.js";import"./chunk-YIBVYNHV.js";import"./chunk-NWM62KI3.js";import"./chunk-7LULF3D2.js";import"./chunk-JDQ5AJJ4.js";import"./chunk-WKSX2VHB.js";import"./chunk-NEKVW4FE.js";import"./chunk-NR2G2PSN.js";import"./chunk-TABUERS3.js";import"./chunk-MPDBF324.js";import"./chunk-RCH5EVVP.js";import"./chunk-4PKUB2QX.js";import"./chunk-SDBIR5ON.js";import{h as R,j as N,m as d,n as S}from"./chunk-KYGB26L4.js";import"./chunk-KEFBMDYK.js";import"./chunk-M33LQWC2.js";import"./chunk-WE74HC52.js";import"./chunk-J22XZAGG.js";import"./chunk-SOBEJUH4.js";import"./chunk-4MNKKMYG.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-EKNSKDBI.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),v=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,t)=>{this.ws.once("open",()=>r()),this.ws.once("error",t)}),this.ws.on("message",r=>{let t=JSON.parse(r.toString());if(t.id&&this.pending.has(t.id)){let{res:n,rej:s}=this.pending.get(t.id);this.pending.delete(t.id),t.error?s(new Error(JSON.stringify(t.error))):n(t.result)}else if(t.method)for(let n of this.listeners)n(t.method,t.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},t){let n=this.nextId++;return new Promise((s,a)=>{this.pending.set(n,{res:s,rej:a}),this.ws.send(JSON.stringify({id:n,method:o,params:r,...t?{sessionId:t}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(h(e,"--sample-interval")??"0.1"),n=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return E(n),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${n}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new v(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:t*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${P(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function P(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,a=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(a,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
4
+ import{k as x}from"./chunk-HKWQLGKK.js";import"./chunk-CQEK4J75.js";import"./chunk-GVC4ZNVM.js";import"./chunk-YWAV3FQJ.js";import"./chunk-MLHEWBGL.js";import"./chunk-ATRV3MGB.js";import"./chunk-JZZIA5BR.js";import"./chunk-SSGGUPY7.js";import"./chunk-3I647BPF.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-TL6D2L7C.js";import"./chunk-UJIGVLKD.js";import"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import{h as R,j as N,m as d,n as S}from"./chunk-5NHCBHYZ.js";import"./chunk-AWE4ZKR3.js";import"./chunk-APBN2B6C.js";import"./chunk-NRPNLTJI.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{mkdirSync as D,writeFileSync as W}from"fs";import{dirname as A,resolve as J}from"path";import{WebSocket as B}from"ws";var C=e=>new Promise(o=>setTimeout(o,e)),v=class{ws;nextId=1;pending=new Map;listeners=new Set;ready;constructor(o){this.ws=new B(o,{maxPayload:1<<28}),this.ready=new Promise((r,t)=>{this.ws.once("open",()=>r()),this.ws.once("error",t)}),this.ws.on("message",r=>{let t=JSON.parse(r.toString());if(t.id&&this.pending.has(t.id)){let{res:n,rej:s}=this.pending.get(t.id);this.pending.delete(t.id),t.error?s(new Error(JSON.stringify(t.error))):n(t.result)}else if(t.method)for(let n of this.listeners)n(t.method,t.params)})}waitOpen(){return this.ready}on(o){this.listeners.add(o)}send(o,r={},t){let n=this.nextId++;return new Promise((s,a)=>{this.pending.set(n,{res:s,rej:a}),this.ws.send(JSON.stringify({id:n,method:o,params:r,...t?{sessionId:t}:{}}))})}close(){try{this.ws.close()}catch{}}};async function O(e,o){let r=Number(h(e,"--duration")??"5");if(!Number.isFinite(r)||r<=0)return console.error(" --duration must be a positive number (seconds)"),1;let t=Number(h(e,"--sample-interval")??"0.1"),n=Number(h(e,"--cdp-port")??process.env.SOOTSIM_CDP_PORT??"9222"),s=h(e,"--match")??"/rn/",a=h(e,"--output")??h(e,"-o"),i=J(process.cwd(),a??"/tmp/sootsim.cpuprofile"),l=[];try{l=await(await fetch(`http://localhost:${n}/json/list`)).json()}catch{return E(n),1}let f=l.find(m=>m.type==="page"&&m.url.includes(s));if(!f)return console.error(` no page target matching "${s}" on CDP :${n}`),console.error(` open targets: ${l.map(m=>m.url).join(", ")||"(none)"}`),1;let u=new v(f.webSocketDebuggerUrl);await u.waitOpen();try{let m=new Map;if(u.on((c,p)=>{c==="Target.attachedToTarget"&&p.targetInfo?.type==="worker"&&m.set(p.sessionId,p.targetInfo.url),c==="Target.detachedFromTarget"&&m.delete(p.sessionId)}),await u.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),await C(500),m.size===0)return console.error(" no worker targets attached \u2014 is the app loaded in this tab?"),1;for(let c of m.keys())await u.send("Profiler.enable",{},c),await u.send("Profiler.setSamplingInterval",{interval:t*1e3},c),await u.send("Profiler.start",{},c);console.log(` recording ${r}s across ${m.size} worker(s) \u2014 interact now\u2026`),await C(r*1e3);let b=[];for(let[c,p]of m){let{profile:y}=await u.send("Profiler.stop",{},c);b.push({url:p,profile:y})}return b.sort((c,p)=>p.profile.samples.length-c.profile.samples.length),D(A(i),{recursive:!0}),b.forEach((c,p)=>{let y=p===0?i:i.replace(/(\.[^.]+)?$/,`.worker${p}$1`);if(W(y,JSON.stringify(c.profile)),console.log(` ${P(c.url)}: ${c.profile.samples.length} samples \u2192 ${y}`),o.verbose&&c.profile.samples.length>0)for(let $ of U(c.profile,12))console.log(` ${$.pct.toFixed(1).padStart(5)}% ${$.name} ${$.url}`)}),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}finally{u.close()}}function E(e){console.error(` perf cpu needs a CDP-enabled browser on :${e}.`),console.error(" the tenant worker can't be profiled via the JS Self-Profiler API (F28),"),console.error(" so the sim must expose Chrome remote debugging. easiest path \u2014"),console.error(" open the sim with a CDP port (it stays driveable over the bridge,"),console.error(" so you can scroll/navigate while profiling):"),console.error(""),console.error(` sootsim open <metro-port> --new --driver playwright --cdp-port ${e}`),console.error(` sootsim perf cpu --cdp-port ${e} --match <metro-port>`),console.error(""),console.error(" or launch a standalone CDP Chrome (not bridge-driveable):"),console.error(""),console.error(' "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \\'),console.error(` --remote-debugging-port=${e} --user-data-dir=/tmp/sootsim-cdp \\`),console.error(" --no-sandbox --disable-gpu-sandbox \\"),console.error(" --use-gl=angle --use-angle=metal \\"),console.error(' "http://localhost:5173/rn/<metro-port>" &'),console.error(""),console.error(" override the port with --cdp-port or $SOOTSIM_CDP_PORT.")}function P(e){return e?e.replace(/^https?:\/\/[^/]+/,"").replace(/\?.*$/,"").slice(-50):"(native)"}function U(e,o){let r=e.samples.length||1,t=new Map;for(let n of e.nodes){let s=n.callFrame,a=`${s.functionName||"(anonymous)"}@${P(s.url)}:${s.lineNumber}`,i=t.get(a)??{self:0,name:s.functionName||"(anonymous)",url:`${P(s.url)}:${s.lineNumber}`};i.self+=n.hitCount??0,t.set(a,i)}return[...t.values()].map(n=>({...n,pct:n.self/r*100})).sort((n,s)=>s.self-n.self).slice(0,o)}function h(e,o){let r=e.indexOf(o);if(!(r<0||r===e.length-1))return e[r+1]}function j(){console.log(`
5
5
  sootsim perf react \u2014 inspect React component render cost in the tenant worker
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{h,j as w,m as l,n as u}from"./chunk-KYGB26L4.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
4
+ import{h,j as w,m as l,n as u}from"./chunk-5NHCBHYZ.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";var A=["not-determined","restricted","denied","authorized","limited","provisional","ephemeral","unavailable"],E=["app-tracking-transparency","bluetooth","calendars","camera","contacts","face-id","local-network","location-always","location-when-in-use","media-library","microphone","motion","notifications","photo-library","photo-library-add-only","reminders","siri","speech-recognition"];function b(){console.log(`
5
5
  sootsim permissions \u2014 inspect and change simulated operating-system permissions
6
6
 
7
7
  usage:
@@ -1,12 +1,12 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as W}from"./chunk-DNH4ZWVK.js";import{a as oe}from"./chunk-P2HUPEXS.js";import{a as Z,c as ee}from"./chunk-YTUW6DGN.js";import"./chunk-NEKVW4FE.js";import"./chunk-NR2G2PSN.js";import{d as Y}from"./chunk-TABUERS3.js";import"./chunk-SDBIR5ON.js";import{h as b,j as v,k as Q}from"./chunk-KYGB26L4.js";import"./chunk-BGY7U4IH.js";import"./chunk-4FCN3KOD.js";import"./chunk-6MFFAN7Q.js";import{c as X}from"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import{existsSync as he,mkdirSync as B,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as C}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as A,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
4
+ import{a as W}from"./chunk-QR4A5JV3.js";import{a as oe}from"./chunk-VLLTUTO5.js";import{a as Z,c as ee}from"./chunk-G4B2PTUA.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import{d as Y}from"./chunk-TFWWL3HI.js";import"./chunk-XAHT6BRW.js";import{h as b,j as v,k as Q}from"./chunk-5NHCBHYZ.js";import"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import"./chunk-YOV3CQIH.js";import{c as X}from"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{existsSync as he,mkdirSync as B,readdirSync as be,readFileSync as ve,rmSync as q,writeFileSync as C}from"fs";import{homedir as ye,tmpdir as Se}from"os";import{dirname as z,extname as re,join as A,resolve as $e}from"path";var J=24e4,Re=9e4,xe=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+xe);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
5
5
  the capture lock auto-releases, so simply retry the recording.
6
6
  if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording|lock already held/i.test(s)&&(console.error(` ${o} failed: ${s}
7
7
  a prior recording was abandoned and its capture is still
8
8
  releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
9
- \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(d,r);return}if(o.name==="prelude-start"){await Ce(d,r);return}if(o.name==="upload"){let{runUpload:y}=await import("./upload-D5BXJTXK.js");await y(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Fe(d,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let u=600;a>u&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${u}s (10m) maximum`),process.exit(1));let m=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),k=l(e,"--max-width")?Number(l(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=v({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await M(d),await ce(d,K,fe);let y=await le(d,t,t==="combined"?n:void 0);y.ok||(console.error(` start failed: recording store refused to start (${t})`+(y.error?`: ${y.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await ue(d);let O=await me(d);pe(O,x,t)}finally{d.close()}return}let F=p?Number(p):null,$=Me(s,c,F);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await ne(h),await M(h),$==="png"){let R=F??10,w=I(c,`sootsim-frames-${T()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),B(w,{recursive:!0});for(let f of be(w))/^frame-\d+\.png$/.test(f)&&q(A(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let S=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!S.ok||!S.requestId)&&(console.error(` frame capture start failed: ${S.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let ge=Date.now()+Math.max(5e3,g),N=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${S.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),N=f.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((f,P)=>{let we=`${w}/frame-${String(P+1).padStart(3,"0")}.png`;C(we,Buffer.from(f.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if($==="gif"){let R=F??Math.max(10,Math.round(a*m/3)),w=I(c,`sootsim-${T()}.gif`);B(z(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let S=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);S||(console.error(" gif capture returned no frames"),process.exit(1)),C(w,Buffer.from(S.data,"base64")),console.log(` saved: ${w} (${L(S.size)})`);return}let d=I(c,`sootsim-${T()}.${$}`);B(z(d),{recursive:!0});let y={format:$,fps:m,durationMs:g};n&&(y.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify(y)})`,`${$} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${$} for ${a}s \u2192 ${d}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${$} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(h,d),console.log(` saved: ${d} (${L(_.size)})`)}finally{h.close()}}var Ee=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function M(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
9
+ \`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),ke=new Set(["start","stop","cancel","status","prelude-start","upload"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return ke.has(o)?{name:o,index:r}:null}return null}function te(e){let r=l(e,"--owner")?.trim(),o=l(e,"--repo")?.trim();return(r&&!o||!r&&o)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),r&&o?{owner:r,repo:o}:null}async function He(e,r){let o=Oe(e);if(o){let d=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(d,r);return}if(o.name==="prelude-start"){await Ce(d,r);return}if(o.name==="upload"){let{runUpload:y}=await import("./upload-6IA2EKEH.js");await y(d,r);return}if(o.name==="stop"){await Pe(d,r);return}if(o.name==="cancel"){await Ne(d,r);return}await Fe(d,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open","--lockstep"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=se(l(e,"--mode")),n=e.includes("--shell-only")?"shell":e.includes("--no-shell")?"tenant":void 0,s=l(e,"--format");s&&!["webm","mp4","gif","png"].includes(s)&&(console.error(` invalid --format "${s}" \u2014 expected webm | mp4 | gif | png`),process.exit(1));let c=l(e,"--output"),a=Number(l(e,"--duration")??"10");(!Number.isFinite(a)||a<=0)&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 expected a positive number of seconds`),process.exit(1));let u=600;a>u&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${u}s (10m) maximum`),process.exit(1));let m=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let d=Number(p);(!Number.isInteger(d)||d<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),k=l(e,"--max-width")?Number(l(e,"--max-width")):void 0;e.includes("--lockstep")&&(console.error(" --lockstep works with `record start` / `record stop` (stateful mode) \u2014 atomic --duration is wall-clock and cannot bound a virtual-time capture"),process.exit(1));let g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),fe=te(e);if(t==="live"||t==="combined"){c&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await W("record",{originOverride:K,allowGitHubAuth:!0});let d=v({...i,commandTimeoutMs:6e4});try{await H(d),await de(d,t),t==="combined"&&await M(d),await ce(d,K,fe);let y=await le(d,t,t==="combined"?n:void 0);y.ok||(console.error(` start failed: recording store refused to start (${t})`+(y.error?`: ${y.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await ue(d);let O=await me(d);pe(O,x,t)}finally{d.close()}return}let F=p?Number(p):null,$=Me(s,c,F);x&&console.log(" note: --open is ignored for local-file capture \u2014 it applies to --mode live/combined");let h=v({...i,commandTimeoutMs:6e4});try{if(await ne(h),await M(h),$==="png"){let R=F??10,w=I(c,`sootsim-frames-${T()}`);c&&re(c)&&console.log(` note: --frames writes multiple pngs, so --output "${c}" is a directory \u2014 frame-NNN.png files land inside it`),B(w,{recursive:!0});for(let f of be(w))/^frame-\d+\.png$/.test(f)&&q(A(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let S=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!S.ok||!S.requestId)&&(console.error(` frame capture start failed: ${S.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let ge=Date.now()+Math.max(5e3,g),N=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${S.requestId})`});if(f||(console.error(" frame capture result missing"),process.exit(1)),f.done){f.ok||(console.error(` frame capture failed: ${f.error??"unknown error"}`),process.exit(1)),N=f.frames??[];break}Date.now()>=ge&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(P=>setTimeout(P,100))}N.forEach((f,P)=>{let we=`${w}/frame-${String(P+1).padStart(3,"0")}.png`;C(we,Buffer.from(f.data,"base64"))}),console.log(` saved ${N.length} frames`);return}if($==="gif"){let R=F??Math.max(10,Math.round(a*m/3)),w=I(c,`sootsim-${T()}.gif`);B(z(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let S=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${k?`, maxWidth: ${k}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);S||(console.error(" gif capture returned no frames"),process.exit(1)),C(w,Buffer.from(S.data,"base64")),console.log(` saved: ${w} (${L(S.size)})`);return}let d=I(c,`sootsim-${T()}.${$}`);B(z(d),{recursive:!0});let y={format:$,fps:m,durationMs:g};n&&(y.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify(y)})`,`${$} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording|lock already held/i.test(O.error??"")&&console.error(" a prior recording was abandoned and its capture is still\n releasing. retry in ~20s, or recover now with\n `sootsim close --sim <id>` then reopen the sim."),process.exit(1)),console.log(` recording ${$} for ${a}s \u2192 ${d}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${$} encode/flush`,g);_.ok||(console.error(` stop failed: ${_.error??"unknown error"}`),process.exit(1)),_.size||(console.error(" recorder returned an empty blob \u2014 nothing written"),process.exit(1)),await ie(h,d),console.log(` saved: ${d} (${L(_.size)})`)}finally{h.close()}}var Ee=6e3;async function V(e,r){try{return await e.send({type:"evaluate",code:r},{timeoutMs:Ee})}catch(o){let i=o instanceof Error?o.message:String(o);throw/^command timed out after \d+s$/.test(i)&&(console.error(" sim did not respond \u2014 it is connected to the bridge but has not\n loaded an app (or its page is unresponsive). run `sootsim list`\n and target a sim with a loaded app via --sim <id>."),process.exit(1)),o}}async function ne(e){await V(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function M(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
10
10
  would be throttled to ~1fps and produce a frozen-looking file.
11
11
  bring the chrome window to the foreground (un-minimize / switch to
12
12
  its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ie(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}C(r,Buffer.concat(o))}function l(e,r){let o=e.indexOf(r);if(!(o<0||o===e.length-1))return e[o+1]}function Be(e){if(!e)return;let r=re(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Me(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function T(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Ue(){let e=A(ye(),".sootsim","recordings");return B(e,{recursive:!0}),e}function I(e,r){return e?$e(process.cwd(),e):A(Ue(),r)}function L(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function se(e){if(!e)return"video";if(e==="video"||e==="live"||e==="combined")return e;console.error(` invalid --mode "${e}" \u2014 expected video | live | combined`),process.exit(1)}function G(){return A(Se(),`sootsim-recording-${X()}.json`)}function U(){let e=G();if(!he(e))return null;try{return{mode:"video",...JSON.parse(ve(e,"utf8"))}}catch{return q(e,{force:!0}),null}}function Te(e){C(G(),JSON.stringify(e,null,2))}function E(){q(G(),{force:!0})}function j(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as m,b as f}from"./chunk-YTUW6DGN.js";import{a as d}from"./chunk-7RU45W2O.js";import"./chunk-4FCN3KOD.js";import{H as p}from"./chunk-UK7X4OX3.js";import{a as l}from"./chunk-V2SZPQJF.js";import"./chunk-IRNRCBRW.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function S(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function I(t,e=process.cwd()){let n=S(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function D(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function O(t,e=new Date){let n=D(t.appDir),r=n?(await import("./web-7P7SQTFS.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=I(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
4
+ import{a as m,b as f}from"./chunk-G4B2PTUA.js";import{a as d}from"./chunk-CVRPU5KX.js";import"./chunk-FLLDNYUC.js";import{H as p}from"./chunk-LK63GSPB.js";import{a as l}from"./chunk-BDZ7GDAA.js";import"./chunk-BQLQCPXE.js";import{existsSync as h,readFileSync as w}from"node:fs";import{resolve as b}from"node:path";var R="https://contrast.dev",g=8e3;function v(){return{request:(t,e)=>fetch(t,e),confirmSubmission:d,isInteractive:process.stdin.isTTY===!0,now:()=>new Date,stdout:t=>process.stdout.write(t),stderr:t=>process.stderr.write(t)}}function S(t,e){let n=t.indexOf(e);if(n===-1)return null;let r=t[n+1];if(!r||r.startsWith("-"))throw new Error(`${e} requires a value`);return r}function I(t,e=process.cwd()){let n=S(t,"--app"),r=new Set,s=t.indexOf("--app");s!==-1&&(r.add(s),r.add(s+1));let a=[];for(let c=0;c<t.length;c+=1){if(r.has(c))continue;let u=t[c];if(!(u==="--yes"||u==="-y"||u==="--dry-run")){if(u.startsWith("-"))throw new Error(`unknown flag: ${u}`);a.push(u)}}let i=a.join(" ").trim();if(!i)throw new Error("describe the missing or broken compatibility behavior");if(i.length>g)throw new Error(`description is too long (maximum ${g} characters)`);return{appDir:b(e,n??"."),description:i,dryRun:t.includes("--dry-run"),yes:t.includes("--yes")||t.includes("-y")}}function y(t){if(!t||typeof t!="object")return;let e={};for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n)?.value;typeof r=="string"&&(e[n]=r)}return e}function D(t){let e=b(t,"package.json");if(!h(e))return null;let n;try{n=JSON.parse(w(e,"utf8"))}catch{throw new Error(`could not parse ${e}`)}if(!n||typeof n!="object")throw new Error(`${e} must contain a JSON object`);let r=Object.getOwnPropertyDescriptor(n,"name")?.value,s=Object.getOwnPropertyDescriptor(n,"dependencies")?.value,a=Object.getOwnPropertyDescriptor(n,"devDependencies")?.value,i=y(s),c=y(a);return{...typeof r=="string"?{name:r}:{},...i?{dependencies:i}:{},...c?{devDependencies:c}:{}}}async function O(t,e=new Date){let n=D(t.appDir),r=n?(await import("./web-NEPM3SZU.js")).scanDeps(n):null,s=l(),a=p();return{note:t.description,timestamp:e.toISOString(),sootsim_version:a,cli_version:s,bundle:{activeApp:r&&r.projectName!=="unknown"?{appName:r.projectName}:null,reportSource:"cli",runtimeVersion:a,cliVersion:s,platform:process.platform,arch:process.arch,compatibility:r}}}function $(){let t=m(),e=t?.kind==="session"?t.origin.replace(/\/+$/,""):R,n=t&&t.kind!=="github"?f(t):null;return{url:`${e}/api/sootsim/report-issue`,authorization:n}}function k(t){if(!t)return"no package.json found; no compatibility scan attached";let e=t.packages.filter(n=>n.status!=="full"&&n.status!=="not-relevant").length;return`${t.packages.length} React Native ecosystem packages, ${e} needing attention`}function P(t){if(!t||typeof t!="object")return null;let e=Object.getOwnPropertyDescriptor(t,"id")?.value;return typeof e=="string"&&e?e:null}async function V(t,e=v()){let n;try{n=I(t)}catch(o){return e.stderr(` ${o instanceof Error?o.message:String(o)}
5
5
  usage: sootsim report-issue [--app <dir>] [--dry-run] [--yes] "<description>"
6
6
  `),1}if(!h(n.appDir))return e.stderr(` directory not found: ${n.appDir}
7
7
  `),1;let r;try{r=await O(n,e.now())}catch(o){return e.stderr(` could not prepare the issue report: ${o instanceof Error?o.message:String(o)}
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as a}from"./chunk-3YYCMGOR.js";import"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import"./chunk-NRPNLTJI.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";export{a as runRuntime};