sootsim 0.1.168 → 0.1.170
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.
- package/README.md +66 -63
- package/detox/index.ts +3 -3
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/agent-3C2BKQKX.js +46 -0
- package/dist-cli/chunks/{agent-wrapper-M32Q4WRZ.js → agent-wrapper-OIKCYOXZ.js} +2 -2
- package/dist-cli/chunks/{app-fonts-QJCMHTWY.js → app-fonts-25O32NAP.js} +2 -2
- package/dist-cli/chunks/{assert-FUPVKOCV.js → assert-ONEP4NQU.js} +2 -2
- package/dist-cli/chunks/beta-4E5USTEI.js +2 -0
- package/dist-cli/chunks/{camera-6Z3YMMEG.js → camera-RORW4MAA.js} +2 -2
- package/dist-cli/chunks/{chunk-MHEP6UMF.js → chunk-25RFZ6WP.js} +6 -6
- package/dist-cli/chunks/chunk-35GMFXVJ.js +2 -0
- package/dist-cli/chunks/{chunk-BKYCQJKE.js → chunk-3TM7DHWE.js} +2 -2
- package/dist-cli/chunks/{chunk-MGB5W5VY.js → chunk-4XVY5TUF.js} +2 -2
- package/dist-cli/chunks/{chunk-2DDHS4Z3.js → chunk-5ZHUPPS5.js} +1 -1
- package/dist-cli/chunks/{chunk-MO3L5VGD.js → chunk-6FAEORJ2.js} +2 -2
- package/dist-cli/chunks/{chunk-HIAR3KTT.js → chunk-6TSXXN2W.js} +4 -4
- package/dist-cli/chunks/chunk-AJF3QF4K.js +1 -0
- package/dist-cli/chunks/{chunk-QMQBMB4S.js → chunk-AUCNBB6Q.js} +2 -2
- package/dist-cli/chunks/{chunk-27Q45J2N.js → chunk-BP3EGFER.js} +2 -2
- package/dist-cli/chunks/{chunk-XWG6NJJE.js → chunk-DAXME77O.js} +3 -3
- package/dist-cli/chunks/chunk-DGJTEFE7.js +13 -0
- package/dist-cli/chunks/chunk-DIRDEKRW.js +23 -0
- package/dist-cli/chunks/{chunk-QWNLVJ4P.js → chunk-DKTC53HV.js} +1 -1
- package/dist-cli/chunks/{chunk-QBYYAPTB.js → chunk-DWXC25XG.js} +1 -1
- package/dist-cli/chunks/{chunk-OC4Y3UIV.js → chunk-E3FKMY5E.js} +1 -1
- package/dist-cli/chunks/chunk-ER4GBJRY.js +2 -0
- package/dist-cli/chunks/chunk-EX6V4ZV6.js +6 -0
- package/dist-cli/chunks/{chunk-MRPFNK2L.js → chunk-GQH3PD3W.js} +5 -5
- package/dist-cli/chunks/{chunk-IHVCKNFX.js → chunk-GST4YSBO.js} +4 -4
- package/dist-cli/chunks/{chunk-YNTWHWFY.js → chunk-I4RV5I6V.js} +1 -1
- package/dist-cli/chunks/{chunk-AFPKG2L6.js → chunk-I5WXVKR6.js} +1 -1
- package/dist-cli/chunks/{chunk-WUKEI6SL.js → chunk-IO7KAVFK.js} +2 -2
- package/dist-cli/chunks/{chunk-7YQ7CJFO.js → chunk-LMX7UB5T.js} +2 -2
- package/dist-cli/chunks/{chunk-ZIEXUO4S.js → chunk-N4YCSOCR.js} +2 -2
- package/dist-cli/chunks/{chunk-YR7WIUVL.js → chunk-NI3L4A65.js} +2 -2
- package/dist-cli/chunks/{chunk-TXZKEW6C.js → chunk-ODGEH6OW.js} +2 -2
- package/dist-cli/chunks/{chunk-LCHPOJOO.js → chunk-Q4NDYO2U.js} +1 -1
- package/dist-cli/chunks/{chunk-SHCQRQJA.js → chunk-QPRF3UYX.js} +2 -2
- package/dist-cli/chunks/chunk-QXJMXSQP.js +2 -0
- package/dist-cli/chunks/chunk-RLKSLUNR.js +2 -0
- package/dist-cli/chunks/{chunk-XUABY4IN.js → chunk-S244IT4W.js} +1 -1
- package/dist-cli/chunks/chunk-SDHOM6ZG.js +62 -0
- package/dist-cli/chunks/{chunk-ENK2SG5R.js → chunk-TXKOJ3P5.js} +1 -1
- package/dist-cli/chunks/{chunk-QGL6XWHB.js → chunk-UDMJSFSH.js} +8 -8
- package/dist-cli/chunks/{chunk-FZ656TJA.js → chunk-ULV4PWN4.js} +1 -1
- package/dist-cli/chunks/{chunk-VHVFXSXT.js → chunk-V4HTQPMA.js} +2 -2
- package/dist-cli/chunks/chunk-VATHADSI.js +2 -0
- package/dist-cli/chunks/{chunk-BSKD5K5N.js → chunk-VUOCUCJ2.js} +2 -2
- package/dist-cli/chunks/{chunk-BUCBIG2A.js → chunk-WN7R4GL4.js} +1 -1
- package/dist-cli/chunks/chunk-XOTJD6PU.js +118 -0
- package/dist-cli/chunks/chunk-XUNPVF5K.js +1 -0
- package/dist-cli/chunks/{chunk-SMBSZIDN.js → chunk-YMFSRCHL.js} +4 -4
- package/dist-cli/chunks/{chunk-JJIJVKAV.js → chunk-YV74D4MG.js} +2 -2
- package/dist-cli/chunks/{chunk-5GGI6NGS.js → chunk-YVTWSC5Y.js} +3 -3
- package/dist-cli/chunks/cli-version-EKKWCHRX.js +2 -0
- package/dist-cli/chunks/{compat-CH6BYJ4T.js → compat-ZVZM5TML.js} +3 -3
- package/dist-cli/chunks/control-TWINYHMY.js +2 -0
- package/dist-cli/chunks/{cpu-profile-VMHZN3WB.js → cpu-profile-RWGQTWLP.js} +2 -2
- package/dist-cli/chunks/daemon-AOSMNBD4.js +2 -0
- package/dist-cli/chunks/{debug-WQP3TJ62.js → debug-R7PL3MHF.js} +5 -5
- package/dist-cli/chunks/{detox-IAWL5YVJ.js → detox-UIJMKIGQ.js} +2 -2
- package/dist-cli/chunks/{device-GYJ6BHY7.js → device-7SRVX2PU.js} +2 -2
- package/dist-cli/chunks/{diagnose-GFDUQYHG.js → diagnose-OXAKLLZT.js} +2 -2
- package/dist-cli/chunks/drivers-BPPG22VP.js +2 -0
- package/dist-cli/chunks/{electron-CF7HUVQL.js → electron-CTCH4VOL.js} +3 -3
- package/dist-cli/chunks/flow-KA2WCWDL.js +2 -0
- package/dist-cli/chunks/help-XBQIK2XY.js +2 -0
- package/dist-cli/chunks/{hints-HF2LDTK7.js → hints-P3ZIAP3Z.js} +2 -2
- package/dist-cli/chunks/home-paths-ZSCTLOYE.js +2 -0
- package/dist-cli/chunks/{inspect-P2MPMFR3.js → inspect-2ABU5WET.js} +24 -24
- package/dist-cli/chunks/{install-desktop-QYLXYZQJ.js → install-desktop-4NOQ3YY4.js} +3 -3
- package/dist-cli/chunks/{keys-LJ37JUG2.js → keys-RPVEUNUC.js} +2 -2
- package/dist-cli/chunks/{login-RUZ7MAPC.js → login-6D6DXBO3.js} +4 -4
- package/dist-cli/chunks/{logout-4RE2BP3H.js → logout-T5OSWDTJ.js} +2 -2
- package/dist-cli/chunks/{maestro-V62C4AQM.js → maestro-MKCHEOKA.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-EYD2K3QH.js +2 -0
- package/dist-cli/chunks/{preview-3HWBUCVM.js → preview-S52ZNGN2.js} +2 -2
- package/dist-cli/chunks/{profile-D2CAEFO5.js → profile-IG5F3LTL.js} +2 -2
- package/dist-cli/chunks/{react-PXYQBCAK.js → react-275HCOFC.js} +2 -2
- package/dist-cli/chunks/{record-R7IDN3T6.js → record-YT63SUHO.js} +4 -4
- package/dist-cli/chunks/runtime-WYZMDZAK.js +2 -0
- package/dist-cli/chunks/{screenshot-YGGPEX7B.js → screenshot-5AZ4MY3A.js} +4 -4
- package/dist-cli/chunks/{screenshot-mode-QDUWRQUF.js → screenshot-mode-4S4EX2XJ.js} +2 -2
- package/dist-cli/chunks/{screenshots-6PNFJNLF.js → screenshots-UUJNZSG7.js} +2 -2
- package/dist-cli/chunks/screenshots-capture-I66JD3AD.js +41 -0
- package/dist-cli/chunks/{server-7Q3NW5MV.js → serve-O46Q4WAD.js} +18 -17
- package/dist-cli/chunks/setup-C44N54O7.js +77 -0
- package/dist-cli/chunks/skills-PPVS4XOQ.js +40 -0
- package/dist-cli/chunks/{slides-HJXHSWEF.js → slides-ZWSZJZUY.js} +2 -2
- package/dist-cli/chunks/store-3SLGP5O3.js +2 -0
- package/dist-cli/chunks/telemetry-2XLLWARK.js +2 -0
- package/dist-cli/chunks/{test-4TUHEODP.js → test-362G4M5A.js} +3 -3
- package/dist-cli/chunks/{three-mode-IL5442GI.js → three-mode-JNVTM2UT.js} +2 -2
- package/dist-cli/chunks/{timeline-JILPOKRF.js → timeline-VKC6ULRK.js} +2 -2
- package/dist-cli/chunks/{upgrade-SL5WMHSF.js → upgrade-SJPX4SPA.js} +2 -2
- package/dist-cli/chunks/upload-MXOBV6RT.js +2 -0
- package/dist-cli/chunks/version-4Z7AFNH3.js +4 -0
- package/dist-cli/chunks/web-WB2I2AWL.js +2 -0
- package/dist-cli/chunks/{what-happened-KKAJOJWO.js → what-happened-KQCWMQJT.js} +3 -3
- package/dist-cli/chunks/{whoami-QDJPYI2O.js → whoami-K76PXAD4.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +4 -5
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +3 -6
- package/dist-lib/beta.mjs +3 -5
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +4 -4
- package/dist-lib/dev-bundle-resolution.cjs +2 -9
- package/dist-lib/home-paths.cjs +59 -1
- package/dist-lib/host/bridge-host.cjs +67 -5
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +2 -2
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +5 -4
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +136 -20
- package/dist-lib/vite.cjs +2 -2
- package/package.json +2 -1
- package/scripts/dev-server-scanner.ts +3 -4
- package/scripts/postinstall.cjs +2 -2
- package/scripts/preuninstall.cjs +5 -7
- package/skills/soot.md +178 -0
- package/skills/sootsim-debug.md +384 -0
- package/skills/sootsim-setup.md +96 -0
- package/skills/sootsim-test.md +292 -0
- package/skills/sootsim-visual.md +122 -0
- package/src/agent-daemon-client.ts +4 -14
- package/src/beta.ts +3 -5
- package/src/dev-bundle-resolution.ts +1 -14
- package/src/home-paths.ts +77 -2
- package/src/host/agent-host.ts +1 -1
- package/src/host/bridge-host.ts +65 -6
- package/src/metro-plugin.ts +1 -1
- package/src/runtime-assets.ts +1 -1
- package/src/skills/builtin/a11y-review.ts +4 -1
- package/src/skills/builtin/perf-profile.ts +4 -1
- package/src/skills/builtin/screenshot-all.ts +4 -1
- package/src/skills/builtin/visual-diff.ts +4 -1
- package/src/vite-plugin.ts +1 -0
- package/dist-cli/chunks/agent-V5N6TSVL.js +0 -46
- package/dist-cli/chunks/auto-bootstrap-BMAKK4FR.js +0 -2
- package/dist-cli/chunks/beta-ERD6Z2EE.js +0 -2
- package/dist-cli/chunks/chunk-2UDB2A2Z.js +0 -119
- package/dist-cli/chunks/chunk-4PXQB4KC.js +0 -2
- package/dist-cli/chunks/chunk-4TJ2FLZX.js +0 -2
- package/dist-cli/chunks/chunk-5PEYA6XI.js +0 -1
- package/dist-cli/chunks/chunk-6MBEHPFK.js +0 -1
- package/dist-cli/chunks/chunk-BLRVSHCX.js +0 -7
- package/dist-cli/chunks/chunk-EMWWY2MH.js +0 -2
- package/dist-cli/chunks/chunk-FAEIKMNH.js +0 -1
- package/dist-cli/chunks/chunk-L62FIJ3P.js +0 -2
- package/dist-cli/chunks/chunk-L7F7QBGM.js +0 -23
- package/dist-cli/chunks/chunk-MQWZBKOF.js +0 -5
- package/dist-cli/chunks/chunk-N6CHIBHJ.js +0 -79
- package/dist-cli/chunks/chunk-PPIRXSWS.js +0 -13
- package/dist-cli/chunks/cli-version-P4CDXF4L.js +0 -2
- package/dist-cli/chunks/config-ST33XAYN.js +0 -45
- package/dist-cli/chunks/control-FW6XTHQE.js +0 -2
- package/dist-cli/chunks/daemon-5DEUBHYC.js +0 -67
- package/dist-cli/chunks/drivers-VTVBB4KQ.js +0 -2
- package/dist-cli/chunks/flow-GZZ7OVM3.js +0 -2
- package/dist-cli/chunks/help-EUSCLRLF.js +0 -2
- package/dist-cli/chunks/home-paths-ZBDTVPMF.js +0 -2
- package/dist-cli/chunks/install-N4QT365P.js +0 -2
- package/dist-cli/chunks/launch-3TUC2YGM.js +0 -16
- package/dist-cli/chunks/optional-demo-registry-ZEPUCMEO.js +0 -2
- package/dist-cli/chunks/runtime-RQOM2I2S.js +0 -2
- package/dist-cli/chunks/runtime-delivery-K4LFILF7.js +0 -2
- package/dist-cli/chunks/setup-repo-UZMY3JFZ.js +0 -2
- package/dist-cli/chunks/skills-GDYPRMR5.js +0 -10
- package/dist-cli/chunks/start-HDWGM5WJ.js +0 -23
- package/dist-cli/chunks/store-5DYIIFYH.js +0 -2
- package/dist-cli/chunks/telemetry-TMT3DYZU.js +0 -2
- package/dist-cli/chunks/upload-35XW4DMZ.js +0 -2
- package/dist-cli/chunks/version-ZEBIO5HC.js +0 -4
- package/dist-cli/chunks/web-JICQ5RN4.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as y,c as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as y,c as v}from"./chunk-25RFZ6WP.js";import"./chunk-YV74D4MG.js";import"./chunk-AJF3QF4K.js";import"./chunk-N4YCSOCR.js";import{b as h,c as w}from"./chunk-AUCNBB6Q.js";import"./chunk-DGJTEFE7.js";import"./chunk-6TSXXN2W.js";import"./chunk-YMFSRCHL.js";import"./chunk-Q4NDYO2U.js";import"./chunk-I5WXVKR6.js";import"./chunk-GST4YSBO.js";import"./chunk-S244IT4W.js";import"./chunk-LMX7UB5T.js";import"./chunk-GQH3PD3W.js";import"./chunk-BP3EGFER.js";import"./chunk-QXJMXSQP.js";import"./chunk-TXKOJ3P5.js";import"./chunk-DIRDEKRW.js";import"./chunk-6FAEORJ2.js";import"./chunk-NI3L4A65.js";import"./chunk-QPRF3UYX.js";import"./chunk-ODGEH6OW.js";import"./chunk-ER4GBJRY.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-VUOCUCJ2.js";import"./chunk-V4HTQPMA.js";import"./chunk-WN7R4GL4.js";import*as n from"fs";import*as a from"path";var S=[".maestro","maestro"];function k(){console.log(`
|
|
3
3
|
sootsim maestro \u2014 run maestro YAML flows against sootsim (drop-in)
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-WN7R4GL4.js";import{resolve as c,dirname as m}from"path";import{fileURLToPath as a}from"url";var t=m(a(import.meta.resolve("sootsim-engine/package.json")));async function g(o,r){(o.includes("--help")||o.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim preview \u2014 production-like preview
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as s,c as i,d as t,e as n,f as c}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as s,c as i,d as t,e as n,f as c}from"./chunk-LMX7UB5T.js";import"./chunk-EX6V4ZV6.js";import"./chunk-WN7R4GL4.js";function f(){console.log(`
|
|
3
3
|
sootsim profile \u2014 manage isolated storage profiles
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as w,e as b,h as m,i as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as w,e as b,h as m,i as f}from"./chunk-DIRDEKRW.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-WN7R4GL4.js";function h(){console.log(`
|
|
3
3
|
sootsim react \u2014 inspect React component render cost in the tenant worker
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P}from"./chunk-N4YCSOCR.js";import"./chunk-GQH3PD3W.js";import{d as Z,f as ee}from"./chunk-BP3EGFER.js";import"./chunk-QXJMXSQP.js";import"./chunk-TXKOJ3P5.js";import{c as b,e as v,f as Q}from"./chunk-DIRDEKRW.js";import{d as Y}from"./chunk-6FAEORJ2.js";import"./chunk-NI3L4A65.js";import"./chunk-QPRF3UYX.js";import"./chunk-ULV4PWN4.js";import{b as X}from"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-WN7R4GL4.js";import{existsSync as we,mkdirSync as E,readdirSync as he,readFileSync as be,rmSync as J,writeFileSync as I}from"fs";import{homedir as ve,tmpdir as ye}from"os";import{dirname as W,extname as oe,join as N,resolve as Se}from"path";var z=24e4,Re=9e4,$e=3e4;async function D(e,r,o,i){let t=Math.max(2e4,i+$e);try{return await e.send({type:"evaluate",code:r},{timeoutMs:t})}catch(n){let s=n instanceof Error?n.message:String(n);/^command timed out after \d+s$/.test(s)&&(console.error(` ${o} stalled \u2014 the render host did not finish within ${Math.round(t/1e3)}s; it is likely contended or wedged.
|
|
3
3
|
the capture lock auto-releases, so simply retry the recording.
|
|
4
4
|
if it persists, recover the sim with \`sootsim close --sim <id>\`.`),process.exit(1)),/render host not available|already streaming|already recording/i.test(s)&&(console.error(` ${o} failed: ${s}
|
|
5
5
|
a prior recording was abandoned and its capture is still
|
|
6
6
|
releasing. the lock self-heals in ~${Math.round((i+2e4)/1e3)}s \u2014 retry then, or recover now with
|
|
7
|
-
\`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),xe=new Set(["start","stop","cancel","status","prelude-start"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return xe.has(o)?{name:o,index:r}:null}return null}function ke(){let e=process.env,r=(e.SOOT_BRANCH||e.GITHUB_HEAD_REF||e.GITHUB_REF_NAME||"").trim(),o=(e.SOOT_SHA||e.GITHUB_SHA||"").trim(),i=(e.SOOT_PR_NUMBER||"").trim(),t=i?Number.parseInt(i,10):Number.NaN,n=(e.SOOT_PR_TITLE||"").trim();return{branch:r||void 0,commitSha:o||void 0,pullRequestNumber:Number.isFinite(t)&&t>0?t:void 0,pullRequestTitle:n||void 0}}function re(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 qe(e,r){let o=Oe(e);if(o){let c=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(c,r);return}if(o.name==="prelude-start"){await Ne(c,r);return}if(o.name==="stop"){await Pe(c,r);return}if(o.name==="cancel"){await Fe(c,r);return}await Ae(c,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=ie(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 d=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 m=600;a>m&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${m}s (10m) maximum`),process.exit(1));let u=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let c=Number(p);(!Number.isInteger(c)||c<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),j=l(e,"--max-width")?Number(l(e,"--max-width")):void 0,g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),pe=re(e);if(t==="live"||t==="combined"){d&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:K,allowGitHubAuth:!0});let c=v({...i,commandTimeoutMs:6e4});try{await q(c),await ae(c,t),t==="combined"&&await B(c),await de(c,K,pe);let $=await ce(c,t,t==="combined"?n:void 0);$.ok||(console.error(` start failed: recording store refused to start (${t})`+($.error?`: ${$.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await le(c);let O=await ue(c);me(O,x,t)}finally{c.close()}return}let C=p?Number(p):null,S=Te(s,d,C);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 te(h),await B(h),S==="png"){let R=C??10,w=U(d,`sootsim-frames-${M()}`);d&&oe(d)&&console.log(` note: --frames writes multiple pngs, so --output "${d}" is a directory \u2014 frame-NNN.png files land inside it`),E(w,{recursive:!0});for(let f of he(w))/^frame-\d+\.png$/.test(f)&&J(N(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let y=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!y.ok||!y.requestId)&&(console.error(` frame capture start failed: ${y.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let fe=Date.now()+Math.max(5e3,g),A=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${y.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)),A=f.frames??[];break}Date.now()>=fe&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(F=>setTimeout(F,100))}A.forEach((f,F)=>{let ge=`${w}/frame-${String(F+1).padStart(3,"0")}.png`;I(ge,Buffer.from(f.data,"base64"))}),console.log(` saved ${A.length} frames`);return}if(S==="gif"){let R=C??Math.max(10,Math.round(a*u/3)),w=U(d,`sootsim-${M()}.gif`);E(W(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let y=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${j?`, maxWidth: ${j}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);y||(console.error(" gif capture returned no frames"),process.exit(1)),I(w,Buffer.from(y.data,"base64")),console.log(` saved: ${w} (${G(y.size)})`);return}let c=U(d,`sootsim-${M()}.${S}`);E(W(c),{recursive:!0});let $={format:S,fps:u,durationMs:g};n&&($.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify($)})`,`${S} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording/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 ${S} for ${a}s \u2192 ${c}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${S} 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 ne(h,c),console.log(` saved: ${c} (${G(_.size)})`)}finally{h.close()}}var Ee=6e3;async function L(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 te(e){await L(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await
|
|
7
|
+
\`sootsim close --sim <id>\` and reopen the sim.`),process.exit(1)),console.error(` ${o} failed: ${s}`),process.exit(1)}}var _e=new Set(["--sim","--port","-p","--mode","--duration","--fps","--format","--output","-o","--frames","--max-width","--origin","--owner","--repo"]),xe=new Set(["start","stop","cancel","status","prelude-start"]);function Oe(e){for(let r=0;r<e.length;r++){let o=e[r];if(o.startsWith("-")){_e.has(o)&&r++;continue}return xe.has(o)?{name:o,index:r}:null}return null}function ke(){let e=process.env,r=(e.SOOT_BRANCH||e.GITHUB_HEAD_REF||e.GITHUB_REF_NAME||"").trim(),o=(e.SOOT_SHA||e.GITHUB_SHA||"").trim(),i=(e.SOOT_PR_NUMBER||"").trim(),t=i?Number.parseInt(i,10):Number.NaN,n=(e.SOOT_PR_TITLE||"").trim();return{branch:r||void 0,commitSha:o||void 0,pullRequestNumber:Number.isFinite(t)&&t>0?t:void 0,pullRequestTitle:n||void 0}}function re(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 qe(e,r){let o=Oe(e);if(o){let c=[...e.slice(0,o.index),...e.slice(o.index+1)];if(o.name==="start"){await Ie(c,r);return}if(o.name==="prelude-start"){await Ne(c,r);return}if(o.name==="stop"){await Pe(c,r);return}if(o.name==="cancel"){await Fe(c,r);return}await Ae(c,r);return}let i=b(e,{port:r.port,stripBooleanFlags:["--no-shell","--shell-only","--open"],stripValueFlags:["--mode","--duration","--fps","--format","--output","--frames","--max-width","--origin","--owner","--repo"]}),t=ie(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 d=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 m=600;a>m&&(console.error(` invalid --duration "${l(e,"--duration")}" \u2014 exceeds the ${m}s (10m) maximum`),process.exit(1));let u=Number(l(e,"--fps")??"30"),p=l(e,"--frames");if(p!==void 0){let c=Number(p);(!Number.isInteger(c)||c<=0)&&(console.error(` invalid --frames "${p}" \u2014 expected a positive integer count`),process.exit(1))}let x=e.includes("--open"),j=l(e,"--max-width")?Number(l(e,"--max-width")):void 0,g=Math.max(100,Math.round(a*1e3)),K=l(e,"--origin"),pe=re(e);if(t==="live"||t==="combined"){d&&console.log(` note: --output is ignored for --mode ${t} \u2014 the recording uploads to /preview/<id>`),n&&t==="live"&&console.log(` note: --${n==="shell"?"shell-only":"no-shell"} is ignored for --mode live \u2014 live recordings capture events only, no video`),await P("record",{originOverride:K,allowGitHubAuth:!0});let c=v({...i,commandTimeoutMs:6e4});try{await q(c),await ae(c,t),t==="combined"&&await B(c),await de(c,K,pe);let $=await ce(c,t,t==="combined"?n:void 0);$.ok||(console.error(` start failed: recording store refused to start (${t})`+($.error?`: ${$.error}`:"")),process.exit(1)),console.log(` recording ${t} for ${a}s`),await new Promise(_=>setTimeout(_,g)),await le(c);let O=await ue(c);me(O,x,t)}finally{c.close()}return}let C=p?Number(p):null,S=Te(s,d,C);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 te(h),await B(h),S==="png"){let R=C??10,w=U(d,`sootsim-frames-${M()}`);d&&oe(d)&&console.log(` note: --frames writes multiple pngs, so --output "${d}" is a directory \u2014 frame-NNN.png files land inside it`),E(w,{recursive:!0});for(let f of he(w))/^frame-\d+\.png$/.test(f)&&J(N(w,f),{force:!0});console.log(` sampling ${R} frames over ${a}s \u2192 ${w}`);let y=await h.send({type:"evaluate",code:`window.__sootsimRecorder.startFrameCapture({ count: ${R}, durationMs: ${g}${n?`, layers: ${JSON.stringify(n)}`:""} })`});(!y.ok||!y.requestId)&&(console.error(` frame capture start failed: ${y.error??"unknown error"}`),process.exit(1)),await new Promise(f=>setTimeout(f,g));let fe=Date.now()+Math.max(5e3,g),A=null;for(;;){let f=await h.send({type:"evaluate",code:`window.__sootsimRecorder.getFrameCaptureResult(${y.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)),A=f.frames??[];break}Date.now()>=fe&&(console.error(" frame capture timed out"),process.exit(1)),await new Promise(F=>setTimeout(F,100))}A.forEach((f,F)=>{let ge=`${w}/frame-${String(F+1).padStart(3,"0")}.png`;I(ge,Buffer.from(f.data,"base64"))}),console.log(` saved ${A.length} frames`);return}if(S==="gif"){let R=C??Math.max(10,Math.round(a*u/3)),w=U(d,`sootsim-${M()}.gif`);E(W(w),{recursive:!0}),console.log(` encoding gif: ${R} frames over ${a}s \u2192 ${w}`);let y=await D(h,`window.__sootsimRecorder.captureGif({ frames: ${R}, durationMs: ${g}${j?`, maxWidth: ${j}`:""}${n?`, layers: ${JSON.stringify(n)}`:""} })`,"gif encode",g);y||(console.error(" gif capture returned no frames"),process.exit(1)),I(w,Buffer.from(y.data,"base64")),console.log(` saved: ${w} (${G(y.size)})`);return}let c=U(d,`sootsim-${M()}.${S}`);E(W(c),{recursive:!0});let $={format:S,fps:u,durationMs:g};n&&($.layers=n);let O=await D(h,`window.__sootsimRecorder.start(${JSON.stringify($)})`,`${S} start`,g);O.ok||(console.error(` start failed: ${O.error??"unknown error"}`),/render host not available|already streaming|already recording/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 ${S} for ${a}s \u2192 ${c}`),await new Promise(R=>setTimeout(R,g));let _=await D(h,"window.__sootsimRecorder.stop()",`${S} 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 ne(h,c),console.log(` saved: ${c} (${G(_.size)})`)}finally{h.close()}}var Ee=6e3;async function L(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 te(e){await L(e,'typeof window.__sootsimRecorder !== "undefined"')||(console.error(" window.__sootsimRecorder missing \u2014 is sootsim engine running in this sim?"),process.exit(1))}async function B(e){let{hidden:r}=await Q(e);r&&(console.error(` refusing to record: the sootsim tab is hidden, so frame capture
|
|
8
8
|
would be throttled to ~1fps and produce a frozen-looking file.
|
|
9
9
|
bring the chrome window to the foreground (un-minimize / switch to
|
|
10
10
|
its tab) or run the recording in headless playwright, then retry.`),process.exit(1))}async function ne(e,r){let o=[],i=0;for(;;){let t=await e.send({type:"evaluate",code:`window.__sootsimRecorder.getBlobBase64({ offset: ${i}, chunk: 2097152 })`});if(!t)throw new Error("no blob available on recorder");if(o.push(Buffer.from(t.data,"base64")),i=t.offset,t.done)break}I(r,Buffer.concat(o))}function 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=oe(e).toLowerCase().replace(/^\./,"");if(r==="webm"||r==="mp4"||r==="gif")return r;if(r==="png")return"png"}function Te(e,r,o){return e||(o!=null?"png":Be(r)??"webm")}function M(){return new Date().toISOString().replace(/[:T]/g,"-").replace(/\..+/,"")}function Me(){let e=N(ve(),".sootsim","recordings");return E(e,{recursive:!0}),e}function U(e,r){return e?Se(process.cwd(),e):N(Me(),r)}function G(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(2)}MB`}function ie(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 H(){return N(ye(),`sootsim-recording-${X()}.json`)}function T(){let e=H();if(!we(e))return null;try{return{mode:"video",...JSON.parse(be(e,"utf8"))}}catch{return J(e,{force:!0}),null}}function Ue(e){I(H(),JSON.stringify(e,null,2))}function k(){J(H(),{force:!0})}function V(e,r){e&&r.simId&&e!==r.simId&&console.log(` note: the tracked recording session is on sim ${r.simId}, not the
|
|
@@ -67,4 +67,4 @@ import{a as P}from"./chunk-ZIEXUO4S.js";import"./chunk-MRPFNK2L.js";import{d as
|
|
|
67
67
|
})()`})||(console.error(" SootSim.bridges.setSession missing \u2014 this sim is running an engine\n build without CLI-injected preview auth. reload the sim or open a\n fresh one (`sootsim open --new`); if it persists, update sootsim."),process.exit(1))}async function ce(e,r,o){let i=o?JSON.stringify(o):"undefined";return await e.send({type:"evaluate",code:`window.SootSim.bridges.startRecording(${JSON.stringify(r)}, ${i}, { skipEntitlement: true })`})===!0?{ok:!0,error:null}:{ok:!1,error:await e.send({type:"evaluate",code:"(window.SootSim?.bridges?.getRecordingStartError?.() ?? null)"}).catch(()=>null)??null}}async function le(e){await e.send({type:"evaluate",code:"void window.SootSim.bridges.stopRecording()"})}async function ue(e){let r=Date.now()+z;for(;Date.now()<r;){let o=await e.send({type:"evaluate",code:"(() => { const s = window.SootSim?.bridges?.getRecordingState?.(); return s ? { state: s.state, lastUpload: s.lastUpload, uploadError: s.uploadError } : null })()"});if(o&&o.state==="idle"){if(o.uploadError)return{uploadError:o.uploadError};if(o.lastUpload?.previewUrl)return{previewUrl:o.lastUpload.previewUrl,eventCount:o.lastUpload.eventCount}}await new Promise(i=>setTimeout(i,300))}return{uploadError:`upload did not settle within ${z/1e3}s`}}function me(e,r,o){e.uploadError&&(console.error(` upload failed: ${e.uploadError}`),process.exit(1)),e.previewUrl||(console.error(" upload returned no preview URL"),process.exit(1)),console.log(` preview: ${e.previewUrl}`),console.log(` note: this URL is content-addressed \u2014 re-recording the same bundle
|
|
68
68
|
replaces this capture at the same /preview/<id>.`),(o==="live"||o==="combined")&&typeof e.eventCount=="number"&&console.log(` captured ${e.eventCount} event${e.eventCount===1?"":"s"}`),(o==="live"||o==="combined")&&e.eventCount===0&&console.log(o==="combined"?` note: this combined recording captured no events \u2014 the Live tab has
|
|
69
69
|
nothing to replay. Video will play the captured screen recording.`:` note: this live recording captured no events \u2014 the preview has nothing
|
|
70
|
-
to replay and will boot a fresh interactive session instead.`),r&&
|
|
70
|
+
to replay and will boot a fresh interactive session instead.`),r&&Y(e.previewUrl)}export{Be as extToFormat,Te as resolveFormat,qe as runRecord,l as valueOf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a}from"./chunk-YVTWSC5Y.js";import"./chunk-DAXME77O.js";import"./chunk-DIRDEKRW.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-WN7R4GL4.js";export{a as runRuntime};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-E3FKMY5E.js";import{a as E}from"./chunk-YV74D4MG.js";import"./chunk-AJF3QF4K.js";import{r as y}from"./chunk-Q4NDYO2U.js";import{c as x,d as v,e as S,f as b,h as _}from"./chunk-DIRDEKRW.js";import"./chunk-ODGEH6OW.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-VUOCUCJ2.js";import{g as w}from"./chunk-V4HTQPMA.js";import"./chunk-WN7R4GL4.js";import{mkdirSync as $,writeFileSync as A}from"fs";import{dirname as M,resolve as F}from"path";async function Q(t,o){let e=q(t);(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim screenshot \u2014 capture the canvas as a PNG
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -27,9 +27,9 @@ examples:
|
|
|
27
27
|
sootsim screenshot --with-frame --output framed.png
|
|
28
28
|
sootsim screenshot --area 0,200,393,400 --output hero.png
|
|
29
29
|
sootsim screenshot --id loginButton --output button.png
|
|
30
|
-
`),process.exit(0));let r=V(e);if(r.length>0){for(let{flag:a,suggestion:m}of r)console.error(m?` unknown flag: ${a} (did you mean ${m}?)`:` unknown flag: ${a}`);console.error(" run `sootsim screenshot --help` for the list of supported flags"),process.exit(1)}let s=e.includes("--gallery"),n=e.includes("--themes"),u=G(e),c=U(e);if(s||n)return u&&(console.error(" --with-frame is not supported with --gallery / --themes"),process.exit(1)),T(e,o);u&&e.some(a=>a==="--area"||a==="--id"||a==="--text")&&(console.error(" --with-frame only supports full-screen capture for now"),console.error(" remove --area / --id / --text, or capture raw and compose later"),process.exit(1));let i=
|
|
30
|
+
`),process.exit(0));let r=V(e);if(r.length>0){for(let{flag:a,suggestion:m}of r)console.error(m?` unknown flag: ${a} (did you mean ${m}?)`:` unknown flag: ${a}`);console.error(" run `sootsim screenshot --help` for the list of supported flags"),process.exit(1)}let s=e.includes("--gallery"),n=e.includes("--themes"),u=G(e),c=U(e);if(s||n)return u&&(console.error(" --with-frame is not supported with --gallery / --themes"),process.exit(1)),T(e,o);u&&e.some(a=>a==="--area"||a==="--id"||a==="--text")&&(console.error(" --with-frame only supports full-screen capture for now"),console.error(" remove --area / --id / --text, or capture raw and compose later"),process.exit(1));let i=x(e,{port:o.port,stripBooleanFlags:["--with-frame","--no-frame","--no-shell","--shell-only"],stripValueFlags:["--output","--area","--id","--text"]}),l=O(e),p=await D(e);if(await N(i.wsPort)){try{await L(i,l,p,u,c)}catch(a){console.error(` screenshot failed: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}return}u&&(console.error(" --with-frame requires a running sootsim bridge"),console.error(" open the app in a live sim first, then rerun the command"),process.exit(1)),p&&(console.error(" --area / --id / --text require a running sootsim bridge"),console.error(" start one with `sootsim serve`, `sootsim electron`, or your project dev server"),process.exit(1)),await T(e,o)}async function N(t){let o=v(t,{commandTimeoutMs:1e3});try{return await o.listSims(),!0}catch{return!1}finally{o.close()}}async function D(t){let o=t.find((s,n)=>t[n-1]==="--area");if(o){let s=o.split(",").map(l=>Number(l.trim()));if(s.length!==4||s.some(l=>!Number.isFinite(l)))throw new Error(`--area expects x,y,w,h (got "${o}")`);let[n,u,c,i]=s;return{x:n,y:u,w:c,h:i}}let e=t.find((s,n)=>t[n-1]==="--id"),r=t.find((s,n)=>t[n-1]==="--text");return e||r?{__matcher:{id:e,text:r}}:null}async function L(t,o,e,r,s){let n=S({...t,commandTimeoutMs:45e3});try{(await b(n)).hidden&&process.stderr.write(` \u26A0 screenshot will capture the LAST PAINTED canvas \u2014 likely stale.
|
|
31
31
|
navigation/\`shell\` commands sent before this screenshot may not
|
|
32
32
|
have repainted yet. focus the tab manually or \`sootsim --sim <id>\`
|
|
33
33
|
to target a visible sim before capturing.
|
|
34
34
|
|
|
35
|
-
`);let c=Number(process.env.SOOT_SCREENSHOT_READY_MAX_MS)||9e4,i=await
|
|
35
|
+
`);let c=Number(process.env.SOOT_SCREENSHOT_READY_MAX_MS)||9e4,i=await y(n,c);if(!i.ready)throw new Error(`app not ready to capture after ${Math.round(i.elapsedMs/1e3)}s`+(i.loadingText?` (still showing "${i.loadingText}")`:"")+"; refusing to capture the boot/loading card. retry once the app paints.");let l=e,p=e?.__matcher;if(p){let h=await n.send({type:"evaluate",code:R(p)});if(!h)throw new Error(p.id?`no node with id "${p.id}"`:`no node matching text "${p.text}"`);l=h}let d=l?{x:l.x,y:l.y,w:l.w,h:l.h}:void 0,a={type:"screenshot"};s&&(a.layers=s),d&&(a.crop=d);let k=(await n.send(a)).replace(/^data:image\/png;base64,/,"");d&&console.log(` area: x=${d.x} y=${d.y} w=${d.w} h=${d.h}`),s&&console.log(` layers: ${s}`);let f=F(process.cwd(),o||"/tmp/sootsim-inspect.png");$(M(f),{recursive:!0});let g=Buffer.from(k,"base64");if(r){let h=await C(n);if(!h)throw new Error("could not read current device model from the target sim");let P=await E(g,h);A(f,P),console.log(` frame: ${h}`)}else A(f,g);console.log(` saved: ${f}`)}finally{n.close()}}async function C(t){let o=await _(t,"SootSim.bridges.settings.get")??{deviceModel:null},e=typeof o.deviceModel=="string"?o.deviceModel:null;return!e||!(e in w)?null:e}function G(t){let o=!1;for(let e of t)e==="--with-frame"&&(o=!0),e==="--no-frame"&&(o=!1);return o}function U(t){if(t.includes("--shell-only"))return"shell";if(t.includes("--no-shell"))return"tenant"}var H=new Set(["--help","-h","--verbose","-v","--with-frame","--no-frame","--no-shell","--shell-only","--gallery","--themes"]),B=new Set(["--output","--area","--id","--text","--url","--port","--timeout","--sim"]),I={"--rect":"--area","--crop":"--area","--region":"--area","--bounds":"--area","--box":"--area","--xywh":"--area","--out":"--output","-o":"--output","--file":"--output","--path":"--output","--testid":"--id","--test-id":"--id","--test_id":"--id"};function q(t){let o=[],e={"-o":"--output","--out":"--output","--file":"--output","--path":"--output","--testid":"--id","--test-id":"--id","--test_id":"--id","--rect":"--area","--crop":"--area","--region":"--area","--bounds":"--area","--box":"--area","--xywh":"--area"};for(let r of t){let s=e[r];o.push(s??r)}return o}function V(t){let o=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.startsWith("-")){if(B.has(r)){e++;continue}H.has(r)||o.push({flag:r,suggestion:I[r]})}}return o}function O(t){let o=t.find((e,r)=>t[r-1]==="--output");if(o)return o;for(let e=0;e<t.length;e++){let r=t[e];if(r.startsWith("-")){B.has(r)&&e++;continue}return r}}async function T(t,o){let e=O(t)||"sootsim-screenshot.png",r=t.includes("--gallery"),s=t.find((c,i)=>t[i-1]==="--url")||`http://localhost:${o.port||5173}`,{chromium:n}=await import("playwright"),u=await n.launch({channel:"chrome",headless:!0});try{if(r)console.log(" capturing gallery..."),console.log(" (gallery mode not yet implemented)");else{let c=await u.newPage({viewport:{width:500,height:900}});await c.goto(s,{waitUntil:"networkidle"}),await c.waitForTimeout(2e3);let i=F(process.cwd(),e);$(M(i),{recursive:!0}),await c.screenshot({path:i}),console.log(` saved: ${i}`),await c.close()}}catch(c){console.error(` screenshot failed: ${c.message}`),process.exitCode=1}finally{await u.close()}}export{Q as runScreenshot};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as o}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as o}from"./chunk-4XVY5TUF.js";import"./chunk-DIRDEKRW.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-WN7R4GL4.js";async function n(e,s){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
3
3
|
sootsim screenshot-mode \u2014 toggle the screenshot-mode chrome overlay
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as q}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as q}from"./chunk-25RFZ6WP.js";import{b as L}from"./chunk-YV74D4MG.js";import"./chunk-AJF3QF4K.js";import"./chunk-N4YCSOCR.js";import{b as H}from"./chunk-AUCNBB6Q.js";import"./chunk-DGJTEFE7.js";import"./chunk-6TSXXN2W.js";import"./chunk-YMFSRCHL.js";import"./chunk-Q4NDYO2U.js";import"./chunk-I5WXVKR6.js";import"./chunk-GST4YSBO.js";import"./chunk-S244IT4W.js";import"./chunk-LMX7UB5T.js";import"./chunk-GQH3PD3W.js";import{d as U,e as K}from"./chunk-BP3EGFER.js";import"./chunk-QXJMXSQP.js";import"./chunk-TXKOJ3P5.js";import"./chunk-DIRDEKRW.js";import"./chunk-6FAEORJ2.js";import"./chunk-NI3L4A65.js";import"./chunk-QPRF3UYX.js";import"./chunk-ODGEH6OW.js";import"./chunk-ER4GBJRY.js";import"./chunk-ULV4PWN4.js";import"./chunk-DWXC25XG.js";import"./chunk-EX6V4ZV6.js";import"./chunk-VUOCUCJ2.js";import{a as y,b as A,c as E,d as O,e as v,f as C,g as _}from"./chunk-V4HTQPMA.js";import"./chunk-WN7R4GL4.js";import{mkdirSync as I,readFileSync as ye,writeFileSync as se}from"fs";import{tmpdir as We}from"os";import F from"path";import{mkdirSync as W,readFileSync as ae,writeFileSync as X}from"fs";import B from"path";function V(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function T(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function ce(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function D(e,t){let o=ce(e),i=Math.max(0,Math.min(1,t)),n=o.match(/^#([0-9a-f]{6})$/i);if(n){let s=n[1],r=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),c=Number.parseInt(s.slice(4,6),16);return`rgba(${r}, ${a}, ${c}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function le(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function pe(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${D(t,.46)} 0%, ${D(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function R(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";case"straight":default:return"none"}}function G(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function j(e){let t=D(e.color,e.opacity),o=D(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function Y(e,t){return!t.glow||e.color&&e.color!==y.color?e:{...e,color:t.glow}}function ue(e,t){if(e==="editorial-left"){let n=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(r,a,c)=>{let p=Math.round(t.width*.68*(a.scale??r.scale)),l=Math.round(t.height*(.03+r.offsetY+(a.offsetY??0))),d=a.pose||r.pose||"tilted-right",h=Y(r.shadow,c);return["position:absolute",`top:${Math.round(t.height*.18)+l}px`,`left:${Math.round(t.width*.56)}px`,`width:${p}px`,"transform-origin:center center",`transform:${R(d)}`,`filter:${j(h)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let n=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${n}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,a,c)=>{let p=Math.round(t.width*.84*(a.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(a.offsetY??0))),d=a.pose||r.pose,h=Y(r.shadow,c);return["position:absolute",`top:${Math.round(t.height*.075)+l}px`,"left:50%",`width:${p}px`,"transform-origin:center center",`transform:${G("translateX(-50%)",R(d))}`,`filter:${j(h)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,s,r)=>{let a=t.name==="ipad-13"?.54:.64,c=Math.round(t.width*a*(s.scale??n.scale)),p=Math.round(t.height*(n.offsetY+(s.offsetY??0))),l=s.pose||n.pose,d=Y(n.shadow,r);return["position:absolute",`top:${Math.round(t.height*(t.name==="ipad-13"?.25:.28))+p}px`,"left:50%",`width:${c}px`,"transform-origin:center top",`transform:${G("translateX(-50%)",R(l))}`,`filter:${j(d)}`,"z-index:2"].join(";")}}}function de({canvas:e,compose:t,slide:o,imageDataUrl:i}){let n=o.background??t.background,s=ue(t.text.preset,e),r=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,n),c=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${T(o.headline)}</div>`:"",p=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${T(o.subheadline)}</div>`:"",l=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${T(o.eyebrow)}</div></div>`:"";return`<!doctype html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8" />
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*! sootsim v0.1.170 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as I}from"./chunk-BP3EGFER.js";import"./chunk-QPRF3UYX.js";import"./chunk-EX6V4ZV6.js";import"./chunk-WN7R4GL4.js";import{execSync as E}from"node:child_process";import{mkdirSync as L,mkdtempSync as W,rmSync as q,writeFileSync as z}from"node:fs";import{tmpdir as H}from"node:os";import{dirname as J,isAbsolute as K,join as A,resolve as V}from"node:path";import{chromium as Y}from"playwright-core";import{execSync as j}from"node:child_process";function N(o){let e=o;if(e&&typeof e.process=="function")try{let t=e.process();if(t&&typeof t.pid=="number"&&t.pid>0)return t.pid}catch{}if(e&&typeof e.browser=="function")try{let t=e.browser();if(t)return N(t)}catch{}return null}function x(o){let e=[];try{e=j(`pgrep -P ${o} || true`).toString().split(`
|
|
3
|
+
`).filter(Boolean)}catch{}for(let t of e)x(Number(t));try{process.kill(o,"SIGKILL")}catch{}}var C=new Set,M=!1;function B(){if(M)return;M=!0;let o=()=>{for(let e of C)x(e)};process.on("SIGTERM",()=>{o(),process.exit(0)}),process.on("SIGINT",()=>{o(),process.exit(0)}),process.on("exit",o)}async function U(o){let e=await o(),t=N(e),n=new Set;t!=null&&(n.add(t),C.add(t),B());let i=e;return typeof i.on=="function"&&i.on("disconnected",()=>{for(let c of n)C.delete(c)}),{browser:e,reapNow:()=>{for(let c of n)x(c),C.delete(c);n.clear()}}}var Q=`
|
|
4
|
+
sootsim screenshots capture \u2014 headlessly capture + upload App Store slides
|
|
5
|
+
|
|
6
|
+
usage:
|
|
7
|
+
sootsim screenshots capture --org <org> --repo <repo> [options]
|
|
8
|
+
|
|
9
|
+
what it does:
|
|
10
|
+
boots the org-mode build shell in headless GPU Chrome (authed via your
|
|
11
|
+
\`sootsim login\` session), captures each slide through the live screenshot
|
|
12
|
+
composer so every slide gets editable layers (captureRef + cleanRef +
|
|
13
|
+
screenRef), and lets the shell auto-upload them to your org deck.
|
|
14
|
+
|
|
15
|
+
options:
|
|
16
|
+
--org <org> github org slug (required)
|
|
17
|
+
--repo <repo> repo name (required)
|
|
18
|
+
--branch <branch> build branch to boot (default: main)
|
|
19
|
+
--platform <p> ios | android (default: ios)
|
|
20
|
+
--slides <list> 1-based indices to capture, e.g. 1,3,5 (default: all)
|
|
21
|
+
--dry-run capture + report refs, do NOT upload (PUTs aborted)
|
|
22
|
+
--force allow overwriting a NON-EMPTY existing deck
|
|
23
|
+
--out <dir> also write composed App-Store PNGs locally
|
|
24
|
+
--shell-origin <url> origin serving /build (default: your session origin)
|
|
25
|
+
--api-origin <url> origin for deck/capture APIs (default: session origin)
|
|
26
|
+
--timeout <ms> per-step bridge timeout (default: 45000)
|
|
27
|
+
--json machine-readable summary
|
|
28
|
+
|
|
29
|
+
examples:
|
|
30
|
+
sootsim screenshots capture --org acme --repo my-app --dry-run
|
|
31
|
+
sootsim screenshots capture --org acme --repo my-app --branch main --force
|
|
32
|
+
`;function X(o){let e=a=>{let c=o.indexOf(a);return c>=0?o[c+1]:void 0},t=a=>o.includes(a),n=e("--slides"),i=n?n.split(",").map(a=>Number(a.trim())).filter(a=>Number.isInteger(a)&&a>0):null;return{org:e("--org")??"",repo:e("--repo")??"",branch:e("--branch")??"main",platform:e("--platform")??"ios",slides:i&&i.length?i:null,dryRun:t("--dry-run"),force:t("--force"),out:e("--out")??null,shellOrigin:e("--shell-origin")??null,apiOrigin:e("--api-origin")??null,timeoutMs:Number(e("--timeout")??"45000")||45e3,json:t("--json")}}function Z(){let o=I();if(o&&o.kind==="session")return{token:o.token,origin:o.origin};process.stderr.write(`
|
|
33
|
+
sootsim screenshots capture needs a logged-in session.
|
|
34
|
+
run \`sootsim login\` first (the captured slides upload to that account).
|
|
35
|
+
|
|
36
|
+
`),process.exit(1)}function _(o){let e=o.replace(/^\[|\]$/g,"").toLowerCase();return e==="localhost"||e.endsWith(".localhost")||e==="::1"||/^127(?:\.\d{1,3}){3}$/.test(e)}function ee(o){let e=new URL(o);if(_(e.hostname)){let n=(Number(e.port)||3e3)-3e3;if(n>=0&&n<=1e3)return e.port=String(5173+n),e.origin}return e.hostname==="sootbean.com"||e.hostname.endsWith(".sootbean.com")?"https://sootsim.com":o}function oe(){try{return Number(E("sysctl -n vm.loadavg").toString().trim().split(/\s+/)[1])||0}catch{return 0}}async function te(o,e,t,n){let i=await fetch(`${o}/api/sootsim/screenshot-decks?org=${encodeURIComponent(t)}&repo=${encodeURIComponent(n)}`,{headers:{authorization:`Bearer ${e}`}});if(!i.ok)return[];let a=await i.json().catch(()=>null),c=[];for(let m of a?.decks??[])Array.isArray(m.config?.frames)&&c.push(...m.config.frames);return c}async function re(o,e,t,n){let i=await fetch(`${o}/api/sootsim/screenshot-capture?ref=${encodeURIComponent(n)}&org=${encodeURIComponent(t)}`,{headers:{authorization:`Bearer ${e}`}});return i.ok?`data:image/png;base64,${Buffer.from(await i.arrayBuffer()).toString("base64")}`:null}async function ne(o,e){let t=Date.now()+e;for(;Date.now()<t;){for(let n of o.frames())if(await n.evaluate(()=>!!globalThis.SootSim?.bridges?.screenshotControl).catch(()=>!1))return n;await o.waitForTimeout(250)}throw new Error("screenshot bridge never appeared \u2014 the build shell did not boot screenshot mode (check --branch/--platform has a ready build, and you are logged in)")}async function D(o){return o.evaluate(async()=>{let t=globalThis.SootSim?.bridges?.screenshotControl;if(!t)throw new Error("screenshotControl missing");return t.getState()})}async function se(o){await o.evaluate(async()=>{let e=globalThis.SootSim?.bridges?.settings,t=Date.now()+3e3;for(;Date.now()<t;){if(e?.get?.()?.screenshotMode)return;await new Promise(n=>setTimeout(n,50))}e&&!e.get().screenshotMode&&(e.set("screenshotMode",!0),e.get().showFrame||e.set("showFrame",!0))})}async function ie(o,e,t,n){await o.evaluate(async([i,a,c])=>{let m=globalThis.SootSim,h=m?.bridges?.screenshotControl;if(!h)throw new Error("screenshotControl missing");let w=b=>new Promise(d=>setTimeout(d,b));if(a){h.focusSlide(i);let b=Date.now()+3e4,d=m?.bridges?.threeMode;for(;Date.now()<b&&(d=m?.bridges?.threeMode,!(d?.setScreenImage&&d?.captureStage&&d?.getState?.()?.ready));)await w(150);await w(1e3);let l=a;d?.configure?.({colorway:l.colorway,background:l.background,...l.customGradient?{customGradient:l.customGradient}:{},room:!!l.room,bokeh:!!l.bokeh,environment:l.environmentActive?{pins:l.environmentPins??{},effects:l.environmentEffects??{}}:!1,pose:{phonePosition:l.phonePosition,phoneRotation:l.phoneRotation,cameraPosition:l.cameraPosition,target:l.target}}),await w(900),c&&d?.setScreenImage&&(d.setScreenImage(c),await w(1200))}await h.capture(i)},[e,t,n])}async function be(o){if(o.includes("--help")||o.includes("-h"))return console.log(Q),0;let e=X(o);if(!e.org||!e.repo)return process.stderr.write(` --org and --repo are required (see --help)
|
|
37
|
+
`),1;let{token:t,origin:n}=Z(),i=(e.apiOrigin??n).replace(/\/$/,""),a=(e.shellOrigin??ee(i)).replace(/\/$/,""),c=await te(i,t,e.org,e.repo);if(!e.dryRun&&!e.force&&c.length>0)return process.stderr.write(` refusing to overwrite the existing ${e.org}/${e.repo} deck (${c.length} slide(s)). re-run with --force to replace it, or --dry-run to preview.
|
|
38
|
+
`),1;let m=oe(),h=Number(E("sysctl -n hw.ncpu").toString().trim())||8;if(m>h)return process.stderr.write(` load average ${m.toFixed(1)} exceeds ${h} cores \u2014 tear down other work first.
|
|
39
|
+
`),1;let w=`${a}/build/${encodeURIComponent(e.org)}/${encodeURIComponent(e.repo)}/${encodeURIComponent(e.branch)}?platform=${encodeURIComponent(e.platform)}&ssMode=1`,b=W(A(H(),"sootsim-capture-")),{browser:d,reapNow:l}=await U(()=>Y.launchPersistentContext(b,{headless:!0,channel:"chrome",viewport:{width:393,height:852},deviceScaleFactor:3,args:["--enable-unsafe-webgpu","--enable-features=Vulkan,WebGPU","--hide-scrollbars"]}));await d.addInitScript(s=>{try{localStorage.setItem("sootsim.session.token",s)}catch{}},t);let y=[],g=d.pages()[0]??await d.newPage();e.dryRun?await g.route(/\/api\/sootsim\/screenshot-(decks|capture)/,s=>s.request().method()==="PUT"?s.abort():s.continue()):g.on("response",s=>{let p=s.url();s.request().method()==="PUT"&&(p.includes("/api/sootsim/screenshot-decks")?y.push({kind:"deck",status:s.status()}):p.includes("/api/sootsim/screenshot-capture")&&y.push({kind:"capture",status:s.status()}))});let R=[];g.on("pageerror",s=>R.push(s.message));let G=g.waitForResponse(s=>s.url().includes("/api/sootsim/screenshot-decks")&&s.request().method()==="GET",{timeout:e.timeoutMs}).catch(()=>null);try{await g.goto(w,{waitUntil:"domcontentloaded",timeout:e.timeoutMs});let s=await ne(g,e.timeoutMs);await se(s),await G,await g.waitForTimeout(800);let p=await D(s);if(p.slides.length===0)return process.stderr.write(` the deck has no slides to capture \u2014 add slides in the composer first.
|
|
40
|
+
`),1;let P=e.slides?p.slides.filter(r=>e.slides.includes(r.index)):p.slides;console.log(` ${p.projectName} on ${p.deviceModel} \u2014 capturing ${P.length}/${p.slides.length} slide(s)${e.dryRun?" (dry-run, no upload)":""}`);for(let r of P)try{let u=c[r.index-1],f=u?.threeScene??null,$=f&&u?.screenRef?await re(i,t,e.org,u.screenRef):null;await ie(s,r.index,f,$),console.log(` \u2713 slide ${r.index} "${r.title.slice(0,40)}"`)}catch(u){console.log(` \u2717 slide ${r.index} "${r.title.slice(0,40)}" \u2014 ${u.message}`)}e.dryRun||await g.waitForTimeout(2500);let S=(await D(s)).slides.filter(r=>P.some(u=>u.id===r.id)),v=[];if(e.out){let r=K(e.out)?e.out:V(process.cwd(),e.out);for(let u of S){if(!u.captureRef)continue;let f=await s.evaluate(async k=>{let T=globalThis.SootSim?.bridges?.screenshotControl;if(!T)throw new Error("screenshotControl missing");return T.exportSlide(k)},u.index),$=f.dataUrl.match(/^data:[^;]+;base64,(.+)$/);if($){let k=A(r,f.name);L(J(k),{recursive:!0}),z(k,Buffer.from($[1],"base64")),v.push(k)}}}let F=S.filter(r=>r.captureRef&&r.cleanRef),O={org:e.org,repo:e.repo,branch:e.branch,dryRun:e.dryRun,slides:S.map(r=>({index:r.index,title:r.title,captureRef:!!r.captureRef,cleanRef:!!r.cleanRef,screenRef:!!r.screenRef,captureMode:r.captureMode})),editableCount:F.length,uploads:e.dryRun?"skipped (dry-run)":y,written:v,pageErrors:R.slice(0,5)};if(e.json)console.log(JSON.stringify(O,null,2));else{console.log(`
|
|
41
|
+
${F.length}/${S.length} slide(s) now have editable layers (captureRef + cleanRef)`);let r=S.filter(u=>u.captureRef&&!u.cleanRef);if(r.length&&console.log(` \u26A0 ${r.length} slide(s) baked a flat capture only (no cleanRef) \u2014 typically 3d slides whose scene didn't restore for a re-bake.`),!e.dryRun){let u=y.filter(f=>f.status>=200&&f.status<300).length;console.log(` uploads: ${u}/${y.length} PUT(s) succeeded`)}v.length&&console.log(` wrote ${v.length} local PNG(s) to ${e.out}`),R.length&&console.log(` \u26A0 ${R.length} page error(s) during capture`)}return 0}finally{await d.close().catch(()=>{}),l(),q(b,{recursive:!0,force:!0})}}export{be as runScreenshotsCapture};
|