sootsim 0.1.214 → 0.1.216
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/detox/index.ts +30 -16
- package/dist-cli/bin.js +4 -4
- package/dist-cli/chunks/{agent-QE4ZAHV2.js → agent-RMGUE35J.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-E5HCJNYH.js → agent-wrapper-PNKMWDVX.js} +2 -2
- package/dist-cli/chunks/{app-fonts-4ADYMRQO.js → app-fonts-Z6SGSVKJ.js} +2 -2
- package/dist-cli/chunks/{assert-QZSX66RW.js → assert-ELIDRXY7.js} +2 -2
- package/dist-cli/chunks/{auth-LW224VBS.js → auth-2NJA7QI6.js} +2 -2
- package/dist-cli/chunks/beta-MTYUL7U7.js +2 -0
- package/dist-cli/chunks/{camera-MPIQ3JAA.js → camera-XICNRGGO.js} +2 -2
- package/dist-cli/chunks/{chunk-3CNHHY7U.js → chunk-2FNN7T63.js} +1 -1
- package/dist-cli/chunks/{chunk-USSUXBPG.js → chunk-4BUASWNE.js} +1 -1
- package/dist-cli/chunks/{chunk-I4UH6RI5.js → chunk-4XCGYTBN.js} +2 -2
- package/dist-cli/chunks/chunk-5LT4NR6Y.js +1 -0
- package/dist-cli/chunks/chunk-6KRC622O.js +1 -0
- package/dist-cli/chunks/{chunk-Z6X2QRA3.js → chunk-6TZMBHQ5.js} +3 -3
- package/dist-cli/chunks/{chunk-4RHFQCED.js → chunk-7SPHDLSB.js} +2 -2
- package/dist-cli/chunks/{chunk-6QMGV5H7.js → chunk-AWSL2LAA.js} +2 -2
- package/dist-cli/chunks/{chunk-L3CQVAWX.js → chunk-BGDEZZWT.js} +2 -2
- package/dist-cli/chunks/{chunk-DUGNFSB5.js → chunk-CCFLATUR.js} +2 -2
- package/dist-cli/chunks/{chunk-USW3U45B.js → chunk-CQSIRKJ2.js} +2 -2
- package/dist-cli/chunks/{chunk-KHIKG5LO.js → chunk-CRU7UL5Q.js} +1 -1
- package/dist-cli/chunks/{chunk-CZZZC3BU.js → chunk-CU3LQUJD.js} +2 -2
- package/dist-cli/chunks/chunk-DA7KPSMF.js +2 -0
- package/dist-cli/chunks/{chunk-SLX3HZPR.js → chunk-DRFWZ74H.js} +1 -1
- package/dist-cli/chunks/{chunk-XJEIT5CH.js → chunk-G6VHJWGQ.js} +1 -1
- package/dist-cli/chunks/{chunk-RRFWPEQ6.js → chunk-GIZDZKHC.js} +1 -1
- package/dist-cli/chunks/{chunk-IUTSWOUM.js → chunk-GPLW7IL5.js} +2 -2
- package/dist-cli/chunks/{chunk-QPZW76ZB.js → chunk-HBCEGJQH.js} +2 -2
- package/dist-cli/chunks/chunk-HIDDRHAN.js +99 -0
- package/dist-cli/chunks/chunk-HKKKZRKS.js +89 -0
- package/dist-cli/chunks/{chunk-DABWOLOT.js → chunk-HZCW6RRE.js} +2 -2
- package/dist-cli/chunks/{chunk-2344ZBLD.js → chunk-J4GDWHXE.js} +2 -2
- package/dist-cli/chunks/{chunk-TI2ZOHON.js → chunk-J74AW22R.js} +1 -1
- package/dist-cli/chunks/{chunk-6LJUMA3J.js → chunk-LWECTC6A.js} +2 -2
- package/dist-cli/chunks/{chunk-6EP67RW7.js → chunk-M2DYRSIS.js} +2 -2
- package/dist-cli/chunks/chunk-P5JY275Q.js +119 -0
- package/dist-cli/chunks/{chunk-XQP4TU6P.js → chunk-P735P65P.js} +93 -65
- package/dist-cli/chunks/{chunk-R35AOOU4.js → chunk-QNRORBZE.js} +2 -2
- package/dist-cli/chunks/{chunk-TX53NA5W.js → chunk-RESHDGBU.js} +1 -1
- package/dist-cli/chunks/{chunk-Y3T4POUK.js → chunk-S3C2S27B.js} +2 -2
- package/dist-cli/chunks/{chunk-AYY7JBXA.js → chunk-SBP46OOV.js} +1 -1
- package/dist-cli/chunks/{chunk-5LD4QHER.js → chunk-SPKRGAWR.js} +6 -6
- package/dist-cli/chunks/{chunk-YVIUYF5U.js → chunk-SSLFXUZQ.js} +1 -1
- package/dist-cli/chunks/chunk-TNPHXSMV.js +2 -0
- package/dist-cli/chunks/{chunk-AXXJSIT3.js → chunk-U7UICUB4.js} +2 -2
- package/dist-cli/chunks/{chunk-LRIZ5ACL.js → chunk-UGNYHNBN.js} +3 -3
- package/dist-cli/chunks/{chunk-GTRGDGRK.js → chunk-UPLXEL4D.js} +1 -1
- package/dist-cli/chunks/{chunk-2HCVCJB7.js → chunk-URGNAE7V.js} +31 -31
- package/dist-cli/chunks/{chunk-5P6QAHAI.js → chunk-VDONTXCB.js} +1 -1
- package/dist-cli/chunks/{chunk-L5XB3GRM.js → chunk-VSGSEQE7.js} +2 -2
- package/dist-cli/chunks/{chunk-BNUZWRON.js → chunk-VURHG6DO.js} +1 -1
- package/dist-cli/chunks/{chunk-KPRSDBWU.js → chunk-YN44PKW5.js} +1 -1
- package/dist-cli/chunks/cli-version-BP5GKAZ6.js +2 -0
- package/dist-cli/chunks/{compat-IZXTAA6Q.js → compat-MF7YZPCS.js} +3 -3
- package/dist-cli/chunks/{config-KV7J63HM.js → config-WJSCJ622.js} +2 -2
- package/dist-cli/chunks/{control-CRJA7SXC.js → control-AZFQJXJ5.js} +2 -2
- package/dist-cli/chunks/daemon-MU77JEAP.js +2 -0
- package/dist-cli/chunks/{debug-ZCPDU23K.js → debug-LIXGHFHV.js} +3 -3
- package/dist-cli/chunks/{desktop-HKTZX7OT.js → desktop-T7GTXHL4.js} +3 -3
- package/dist-cli/chunks/{detox-LNWHCNFM.js → detox-WV5FD4G6.js} +2 -2
- package/dist-cli/chunks/{device-AV34WOXK.js → device-GPHUF3BL.js} +2 -2
- package/dist-cli/chunks/{diagnose-7INR3HKD.js → diagnose-OAXHSPXW.js} +2 -2
- package/dist-cli/chunks/drivers-LJAA7XSZ.js +2 -0
- package/dist-cli/chunks/film-ZBYERRWW.js +69 -0
- package/dist-cli/chunks/flow-TXG46ARF.js +2 -0
- package/dist-cli/chunks/help-BVVLN5KL.js +2 -0
- package/dist-cli/chunks/{home-paths-ML5HT67C.js → home-paths-T3SY5QGR.js} +2 -2
- package/dist-cli/chunks/inspect-7SHQVCCL.js +2 -0
- package/dist-cli/chunks/install-desktop-RFGXCZRS.js +2 -0
- package/dist-cli/chunks/{login-IND3C7NP.js → login-QS2GVTJJ.js} +4 -4
- package/dist-cli/chunks/{logout-H6R4RQK7.js → logout-I752SSKU.js} +2 -2
- package/dist-cli/chunks/{maestro-IVTBNNF6.js → maestro-RDBKRP4O.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-WCFBU5JM.js → maestro-generate-JOTQKAEH.js} +3 -3
- package/dist-cli/chunks/mode-Z4W3XXXU.js +24 -0
- package/dist-cli/chunks/optional-demo-registry-JTRVZB45.js +2 -0
- package/dist-cli/chunks/{perf-TNLPQUZI.js → perf-RXXW5GRA.js} +2 -2
- package/dist-cli/chunks/{record-MBJMHM23.js → record-527ZYKHE.js} +3 -3
- package/dist-cli/chunks/runtime-DOAHJLEK.js +2 -0
- package/dist-cli/chunks/{screenshot-command-Q5TFWB2R.js → screenshot-command-OBPEZJLR.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-AW5VYVOF.js → screenshots-capture-VC752Q3V.js} +2 -2
- package/dist-cli/chunks/{serve-L5XOVSCM.js → serve-NU6WWN2K.js} +2 -2
- package/dist-cli/chunks/{setup-TKXVNVBX.js → setup-6BJWI3PC.js} +3 -3
- package/dist-cli/chunks/{skills-GFZ5Z46I.js → skills-L7JPAJEZ.js} +2 -2
- package/dist-cli/chunks/{storage-SW3CLSLM.js → storage-XIZZSPC3.js} +2 -2
- package/dist-cli/chunks/store-3UAGOXD4.js +2 -0
- package/dist-cli/chunks/telemetry-IXCWQVEB.js +2 -0
- package/dist-cli/chunks/{timeline-LVV6HPFG.js → timeline-3MAGSV2V.js} +2 -2
- package/dist-cli/chunks/{upgrade-B22ZDON2.js → upgrade-YDHOHVYZ.js} +2 -2
- package/dist-cli/chunks/upload-YQVEPIO7.js +2 -0
- package/dist-cli/chunks/{version-G2X5AZHL.js → version-QDGDS5P2.js} +2 -2
- package/dist-cli/chunks/web-BK6VHH5W.js +2 -0
- package/dist-cli/chunks/{what-happened-2DEQUI25.js → what-happened-4GGACNI4.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 +108 -12
- 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 +1 -1
- package/dist-lib/menu.mjs +1 -1
- 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 +57 -9
- package/dist-lib/sdk.mjs +57 -9
- package/dist-lib/skills.cjs +41 -15
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/skills/soot/SKILL.md +1 -0
- package/skills/sootsim-debug/SKILL.md +6 -8
- package/skills/sootsim-perf/SKILL.md +4 -4
- package/dist-cli/chunks/beta-VXRR4GRU.js +0 -2
- package/dist-cli/chunks/chunk-FZPRFSTA.js +0 -2
- package/dist-cli/chunks/chunk-NQDDEWYD.js +0 -1
- package/dist-cli/chunks/chunk-T7CWPTU7.js +0 -2
- package/dist-cli/chunks/chunk-TQ7WAA2M.js +0 -119
- package/dist-cli/chunks/chunk-WEBUMXLD.js +0 -97
- package/dist-cli/chunks/chunk-WF6AY4K4.js +0 -1
- package/dist-cli/chunks/cli-version-5DZ5FKJC.js +0 -2
- package/dist-cli/chunks/daemon-LOYTWGGF.js +0 -2
- package/dist-cli/chunks/drivers-Z2TX4DMF.js +0 -2
- package/dist-cli/chunks/flow-7XFQKTBU.js +0 -2
- package/dist-cli/chunks/help-ODEIEVZ6.js +0 -2
- package/dist-cli/chunks/inspect-KFGNZ2E3.js +0 -2
- package/dist-cli/chunks/install-desktop-GTMDR7D5.js +0 -2
- package/dist-cli/chunks/mode-OXPEBMF2.js +0 -111
- package/dist-cli/chunks/optional-demo-registry-CHOUOWFF.js +0 -2
- package/dist-cli/chunks/runtime-NCWCN66Y.js +0 -2
- package/dist-cli/chunks/store-5AQQ6HKE.js +0 -2
- package/dist-cli/chunks/telemetry-L2M7NRKA.js +0 -2
- package/dist-cli/chunks/upload-UQRYTSL2.js +0 -2
- package/dist-cli/chunks/web-YCDMLF4V.js +0 -2
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.214 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{g as x,i as k,l as D,m as v}from"./chunk-5LD4QHER.js";import"./chunk-BNUZWRON.js";import"./chunk-KPRSDBWU.js";import"./chunk-TX53NA5W.js";import"./chunk-TI2ZOHON.js";function q(e){let o=e[0]?.toLowerCase()??"toggle";return o!=="on"&&o!=="off"&&o!=="toggle"&&(console.error(` unknown argument: "${o}" (expected on | off | toggle)`),process.exit(1)),o}async function R(e,o,t){let n=x(e,{port:o.port}),r=q(n.positional),d=k({...n,commandTimeoutMs:5e3});try{let l=!!(await D(d,"SootSim.bridges.settings.get"))?.[t.modeKey],m=r==="on"?!0:r==="off"?!1:!l;if(l===m)return console.log(` ${t.displayName}: already ${m?"on":"off"}`),{current:l,target:m,changed:!1};if(!await d.send({type:"evaluate",acquireLock:!0,code:`(async () => {
|
|
3
|
-
const modeKey = ${JSON.stringify(t.modeKey)}
|
|
4
|
-
const target = ${JSON.stringify(m)}
|
|
5
|
-
window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
6
|
-
detail: { type: 'fire-action', id: ${JSON.stringify(t.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(`${t.displayName} did not change to ${m?"on":"off"}; the live shell may not support this mode`);return console.log(` ${t.displayName}: ${l?"on":"off"} -> ${m?"on":"off"}`),{current:l,target:m,changed:!0}}finally{d.close()}}async function z(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
17
|
-
sootsim mode screenshot \u2014 toggle the screenshot-mode chrome overlay
|
|
18
|
-
|
|
19
|
-
usage:
|
|
20
|
-
sootsim mode screenshot [on|off|toggle]
|
|
21
|
-
|
|
22
|
-
arguments:
|
|
23
|
-
on enable screenshot mode (enables showFrame if needed)
|
|
24
|
-
off disable screenshot mode
|
|
25
|
-
toggle flip the current state (default)
|
|
26
|
-
|
|
27
|
-
examples:
|
|
28
|
-
sootsim mode screenshot
|
|
29
|
-
sootsim mode screenshot on
|
|
30
|
-
sootsim mode screenshot off
|
|
31
|
-
`),process.exit(0)),await R(e,o,{modeKey:"screenshotMode",displayName:"screenshot-mode",actionId:"toggle-screenshot-mode"})}import{createHash as Y}from"node:crypto";import{mkdirSync as Q,readFileSync as K,readdirSync as X,unlinkSync as Z,writeFileSync as U}from"node:fs";import{dirname as ee,extname as oe,resolve as T}from"node:path";var C=12e3,te=18e4,ne=new Set(["load","seek","play","pause","render"]);async function L(e,o){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
32
|
-
sootsim mode three \u2014 toggle the 3d device stage
|
|
33
|
-
|
|
34
|
-
usage:
|
|
35
|
-
sootsim mode three [on|off|toggle]
|
|
36
|
-
sootsim mode three configure [options]
|
|
37
|
-
sootsim mode three load <timeline.json>
|
|
38
|
-
sootsim mode three seek <time-ms>
|
|
39
|
-
sootsim mode three play|pause
|
|
40
|
-
sootsim mode three render <timeline.json> --output <dir> [options]
|
|
41
|
-
|
|
42
|
-
arguments:
|
|
43
|
-
on enable 3d mode
|
|
44
|
-
off disable 3d mode
|
|
45
|
-
toggle flip the current state (default)
|
|
46
|
-
|
|
47
|
-
configure options:
|
|
48
|
-
--background <id> set the 3d background
|
|
49
|
-
--gradient <stops> custom gradient bg: comma-separated css hex stops,
|
|
50
|
-
e.g. "#0a0e1a,#16243f,#05080f" (overrides --background;
|
|
51
|
-
evenly spaced, or use "color@offset" for explicit %)
|
|
52
|
-
--gradient-angle <deg> custom gradient angle (default 180 = top\u2192bottom)
|
|
53
|
-
--colorway <id> set the phone colorway
|
|
54
|
-
--script <id> apply a camera preset pose
|
|
55
|
-
--progress <0..1> script progress to sample (default: 1)
|
|
56
|
-
--animate run the script instead of sampling one frame
|
|
57
|
-
--slow run the script slowly when --animate is set
|
|
58
|
-
--environment on|off enable or disable environment objects
|
|
59
|
-
--env-shape <id> orb | pill | diamond | pane
|
|
60
|
-
--env-spread <id> tight | medium | wide
|
|
61
|
-
--env-size <id> small | medium | large
|
|
62
|
-
--env-color <id> peach | gold | mint | sky | violet
|
|
63
|
-
--env-glow on|off enable or disable environment glow
|
|
64
|
-
--env-plastic on|off enable or disable environment plastic material
|
|
65
|
-
--setting <id> none | room | white-backdrop
|
|
66
|
-
--focus on|off enable or disable Focus depth of field
|
|
67
|
-
--focus-amount <id> subtle | medium | strong | dramatic
|
|
68
|
-
--focus-range <id> tight | balanced | wide
|
|
69
|
-
--reset-pose return to the default hero pose before other changes
|
|
70
|
-
|
|
71
|
-
render options:
|
|
72
|
-
--output <dir> write frame-%05d.png + timeline-render.json
|
|
73
|
-
--fps <number> frames per second (default: 30)
|
|
74
|
-
--width <px> exact output width (default: 1920)
|
|
75
|
-
--height <px> exact output height (default: 1080)
|
|
76
|
-
--from <ms> first timeline time (default: 0)
|
|
77
|
-
--to <ms> exclusive end time (default: timeline duration)
|
|
78
|
-
--overwrite replace this command's existing frames in the dir
|
|
79
|
-
|
|
80
|
-
examples:
|
|
81
|
-
sootsim mode three
|
|
82
|
-
sootsim mode three on
|
|
83
|
-
sootsim mode three configure --script hero-arc --background gradient-neon
|
|
84
|
-
sootsim mode three configure --environment on --env-shape pane --setting room
|
|
85
|
-
sootsim mode three render ./cinematic.json --output ./frames --fps 30
|
|
86
|
-
sootsim mode three off
|
|
87
|
-
`),process.exit(0));let t=ae(e);if(t){await me(t,e,o);return}if(re(e)){await ie(e,o);return}(await R(e,o,{modeKey:"threeMode",displayName:"three-mode",actionId:"toggle-three-mode"})).target&&await se(e,o)}function re(e){return e[0]==="configure"||e.some(o=>["--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(o))}async function ie(e,o){let t=x(e,{port:o.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=ue(e),r=k({...t,commandTimeoutMs:C+1e3});try{await I(r);let d=await v(r,"SootSim.bridges.threeMode.configure",n);console.log(` three-mode: configured (${fe(d)})`)}finally{r.close()}}async function se(e,o){let t=x(e,{port:o.port}),n=k({...t,commandTimeoutMs:C+1e3});try{await I(n)}finally{n.close()}}async function I(e){let o=await e.send({type:"evaluate",code:`(async () => {
|
|
88
|
-
const deadline = Date.now() + ${C}
|
|
89
|
-
while (Date.now() < deadline) {
|
|
90
|
-
const settings = window.SootSim?.bridges?.settings?.get?.()
|
|
91
|
-
if (settings && settings.threeMode !== true) {
|
|
92
|
-
return { ready: false, disabled: true }
|
|
93
|
-
}
|
|
94
|
-
const bridge = window.SootSim?.bridges?.threeMode
|
|
95
|
-
const state = typeof bridge?.getState === 'function' ? bridge.getState() : null
|
|
96
|
-
if (state?.ready === true) return state
|
|
97
|
-
await new Promise((resolve) => setTimeout(resolve, 50))
|
|
98
|
-
}
|
|
99
|
-
const bridge = window.SootSim?.bridges?.threeMode
|
|
100
|
-
const state = typeof bridge?.getState === 'function' ? bridge.getState() : null
|
|
101
|
-
return state || { ready: false }
|
|
102
|
-
})()`});if(o?.ready===!0)return o;throw o?.disabled?new Error("3d mode is off; run `sootsim mode three on` before configure"):new Error("3d mode runtime did not become ready")}function ae(e){for(let o=0;o<e.length;o+=1){let t=e[o];if(t==="--sim"||t==="--port"||t==="-p"){o+=1;continue}if(!t.startsWith("-"))return ne.has(t)?t:null}return null}function V(e,o){let t=e.indexOf(o);return t>=0?e[t+1]:void 0}function F(e,o,t,n=0){let r=V(e,o);if(r===void 0)return t;let d=Number.parseFloat(r);if(!Number.isFinite(d)||d<n)throw new Error(`${o} expects a number greater than or equal to ${n}`);return d}function J(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,o){let t=oe(e).toLowerCase();return o==="recording"?t===".mp4"||t===".m4v"?"video/mp4":"video/webm":t===".jpg"||t===".jpeg"?"image/jpeg":t===".webp"?"image/webp":"image/png"}function j(e,o){if(Array.isArray(e))return e.map(n=>j(n,o));if(!J(e))return e;let t={};for(let[n,r]of Object.entries(e))t[n]=j(r,o);if((t.type==="recording"||t.type==="screenshot")&&typeof t.src=="string"&&!/^(?:blob:|data:|https?:)/i.test(t.src)){let n=T(o,t.src),r=K(n);t.src=`data:${de(n,t.type)};base64,${r.toString("base64")}`}return t}function le(e){let o=T(e),t=JSON.parse(K(o,"utf8"));return{absolutePath:o,timeline:j(t,ee(o))}}async function ce(e){await v(e,"SootSim.bridges.settings.set","threeMode",!0),await I(e)}async function me(e,o,t){let n=x(o,{port:t.port,commandTimeoutMs:te,stripBooleanFlags:["--overwrite"],stripValueFlags:["--output","--fps","--width","--height","--from","--to"]}),r=k(n);try{if(await ce(r),e==="seek"){let i=n.positional[1],u=i===void 0?Number.NaN:Number.parseFloat(i);if(!Number.isFinite(u))throw new Error("three-mode seek expects time in ms");let f=await v(r,"SootSim.bridges.threeMode.seek",u);console.log(` three-mode: ${Math.round(f.timeMs)}ms / ${Math.round(f.durationMs)}ms (${f.shotId??"no shot"})`);return}if(e==="play"||e==="pause"){let i=await v(r,`SootSim.bridges.threeMode.${e}`),u=J(i.timeline)?i.timeline:{};console.log(` three-mode: ${e} (${Math.round(Number(u.timeMs??0))}ms)`);return}let d=n.positional[1];if(!d)throw new Error(`three-mode ${e} expects a timeline JSON path`);let g=le(d),l=await v(r,"SootSim.bridges.threeMode.loadTimeline",g.timeline);if(e==="load"){console.log(` three-mode: loaded ${g.absolutePath} (${Math.round(l.durationMs)}ms)`);return}let m=V(o,"--output");if(!m)throw new Error("three-mode render requires --output <dir>");let p=T(m),w=F(o,"--fps",30,.001),b=Math.round(F(o,"--width",1920,1)),B=Math.round(F(o,"--height",1080,1)),y=F(o,"--from",0,0),h=F(o,"--to",l.durationMs,0);if(h<=y||h>l.durationMs)throw new Error(`--to must be greater than --from and at most ${l.durationMs}`);let s=1e3/w,a=Math.ceil((h-y)/s);Q(p,{recursive:!0});let c=X(p).filter(i=>/^frame-\d{5}\.png$/.test(i)||i==="timeline-render.json");if(c.length>0&&!o.includes("--overwrite"))throw new Error(`${p} already has timeline frames; pass --overwrite to replace them`);for(let i of c)Z(T(p,i));let M=[],$=4;for(let i=0;i<a;i+=$){let u=Math.min($,a-i),f=y+i*s,G=Math.min(h,f+u*s),N=await v(r,"SootSim.bridges.threeMode.renderFrames",{fps:w,from:f,to:G,width:b,height:B,count:u});if(N.frames.length!==u)throw new Error(`3d renderer returned ${N.frames.length} frames for a ${u}-frame batch`);for(let S of N.frames){let H=i+S.index,_=`frame-${String(H).padStart(5,"0")}.png`,A=S.dataUrl.indexOf(",");if(A<0||!S.dataUrl.slice(0,A).includes("image/png;base64"))throw new Error(`3d renderer returned a non-PNG frame at ${S.timeMs}ms`);let P=Buffer.from(S.dataUrl.slice(A+1),"base64");U(T(p,_),P),M.push({file:_,timeMs:S.timeMs,sha256:Y("sha256").update(P).digest("hex"),alpha:S.alpha})}process.stderr.write(`\r three-mode: rendered ${Math.min(i+u,a)}/${a}`)}process.stderr.write(`
|
|
103
|
-
`);let O={version:1,timeline:g.absolutePath,fps:w,from:y,to:h,width:b,height:B,frameCount:a,transparent:M.every(i=>i.alpha.transparentPixels>0),frames:M};U(T(p,"timeline-render.json"),`${JSON.stringify(O,null,2)}
|
|
104
|
-
`),console.log(` three-mode: wrote ${a} deterministic RGBA frames to ${p}`)}finally{r.close()}}function ue(e){let o=s=>e.find((a,c)=>e[c-1]===s),t={},n=o("--colorway");n&&(t.colorway=n);let r=o("--background");r&&(t.background=r);let d=o("--gradient");if(d){let s=d.split(",").map($=>$.trim()).filter(Boolean),a=s.map(($,O)=>{let[i,u]=$.split("@"),f=u!==void 0?Number.parseFloat(u):s.length>1?O/(s.length-1):0;return f>1&&(f=f/100),Number.isFinite(f)||(f=s.length>1?O/(s.length-1):0),{color:i.trim(),offset:f}}),c=o("--gradient-angle"),M=c===void 0?void 0:Number.parseFloat(c);if(c!==void 0&&!Number.isFinite(M))throw new Error(`--gradient-angle expects a number, got "${c}"`);t.customGradient={stops:a,...M!==void 0?{angleDeg:M}:{}}}let g=o("--setting");if(g){if(g!=="none"&&g!=="room"&&g!=="white-backdrop")throw new Error(`--setting expects none, room, or white-backdrop, got "${g}"`);t.setting=g}let l={},m=E(o("--focus"),"--focus");m!==void 0&&(l.enabled=m);for(let[s,a]of[["--focus-amount","amount"],["--focus-range","range"]]){let c=o(s);c&&(l[a]=c)}Object.keys(l).length>0&&(t.focus=l),e.includes("--reset-pose")&&(t.resetPose=!0);let p=E(o("--environment"),"--environment"),w={},b={};for(let[s,a]of[["--env-shape","shape"],["--env-spread","spread"],["--env-size","size"],["--env-color","color"]]){let c=o(s);c&&(w[a]=c)}let B=E(o("--env-glow"),"--env-glow");B!==void 0&&(b.glow=B);let y=E(o("--env-plastic"),"--env-plastic");y!==void 0&&(b.plastic=y),(p!==void 0||Object.keys(w).length>0||Object.keys(b).length>0)&&(t.environment=p===!1?!1:{pins:w,effects:b});let h=o("--script");if(h){let s=o("--progress"),a=s===void 0?1:Number.parseFloat(s);if(!Number.isFinite(a))throw new Error(`--progress expects a number from 0 to 1, got "${s}"`);t.script={id:h,progress:a,animate:e.includes("--animate"),slow:e.includes("--slow")}}return t}function E(e,o){if(e===void 0)return;let t=e.toLowerCase();if(["on","true","yes","1"].includes(t))return!0;if(["off","false","no","0"].includes(t))return!1;throw new Error(`${o} expects on or off, got "${e}"`)}function fe(e){return[`ready=${!!e.ready}`,`background=${String(e.background??"unknown")}`,`colorway=${String(e.colorway??"unknown")}`,`environment=${e.environmentActive?"on":"off"}`,`setting=${String(e.setting??"none")}`,`focus=${e.focus&&typeof e.focus=="object"&&e.focus.enabled?"on":"off"}`].join(", ")}var ge=new Set(["--sim","--port","-p"]),pe=new Set(["screenshot","three"]);function he(e){for(let o=0;o<e.length;o++){let t=e[o];if(t.startsWith("-")){ge.has(t)&&o++;continue}return pe.has(t)?{name:t,index:o}:null}return null}function we(e,o){return[...e.slice(0,o),...e.slice(o+1)]}function W(){console.log(`
|
|
105
|
-
sootsim mode \u2014 toggle live display modes
|
|
106
|
-
|
|
107
|
-
usage:
|
|
108
|
-
sootsim mode screenshot [on|off|toggle]
|
|
109
|
-
sootsim mode three [on|off|toggle]
|
|
110
|
-
sootsim mode three configure [options]
|
|
111
|
-
`)}async function Re(e,o){if(e.includes("--help")||e.includes("-h")){W();return}let t=he(e);t||(W(),process.exit(1));let n=we(e,t.index);if(t.name==="screenshot"){await z(n,o);return}await L(n,o)}export{Re as runMode};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.214 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a}from"./chunk-Z6X2QRA3.js";import"./chunk-I4UH6RI5.js";import"./chunk-5LD4QHER.js";import"./chunk-BNUZWRON.js";import"./chunk-KPRSDBWU.js";import"./chunk-TX53NA5W.js";import"./chunk-TI2ZOHON.js";export{a as runRuntime};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! sootsim v0.1.214 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import{a,b,c}from"./chunk-WEBUMXLD.js";import"./chunk-2344ZBLD.js";import"./chunk-USSUXBPG.js";import"./chunk-5P6QAHAI.js";import"./chunk-5LD4QHER.js";import"./chunk-GTRGDGRK.js";import"./chunk-6LJUMA3J.js";import"./chunk-6QMGV5H7.js";import"./chunk-BNUZWRON.js";import"./chunk-KPRSDBWU.js";import"./chunk-TX53NA5W.js";import"./chunk-TI2ZOHON.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
|