sootsim 0.1.243 → 0.1.244
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/dist-cli/bin.js +4 -4
- package/dist-cli/chunks/{agent-FXEWVX5T.js → agent-JHD2EFVR.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-GUN6VZ5X.js → agent-wrapper-J2H5SHMV.js} +2 -2
- package/dist-cli/chunks/{app-fonts-QRKKOMUI.js → app-fonts-5GKCFKI5.js} +2 -2
- package/dist-cli/chunks/{assert-NM7TWETJ.js → assert-QEJ27UYY.js} +2 -2
- package/dist-cli/chunks/{auth-HDYJCDMP.js → auth-HHF3YPTH.js} +2 -2
- package/dist-cli/chunks/beta-G5FZ5RSW.js +2 -0
- package/dist-cli/chunks/{camera-ZDSBFJL5.js → camera-WUKBXPW7.js} +2 -2
- package/dist-cli/chunks/{chunk-4ZRA4LSB.js → chunk-2D62IZA6.js} +2 -2
- package/dist-cli/chunks/{chunk-YJ2PDE4K.js → chunk-2OPBDHZC.js} +2 -2
- package/dist-cli/chunks/{chunk-6YFIKQI7.js → chunk-3D6IXEES.js} +2 -2
- package/dist-cli/chunks/{chunk-HQTOG4X4.js → chunk-5ESYYH63.js} +2 -2
- package/dist-cli/chunks/{chunk-FSKOS7WC.js → chunk-5MSFB4LE.js} +1 -1
- package/dist-cli/chunks/{chunk-FIDOMJXL.js → chunk-67ZCDTCV.js} +1 -1
- package/dist-cli/chunks/{chunk-5G3LJUYE.js → chunk-6BB55GST.js} +1 -1
- package/dist-cli/chunks/{chunk-SP2DEZXG.js → chunk-7YLGDFKU.js} +2 -2
- package/dist-cli/chunks/{chunk-J45AZS5J.js → chunk-CAAFEEFM.js} +3 -3
- package/dist-cli/chunks/{chunk-GEJBVV4M.js → chunk-CW6ZDGC2.js} +1 -1
- package/dist-cli/chunks/{chunk-SUJVPDRY.js → chunk-D5ZQSHVC.js} +3 -3
- package/dist-cli/chunks/{chunk-XZ2FVQMY.js → chunk-DL3M4AVQ.js} +1 -1
- package/dist-cli/chunks/{chunk-MO2QVYFW.js → chunk-DOSHBZMI.js} +2 -2
- package/dist-cli/chunks/{chunk-QOE3DNO5.js → chunk-G5F4MWYF.js} +1 -1
- package/dist-cli/chunks/chunk-G6O6YSIV.js +103 -0
- package/dist-cli/chunks/chunk-HAAUOADL.js +1 -0
- package/dist-cli/chunks/{chunk-EGQBLGHM.js → chunk-HH5BFXN5.js} +2 -2
- package/dist-cli/chunks/{chunk-3I6TOP3W.js → chunk-I5L4NSXA.js} +69 -69
- package/dist-cli/chunks/{chunk-EHFPZFQE.js → chunk-JEQXLBYH.js} +1 -1
- package/dist-cli/chunks/chunk-JM7KI2DG.js +2 -0
- package/dist-cli/chunks/{chunk-SZYSZKHI.js → chunk-K375R6PR.js} +2 -2
- package/dist-cli/chunks/{chunk-GUFB26IN.js → chunk-LJTFFZX3.js} +1 -1
- package/dist-cli/chunks/{chunk-TDA6GMMJ.js → chunk-LRSVGYTU.js} +1 -1
- package/dist-cli/chunks/{chunk-JF4J3LFL.js → chunk-MG2NFJOU.js} +1 -1
- package/dist-cli/chunks/chunk-MKA7IFWN.js +1 -0
- package/dist-cli/chunks/{chunk-YGZYZ5PG.js → chunk-MZWAGLVV.js} +2 -2
- package/dist-cli/chunks/{chunk-3SDYUIT5.js → chunk-OTHI65BB.js} +1 -1
- package/dist-cli/chunks/{chunk-4ZUKMTEH.js → chunk-PLVKGUKI.js} +2 -2
- package/dist-cli/chunks/{chunk-U3O2ZVZJ.js → chunk-PWDCBXRI.js} +2 -2
- package/dist-cli/chunks/{chunk-HCE47EED.js → chunk-QDSYYPBW.js} +1 -1
- package/dist-cli/chunks/{chunk-CBOYNMNP.js → chunk-QRQRHX3L.js} +2 -2
- package/dist-cli/chunks/{chunk-ED4PHTSN.js → chunk-R2DSJS7L.js} +2 -2
- package/dist-cli/chunks/{chunk-RNBYQ5TF.js → chunk-S4KDO7C5.js} +1 -1
- package/dist-cli/chunks/{chunk-D2AQJY2L.js → chunk-SEW3SBFZ.js} +2 -2
- package/dist-cli/chunks/{chunk-4ET5SQJ7.js → chunk-SIKHCBXV.js} +2 -2
- package/dist-cli/chunks/{chunk-LRWFVZOL.js → chunk-TL5J6UCV.js} +1 -1
- package/dist-cli/chunks/{chunk-TXGYN5YH.js → chunk-UEHOXLFD.js} +1 -1
- package/dist-cli/chunks/{chunk-RWIXBCIJ.js → chunk-VJYSRAHZ.js} +2 -2
- package/dist-cli/chunks/{chunk-QNQJW3CU.js → chunk-WGU7SGOZ.js} +2 -2
- package/dist-cli/chunks/{chunk-6D4GB3TT.js → chunk-WM6FZGUL.js} +2 -2
- package/dist-cli/chunks/{chunk-IFIE63FU.js → chunk-WR36BYQG.js} +2 -2
- package/dist-cli/chunks/{chunk-3TYXB26Z.js → chunk-XVEN5M47.js} +1 -1
- package/dist-cli/chunks/{chunk-PYRQ46AN.js → chunk-Y2KQOMYR.js} +3 -3
- package/dist-cli/chunks/{chunk-SXIRWCAW.js → chunk-YULJQBOJ.js} +1 -1
- package/dist-cli/chunks/cli-version-XDAICYFB.js +2 -0
- package/dist-cli/chunks/{compat-LYH3JXAH.js → compat-FGJWV5EA.js} +3 -3
- package/dist-cli/chunks/{config-IORPXBOY.js → config-NYQSNDVQ.js} +2 -2
- package/dist-cli/chunks/{control-IJVA52FL.js → control-UDPDWRBU.js} +2 -2
- package/dist-cli/chunks/daemon-2J4DKNYN.js +2 -0
- package/dist-cli/chunks/{debug-U7A5EU4C.js → debug-IPQI54AY.js} +3 -3
- package/dist-cli/chunks/{desktop-55T7IQER.js → desktop-GSMA5PJQ.js} +3 -3
- package/dist-cli/chunks/{detox-MJIXMF2Z.js → detox-4ZNSSEAR.js} +2 -2
- package/dist-cli/chunks/{device-PVRAGZPQ.js → device-HYTTW3OU.js} +2 -2
- package/dist-cli/chunks/{diagnose-4GDAZJTI.js → diagnose-XQ74L3KW.js} +2 -2
- package/dist-cli/chunks/drivers-ONFQAFOU.js +2 -0
- package/dist-cli/chunks/{film-P2LE6XM6.js → film-WOJZUOFM.js} +3 -3
- package/dist-cli/chunks/flow-LVERPR3B.js +2 -0
- package/dist-cli/chunks/help-EMMS3CAK.js +2 -0
- package/dist-cli/chunks/{hidden-runtime-alias-SS2MFPJT.js → hidden-runtime-alias-C5LGEAKX.js} +2 -2
- package/dist-cli/chunks/{home-paths-GE2WICB2.js → home-paths-RXADRYAC.js} +2 -2
- package/dist-cli/chunks/inspect-SSNBQY3F.js +2 -0
- package/dist-cli/chunks/install-desktop-UYHELYFF.js +2 -0
- package/dist-cli/chunks/{login-ZAKDNYE6.js → login-6TAIMXBQ.js} +4 -4
- package/dist-cli/chunks/{logout-V5QL47PV.js → logout-JKPUYSSG.js} +2 -2
- package/dist-cli/chunks/{maestro-DUMTBJA3.js → maestro-GI6ZTN3M.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-2J36R5WJ.js → maestro-generate-LGAIYEDS.js} +3 -3
- package/dist-cli/chunks/{mode-LAVXTH3K.js → mode-24IUHOZN.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-UQEDFVFZ.js +2 -0
- package/dist-cli/chunks/{perf-ZDLZ7WFT.js → perf-OKN7B352.js} +2 -2
- package/dist-cli/chunks/{record-B6BHP2KY.js → record-UDMEZBYE.js} +3 -3
- package/dist-cli/chunks/runtime-VSCBA7IR.js +2 -0
- package/dist-cli/chunks/{screenshot-command-3OMBI6OQ.js → screenshot-command-HCPVVXHF.js} +9 -8
- package/dist-cli/chunks/{screenshots-capture-EIEG7WBP.js → screenshots-capture-EE64JRBF.js} +2 -2
- package/dist-cli/chunks/{serve-UZE7D7I7.js → serve-U2YX7JT3.js} +2 -2
- package/dist-cli/chunks/{setup-C7FLHLXZ.js → setup-C7UXZ3EU.js} +3 -3
- package/dist-cli/chunks/{skills-3RPTVTZ7.js → skills-4BH6IQLH.js} +2 -2
- package/dist-cli/chunks/{storage-MRXCZ5X7.js → storage-SOJGFOLK.js} +2 -2
- package/dist-cli/chunks/store-4HP2JT7J.js +2 -0
- package/dist-cli/chunks/telemetry-KGIV6FY7.js +2 -0
- package/dist-cli/chunks/{timeline-6F5MN4BT.js → timeline-BTQDQ7GF.js} +2 -2
- package/dist-cli/chunks/{upgrade-USHBFEFD.js → upgrade-4WPELESU.js} +2 -2
- package/dist-cli/chunks/upload-D22GTV4Y.js +2 -0
- package/dist-cli/chunks/{version-VK7TXLXO.js → version-6TAD2HKX.js} +2 -2
- package/dist-cli/chunks/{web-5FXZSCMD.js → web-F3TBVSMC.js} +2 -2
- package/dist-cli/chunks/{what-happened-GCE2WS2O.js → what-happened-OICHDCFR.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.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 +1 -1
- package/dist-lib/beta.mjs +1 -1
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- 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 +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +27 -3
- package/dist-lib/menu.mjs +27 -3
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/menu.ts +26 -0
- package/dist-cli/chunks/beta-FZWO5IHA.js +0 -2
- package/dist-cli/chunks/chunk-AUOXELFC.js +0 -89
- package/dist-cli/chunks/chunk-EP5524NT.js +0 -1
- package/dist-cli/chunks/chunk-JI4QHZWI.js +0 -2
- package/dist-cli/chunks/chunk-RK7C5U3G.js +0 -1
- package/dist-cli/chunks/cli-version-SF2RISK3.js +0 -2
- package/dist-cli/chunks/daemon-OOTI5UKF.js +0 -2
- package/dist-cli/chunks/drivers-ZFC7LCIG.js +0 -2
- package/dist-cli/chunks/flow-NNEJSUCZ.js +0 -2
- package/dist-cli/chunks/help-C6UYHCX7.js +0 -2
- package/dist-cli/chunks/inspect-QRU6GSC3.js +0 -2
- package/dist-cli/chunks/install-desktop-7Q3Q4EDN.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-L4MJWR2U.js +0 -2
- package/dist-cli/chunks/runtime-PZRJDSB4.js +0 -2
- package/dist-cli/chunks/store-FP3OZ75R.js +0 -2
- package/dist-cli/chunks/telemetry-HV232CTG.js +0 -2
- package/dist-cli/chunks/upload-BKS77SNB.js +0 -2
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*! sootsim v0.1.244 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{g as E,i as O,l as K,m as v}from"./chunk-R2DSJS7L.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as R}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,o){let n=E(t,{port:e.port}),r=H(n.positional),u=O({...n,commandTimeoutMs:5e3});try{let s=!!(await K(u,"SootSim.bridges.settings.get"))?.[o.modeKey],p=r==="on"?!0:r==="off"?!1:!s;if(s===p)return console.log(` ${o.displayName}: already ${p?"on":"off"}`),{current:s,target:p,changed:!1};if(!await u.send({type:"evaluate",acquireLock:!0,code:`(async () => {
|
|
3
|
+
const modeKey = ${JSON.stringify(o.modeKey)}
|
|
4
|
+
const target = ${JSON.stringify(p)}
|
|
5
|
+
window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
6
|
+
detail: { type: 'fire-action', id: ${JSON.stringify(o.actionId)} },
|
|
7
|
+
}))
|
|
8
|
+
const deadline = Date.now() + 1200
|
|
9
|
+
while (Date.now() < deadline) {
|
|
10
|
+
if (Boolean(window.SootSim?.bridges?.settings?.get?.()?.[modeKey]) === target) {
|
|
11
|
+
return true
|
|
12
|
+
}
|
|
13
|
+
await new Promise((resolve) => setTimeout(resolve, 40))
|
|
14
|
+
}
|
|
15
|
+
return false
|
|
16
|
+
})()`}))throw new Error(`${o.displayName} did not change to ${p?"on":"off"}; the live shell may not support this mode`);return console.log(` ${o.displayName}: ${s?"on":"off"} -> ${p?"on":"off"}`),{current:s,target:p,changed:!0}}finally{u.close()}}var z=12e3,ee=6e5,te=new Set(["load","seek","play","pause","render","measure"]);async function ye(t,e){(t.includes("--help")||t.includes("-h"))&&(console.log(`
|
|
17
|
+
sootsim mode three \u2014 toggle the 3d device stage
|
|
18
|
+
|
|
19
|
+
usage:
|
|
20
|
+
sootsim mode three [on|off|toggle]
|
|
21
|
+
sootsim mode three configure [options]
|
|
22
|
+
sootsim mode three load <timeline.json>
|
|
23
|
+
sootsim mode three seek <time-ms>
|
|
24
|
+
sootsim mode three play|pause
|
|
25
|
+
sootsim mode three render <timeline.json> --output <dir> [options]
|
|
26
|
+
sootsim mode three measure <timeline.json> [options]
|
|
27
|
+
|
|
28
|
+
arguments:
|
|
29
|
+
on enable 3d mode
|
|
30
|
+
off disable 3d mode
|
|
31
|
+
toggle flip the current state (default)
|
|
32
|
+
|
|
33
|
+
configure options:
|
|
34
|
+
--background <id> set the 3d background
|
|
35
|
+
--gradient <stops> custom gradient bg: comma-separated css hex stops,
|
|
36
|
+
e.g. "#0a0e1a,#16243f,#05080f" (overrides --background;
|
|
37
|
+
evenly spaced, or use "color@offset" for explicit %)
|
|
38
|
+
--gradient-angle <deg> custom gradient angle (default 180 = top\u2192bottom)
|
|
39
|
+
--colorway <id> set the phone colorway
|
|
40
|
+
--script <id> apply a camera preset pose
|
|
41
|
+
--progress <0..1> script progress to sample (default: 1)
|
|
42
|
+
--animate run the script instead of sampling one frame
|
|
43
|
+
--slow run the script slowly when --animate is set
|
|
44
|
+
--environment on|off enable or disable environment objects
|
|
45
|
+
--env-shape <id> orb | pill | diamond | pane
|
|
46
|
+
--env-spread <id> tight | medium | wide
|
|
47
|
+
--env-size <id> small | medium | large
|
|
48
|
+
--env-color <id> peach | gold | mint | sky | violet
|
|
49
|
+
--env-glow on|off enable or disable environment glow
|
|
50
|
+
--env-plastic on|off enable or disable environment plastic material
|
|
51
|
+
--setting <id> none | room | white-backdrop
|
|
52
|
+
--focus on|off enable or disable Focus depth of field
|
|
53
|
+
--focus-amount <id> subtle | medium | strong | dramatic
|
|
54
|
+
--focus-range <id> tight | balanced | wide
|
|
55
|
+
--reset-pose return to the default hero pose before other changes
|
|
56
|
+
|
|
57
|
+
render options:
|
|
58
|
+
--output <dir> write frame-%05d.png + timeline-render.json
|
|
59
|
+
--fps <number> frames per second (default: 30)
|
|
60
|
+
--width <px> exact output width (default: 1920)
|
|
61
|
+
--height <px> exact output height (default: 1080)
|
|
62
|
+
--from <ms> first timeline time (default: 0)
|
|
63
|
+
--to <ms> exclusive end time (default: timeline duration)
|
|
64
|
+
--overwrite replace this command's existing frames in the dir
|
|
65
|
+
|
|
66
|
+
measure options (projected bounds only \u2014 no pixels rendered):
|
|
67
|
+
--fps <number> sample rate (default: 30)
|
|
68
|
+
--width <px> output width the bounds project into (default: 1920)
|
|
69
|
+
--height <px> output height the bounds project into (default: 1080)
|
|
70
|
+
--from <ms> first timeline time (default: 0)
|
|
71
|
+
--to <ms> exclusive end time (default: timeline duration)
|
|
72
|
+
--count <n> sample n frames from --from at the --fps spacing
|
|
73
|
+
--at <ms[,ms...]> sample exact timeline times (overrides from/to/count)
|
|
74
|
+
--output <file.json> write the measurement JSON here instead of stdout
|
|
75
|
+
|
|
76
|
+
examples:
|
|
77
|
+
sootsim mode three
|
|
78
|
+
sootsim mode three on
|
|
79
|
+
sootsim mode three configure --script hero-arc --background gradient-tide
|
|
80
|
+
sootsim mode three configure --environment on --env-shape pane --setting room
|
|
81
|
+
sootsim mode three render ./cinematic.json --output ./frames --fps 30
|
|
82
|
+
sootsim mode three measure ./cinematic.json --width 450 --height 900 --at 0,1200
|
|
83
|
+
sootsim mode three off
|
|
84
|
+
`),process.exit(0));let o=ie(t);if(o){await le(o,t,e);return}if(oe(t)){await ne(t,e);return}(await U(t,e,{modeKey:"threeMode",displayName:"three-mode",actionId:"toggle-three-mode"})).target&&await re(t,e)}function oe(t){return t[0]==="configure"||t.some(e=>["--background","--gradient","--gradient-angle","--colorway","--script","--progress","--animate","--slow","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--setting","--focus","--focus-amount","--focus-range","--reset-pose"].includes(e))}async function ne(t,e){let o=E(t,{port:e.port,stripBooleanFlags:["--animate","--slow","--reset-pose"],stripValueFlags:["--background","--gradient","--gradient-angle","--colorway","--script","--progress","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--setting","--focus","--focus-amount","--focus-range"]}),n=me(t),r=O({...o,commandTimeoutMs:z+1e3});try{await J(r);let u=await v(r,"SootSim.bridges.threeMode.configure",n);console.log(` three-mode: configured (${ue(u)})`)}finally{r.close()}}async function re(t,e){let o=E(t,{port:e.port}),n=O({...o,commandTimeoutMs:z+1e3});try{await J(n)}finally{n.close()}}async function J(t){let e=await t.send({type:"evaluate",code:`(async () => {
|
|
85
|
+
const deadline = Date.now() + ${z}
|
|
86
|
+
while (Date.now() < deadline) {
|
|
87
|
+
const settings = window.SootSim?.bridges?.settings?.get?.()
|
|
88
|
+
if (settings && settings.threeMode !== true) {
|
|
89
|
+
return { ready: false, disabled: true }
|
|
90
|
+
}
|
|
91
|
+
const bridge = window.SootSim?.bridges?.threeMode
|
|
92
|
+
const state = typeof bridge?.getState === 'function' ? bridge.getState() : null
|
|
93
|
+
if (state?.ready === true) return state
|
|
94
|
+
await new Promise((resolve) => setTimeout(resolve, 50))
|
|
95
|
+
}
|
|
96
|
+
const bridge = window.SootSim?.bridges?.threeMode
|
|
97
|
+
const state = typeof bridge?.getState === 'function' ? bridge.getState() : null
|
|
98
|
+
return state || { ready: false }
|
|
99
|
+
})()`});if(e?.ready===!0)return e;throw e?.disabled?new Error("3d mode is off; run `sootsim mode three on` before configure"):new Error("3d mode runtime did not become ready")}function ie(t){for(let e=0;e<t.length;e+=1){let o=t[e];if(o==="--sim"||o==="--port"||o==="-p"){e+=1;continue}if(!o.startsWith("-"))return te.has(o)?o:null}return null}function A(t,e){let o=t.indexOf(e);return o>=0?t[o+1]:void 0}function y(t,e,o,n=0){let r=A(t,e);if(r===void 0)return o;let u=Number.parseFloat(r);if(!Number.isFinite(u)||u<n)throw new Error(`${e} expects a number greater than or equal to ${n}`);return u}function G(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function se(t,e){let o=Z(t).toLowerCase();return e==="recording"?o===".mp4"||o===".m4v"?"video/mp4":"video/webm":o===".jpg"||o===".jpeg"?"image/jpeg":o===".webp"?"image/webp":"image/png"}function V(t,e){if(Array.isArray(t))return t.map(n=>V(n,e));if(!G(t))return t;let o={};for(let[n,r]of Object.entries(t))o[n]=V(r,e);if((o.type==="recording"||o.type==="screenshot")&&typeof o.src=="string"&&!/^(?:blob:|data:|https?:)/i.test(o.src)){let n=R(e,o.src),r=W(n);o.src=`data:${se(n,o.type)};base64,${r.toString("base64")}`}return o}function ae(t){let e=R(t),o=JSON.parse(W(e,"utf8"));return{absolutePath:e,timeline:V(o,q(e))}}async function de(t){await v(t,"SootSim.bridges.settings.set","threeMode",!0),await J(t)}async function le(t,e,o){let n=E(e,{port:o.port,commandTimeoutMs:ee,stripBooleanFlags:["--overwrite"],stripValueFlags:["--output","--fps","--width","--height","--from","--to","--count","--at"]}),r=O(n);try{if(await de(r),t==="seek"){let i=n.positional[1],d=i===void 0?Number.NaN:Number.parseFloat(i);if(!Number.isFinite(d))throw new Error("three-mode seek expects time in ms");let l=await v(r,"SootSim.bridges.threeMode.seek",d);console.log(` three-mode: ${Math.round(l.timeMs)}ms / ${Math.round(l.durationMs)}ms (${l.shotId??"no shot"})`);return}if(t==="play"||t==="pause"){let i=await v(r,`SootSim.bridges.threeMode.${t}`),d=G(i.timeline)?i.timeline:{};console.log(` three-mode: ${t} (${Math.round(Number(d.timeMs??0))}ms)`);return}let u=n.positional[1];if(!u)throw new Error(`three-mode ${t} expects a timeline JSON path`);let g=ae(u),s=await v(r,"SootSim.bridges.threeMode.loadTimeline",g.timeline);if(t==="load"){console.log(` three-mode: loaded ${g.absolutePath} (${Math.round(s.durationMs)}ms)`);return}if(t==="measure"){let i=y(e,"--fps",30,.001),d=Math.round(y(e,"--width",1920,1)),l=Math.round(y(e,"--height",1080,1)),_=A(e,"--at"),x;if(_!==void 0){let f=_.split(",").map(w=>{let S=Number.parseFloat(w);if(!Number.isFinite(S)||S<0)throw new Error(`--at expects comma-separated times in ms, got "${w}"`);return Math.min(S,s.durationMs)}),M=[];for(let w of f){let S=await v(r,"SootSim.bridges.threeMode.measure",{fps:i,width:d,height:l,from:w,count:1});M.push({...S.frames[0],index:M.length})}x={fps:i,from:f[0],to:f[f.length-1],width:d,height:l,frames:M}}else{let f=y(e,"--from",0,0),M=A(e,"--count"),w={fps:i,width:d,height:l,from:f};if(M===void 0){let S=y(e,"--to",s.durationMs,0);if(S<=f||S>s.durationMs)throw new Error(`--to must be greater than --from and at most ${s.durationMs}`);w.to=S}else w.count=Math.round(y(e,"--count",1,1));x=await v(r,"SootSim.bridges.threeMode.measure",w)}let b=`${JSON.stringify(x,null,2)}
|
|
100
|
+
`,I=A(e,"--output");if(I){let f=R(I);L(q(f),{recursive:!0}),D(f,b),process.stderr.write(` three-mode: measured ${x.frames.length} frames \u2192 ${f}
|
|
101
|
+
`)}else process.stdout.write(b);return}let p=A(e,"--output");if(!p)throw new Error("three-mode render requires --output <dir>");let h=R(p),T=y(e,"--fps",30,.001),k=Math.round(y(e,"--width",1920,1)),j=Math.round(y(e,"--height",1080,1)),F=y(e,"--from",0,0),$=y(e,"--to",s.durationMs,0);if($<=F||$>s.durationMs)throw new Error(`--to must be greater than --from and at most ${s.durationMs}`);let a=1e3/T,m=Math.ceil(($-F)/a);L(h,{recursive:!0});let c=Q(h).filter(i=>/^frame-\d{5}\.png$/.test(i)||i==="timeline-render.json");if(c.length>0&&!e.includes("--overwrite"))throw new Error(`${h} already has timeline frames; pass --overwrite to replace them`);for(let i of c)X(R(h,i));let B=[],N=4;for(let i=0;i<m;i+=N){let d=Math.min(N,m-i),l=F+i*a,_=Math.min($,l+d*a),x=await v(r,"SootSim.bridges.threeMode.renderFrames",{fps:T,from:l,to:_,width:k,height:j,count:d});if(x.frames.length!==d)throw new Error(`3d renderer returned ${x.frames.length} frames for a ${d}-frame batch`);for(let b of x.frames){let I=i+b.index,f=`frame-${String(I).padStart(5,"0")}.png`,M=b.dataUrl.indexOf(",");if(M<0||!b.dataUrl.slice(0,M).includes("image/png;base64"))throw new Error(`3d renderer returned a non-PNG frame at ${b.timeMs}ms`);let w=Buffer.from(b.dataUrl.slice(M+1),"base64");D(R(h,f),w),B.push({file:f,timeMs:b.timeMs,sha256:Y("sha256").update(w).digest("hex"),alpha:b.alpha,phoneCollision:b.phoneCollision})}process.stderr.write(`\r three-mode: rendered ${Math.min(i+d,m)}/${m}`)}process.stderr.write(`
|
|
102
|
+
`);let C={version:2,timeline:g.absolutePath,fps:T,from:F,to:$,width:k,height:j,frameCount:m,transparent:B.every(i=>i.alpha.transparentPixels>0),frames:B};D(R(h,"timeline-render.json"),`${JSON.stringify(C,null,2)}
|
|
103
|
+
`),console.log(` three-mode: wrote ${m} deterministic RGBA frames to ${h}`)}finally{r.close()}}function me(t){let e=a=>t.find((m,c)=>t[c-1]===a),o={},n=e("--colorway");n&&(o.colorway=n);let r=e("--background");r&&(o.background=r);let u=e("--gradient");if(u){let a=u.split(",").map(N=>N.trim()).filter(Boolean),m=a.map((N,C)=>{let[i,d]=N.split("@"),l=d!==void 0?Number.parseFloat(d):a.length>1?C/(a.length-1):0;return l>1&&(l=l/100),Number.isFinite(l)||(l=a.length>1?C/(a.length-1):0),{color:i.trim(),offset:l}}),c=e("--gradient-angle"),B=c===void 0?void 0:Number.parseFloat(c);if(c!==void 0&&!Number.isFinite(B))throw new Error(`--gradient-angle expects a number, got "${c}"`);o.customGradient={stops:m,...B!==void 0?{angleDeg:B}:{}}}let g=e("--setting");if(g){if(g!=="none"&&g!=="room"&&g!=="white-backdrop")throw new Error(`--setting expects none, room, or white-backdrop, got "${g}"`);o.setting=g}let s={},p=P(e("--focus"),"--focus");p!==void 0&&(s.enabled=p);for(let[a,m]of[["--focus-amount","amount"],["--focus-range","range"]]){let c=e(a);c&&(s[m]=c)}Object.keys(s).length>0&&(o.focus=s),t.includes("--reset-pose")&&(o.resetPose=!0);let h=P(e("--environment"),"--environment"),T={},k={};for(let[a,m]of[["--env-shape","shape"],["--env-spread","spread"],["--env-size","size"],["--env-color","color"]]){let c=e(a);c&&(T[m]=c)}let j=P(e("--env-glow"),"--env-glow");j!==void 0&&(k.glow=j);let F=P(e("--env-plastic"),"--env-plastic");F!==void 0&&(k.plastic=F),(h!==void 0||Object.keys(T).length>0||Object.keys(k).length>0)&&(o.environment=h===!1?!1:{pins:T,effects:k});let $=e("--script");if($){let a=e("--progress"),m=a===void 0?1:Number.parseFloat(a);if(!Number.isFinite(m))throw new Error(`--progress expects a number from 0 to 1, got "${a}"`);o.script={id:$,progress:m,animate:t.includes("--animate"),slow:t.includes("--slow")}}return o}function P(t,e){if(t===void 0)return;let o=t.toLowerCase();if(["on","true","yes","1"].includes(o))return!0;if(["off","false","no","0"].includes(o))return!1;throw new Error(`${e} expects on or off, got "${t}"`)}function ue(t){return[`ready=${!!t.ready}`,`background=${String(t.background??"unknown")}`,`colorway=${String(t.colorway??"unknown")}`,`environment=${t.environmentActive?"on":"off"}`,`setting=${String(t.setting??"none")}`,`focus=${t.focus&&typeof t.focus=="object"&&t.focus.enabled?"on":"off"}`].join(", ")}export{U as a,ye as b,J as c,me as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.244 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.244 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{H as I,m as B,n as E,o as y,t as v,v as A}from"./chunk-UEHOXLFD.js";import{h,l as N,m as P}from"./chunk-R2DSJS7L.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}function V(e){process.stderr.write(`${e}
|
|
4
4
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function D(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return P(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!I(o)||Date.now()>=s)throw o;await w(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function X(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await w(o)}return null}async function Z(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&y({nodes:f,targets:$})&&g-u>=E)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&y(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:A});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
5
5
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await v(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|