sootsim 0.1.138 → 0.1.140
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 +3 -3
- package/dist-cli/chunks/{agent-TD7SHXRH.js → agent-N767ME6M.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-H6JLLQAZ.js → agent-wrapper-ELHIUFZZ.js} +2 -2
- package/dist-cli/chunks/{app-fonts-JDQFGE3V.js → app-fonts-OZ3OSNAJ.js} +2 -2
- package/dist-cli/chunks/{assert-2XLXLJOD.js → assert-GGFUQBNB.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-L5E6XMCK.js +2 -0
- package/dist-cli/chunks/beta-D74SDA2L.js +2 -0
- package/dist-cli/chunks/camera-5PYEDLLB.js +20 -0
- package/dist-cli/chunks/chunk-4FBFOWV3.js +4 -0
- package/dist-cli/chunks/{chunk-7ELG4PYE.js → chunk-4FGNOWB6.js} +1 -1
- package/dist-cli/chunks/{chunk-ZSPUTLK7.js → chunk-5EP5RRNS.js} +35 -34
- package/dist-cli/chunks/{chunk-BA3QQ5B3.js → chunk-5VTYMBUK.js} +2 -2
- package/dist-cli/chunks/chunk-6KUVOSFF.js +79 -0
- package/dist-cli/chunks/{chunk-CTXIRBH2.js → chunk-77TL74AM.js} +1 -1
- package/dist-cli/chunks/{chunk-BDOLDROC.js → chunk-7SMEXHWJ.js} +1 -1
- package/dist-cli/chunks/{chunk-JFQVDRBK.js → chunk-AI65UVSN.js} +52 -4
- package/dist-cli/chunks/{chunk-XWHR6IKV.js → chunk-AOICEZCA.js} +2 -2
- package/dist-cli/chunks/chunk-AP2MOP44.js +2 -0
- package/dist-cli/chunks/chunk-BEA3AO36.js +5 -0
- package/dist-cli/chunks/{chunk-PILBWKNB.js → chunk-BGXNYXBC.js} +1 -1
- package/dist-cli/chunks/{chunk-FFVME5EQ.js → chunk-BLQBPN76.js} +2 -2
- package/dist-cli/chunks/{chunk-Q4J2SESV.js → chunk-BM7QWZRI.js} +2 -2
- package/dist-cli/chunks/{chunk-5N5MQQM5.js → chunk-C3FURRBF.js} +1 -1
- package/dist-cli/chunks/{chunk-RHU73TIJ.js → chunk-CQ3LV5VL.js} +2 -2
- package/dist-cli/chunks/chunk-EH6YDCSN.js +119 -0
- package/dist-cli/chunks/{chunk-T3HJHXXN.js → chunk-EMNVJOEL.js} +3 -3
- package/dist-cli/chunks/{chunk-C563J47N.js → chunk-FYUDIUFX.js} +2 -2
- package/dist-cli/chunks/{chunk-WHIZNJLR.js → chunk-GI43DDEI.js} +1 -1
- package/dist-cli/chunks/{chunk-KLFGCFE4.js → chunk-GL74P6NR.js} +1 -1
- package/dist-cli/chunks/{chunk-GYZ5ZZMH.js → chunk-GYZNLDBX.js} +2 -2
- package/dist-cli/chunks/chunk-HPTMLB7V.js +2 -0
- package/dist-cli/chunks/{chunk-NPUHFOSG.js → chunk-MRQRJINW.js} +1 -1
- package/dist-cli/chunks/{chunk-IEGRNKTT.js → chunk-N2XPC4Z7.js} +2 -2
- package/dist-cli/chunks/chunk-NQG4R5K2.js +1 -0
- package/dist-cli/chunks/{chunk-62DPZPFC.js → chunk-O2SQNUDP.js} +1 -1
- package/dist-cli/chunks/{chunk-I7RL227U.js → chunk-PBS47TD5.js} +2 -2
- package/dist-cli/chunks/chunk-Q5Z7P54I.js +2 -0
- package/dist-cli/chunks/{chunk-FBDOREAI.js → chunk-QOZ2Q4FH.js} +1 -1
- package/dist-cli/chunks/{chunk-SX6BVZL5.js → chunk-QRRBQE6M.js} +2 -2
- package/dist-cli/chunks/{chunk-KJOBH5CA.js → chunk-QXOZB7WD.js} +2 -2
- package/dist-cli/chunks/{chunk-3XBLSPSH.js → chunk-R5F7XGAO.js} +3 -3
- package/dist-cli/chunks/{chunk-VIZ5BLM2.js → chunk-RAY2DLSK.js} +1 -1
- package/dist-cli/chunks/{chunk-TP3NTZUM.js → chunk-REIC7HRW.js} +1 -1
- package/dist-cli/chunks/chunk-S7I6ZCT2.js +1 -0
- package/dist-cli/chunks/{chunk-GSGRNYPC.js → chunk-SSZBFWV7.js} +1 -1
- package/dist-cli/chunks/chunk-UHTE6FLK.js +69 -0
- package/dist-cli/chunks/{chunk-MZ7TYYP7.js → chunk-WGDXZMKT.js} +2 -2
- package/dist-cli/chunks/chunk-WN3WZEE5.js +1 -0
- package/dist-cli/chunks/{chunk-JEL7BQG7.js → chunk-X6AWKKL4.js} +2 -2
- package/dist-cli/chunks/{chunk-T6QPOIJN.js → chunk-XGYD25DJ.js} +1 -1
- package/dist-cli/chunks/{chunk-XV6XIC4J.js → chunk-ZGDJ5TFU.js} +2 -2
- package/dist-cli/chunks/{chunk-KBOMW6U3.js → chunk-ZN4Z2W7F.js} +2 -2
- package/dist-cli/chunks/{chunk-MNKYCXHQ.js → chunk-ZVQOEMXS.js} +52 -52
- package/dist-cli/chunks/cli-version-EZRTEUXF.js +2 -0
- package/dist-cli/chunks/{compat-6KRCWKBL.js → compat-U3772TUK.js} +3 -3
- package/dist-cli/chunks/{config-JGTLOWS6.js → config-6CZCIYKJ.js} +2 -2
- package/dist-cli/chunks/{control-3LHOESUK.js → control-NVA25O65.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-KWE5IXBN.js → cpu-profile-WRLTZYO6.js} +2 -2
- package/dist-cli/chunks/{daemon-S5LNAQAU.js → daemon-QQPGLGS6.js} +2 -2
- package/dist-cli/chunks/{debug-KJ3TNXUN.js → debug-RKYLSDZV.js} +3 -3
- package/dist-cli/chunks/{detox-UJIPM47N.js → detox-ZRUQQU22.js} +2 -2
- package/dist-cli/chunks/{device-23SEWSUA.js → device-HXTOLEWY.js} +2 -2
- package/dist-cli/chunks/{diagnose-53JGSJF2.js → diagnose-QN4E4WA6.js} +2 -2
- package/dist-cli/chunks/drivers-EVK22AX5.js +2 -0
- package/dist-cli/chunks/{electron-F43274XT.js → electron-ZHRC4WQ5.js} +3 -3
- package/dist-cli/chunks/flow-ICCRVJVX.js +2 -0
- package/dist-cli/chunks/help-QMZ35MIQ.js +2 -0
- package/dist-cli/chunks/{hints-6EFUPUX6.js → hints-HCHKMDUE.js} +2 -2
- package/dist-cli/chunks/{home-paths-TAGKOEXO.js → home-paths-3OHKRAE4.js} +2 -2
- package/dist-cli/chunks/{inspect-UVBYBYJB.js → inspect-QXUBDKJJ.js} +3 -3
- package/dist-cli/chunks/install-JSDZIE2T.js +2 -0
- package/dist-cli/chunks/{install-desktop-M2QEFAIN.js → install-desktop-QCX44BGL.js} +7 -7
- package/dist-cli/chunks/{keys-IJNQHCGZ.js → keys-VEP2KPUF.js} +2 -2
- package/dist-cli/chunks/{launch-UK4I6UYE.js → launch-K4BPQLTP.js} +3 -3
- package/dist-cli/chunks/{login-OBLKQALN.js → login-UVC5XRKR.js} +4 -4
- package/dist-cli/chunks/{logout-HUOLFAU6.js → logout-3VW34IBA.js} +2 -2
- package/dist-cli/chunks/{maestro-B6JMWFEO.js → maestro-HTFXXMLR.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-5YYEAL46.js +2 -0
- package/dist-cli/chunks/{preview-TYICI3EN.js → preview-TZYJMLEJ.js} +2 -2
- package/dist-cli/chunks/{profile-NQO5HFFJ.js → profile-HDJRF7YB.js} +2 -2
- package/dist-cli/chunks/{react-WXEGMAH6.js → react-RLJR26M7.js} +2 -2
- package/dist-cli/chunks/{record-3DK7CCXV.js → record-2LDDHHUY.js} +2 -2
- package/dist-cli/chunks/runtime-QPYF2WQX.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-QAHWI6JH.js → runtime-delivery-3F6O57E5.js} +2 -2
- package/dist-cli/chunks/{screenshot-SQ7ETUJY.js → screenshot-QAUSSEPK.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-YYIBQI6S.js → screenshot-mode-K6HEVK4K.js} +2 -2
- package/dist-cli/chunks/{screenshots-YH5P24GR.js → screenshots-TWMCGUBT.js} +2 -2
- package/dist-cli/chunks/{server-PVYHPTCD.js → server-ZPIZCBW5.js} +3 -3
- package/dist-cli/chunks/setup-repo-VHOZJEIV.js +2 -0
- package/dist-cli/chunks/{skills-2V2A7R4O.js → skills-NI3RH7CW.js} +2 -2
- package/dist-cli/chunks/{start-JKY3T6AY.js → start-G6CQL6HJ.js} +4 -4
- package/dist-cli/chunks/store-F6MJUJYW.js +2 -0
- package/dist-cli/chunks/telemetry-DM2Y7OQJ.js +2 -0
- package/dist-cli/chunks/{test-FVA5WGGM.js → test-V47D6EPK.js} +3 -3
- package/dist-cli/chunks/{three-mode-GVODLLP3.js → three-mode-G7N3LRHM.js} +2 -2
- package/dist-cli/chunks/{timeline-LCJYWJBG.js → timeline-EBUOILTJ.js} +2 -2
- package/dist-cli/chunks/{upgrade-4TVPQJRL.js → upgrade-OQJLTCQP.js} +2 -2
- package/dist-cli/chunks/upload-W3YCA65H.js +2 -0
- package/dist-cli/chunks/{version-2XWRCYTM.js → version-3YJPPUE5.js} +2 -2
- package/dist-cli/chunks/web-ZKUX5ICX.js +2 -0
- package/dist-cli/chunks/{what-happened-R57H6WK6.js → what-happened-HOY3TA42.js} +2 -2
- package/dist-cli/chunks/{whoami-YCVHJHIM.js → whoami-GOCSBVTG.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +42 -820
- 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 +179 -956
- 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/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 +29 -797
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +660 -1032
- package/dist-lib/vite.cjs +1 -1
- package/package.json +2 -6
- package/scripts/dev-server-scanner.ts +10 -2
- package/scripts/optional-demo-registry.ts +54 -0
- package/src/attached-projects.ts +6 -27
- package/dist-cli/chunks/auto-bootstrap-Q7Z5522T.js +0 -2
- package/dist-cli/chunks/beta-LW4TRSKL.js +0 -2
- package/dist-cli/chunks/chunk-3AVKOCIL.js +0 -5
- package/dist-cli/chunks/chunk-BXITI3GQ.js +0 -4
- package/dist-cli/chunks/chunk-DBJCMZX7.js +0 -1
- package/dist-cli/chunks/chunk-DV4DKAHB.js +0 -64
- package/dist-cli/chunks/chunk-KYAAYSMS.js +0 -2
- package/dist-cli/chunks/chunk-M6GZUJXH.js +0 -62
- package/dist-cli/chunks/chunk-N4DFR7UX.js +0 -79
- package/dist-cli/chunks/chunk-N7TXV2XT.js +0 -1
- package/dist-cli/chunks/chunk-SIKDBA2E.js +0 -119
- package/dist-cli/chunks/chunk-YB7NANNJ.js +0 -1
- package/dist-cli/chunks/chunk-ZS55UGAA.js +0 -2
- package/dist-cli/chunks/cli-version-ROECZHPK.js +0 -2
- package/dist-cli/chunks/demo-app-registry-SU74KYFQ.js +0 -2
- package/dist-cli/chunks/drivers-LQS4T2IT.js +0 -2
- package/dist-cli/chunks/flow-H4F2X23Y.js +0 -2
- package/dist-cli/chunks/help-BT5NJNJ5.js +0 -2
- package/dist-cli/chunks/install-P5R6747T.js +0 -2
- package/dist-cli/chunks/runtime-IFNZGBPZ.js +0 -2
- package/dist-cli/chunks/setup-repo-Y63FUXRC.js +0 -2
- package/dist-cli/chunks/store-KNRC4EGM.js +0 -2
- package/dist-cli/chunks/telemetry-HDSITSDA.js +0 -2
- package/dist-cli/chunks/upload-3AXP6K6R.js +0 -2
- package/dist-cli/chunks/web-4Z6SFQFV.js +0 -2
- package/dist-lib/scripts/demo-app-registry.cjs +0 -818
- package/scripts/demo-app-registry.ts +0 -1006
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as R,B as g,C as v,E as w,k as p,t as b,v as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as R,B as g,C as v,E as w,k as p,t as b,v as S}from"./chunk-GL74P6NR.js";import{spawn as I}from"child_process";import P from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as E}from"stream/promises";var M="https://sootbean.com",C="SOOTSIM_CDN_ORIGIN",N="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(S(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function m(e){let t=$();return(e||process.env[C]||t.cdnOrigin||M).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[N]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${m(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function D(e,t){return`${m(t)}/runtimes/sootsim-runtime-${e}.tar.gz`}async function y(e){let t=T(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function U(e,t){let r=new URL(`${m(t)}/api/changelog/sootsim`);return r.searchParams.set("page",String(e)),r.searchParams.set("t",String(Date.now())),r.toString()}async function V(e,t){let r=U(e,t),n=await fetch(r,{headers:{Accept:"application/json"}});if(n.status===404)return{product:"sootsim",updatedThrough:null,page:e,pageSize:0,total:0,totalPages:0,hasMore:!1,entries:[]};if(!n.ok)throw new Error(`releases fetch failed: ${n.status} ${n.statusText} (${r})`);return await n.json()}async function K(e){let t=[],r=1;for(let n=0;n<1e3;n++){let i=await V(r,e);if(Array.isArray(i.entries)&&t.push(...i.entries),!i.hasMore||i.entries.length===0)break;r++}return t}function A(e,t={}){let r=x(t.channel),n=t.version||e.channels[r]?.latest;if(!n)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let i=e.versions[n];if(!i)throw new Error(`version ${n} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:n,channel:r,entry:i}}async function j(e={}){R();let t=m(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=A(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&v(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let d=o.tarball||D(n,t),f=l.join(b(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(d,f),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await z(f);if(h!==o.sha256)throw s.rmSync(f,{force:!0}),new Error(`sha256 mismatch for runtime ${n}: expected ${o.sha256}, actual ${h}`);let u=l.join(l.dirname(a),`.installing-${n}-${process.pid}`);s.rmSync(u,{recursive:!0,force:!0}),s.mkdirSync(u,{recursive:!0});try{if(await L(f,u),!s.existsSync(l.join(u,"index.html")))throw new Error(`extracted tarball for runtime ${n} is missing index.html`);s.rmSync(a,{recursive:!0,force:!0}),s.renameSync(u,a)}catch(O){throw s.rmSync(u,{recursive:!0,force:!0}),O}return c&&v(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function Q(e={}){R();let t=m(e.cdnOrigin),r=x(e.channel),n=await y(t),i=n.channels[r]?.latest;if(!i)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:g()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:g(),latestVersion:i};let a=g(),c=a?p(a):null,d=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!d||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await j({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function X(e={}){let t=g();try{let r=await y(m(e.cdnOrigin)),n=x(e.channel),i=r.channels[n]?.latest??null,o=!!(i&&(!t||w(i,t)>0));return{active:t,latest:i,outdated:o}}catch{return{active:t,latest:null,outdated:!1}}}async function _(e,t){let r=await fetch(e);if(!r.ok||!r.body)throw new Error(`download failed: ${r.status} ${r.statusText} (${e})`);s.mkdirSync(l.dirname(t),{recursive:!0});let n=`${t}.partial`;try{await E(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function z(e){return new Promise((t,r)=>{let n=P.createHash("sha256"),i=s.createReadStream(e);i.on("data",o=>n.update(o)),i.on("error",r),i.on("end",()=>t(n.digest("hex")))})}function L(e,t){return new Promise((r,n)=>{let i=I("tar",["-xzf",e,"-C",t],{stdio:["ignore","inherit","inherit"]});i.on("error",n),i.on("exit",o=>{o===0?r():n(new Error(`tar exited with code ${o}`))})})}export{M as a,C as b,N as c,m as d,x as e,T as f,D as g,y as h,U as i,K as j,A as k,j as l,Q as m,X as n};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as ue,e as de,f as pe}from"./chunk-QRRBQE6M.js";import{d as ce}from"./chunk-REIC7HRW.js";import{c as ae,e as le,g as P}from"./chunk-AOICEZCA.js";import{d as ie}from"./chunk-XGYD25DJ.js";import{a as se,b}from"./chunk-QXOZB7WD.js";import{a as oe}from"./chunk-N2XPC4Z7.js";import{createHash as He}from"crypto";import{readFileSync as K}from"fs";import{gzipSync as Ce}from"zlib";function fe(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as Le,constants as Ee}from"node:zlib";var ke=9;function ge(e){return Le(e,{params:{[Ee.BROTLI_PARAM_QUALITY]:ke}})}function G(e,t){let r=new AbortController,o=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(o)}}async function Ae(e){let t=G(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let o=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${o.slice(0,200)}`)}}async function Fe(e,t=8,r){let o=0,i=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;o<a;){let c=e[o++];await Ae(c),i++,r?.(i,a)}}))}function ze(e,t,r,o){let i=[];i.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let c=r.get(a.urlhash);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}e.events&&o?.eventsBytes&&i.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:o.eventsBytes}),e.flowVideo&&o?.videoBytes&&i.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:o.videoBytes}),e.storage&&o?.storageBytes&&i.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:o.storageBytes});for(let a of e.snapshots??[]){let c=o?.snapshotBytes?.get(a.id);c&&i.push({url:a.putUrl,contentType:a.contentType,bytes:c})}return i}function Me(e){return e.replace(/\/+$/,"")}var F=class extends Error{constructor(r,o,i,a=""){super(r);this.status=o;this.phase=i;this.responseText=a;this.name="PresignedUploadError"}};async function he(e){let t=Me(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let o=G(3e4,"init"),i;try{i=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:o.signal})}finally{o.cancel()}if(!i.ok){let p=await i.text().catch(()=>"");throw new F(`init failed: ${i.status} ${p.slice(0,200)}`,i.status,"init",p)}let a=await i.json(),c=ze(a,e.bundleBytes,e.filesByHash,e.extras);await Fe(c,e.concurrency??8,e.onPutProgress);let y=G(3e4,"finalize"),u;try{u=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:y.signal})}finally{y.cancel()}if(!u.ok){let p=await u.text().catch(()=>"");throw new F(`finalize failed: ${u.status} ${p.slice(0,200)}`,u.status,"finalize",p)}let S=await u.json();return{init:a,finalize:S}}function Ne(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}var be=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",ve=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",J="http://localhost:3000",We=2e3;async function Ve(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${J}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(We)});if(t.ok||t.status===204||t.status===405)return J}catch{}return be}function O(e){return e.replace(/\/$/,"")}function qe(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function De(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Ge(e,t){return t?O(t):process.env.SOOTSIM_PREVIEW_ORIGIN?O(process.env.SOOTSIM_PREVIEW_ORIGIN):qe(e)?O(e):De(e)?O(ve):O(e)}function Ke(){console.log(`
|
|
3
|
+
sootsim upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
4
|
+
|
|
5
|
+
usage:
|
|
6
|
+
sootsim upload [--origin <url>] [--public-origin <url>] (--events <path> | --video <path>) [--screenshot <path>] [--owner <org> --repo <repo>] [--sim <sim>] [--open] [--assets-only]
|
|
7
|
+
|
|
8
|
+
options:
|
|
9
|
+
--origin <url> upload target (default: auto)
|
|
10
|
+
prefers ${J} when available, otherwise
|
|
11
|
+
falls back to ${be}
|
|
12
|
+
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
13
|
+
--public-origin <url>
|
|
14
|
+
public /preview link origin (default: ${ve}
|
|
15
|
+
for prod uploads, upload origin for localhost/custom origins).
|
|
16
|
+
override with SOOTSIM_PREVIEW_ORIGIN env var
|
|
17
|
+
--events <path> path to a gzipped events .jsonl.gz file to attach
|
|
18
|
+
required unless --video is present; previews must
|
|
19
|
+
have replay or recording playback data
|
|
20
|
+
--screenshot <path>
|
|
21
|
+
path to a PNG thumbnail to attach to the share
|
|
22
|
+
--video <path> path to a mp4/gif flow recording. embedded inline
|
|
23
|
+
in the pr sticky comment served at
|
|
24
|
+
/api/preview/flow-video?id=<share-id>
|
|
25
|
+
--video-duration-ms <ms>
|
|
26
|
+
duration hint for attached flow video
|
|
27
|
+
--owner <org> associate a session upload with a linked org repo
|
|
28
|
+
--repo <repo> repo name for --owner; the signed-in user must belong
|
|
29
|
+
to the local/org team that owns the link
|
|
30
|
+
--sim <sim> target a specific sim (see: sootsim list)
|
|
31
|
+
--open open the resulting /preview/<id> url in the browser
|
|
32
|
+
--assets-only drop API/JSON/HTML records before upload; keep images,
|
|
33
|
+
fonts, css, js, and binary blobs. live-data demos hit
|
|
34
|
+
the real network at replay time instead of serving
|
|
35
|
+
recorded API snapshots
|
|
36
|
+
-h, --help
|
|
37
|
+
|
|
38
|
+
examples:
|
|
39
|
+
sootsim upload --events ./my-session.jsonl.gz
|
|
40
|
+
sootsim upload --origin http://localhost:3000 --events ./my-session.jsonl.gz --open
|
|
41
|
+
sootsim upload --video /tmp/soot-flow.mp4 --video-duration-ms 12000
|
|
42
|
+
`)}function v(e,t){let r=e.findIndex(i=>i===t);if(r<0)return;let o=e[r+1];return e.splice(r,2),o}function ye(e,t){let r=e.findIndex(o=>o===t);return r<0?!1:(e.splice(r,1),!0)}function me(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function we(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function je(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function Je(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function Ye(e){try{let t=new URL(e);return t.searchParams.get("lazy")==="true"?(t.searchParams.set("lazy","false"),t.toString()):e}catch{return e}}async function Qe(e,t){let o=[];for(let i=0;i<t;i+=15e5){let a=Math.min(i+15e5,t),c=await P(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${i}, ${a})`);if(typeof c!="string")return null;o.push(c)}return o.join("")}function j(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function ht(e,t){(e.includes("--help")||e.includes("-h"))&&(Ke(),process.exit(0));let r=[...e],o=await Ve(v(r,"--origin")),i=Ge(o,v(r,"--public-origin")),a=v(r,"--events"),c=v(r,"--screenshot"),y=v(r,"--video"),u=v(r,"--video-duration-ms"),S=v(r,"--owner"),p=v(r,"--repo"),Ue=ye(r,"--open");(S&&!p||!S&&p)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),!a&&!y&&(console.error(" preview uploads require playback data: pass --events or --video.\n for a normal local preview, use `sootsim record --mode combined --open`\n or `sootsim flow --preview` instead of uploading a bundle-only snapshot."),process.exit(1));let Y=ye(r,"--assets-only"),Be=ae(r,{stripBooleanFlags:[],stripValueFlags:[]}),U=le(Be),l,Q=[],m=[],z=null;try{if(l=await P(U,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[s,h]=await Promise.all([P(U,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),P(U,`(async () => {
|
|
43
|
+
const list = window.__sootsimListWorkerFetchRecorder
|
|
44
|
+
return typeof list === 'function'
|
|
45
|
+
? await list(${JSON.stringify(n)})
|
|
46
|
+
: []
|
|
47
|
+
})()`)]);Q=j([...s,...h]).filter(d=>{try{return!new URL(d.url).pathname.startsWith("/api/")}catch{return!0}});let E=await P(U,`(async () => {
|
|
48
|
+
const rec = window.__sootsimPreviewRecorder
|
|
49
|
+
const workerList = window.__sootsimListWorkerFetchRecorder
|
|
50
|
+
return {
|
|
51
|
+
main: rec?.list ? rec.list() : [],
|
|
52
|
+
worker: typeof workerList === 'function' ? await workerList() : [],
|
|
53
|
+
}
|
|
54
|
+
})()`),_=(E?j([...E.main,...E.worker]):[]).filter(d=>{try{return new URL(d.url).origin!==n}catch{return!1}}),T=_.length>0?{count:_.length,totalBytes:_.reduce((d,x)=>d+(x.size||0),0)}:null;if(T&&T.count>0){console.log(` ${T.count} recorded cross-origin responses (${(T.totalBytes/1024).toFixed(1)} KiB)`);let d=await P(U,`(async () => {
|
|
55
|
+
const rec = window.__sootsimPreviewRecorder
|
|
56
|
+
const workerDump = window.__sootsimDumpWorkerFetchRecorder
|
|
57
|
+
const bundleUrl = ${JSON.stringify(l.bundleUrl)}
|
|
58
|
+
const keep = (r) => {
|
|
59
|
+
try {
|
|
60
|
+
const u = new URL(r.url)
|
|
61
|
+
if (u.origin !== ${JSON.stringify(n)}) return true
|
|
62
|
+
// bundle-origin api responses came from the rewritten
|
|
63
|
+
// /__app-api proxy at record time (re-keyed by the
|
|
64
|
+
// recorder's unwrap step). they need bodies attached the
|
|
65
|
+
// same way as cross-origin records \u2014 direct re-fetch from
|
|
66
|
+
// the dev server lacks the bundle's session cookies.
|
|
67
|
+
if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
|
|
68
|
+
return false
|
|
69
|
+
} catch { return false }
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
main: rec?.dump ? rec.dump().filter(keep) : [],
|
|
73
|
+
worker: typeof workerDump === 'function'
|
|
74
|
+
? (await workerDump()).filter(keep)
|
|
75
|
+
: [],
|
|
76
|
+
}
|
|
77
|
+
})()`);if(m=j([...d.main,...d.worker]),Y){let x=m.length;m=m.filter(D=>me(D.contentType));let q=T.totalBytes-m.reduce((D,$e)=>D+($e.size||0),0);console.log(` --assets-only: kept ${m.length}/${x} records (dropped ${(q/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(z=await Qe(U,l.transformedBundle.byteLength))}finally{U.close()}l||(console.error(" could not read bundle snapshot \u2014 is sootsim running and is the bundle loaded?"),process.exit(2)),l.bundleUrl||(console.error(` no ?bundle= URL on the current sootsim tab.
|
|
78
|
+
open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let f,M=!1;if(z!==null)f=new TextEncoder().encode(z),M=!0,console.log(` using post-transform bundle: ${(f.byteLength/1024).toFixed(1)} KiB`);else{let n=Ye(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),f=await we(n),console.log(` main bundle: ${(f.byteLength/1024).toFixed(1)} KiB`)}let k=Q.filter(n=>n.url!==l.bundleUrl);Y&&(k=k.filter(n=>me(n.contentType))),console.log(` fetching ${k.length} extra files\u2026`);let A=(await Promise.all(k.map(async n=>{try{let s=await we(n.url);return{...n,bytes:s}}catch(s){return console.error(` warning: failed to re-fetch ${n.url}: ${s instanceof Error?s.message:s}`),null}}))).filter(n=>!!n),Te=A.reduce((n,s)=>n+s.bytes.byteLength,0);console.log(` ${A.length} extra files: ${(Te/1024).toFixed(1)} KiB`);let B;a&&(B=K(a));let g;c&&(g=K(c),console.log(` attaching screenshot: ${(g.byteLength/1024).toFixed(1)} KiB`));let w,$,X;if(y){if(w=K(y),$=y.endsWith(".mp4")?"video/mp4":y.endsWith(".gif")?"image/gif":void 0,$||(console.error(" preview flow videos must be mp4 or gif"),await b(),process.exit(1)),u){let n=Number(u);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${u}`),await b(),process.exit(1)),X=Math.round(n)}console.log(` attaching flow video: ${(w.byteLength/1024).toFixed(1)} KiB (${$})`)}let I=ue(),R=pe(I),Pe=oe();se({event:"preview_upload_started",identity:{userId:I?.kind==="session"?Pe?.user?.id??null:null,repoId:R?.repoId??null,installationId:R?.installationId??null},properties:{origin:o,hasAuth:!!I,authMode:I?.kind??"none",bundleBytes:f.byteLength,isTransformed:M,extraFiles:A.length,recordedFetches:m.length,hasEvents:!!B,hasScreenshot:!!g,hasVideo:!!w}}),I||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await b(),process.exit(1));let Ie=de(I),Re=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),H=(n,s,h,E,re,_,T,d)=>{let x=fe(_),q=x?Ce(n):n;return{url:s,urlhash:h,method:E,bodyHash:re,requestVaryHash:d,contentType:_,responseHeaders:T,bytes:q,encoding:x?"gzip":void 0}},Z=[],C=Je(l.pageHref)||"";if(C){let n=await ce(C,{onStaged:({url:s,byteLength:h})=>console.log(` staged app font: ${s} (${(h/1024).toFixed(1)} KiB)`),onError:(s,h)=>console.error(` warning: failed to fetch app font ${s}: ${h instanceof Error?h.message:h}`)});for(let s of n)Z.push(H(Buffer.from(s.bytes),s.url,s.urlhash,"GET","-",s.contentType))}let N=[...A.map(n=>H(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...m.map(n=>H(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...Z],W=ge(f),_e=He("sha256").update(f).digest("hex");console.log(` bundle raw=${(f.byteLength/1024).toFixed(1)} KiB br=${(W.byteLength/1024).toFixed(1)} KiB`);let xe={contentHash:_e,bundleSizeBytes:f.byteLength,bundleContentType:je(l.bundleUrl),bundleEncoding:"br",bundleOrigin:Re,runtimeVersion:l.runtimeVersion??void 0,appFonts:C||void 0,entry:l.entry,isTransformed:M,deviceSpec:l.deviceSpec,installationId:R?.installationId??void 0,repoId:R?.repoId,owner:S??R?.owner,repo:p??R?.repo,files:N.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,requestVaryHash:n.requestVaryHash,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:B?{sizeBytes:B.byteLength}:void 0,snapshots:g?[{id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:g.byteLength}]:void 0,flowVideo:w&&$?{sizeBytes:w.byteLength,contentType:$,durationMs:X}:void 0},ee=new Map;for(let n of N)ee.set(n.urlhash,n.bytes);let te=new Map;g&&te.set("landing",g);let Oe=Date.now(),L=W.byteLength;for(let n of N)L+=n.bytes.byteLength;B&&(L+=B.byteLength),g&&(L+=g.byteLength),w&&(L+=w.byteLength);let Se=`${O(o)}/api/preview/upload/init`;console.log(` init: ${Se}`);let V;try{let n=await he({originBase:o,initBody:xe,bundleBytes:W,filesByHash:ee,extras:{eventsBytes:B,videoBytes:w,snapshotBytes:te},authHeader:Ie,concurrency:16});V=n.finalize;let s=1+n.init.files.length+(n.init.events?1:0)+n.init.snapshots.length+(n.init.flowVideo?1:0);console.log(` PUT ${s} objects in ${Date.now()-Oe}ms (${(L/1024).toFixed(1)} KiB)`)}catch(n){let s=n;s.phase==="init"&&s.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await b(),process.exit(1)),s.status===402&&(console.error(` ${Ne(s.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await b(),process.exit(1)),console.error(` ${s.message??`${s.phase??"upload"} failed: ${String(n)}`}`),await b(),process.exit(1)}let ne=`${i}${V.url}`;console.log(`
|
|
79
|
+
stored ${V.filesStored??0} extra files`),console.log(` preview: ${ne}`),Ue&&await ie(ne),await b()}export{Ve as a,Ge as b,ht as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function t(_){return`(async () => {
|
|
3
3
|
const __t = window.__sootsimTest
|
|
4
4
|
if (!__t) throw new Error('__sootsimTest not available')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d,b as
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d,b as g}from"./chunk-SSZBFWV7.js";import{a as f,c as w}from"./chunk-FYUDIUFX.js";import{a as u,b as h,c as m}from"./chunk-XGYD25DJ.js";import{c as p}from"./chunk-RAY2DLSK.js";function I(){let e=u();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function M(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=u();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await m(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var v={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:I,launch:M};function _(){let e=d();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim install-desktop`)"}}async function x(e){let r=d();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await g(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var y={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:_,launch:x};import{spawn as C}from"child_process";import{closeSync as E,mkdtempSync as A,openSync as L,readFileSync as R}from"fs";import{createRequire as W}from"module";import{tmpdir as b}from"os";import{join as S}from"path";var N=`
|
|
3
3
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
4
4
|
const url = process.env.SOOTSIM_PW_URL;
|
|
5
5
|
const headless = process.env.SOOTSIM_PW_HEADLESS === '1';
|
|
@@ -17,6 +17,40 @@ const cdpPort = process.env.SOOTSIM_PW_CDP_PORT || '';
|
|
|
17
17
|
const closeTimeoutMs = Number(process.env.SOOTSIM_PW_CLOSE_TIMEOUT_MS || 2500);
|
|
18
18
|
const connectAckFile = process.env.SOOTSIM_PW_CONNECTED_ACK_FILE || '';
|
|
19
19
|
const { existsSync, unlinkSync } = require('fs');
|
|
20
|
+
const { execSync } = require('child_process');
|
|
21
|
+
// chromium tree reaper \u2014 playwright's browser.close() does not reliably reap
|
|
22
|
+
// the chromium helper tree (gpu/renderer/zygote/utility reparent to init and
|
|
23
|
+
// survive), and a SIGTERM/SIGKILL of just the root leaves them behind too.
|
|
24
|
+
// repeated/aborted opens then accumulate orphan chromiums until the machine
|
|
25
|
+
// OOMs (31 leaked processes thrashed a 4GB VM in one smoke run). mirror the
|
|
26
|
+
// proven pid-diff + recursive killTree pattern from scripts/lib/reap-browser.ts:
|
|
27
|
+
// only pids matching the playwright-managed chromium install are ever touched
|
|
28
|
+
// (a system Chrome launched via channel:'chrome' lives outside ms-playwright/
|
|
29
|
+
// and is never killed), and the whole thing is skipped on windows where pgrep
|
|
30
|
+
// does not exist \u2014 there plain close() remains the only teardown.
|
|
31
|
+
const reapEnabled = process.platform !== 'win32';
|
|
32
|
+
const chromiumPids = () => {
|
|
33
|
+
if (!reapEnabled) return [];
|
|
34
|
+
try {
|
|
35
|
+
// [c]hromium: this host runs as \`node -e <script>\`, so its OWN cmdline
|
|
36
|
+
// contains this source \u2014 a plain pattern would match every sibling host
|
|
37
|
+
// process and a concurrent launch could cross-kill another host's tree.
|
|
38
|
+
// the character class keeps the pattern from matching its own literal.
|
|
39
|
+
return execSync('pgrep -f "ms-playwright/[c]hromium" || true', { stdio: ['ignore', 'pipe', 'ignore'] })
|
|
40
|
+
.toString().split('\\n').filter(Boolean);
|
|
41
|
+
} catch { return []; }
|
|
42
|
+
};
|
|
43
|
+
const killTree = (pid) => {
|
|
44
|
+
let kids = [];
|
|
45
|
+
try {
|
|
46
|
+
kids = execSync('pgrep -P ' + pid + ' || true', { stdio: ['ignore', 'pipe', 'ignore'] })
|
|
47
|
+
.toString().split('\\n').filter(Boolean);
|
|
48
|
+
} catch {}
|
|
49
|
+
for (const k of kids) killTree(Number(k));
|
|
50
|
+
try { process.kill(pid, 'SIGKILL'); } catch {}
|
|
51
|
+
};
|
|
52
|
+
const myChromiumRoots = new Set();
|
|
53
|
+
const reapChromium = () => { for (const pid of myChromiumRoots) killTree(pid); };
|
|
20
54
|
(async () => {
|
|
21
55
|
const pw = require(modulePath);
|
|
22
56
|
let browser = null;
|
|
@@ -118,6 +152,9 @@ const { existsSync, unlinkSync } = require('fs');
|
|
|
118
152
|
const b = maybeBrowser();
|
|
119
153
|
if (b) await bounded('browser.close', () => b.close(), timeoutMs);
|
|
120
154
|
await terminateBrowserProcess();
|
|
155
|
+
// close() / root-SIGTERM above handle the graceful case; this sweeps any
|
|
156
|
+
// helper processes they left behind. no-op for already-dead pids.
|
|
157
|
+
reapChromium();
|
|
121
158
|
if (connectAckFile) {
|
|
122
159
|
try { unlinkSync(connectAckFile); } catch {}
|
|
123
160
|
}
|
|
@@ -125,6 +162,9 @@ const { existsSync, unlinkSync } = require('fs');
|
|
|
125
162
|
};
|
|
126
163
|
process.once('SIGTERM', () => { void shutdown(0); });
|
|
127
164
|
process.once('SIGINT', () => { void shutdown(0); });
|
|
165
|
+
// the launch-failure path at the bottom of this script exits without going
|
|
166
|
+
// through shutdown(); the exit hook (sync killTree) still reaps the tree.
|
|
167
|
+
process.on('exit', () => { reapChromium(); });
|
|
128
168
|
// owner-liveness watchdog \u2014 the load-bearing fix for leaked Chrome hosts.
|
|
129
169
|
// we are spawned detached + unref'd so \`sootsim open\` returns immediately,
|
|
130
170
|
// which means nothing in the OS process tree ties Chrome's lifetime to the
|
|
@@ -187,7 +227,15 @@ const { existsSync, unlinkSync } = require('fs');
|
|
|
187
227
|
let launchedChannel = null;
|
|
188
228
|
for (const channel of channelsToTry) {
|
|
189
229
|
try {
|
|
230
|
+
// bracket the launch with a chromium pid-diff so only the tree THIS
|
|
231
|
+
// host spawned is ever reaped (playwright's Browser exposes no pid, so
|
|
232
|
+
// the diff is the portable way to find our roots \u2014 same approach as
|
|
233
|
+
// scripts/lib/reap-browser.ts).
|
|
234
|
+
const pidsBefore = new Set(chromiumPids());
|
|
190
235
|
const launched = await launchWith(channel);
|
|
236
|
+
for (const p of chromiumPids()) {
|
|
237
|
+
if (!pidsBefore.has(p)) myChromiumRoots.add(Number(p));
|
|
238
|
+
}
|
|
191
239
|
launchedChannel = channel || 'chromium';
|
|
192
240
|
if (launched.kind === 'persistent') {
|
|
193
241
|
context = launched.value;
|
|
@@ -269,5 +317,5 @@ const { existsSync, unlinkSync } = require('fs');
|
|
|
269
317
|
process.stderr.write(String((err && err.stack) || err) + '\\n');
|
|
270
318
|
process.exit(1);
|
|
271
319
|
});
|
|
272
|
-
`;function
|
|
273
|
-
${i}`:""}`}}return{launched:!0,message:`playwright chrome launched \u2192 ${e.url}`,pid:l.pid,target:r.spec,attachUrl:e.url,connectAckFile:n,diagnosticLogPath:t}}catch(o){return{launched:!1,message:`playwright launch failed: ${o instanceof Error?o.message:String(o)}`}}finally{E(a)}}var
|
|
320
|
+
`;function P(){let e=[process.cwd()+"/"];try{process.argv[1]&&e.push(process.argv[1])}catch{}for(let r of e)try{let t=W(r);for(let n of["playwright","playwright-chromium","playwright-core"])try{return{spec:n,modulePath:t.resolve(n)}}catch{}}catch{}return null}function $(){let e=P();return e?{available:!0,reason:null,detail:`resolved via ${e.spec}`}:{available:!1,reason:"playwright not installed in the current workspace"}}function F(e){return e.profileId?f(w(e.profileId).id):e.ephemeralProfile?A(S(b(),"sootsim-playwright-profile-")):""}async function U(e){let r=P();if(!r)return{launched:!1,message:"playwright not installed \u2014 run `bun add -D playwright` first"};if(!e.url)return{launched:!1,message:"playwright driver requires a target url"};let t=S(b(),`sootsim-playwright-host-${Date.now().toString(36)}-${process.pid}.log`),n=`${t}.connected`,a=L(t,"a");try{let o=p(),l=C(process.execPath,["-e",N],{detached:!0,stdio:["ignore","ignore",a],env:{...process.env,SOOTSIM_PW_MODULE:r.modulePath,SOOTSIM_PW_URL:e.url,SOOTSIM_PW_HEADLESS:e.headless??!0?"1":"0",SOOTSIM_PW_USERDATADIR:F(e),SOOTSIM_PW_CDP_PORT:e.cdpPort?String(e.cdpPort):"",SOOTSIM_PW_CONNECTED_ACK_FILE:n,SOOTSIM_PW_CONNECT_TIMEOUT_MS:String(e.connectTimeoutMs??12e4),SOOTSIM_PW_OWNER_PID:o&&o>1?String(o):""}});l.unref();let c=await new Promise(i=>{let O=setTimeout(()=>i(null),4e3);l.once("exit",T=>{clearTimeout(O),i(T??0)})});if(c!==null&&c!==0){let i=R(t,"utf8").trim();return{launched:!1,message:`playwright host exited early (code ${c}) \u2014 host log ${t}${i?`:
|
|
321
|
+
${i}`:""}`}}return{launched:!0,message:`playwright chrome launched \u2192 ${e.url}`,pid:l.pid,target:r.spec,attachUrl:e.url,connectAckFile:n,diagnosticLogPath:t}}catch(o){return{launched:!1,message:`playwright launch failed: ${o instanceof Error?o.message:String(o)}`}}finally{E(a)}}var k={id:"playwright",name:"playwright",description:"programmatic chromium via the playwright package \u2014 headless default",kind:"automation",availability:$,launch:U};function H(){return process.platform!=="darwin"&&process.platform!=="linux"&&process.platform!=="win32"?{available:!1,reason:`unsupported platform: ${process.platform}`}:{available:!0,reason:null,detail:process.platform==="darwin"?"open(1)":process.platform==="win32"?"cmd /c start":"xdg-open(1)"}}async function B(e){if(e.headless)return{launched:!1,message:"system driver does not support --headless; use chromium or playwright"};if(!e.url)return{launched:!1,message:"system driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current browser profile"};try{let r=await h(e.url,{detached:e.detached??!0,newWindow:e.newWindow});return{launched:!0,message:`${r.via} launch \u2192 ${e.url}`,pid:r.pid,target:r.target,attachUrl:e.url}}catch(r){return{launched:!1,message:`system launch failed: ${r instanceof Error?r.message:String(r)}`}}}var D={id:"system",name:"system",description:"shared browser launcher \u2014 system default or chromium window",kind:"delegate",availability:H,launch:B};var s=[v,y,k,D];function ae(){return s}function le(e){return s.find(r=>r.id===e)??null}function ce(e,r){if(e)return s.find(n=>n.id===e)??null;for(let t of r){let n=s.find(a=>a.id===t);if(n&&n.availability().available)return n}return null}function ue(){return s.map(e=>{let r=e.availability();return{id:e.id,name:e.name,kind:e.kind,description:e.description,available:r.available,reason:r.reason,detail:r.detail??null}})}export{v as a,y as b,k as c,D as d,s as e,ae as f,le as g,ce as h,ue as i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,d as T,f as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,d as T,f as C}from"./chunk-RAY2DLSK.js";import{G as k,H as v}from"./chunk-GL74P6NR.js";import{WebSocket as I}from"ws";function x(){let e=k();return e&&v(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(r,i){super(r),this.name="BridgeSimLockedError",this.lock=i}};function $(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,r={}){let i=new Set,a=r.port??x(),l=r.commandTimeoutMs??15e3,t,m="none",h=new Set(r.stripBooleanFlags??[]),b=new Set(r.stripValueFlags??[]);for(let n=0;n<e.length;n++){let d=e[n];if(d==="--port"||d==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(d.startsWith("--port=")){i.add(n),a=Number(d.slice(7));continue}if(d==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),l=Number(e[n+1])),n++;continue}if(d==="--sim"||d==="--session"||d==="--tab"){i.add(n),n+1<e.length&&(i.add(n+1),t=e[n+1]?.trim()||void 0,m="flag"),n++;continue}let s=d.startsWith("--sim=")?d.slice(6):d.startsWith("--session=")?d.slice(10):d.startsWith("--tab=")?d.slice(6):void 0;if(s!==void 0){i.add(n),t=s.trim()||void 0,m="flag";continue}if(h.has(d)){i.add(n);continue}b.has(d)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,m="saved")}return{positional:e.filter((n,d)=>!i.has(d)),wsPort:a,simId:t,simIdSource:m,commandTimeoutMs:l}}function E(e,r={}){let i=1,a=r.commandTimeoutMs??15e3,l=new Map,t=new I(`ws://localhost:${e}`),m=P(),h=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:m.key,cliIdentitySource:m.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let g=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${g}`))})}),b=!1,n=!1;function d(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",g=$(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${g})
|
|
3
3
|
`)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!b&&(b=!0,process.stderr.write(`
|
|
4
4
|
\u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
|
|
5
5
|
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R,b as C}from"./chunk-AP2MOP44.js";var x="sootsimConfig";function m(e){return!!e&&Object.keys(e).length>0}function _(e){return e?m(e.modules)||m(e.turboModules)||m(e.nativeModules)||m(e.env)||m(e.settings)||m(e.initialState):!1}function k(e,o){let t=new URL(e);return _(o)?t.searchParams.set(x,JSON.stringify(o)):t.searchParams.delete(x),t.toString()}import{exec as A}from"child_process";import N from"http";import L from"net";import{promisify as O}from"util";var ne="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function D(e){return/^https?:\/\//i.test(e)}function T(e){return e.endsWith(".bundle")}function E(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function M(e){try{let o=D(e),t=new URL(e,"http://soot.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),T(t.pathname)?(t.searchParams.delete("transform.bytecode"),E(t),o?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}var P=O(A);R();var $=250,I=1500,B=120;function H(e,o=B){return new Promise(t=>{let r=new L.Socket,s=!1,i=a=>{s||(s=!0,r.destroy(),t(a))};r.setTimeout(o),r.once("connect",()=>i(!0)),r.once("timeout",()=>i(!1)),r.once("error",()=>i(!1)),r.connect(e,"localhost")})}function h(e,o,t="GET",r=$,s={}){return new Promise(i=>{let a=N.request({hostname:"localhost",port:e,path:o,method:t,timeout:r,headers:s},n=>{let u="";n.on("data",l=>u+=l.toString());let c=(()=>{let l=n.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();n.on("end",()=>i({statusCode:n.statusCode||0,body:u,contentType:c}))});a.on("error",()=>i(null)),a.setTimeout(r,()=>{a.destroy(),i(null)}),a.end()})}var j=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function v(e,o){return!(e<=0||e>=2e4||o.has(e)||e>=5170&&e<=5200)}async function W(e=[]){let o=new Set(e);try{let{stdout:t}=await P("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let r=new Map;for(let s of t.trim().split(`
|
|
3
|
+
`)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),u=i[8].match(/:(\d+)$/);if(!u)continue;let c=Number(u[1]);v(c,o)&&(r.has(c)||r.set(c,a))}if(r.size>0)return[...r.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:t}=await P(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(t.trim()){let r=new Map;for(let s of t.trim().split(`
|
|
4
|
+
`)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let n=Number(i[1]),u=a?Number(a[1]):0;v(n,o)&&(r.has(n)||r.set(n,u))}if(r.size>0)return[...r.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return j.filter(t=>v(t.port,o))}var y=new Map;async function F(e){if(e<=0)return null;let o=y.get(e);if(o)return o;try{let{stdout:t}=await P(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let r of t.split(`
|
|
5
|
+
`))if(r.startsWith("n")&&r.length>1){let s=r.slice(1).trim();if(s)return y.set(e,s),s}}catch{}return null}function G(e,o){return{port:e,framework:o,bundleUrl:p(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function p(e,o){let t=C().find(s=>s.preferredPort===e),r=t?.runtimeConfig?k(o,t.runtimeConfig):o;return M(r)}function z(e){return e.includes("/node_modules/one/metro-entry.bundle")}function J(e){try{let o=JSON.parse(e);return o&&typeof o=="object"?o:null}catch{return null}}function b(e,o,t){if(!o)return e;try{let r=JSON.parse(o.body),s=r?.extra?.expoClient||r?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=r?.launchAsset?.url;i&&!e.patched&&!z(e.bundleUrl)&&(e.bundleUrl=p(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,t)if(a.startsWith("http"))e.iconUrl=t(a);else{let n=a.replace(/^\.\//,"");e.iconUrl=t(`http://localhost:${e.port}/assets/${n}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var d=new Set,f=new Set,S=new Set;async function K(e,o){if(!await H(e))return null;let t="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[r,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),S.has(e)?Promise.resolve(null):h(e,"/","GET",I,{"expo-platform":"ios"}),f.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?f.delete(e):f.has(e)||f.add(e);let n=i?J(i.body):null,u=typeof n?.launchAsset?.url=="string"?n.launchAsset.url:null,c=n?.extra?.expoClient||n?.extra||{};if(n&&(u||typeof c.name=="string")){d.add(e);let g=u||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,U=g.includes("/one/metro-entry.bundle")?"one":"expo";return b({port:e,framework:U,bundleUrl:p(e,g),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,o)}if(s&&s.body.includes("packager-status:running"))return d.add(e),b(G(e,a&&a.statusCode===200?"expo":"metro"),i,o);if(r&&r.statusCode===200&&r.body.includes("sootsim-patched"))return d.delete(e),b({port:e,framework:"one",bundleUrl:p(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,o);let l=await h(e,t,"HEAD");return l&&l.statusCode>0&&l.statusCode<400&&/application\/javascript/i.test(l.contentType||"")?(d.add(e),S.add(e),b({port:e,framework:"one",bundleUrl:p(e,`http://localhost:${e}${t}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,o)):(d.add(e),null)}function V(e){let o=e.projectName?.trim().toLowerCase();return!!(o==="soot"||o==="sootsim"||e.bundleId?.trim().toLowerCase()?.startsWith("dev.soot"))}var w=new Map,q=3e4,Q=1500;function Y(e){return!e||e.framework==="metro"||e.framework==="unknown"}function X(e){return e?p(e.port,e.bundleUrl)===e.bundleUrl:!0}function Z(e,o,t=Date.now()){if(o===0||e.pid!==o||!X(e.result))return!1;let r=t-e.cachedAt;return!(e.result===null&&r>=q||Y(e.result)&&r>=Q)}async function le(e={}){let o=await W(e.excludePorts),t=new Set(o.map(n=>n.port));for(let n of[...w.keys()])t.has(n)||w.delete(n);for(let n of[...d])t.has(n)||d.delete(n);for(let n of[...f])t.has(n)||f.delete(n);for(let n of[...S])t.has(n)||S.delete(n);let r=[],s=[];for(let{port:n,pid:u}of o){let c=w.get(n);if(c&&Z(c,u)){c.result&&r.push(c.result);continue}c&&c.pid!==u&&(d.delete(n),f.delete(n),S.delete(n)),s.push({port:n,pid:u})}s.length>0&&(await Promise.all(s.map(u=>K(u.port,e.buildIconProxyUrl)))).forEach((u,c)=>{let{port:l,pid:g}=s[c];g!==0&&w.set(l,{pid:g,result:u,cachedAt:Date.now()}),u&&r.push(u)});let i=new Map;for(let{port:n,pid:u}of o)u>0&&i.set(n,u);await Promise.all(r.map(async n=>{let u=i.get(n.port);if(!u)return;n.pid=u;let c=await F(u);c&&(n.cwd=c)}));let a=new Set(i.values());for(let n of[...y.keys()])a.has(n)||y.delete(n);return r.filter(n=>!V(n))}export{k as a,ne as b,M as c,K as d,le as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=!0,e="1.0.0",o="public beta",n=`${o} \xB7 free until ${e}`,r="free for everyone until 1.0 \u2014 we send anonymous error and dependency data while you use it";export{t as a,e as b,o as c,n as d,r as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as t}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as t}from"./chunk-PBS47TD5.js";import{a as p,b as m,c as a}from"./chunk-EH6YDCSN.js";import{a as r}from"./chunk-Q5Z7P54I.js";import{a as l}from"./chunk-4FGNOWB6.js";import{a as u,d}from"./chunk-BGXNYXBC.js";import{B as i}from"./chunk-GL74P6NR.js";function c(){let o=i();return`sootsim CLI v${l()} \xB7 runtime ${o?`v${o}`:"not installed"}`}function S(){let o=m({bridgePort:7668,defaultShellUrl:r},t()),e=`
|
|
3
3
|
${d}
|
|
4
4
|
`;console.log(`${c()}
|
|
5
5
|
${e}${o}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as y}from"./chunk-RAY2DLSK.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as p}from"fs";import{tmpdir as m}from"os";import{dirname as v,join as w}from"path";var d=new Map;function s(e,r){d.set(e,r)}var c=1;function i(){return w(m(),`sootsim-cli-hints-${y()}.json`)}function l(){return w(m(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:c,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==c||!r?.shown?{version:c,shown:{}}:r}catch{return{version:c,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
|
|
3
3
|
`)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let n=Date.now();if(r==="once-per-identity"){let t=u(i());return t.shown[e]?!1:(t.shown[e]=n,f(i(),t),!0)}if(r==="once-ever"){let t=u(l());return t.shown[e]?!1:(t.shown[e]=n,f(l(),t),!0)}if(typeof r=="object"&&"cooldownMs"in r){let t=u(i()),a=t.shown[e]??0;return n-a<r.cooldownMs?!1:(t.shown[e]=n,f(i(),t),!0)}return!0}function k(e,...r){let o=d.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let n=o.render(...r);if(n==null)return!1;let t=Array.isArray(n)?n:[n],a=o.stream==="error"?console.error:console.log;for(let g of t)a(` hint: ${g}`);return!0}function M(){p(i(),{force:!0})}function O(){p(l(),{force:!0})}function T(){return Array.from(d.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});s("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{k as a,M as b,O as c,T as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var o={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},m={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},c={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},p={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},r=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var h={"iphone-se":t({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:m}),"iphone-14":t({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:55,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15":t({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-plus":t({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-16":t({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-plus":t({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17":t({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-air":t({name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"ipad-pro-13":t({name:'iPad Pro 13"',width:1032,height:1376,scale:2,statusBarHeight:24,homeIndicatorHeight:20,cornerRadius:18,dynamicIsland:null,safeAreaInsets:{top:24,bottom:20,left:0,right:0},iosVersion:"18.2",physicalPPI:264,hardwareButtons:o}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:c},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:p},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:p}},u="iphone-17-pro";function S(e){return h[e]}function g(){return Object.keys(h)}var i={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},s={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},P={color:"#25c3ec",blur:120,spread:52,opacity:.34},v="iphone-17-pro";var f=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],x=Object.fromEntries(f.map(e=>[e.name,e.value]));function B(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function b(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(n=>({...n}))}}function I(e){return Object.prototype.hasOwnProperty.call(s,e)?b(s[e]):null}var d={deviceModel:{type:"enum",default:u,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:g(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(i),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(s),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function y(){if(typeof window>"u")return{};let e={};try{let n=new URLSearchParams(window.location.search),a=n.get("device");a&&d.deviceModel.options?.includes(a)&&(e.deviceModel=a);let l=n.get("colorScheme")??n.get("theme");l&&d.colorScheme.options?.includes(l)&&(e.colorScheme=l)}catch{}return e}function R(){let e={};for(let[n,a]of Object.entries(d))e[n]=a.default;return Object.assign(e,y()),e}export{P as a,v as b,B as c,b as d,I as e,h as f,S as g,g as h,d as i,y as j,R as k};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.140 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as p}from"./chunk-6KUVOSFF.js";import{d as c,e as l}from"./chunk-QRRBQE6M.js";import{a}from"./chunk-N2XPC4Z7.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
|
|
3
3
|
sootsim ${e} needs auth before it can check recording access.
|
|
4
4
|
|
|
5
5
|
pick one:
|