sootsim 0.1.104 → 0.1.106
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-VVOGXPON.js → agent-NOFM32GQ.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-XPEGA24X.js → agent-wrapper-SQHWJCWJ.js} +2 -2
- package/dist-cli/chunks/{assert-YKFEKX54.js → assert-TT5S3B7W.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-W5NXSN3X.js +2 -0
- package/dist-cli/chunks/beta-NGBKQ34M.js +2 -0
- package/dist-cli/chunks/{chunk-BEYGGLL7.js → chunk-343L4O2H.js} +2 -2
- package/dist-cli/chunks/{chunk-2WV4ZOVO.js → chunk-3KAGEHTB.js} +1 -1
- package/dist-cli/chunks/chunk-44BCPVKS.js +1 -0
- package/dist-cli/chunks/{chunk-LCINF3EO.js → chunk-5E46IWG3.js} +1 -1
- package/dist-cli/chunks/{chunk-77GYHQSO.js → chunk-5VL2EUNR.js} +1 -1
- package/dist-cli/chunks/{chunk-2FWXRIFE.js → chunk-6UTI6XLN.js} +2 -2
- package/dist-cli/chunks/{chunk-HNOCTYUV.js → chunk-A3CTALIK.js} +2 -2
- package/dist-cli/chunks/{chunk-TJGYDVGW.js → chunk-A6DEFUJM.js} +2 -2
- package/dist-cli/chunks/{chunk-GUV6Y4T6.js → chunk-AP622LKJ.js} +2 -2
- package/dist-cli/chunks/{chunk-G7HDI2XA.js → chunk-BDGVC3KF.js} +2 -2
- package/dist-cli/chunks/{chunk-ZA7Z3H2E.js → chunk-CL5Y3CL2.js} +4 -4
- package/dist-cli/chunks/{chunk-LQH3LXLE.js → chunk-D3BOVAZY.js} +2 -2
- package/dist-cli/chunks/{chunk-N5CBDVBC.js → chunk-D67EY7EP.js} +2 -2
- package/dist-cli/chunks/{chunk-Y3HVBG7J.js → chunk-DUEG4N2E.js} +2 -2
- package/dist-cli/chunks/{chunk-VW4JRT7N.js → chunk-EOYZQWP3.js} +1 -1
- package/dist-cli/chunks/{chunk-RSBOSFLX.js → chunk-FKIJAVLB.js} +1 -1
- package/dist-cli/chunks/{chunk-2LNSP3DP.js → chunk-GNYYUIMU.js} +2 -2
- package/dist-cli/chunks/{chunk-FWMUFX7A.js → chunk-GS5ZUXBF.js} +1 -1
- package/dist-cli/chunks/{chunk-K4XHRPXC.js → chunk-GVO3D532.js} +1 -1
- package/dist-cli/chunks/{chunk-AQ4LICCZ.js → chunk-GVXSOL74.js} +2 -2
- package/dist-cli/chunks/chunk-GWDTIWZO.js +13 -0
- package/dist-cli/chunks/{chunk-FCSLS7ZF.js → chunk-HNODJYOJ.js} +2 -2
- package/dist-cli/chunks/{chunk-QNK7V7BJ.js → chunk-HO36EXRI.js} +1 -1
- package/dist-cli/chunks/{chunk-44YS62BC.js → chunk-LJ6FFRZL.js} +1 -1
- package/dist-cli/chunks/{chunk-GHCIPI7O.js → chunk-LKHRTW3Q.js} +2 -2
- package/dist-cli/chunks/{chunk-WZBFMJ3S.js → chunk-LWPHAIDU.js} +2 -2
- package/dist-cli/chunks/{chunk-IWZZ3WNJ.js → chunk-MNO5AR6J.js} +3 -3
- package/dist-cli/chunks/{chunk-KFE2ZIT5.js → chunk-MS5WDYRO.js} +1 -1
- package/dist-cli/chunks/{chunk-GGNGXQL4.js → chunk-PFJ3JSWB.js} +1 -1
- package/dist-cli/chunks/{chunk-S237JR3F.js → chunk-PLOOBWQV.js} +2 -2
- package/dist-cli/chunks/{chunk-P6JIUAJU.js → chunk-QGGKLFUV.js} +1 -1
- package/dist-cli/chunks/{chunk-TRJV4FTF.js → chunk-QU3ONULM.js} +7 -7
- package/dist-cli/chunks/{chunk-CGWV56SN.js → chunk-RDGTFS5Z.js} +3 -3
- package/dist-cli/chunks/chunk-SUWON74V.js +1 -0
- package/dist-cli/chunks/{chunk-UM73C576.js → chunk-TV46SDV2.js} +2 -2
- package/dist-cli/chunks/{chunk-WAWSYREW.js → chunk-TZNL7M5E.js} +1 -1
- package/dist-cli/chunks/{chunk-72OHZ4K4.js → chunk-UBREMS4Z.js} +1 -1
- package/dist-cli/chunks/{chunk-3EJHPOKU.js → chunk-VRQJIUX4.js} +3 -3
- package/dist-cli/chunks/{chunk-PJDJTUPP.js → chunk-VVP32KBY.js} +1 -1
- package/dist-cli/chunks/{chunk-CKYNLYKK.js → chunk-WCPC4T7V.js} +2 -2
- package/dist-cli/chunks/{chunk-AZONU3RG.js → chunk-WKS6CPB3.js} +2 -2
- package/dist-cli/chunks/chunk-WZWFM6ZT.js +1 -0
- package/dist-cli/chunks/chunk-X4RJ4DJP.js +2 -0
- package/dist-cli/chunks/{chunk-EIW7AUAT.js → chunk-ZE72P7KW.js} +1 -1
- package/dist-cli/chunks/cli-version-ABUA3EKO.js +2 -0
- package/dist-cli/chunks/{compat-E4JFL64N.js → compat-V22STUGI.js} +3 -3
- package/dist-cli/chunks/{config-UO7IMICT.js → config-5TBWELJ3.js} +2 -2
- package/dist-cli/chunks/control-Y3YCBZQG.js +2 -0
- package/dist-cli/chunks/{cpu-profile-VOTSB2YB.js → cpu-profile-ATRXOXVT.js} +2 -2
- package/dist-cli/chunks/{daemon-PWHCVTZ3.js → daemon-FCG5K4PZ.js} +2 -2
- package/dist-cli/chunks/{debug-LRWV62WH.js → debug-74Q52PF4.js} +3 -3
- package/dist-cli/chunks/{detox-WOKRYSKW.js → detox-UW6FCAML.js} +2 -2
- package/dist-cli/chunks/{device-2SHSUURQ.js → device-FQIETSR7.js} +2 -2
- package/dist-cli/chunks/{diagnose-ERNUAPHA.js → diagnose-XBMAFK5D.js} +2 -2
- package/dist-cli/chunks/drivers-XBGDG5P7.js +2 -0
- package/dist-cli/chunks/{electron-RZSH4XX3.js → electron-D5TYEQ4V.js} +3 -3
- package/dist-cli/chunks/flow-PJQWCCZJ.js +2 -0
- package/dist-cli/chunks/help-W5KLRBW3.js +2 -0
- package/dist-cli/chunks/{hints-PR6Z52OE.js → hints-2ZURMEIE.js} +2 -2
- package/dist-cli/chunks/{home-paths-A4FOAY3L.js → home-paths-ZH4K4YKX.js} +2 -2
- package/dist-cli/chunks/{inspect-KHVB4AO2.js → inspect-TWOOLRBQ.js} +3 -3
- package/dist-cli/chunks/install-GHNZIW3P.js +2 -0
- package/dist-cli/chunks/{install-desktop-TM76VEVA.js → install-desktop-PSFLXFSN.js} +3 -3
- package/dist-cli/chunks/{keys-BTFQDMHU.js → keys-DNTK75TS.js} +2 -2
- package/dist-cli/chunks/{launch-OBHZBENO.js → launch-GH5NVKQM.js} +3 -3
- package/dist-cli/chunks/{login-2ISPCBA2.js → login-US34WYWM.js} +4 -4
- package/dist-cli/chunks/{logout-7IWIVMBR.js → logout-SQX2P5L3.js} +2 -2
- package/dist-cli/chunks/{maestro-YEUNOWKT.js → maestro-3MPIQOMY.js} +2 -2
- package/dist-cli/chunks/{preview-L6GFYD32.js → preview-6YKZ27CO.js} +2 -2
- package/dist-cli/chunks/{profile-ZYL26KMP.js → profile-UQWXHWRU.js} +2 -2
- package/dist-cli/chunks/{react-CBGVMAFT.js → react-QWJRNNVF.js} +2 -2
- package/dist-cli/chunks/{record-3MGPD2TD.js → record-A73KIW4G.js} +2 -2
- package/dist-cli/chunks/runtime-RUTC5YVC.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-SK2KJMWL.js → runtime-delivery-SSWPHGRR.js} +2 -2
- package/dist-cli/chunks/{screenshot-QDSR4ELW.js → screenshot-DJGEYNJ2.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-D7X27L3S.js → screenshot-mode-M5NM2JJS.js} +2 -2
- package/dist-cli/chunks/{screenshots-NJSLDMVH.js → screenshots-UHZE5MO3.js} +2 -2
- package/dist-cli/chunks/{server-NDZD7IA4.js → server-OG7OZAP3.js} +2 -2
- package/dist-cli/chunks/setup-repo-O7NC5Q7F.js +2 -0
- package/dist-cli/chunks/{skills-MQ3MEE5O.js → skills-NQSEC2UU.js} +2 -2
- package/dist-cli/chunks/{start-P2QW4UJJ.js → start-HHHQ73WS.js} +4 -4
- package/dist-cli/chunks/store-UNEWAJR6.js +2 -0
- package/dist-cli/chunks/telemetry-O22VXBNY.js +2 -0
- package/dist-cli/chunks/{test-OVRFWWZ4.js → test-HRYMXSPQ.js} +3 -3
- package/dist-cli/chunks/{three-mode-LUKP7PN7.js → three-mode-ISTZCCFX.js} +2 -2
- package/dist-cli/chunks/{timeline-ZSZGXH3K.js → timeline-QB2UXNTP.js} +2 -2
- package/dist-cli/chunks/{upgrade-2YXQ2V6O.js → upgrade-WCEXU7SR.js} +2 -2
- package/dist-cli/chunks/upload-MRHDECMV.js +2 -0
- package/dist-cli/chunks/{web-IZKE4IXL.js → web-2B6FK6A6.js} +2 -2
- package/dist-cli/chunks/{what-happened-BW75PTSO.js → what-happened-7BZM5IBN.js} +2 -2
- package/dist-cli/chunks/{whoami-V4BQORO2.js → whoami-AR3HWAST.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 +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/skills.cjs +5 -3
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-TEFYLCIZ.js +0 -2
- package/dist-cli/chunks/beta-LYX5Q66M.js +0 -2
- package/dist-cli/chunks/chunk-7TQLDYHF.js +0 -2
- package/dist-cli/chunks/chunk-GKZQXNNV.js +0 -1
- package/dist-cli/chunks/chunk-HCNHNG6Y.js +0 -1
- package/dist-cli/chunks/chunk-RH3M5CKE.js +0 -1
- package/dist-cli/chunks/chunk-ZDJGK2LP.js +0 -12
- package/dist-cli/chunks/cli-version-VOSOXIKI.js +0 -2
- package/dist-cli/chunks/control-7BBXYRKP.js +0 -2
- package/dist-cli/chunks/drivers-LO2QI4OJ.js +0 -2
- package/dist-cli/chunks/flow-XTJHMWUM.js +0 -2
- package/dist-cli/chunks/help-O3ZYVDVC.js +0 -2
- package/dist-cli/chunks/install-EVGJCT47.js +0 -2
- package/dist-cli/chunks/runtime-FJITOAIR.js +0 -2
- package/dist-cli/chunks/setup-repo-TRDRKJ4N.js +0 -2
- package/dist-cli/chunks/store-LT3WCVFB.js +0 -2
- package/dist-cli/chunks/telemetry-6BBF4TX3.js +0 -2
- package/dist-cli/chunks/upload-NVUEPQHV.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as u,b as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as u,b as f}from"./chunk-UBREMS4Z.js";import{a as h,c as p}from"./chunk-HNODJYOJ.js";import{a as c,b as d,c as m}from"./chunk-PFJ3JSWB.js";function k(){let e=c();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function O(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=c();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:k,launch:O};function _(){let e=u();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 I(e){let r=u();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await f(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 w={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:_,launch:I};import{spawn as M}from"child_process";import{closeSync as x,mkdtempSync as A,openSync as C,readFileSync as E}from"fs";import{createRequire as L}from"module";import{tmpdir as g}from"os";import{join as y}from"path";var R=`
|
|
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';
|
|
@@ -225,5 +225,5 @@ const { existsSync, unlinkSync } = require('fs');
|
|
|
225
225
|
process.stderr.write(String((err && err.stack) || err) + '\\n');
|
|
226
226
|
process.exit(1);
|
|
227
227
|
});
|
|
228
|
-
`;function b(){let e=[process.cwd()+"/"];try{process.argv[1]&&e.push(process.argv[1])}catch{}for(let r of e)try{let t=L(r);for(let n of["playwright","playwright-chromium","playwright-core"])try{return{spec:n,modulePath:t.resolve(n)}}catch{}}catch{}return null}function W(){let e=b();return e?{available:!0,reason:null,detail:`resolved via ${e.spec}`}:{available:!1,reason:"playwright not installed in the current workspace"}}function $(e){return e.profileId?h(p(e.profileId).id):e.ephemeralProfile?A(y(g(),"sootsim-playwright-profile-")):""}async function N(e){let r=b();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=y(g(),`sootsim-playwright-host-${Date.now().toString(36)}-${process.pid}.log`),n=`${t}.connected`,a=C(t,"a");try{let i=
|
|
229
|
-
${o}`:""}`}}return{launched:!0,message:`playwright chrome launched \u2192 ${e.url}`,pid:i.pid,target:r.spec,attachUrl:e.url,connectAckFile:n}}catch(i){return{launched:!1,message:`playwright launch failed: ${i instanceof Error?i.message:String(i)}`}}finally{
|
|
228
|
+
`;function b(){let e=[process.cwd()+"/"];try{process.argv[1]&&e.push(process.argv[1])}catch{}for(let r of e)try{let t=L(r);for(let n of["playwright","playwright-chromium","playwright-core"])try{return{spec:n,modulePath:t.resolve(n)}}catch{}}catch{}return null}function W(){let e=b();return e?{available:!0,reason:null,detail:`resolved via ${e.spec}`}:{available:!1,reason:"playwright not installed in the current workspace"}}function $(e){return e.profileId?h(p(e.profileId).id):e.ephemeralProfile?A(y(g(),"sootsim-playwright-profile-")):""}async function N(e){let r=b();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=y(g(),`sootsim-playwright-host-${Date.now().toString(36)}-${process.pid}.log`),n=`${t}.connected`,a=C(t,"a");try{let i=M(process.execPath,["-e",R],{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:$(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)}});i.unref();let l=await new Promise(o=>{let P=setTimeout(()=>o(null),4e3);i.once("exit",T=>{clearTimeout(P),o(T??0)})});if(l!==null&&l!==0){let o=E(t,"utf8").trim();return{launched:!1,message:`playwright host exited early (code ${l}) \u2014 host log ${t}${o?`:
|
|
229
|
+
${o}`:""}`}}return{launched:!0,message:`playwright chrome launched \u2192 ${e.url}`,pid:i.pid,target:r.spec,attachUrl:e.url,connectAckFile:n,diagnosticLogPath:t}}catch(i){return{launched:!1,message:`playwright launch failed: ${i instanceof Error?i.message:String(i)}`}}finally{x(a)}}var D={id:"playwright",name:"playwright",description:"programmatic chromium via the playwright package \u2014 headless default",kind:"automation",availability:W,launch:N};function U(){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 F(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 d(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 S={id:"system",name:"system",description:"shared browser launcher \u2014 system default or chromium window",kind:"delegate",availability:U,launch:F};var s=[v,w,D,S];function ie(){return s}function oe(e){return s.find(r=>r.id===e)??null}function se(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 ae(){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,w as b,D as c,S as d,s as e,ie as f,oe as g,se as h,ae as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-AP622LKJ.js";import{w as o}from"./chunk-QGGKLFUV.js";function u(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!o()}function a(){if(u())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let t=process.env.SOOT_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:t.replace(/\/+$/,"")}}function c(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:"anonymous-cli":"anonymous-cli"}function p(e){let t=e.identity??{},n={$lib:"soot-cli",source:t.source??"cli",...e.properties};return t.userId&&(n.userId=t.userId),t.repoId&&(n.repoId=t.repoId),t.installationId!=null&&(n.installationId=String(t.installationId)),t.shareId&&(n.shareId=t.shareId),t.plan&&(n.plan=t.plan),{event:e.event,distinct_id:c(t),properties:n,timestamp:new Date().toISOString()}}var r=[],l=!1;async function i(){if(r.length===0)return;let e=a();if(!e){r.length=0;return}let t=r.splice(0,r.length).map(p);try{await fetch(`${e.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:e.apiKey,batch:t}),signal:AbortSignal.timeout(2e3)})}catch{}}function d(){l||(l=!0,process.on("beforeExit",()=>{i()}),process.on("exit",()=>{i()}))}function h(e){if(u())return;d();let t=null;try{t=s()?.user?.id??null}catch{t=null}r.push({...e,identity:{source:"cli",userId:t,...e.identity}})}async function g(){await i()}export{h as a,g as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{g as w,i as u,j as m,k as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{g as w,i as u,j as m,k as l}from"./chunk-FKIJAVLB.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as x}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as x}from"./chunk-TZNL7M5E.js";var J="sootsimConfig";function h(e){return!!e&&Object.keys(e).length>0}function de(e){return e?h(e.modules)||h(e.turboModules)||h(e.nativeModules)||h(e.env)||h(e.settings)||h(e.initialState):!1}function V(e,t){let n=new URL(e);return de(t)?n.searchParams.set(J,JSON.stringify(t)):n.searchParams.delete(J),n.toString()}import{existsSync as d,readFileSync as R,writeFileSync as g}from"node:fs";import{homedir as le}from"node:os";import{dirname as fe,join as c,resolve as y}from"node:path";var _=le();function me(e){let t=e;for(;;){if(d(c(t,"pnpm-workspace.yaml"))||d(c(t,"turbo.json"))||d(c(t,"nx.json"))||d(c(t,"lerna.json")))return t;let n=c(t,"package.json");if(d(n))try{if(JSON.parse(R(n,"utf8")).workspaces)return t}catch{}let r=fe(t);if(r===t)return null;t=r}}function O(e,t){let n=me(process.cwd()),r=[n?y(n,e):null,y(process.cwd(),e),y(process.cwd(),t)].filter(o=>!!o);for(let o of r)if(d(o))return o;return r[0]??y(process.cwd(),e)}var pe=()=>O("packages/sootsim-engine/scripts/expensify-web-proxy.ts","scripts/expensify-web-proxy.ts"),_e=()=>O("packages/sootsim-engine/scripts/rainbow-metadata-proxy.ts","scripts/rainbow-metadata-proxy.ts"),ge=()=>O("packages/compat/src/stubs/mattermost-rnutils-native.ts","../compat/src/stubs/mattermost-rnutils-native.ts"),Re=()=>O("packages/compat/src/stubs/native-seams/react-native-keychain-manager.ts","../compat/src/stubs/native-seams/react-native-keychain-manager.ts"),W=()=>O("packages/compat/src/stubs/mattermost-network-client-native.ts","../compat/src/stubs/mattermost-network-client-native.ts"),Ee=()=>O("packages/sootsim-engine/scripts/mattermost-preview-server.ts","scripts/mattermost-preview-server.ts"),B={USE_NGROK:"true",NGROK_URL:"http://localhost:9000/",SECURE_NGROK_URL:"http://localhost:9000/"},Se=c(_,"github/mattermost-mobile"),N=c(_,"github/uniswap-interface"),Ae=c(N,"apps/mobile"),C=c(N,".env.defaults.local"),he="stored-in-.env.local",q="# sootsim demo env overrides",Pe=c(N,"packages/uniswap/src/features/forceUpgrade/hooks/useForceUpgradeStatus.ts"),Oe=c(N,"apps/mobile/src/notification-service/data-sources/createForceUpgradeNotificationDataSource.ts"),Q="SOOTSIM_DEMO_DISABLE_FORCE_UPGRADE";function X(e){if(!d(e))return{};let t={},n=R(e,"utf8");for(let r of n.split(/\r?\n/)){let o=r.trim();if(!o||o.startsWith("#"))continue;let a=o.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(!a)continue;let i=a[2].trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),t[a[1]]=i}return t}function $(e){if(!e)return!1;let t=e.trim();return!(!t||t.includes(he)||t==="TRADING_API_KEY"||t==="UNISWAP_API_KEY")}function z(e,t){for(let n of e)for(let r of t){let o=n[r];if($(o))return o.trim()}}function oe(){let e=X(C),t=X(c(N,"apps/web/.env")),n=[process.env,e,t],r={},o=[["AMPLITUDE_PROXY_URL_OVERRIDE",["REACT_APP_AMPLITUDE_PROXY_URL"]],["QUICKNODE_ENDPOINT_NAME",["REACT_APP_QUICKNODE_ENDPOINT_NAME"]],["QUICKNODE_ENDPOINT_TOKEN",["REACT_APP_QUICKNODE_ENDPOINT_TOKEN"]],["INFURA_KEY",["REACT_APP_INFURA_KEY"]],["STATSIG_API_KEY",["REACT_APP_STATSIG_API_KEY"]],["STATSIG_PROXY_URL_OVERRIDE",["REACT_APP_STATSIG_PROXY_URL"]],["WALLETCONNECT_PROJECT_ID",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_BETA",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["WALLETCONNECT_PROJECT_ID_DEV",["REACT_APP_WALLET_CONNECT_PROJECT_ID"]],["TRADING_API_KEY",["REACT_APP_TRADING_API_KEY"]],["UNISWAP_API_KEY",[]]];for(let[i,s]of o){let u=z(n,[i,...s]);if(u){r[i]=u;for(let l of s)r[l]=u}}if(!($(r.TRADING_API_KEY)&&$(r.UNISWAP_API_KEY))){let i=z(n,["GRAPHQL_URL_OVERRIDE","REACT_APP_AWS_API_ENDPOINT"])||"https://interface.gateway.uniswap.org/v1/graphql";r.API_BASE_URL_OVERRIDE="https://interface.gateway.uniswap.org",r.API_BASE_URL_V2_OVERRIDE="https://interface.gateway.uniswap.org/v2",r.GRAPHQL_URL_OVERRIDE=i,r.TRADING_API_URL_OVERRIDE="https://trading-api-labs.interface.gateway.uniswap.org",r.FOR_API_URL_OVERRIDE="https://for.interface.gateway.uniswap.org/v2/FOR.v1.FORService"}return r}function Te(){let e=d(C)?R(C,"utf8"):"";if(e&&!e.includes(q))return;let t=oe(),n=[q];for(let[r,o]of Object.entries(t).sort(([a],[i])=>a.localeCompare(i)))n.push(`${r}=${JSON.stringify(o)}`);n.push(""),g(C,`${n.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`)}function ve(){let e=`export function useForceUpgradeStatus(): ForceUpgradeStatus {
|
|
5
5
|
`,t=` // sootsim demo: bypass the force-upgrade gate during local engine demos.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
|
|
3
3
|
${o}
|
|
4
4
|
`);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (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,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as y}from"./chunk-ZE72P7KW.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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function E(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=e.indexOf(r);if(s>=0&&e[s+1]){let a=Number(e[s+1]);if(Number.isFinite(a))return Math.max(100,a)}}return t}var m=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function f(e){return typeof e=="string"&&m.has(e)}async function w(e){return await e.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function L(e,t){if(!f(t))return!1;try{return await w(e)}catch{return!1}}async function D(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function N(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function H(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function B(e,t){let n=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (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 p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as p}from"./chunk-QU3ONULM.js";import{d as c,e as l}from"./chunk-A3CTALIK.js";import{a}from"./chunk-AP622LKJ.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:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as L,b as q,c as me,e as ue}from"./chunk-DUEG4N2E.js";import{m as B}from"./chunk-A6DEFUJM.js";import{k as le,l as ce,n as de}from"./chunk-GS5ZUXBF.js";import{a as fe,b as ge}from"./chunk-VVP32KBY.js";import{b as ae,c as I,d as v,e as x}from"./chunk-WCPC4T7V.js";import{c as C,d as w,e as M}from"./chunk-ZE72P7KW.js";import{g as G}from"./chunk-CL5Y3CL2.js";import{a as T,b as V}from"./chunk-UBREMS4Z.js";import{c as pe}from"./chunk-HNODJYOJ.js";import{d as j}from"./chunk-PFJ3JSWB.js";import{a as ie}from"./chunk-X4RJ4DJP.js";import{E as re,F as se}from"./chunk-QGGKLFUV.js";import X from"node:fs";import Ne from"node:os";import P from"node:path";function Re(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function J(e){let t=Re(e);return t==="localhost"||t.endsWith(".localhost")||t==="0.0.0.0"||t==="::1"||/^127(?:\.\d{1,3}){3}$/.test(t)}function he(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function Ue(e,t){return e?.includes("/one/metro-entry.bundle")?"one":typeof t=="string"&&t?"expo":"unknown"}function ye(e,t,o){return`${e}//${t}:${o}`}function Oe(e){if(typeof window>"u")return!1;try{let t=new URL(e);return J(t.hostname)&&J(window.location.hostname)&&t.origin!==window.location.origin}catch{return!1}}async function we(e,t){let o={...t,cache:t?.cache??"no-store"};return Oe(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,o):fetch(e,o)}function Be(e){return e==="https:"?443:80}function Le(e){let t=e.pathname||"/";return(t==="/"||t==="")&&!e.search&&!e.hash}async function ve(e,t){let o=e.replace(/\/+$/,"");try{let n=await we(`${o}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},a=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(a||s.name)return{bundleUrl:me(a||`${o}${q}`),port:t,framework:Ue(a,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await we(`${o}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${o}${q}`,port:t,framework:"metro"}}catch{}return null}async function be(e){return ve(ye("http:","localhost",e),e)}async function Se(e){let t=e.trim();if(/^\d+$/.test(t)){let i=parseInt(t,10),l=await be(i);if(l)return l;let c=3;for(let d=1;d<=c;d++){let m=await be(i+d);if(m)return m}throw he(`localhost:${i} (also scanned +1..+${c})`)}let o=t.startsWith("http")?t:`http://${t}`,n;try{n=new URL(o)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):Be(r),a=ye(r,n.hostname,s);if(Le(n)){let i=await ve(a,s);if(i)return i;throw he(a)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function wt(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim install-desktop"),console.error(""),console.error(" or wire sootsim into your own project so your dev server hosts the bridge:"),console.error(" sootsim setup-repo"),console.error("")}function $e(e){let t=T();if(console.log(` note: no sootsim bridge detected on port ${e}`),t){console.log(" launch the installed companion with:"),console.log(" sootsim electron");return}console.log(""),console.log(" to get a bridge running, either:"),console.log(" sootsim install-desktop # download the electron app"),console.log(" sootsim setup-repo # wire sootsim into your own project")}function De(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function bt(e,t,o){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){De(t);return}console.error(` no sim with id "${o}" is connected to the bridge on port ${t}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var Ae=12e4,Ie=500,Fe=5e3,He={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function S(e){return new Promise(t=>setTimeout(t,e))}function xe(e){let t=process.env[e]?.trim();if(!t)return null;let o=Number(t);return Number.isInteger(o)&&o>0?o:null}function Ke(){let e=xe("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??xe("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Ae;return{timeoutMs:e,hostTimeoutMs:e+Fe,intervalMs:Ie,attempts:Math.max(1,Math.ceil(e/Ie))}}function We(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function A(e){return e.trim()}function Y(e){try{let t=new URL(e),o=t.pathname.replace(/\/+$/,"")||"/";return t.searchParams.has("open")||t.searchParams.has("port")||t.searchParams.has("bundle")||t.searchParams.has("demo")||t.pathname.includes("/sootsim/index.html")||o==="/sootsim"||t.pathname==="/__soot"||t.pathname==="/__soot/"||o==="/rn"||/^\/rn\/[^/]+$/i.test(o)||/^\/app\/[^/]+$/i.test(o)||o==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(o)||/^\/__soot\/app\/[^/]+$/i.test(o)}catch{return!1}}function ze(e){try{let t=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(t)||/^\/build\/.+/.test(t)}catch{return!1}}async function Nt(e){let t=A(e);return(await Me(t)).bundleUrl}function je(e){try{let t=new URL(e.startsWith("http")?e:`http://${e}`),o=t.pathname||"/";if(o!=="/"&&o!==""||t.search||t.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(t.hostname))return null;let n=t.port?Number(t.port):t.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Me(e){let t=A(e),o=/^\d+$/.test(t)?Number(t):je(t);if(o&&o>0){let n=await ue(o);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return Se(t)}function Z(e){let t=e.replace(/\/+$/,"")||"/";return t==="/__soot"||t.startsWith("/__soot/")?"/__soot":""}function qe(e,t){let o=A(e),n=new URL(t),r=Z(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(o)?n.pathname=`${r}/rn/${o}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",o)),n.toString()}function Ve(e){let t=A(e);return/^\d+$/.test(t)||/^https?:\/\//i.test(t)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(t)}async function Ge(e,t){let o=await Me(e),n=new URL(t),r=Z(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.set("bundle",o.bundleUrl),n.toString()}function Je(e){return e.startsWith("~/")?P.join(Ne.homedir(),e.slice(2)):P.isAbsolute(e)?e:P.resolve(process.cwd(),e)}function Qe(e){let t={};for(let o=0;o<e.length;o++){if(e[o]!=="--replace")continue;let n=e[o+1];n||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let r=n.indexOf("=");(r<=0||r===n.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let s=n.slice(0,r).trim(),a=Je(n.slice(r+1).trim());X.existsSync(a)||(console.error(` sootsim open: replacement file not found: ${a}`),process.exit(1)),t[s]={file:a},o++}return Object.keys(t).length>0?{modules:t}:void 0}function Te(){let e=re();return se(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:ie}function Ye(e){try{let t=new URL(e),o=t.searchParams.get("bundle")||"",n=ge(fe({bundleUrl:o}));return n?(t.searchParams.set("appFonts",n),t.toString()):e}catch{return e}}async function Xe(e,t){if(!e)return new URL(t).toString();if(Y(e))return new URL(e).toString();let o=He[e.toLowerCase()];if(o){let n=new URL(t),r=Z(n.pathname);return n.pathname=`${r}${o}`,n.toString()}return Ve(e)?Ge(e,t):qe(e,t)}async function N(e,t=Te()){return Ye(await Xe(e,t))}function Pe(e,t){let o=e?.url||e?.origin||t;try{let n=new URL(o);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.toString()}catch{return t}}async function Ze(e,t,o){let n=new URL(await N(e,t));return n.searchParams.set("inspectOpen",o),n.toString()}async function et(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500,a=n.minNodeCount??10;for(let i=0;i<r;i++){let l=v(e,{commandTimeoutMs:t,simId:o,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>a)return{bridge:l,count:c}}catch{}l.close(),await S(s)}return null}function tt(e){if(!e)return null;try{let t=new URL(e);if(t.searchParams.has("bundle")){let o=t.searchParams.get("bundle")||"";try{let n=new URL(o),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return t.searchParams.has("port")?`connect :${t.searchParams.get("port")||""}`:t.searchParams.has("open")?`connect ${t.searchParams.get("open")||""}`:t.searchParams.has("demo")?`demo ${t.searchParams.get("demo")||"default"}`:t.pathname.includes("/sootsim/index.html")||t.pathname==="/sootsim/"||t.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function ot(e,t){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
3
|
+
`);for(let o of e){let n=o.lockedBy&&o.lockExpiresAt?`locked by ${o.lockedBy} (${Math.max(0,Math.round((o.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[o.isPrimary?"primary":"",o.id===t?"selected":"",o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":"",o.attachedCliCount&&o.attachedCliCount>0?"in use":"",o.userFocused?"focused":"",n].filter(Boolean);console.log(` ${o.id}${r.length?` [${r.join(", ")}]`:""}`);let s=tt(o.url);if(s)console.log(` loaded: ${s}`);else if(o.url){let a=o.url.length>96?`${o.url.slice(0,93)}\u2026`:o.url;console.log(` url: ${a}`)}else o.origin&&console.log(` origin: ${o.origin}`);o.title&&console.log(` title: ${o.title}`),o.visibilityState&&o.visibilityState!=="visible"&&console.log(` visibility: ${o.visibilityState}`),console.log(` connected: ${ke(Date.now()-o.connectedAt)}`),o.lastActiveAt&&o.lastActiveAt>0&&console.log(` last active: ${ke(Date.now()-o.lastActiveAt)}`)}}function ke(e){let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s ago`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}async function D(e,t,o,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let a=0;a<r;a++){let i=v(e,{commandTimeoutMs:t});try{let c=(await i.listSims()).find(o);if(c)return c}catch{}finally{i.close()}await S(s)}return null}async function nt(e,t,o,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let a=0;a<r;a++){let i=v(e,{commandTimeoutMs:t});try{let c=(await i.listSims()).find(d=>d.id===o);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{i.close()}await S(s)}return!1}function rt(e){let t=e.meta;if(!t||t.sootsimHostDriver!=="playwright")return null;let o=Number(t.sootsimHostPid);return!Number.isInteger(o)||o<=1||o===process.pid?null:o}function st(e){if(!e.connectAckFile)return!1;try{return X.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
4
|
+
`,{flag:"w"}),!0}catch{return!1}}function it(e){if(e.diagnosticLogPath)try{let t=X.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!t){console.error(` ${P.basename(e.diagnosticLogPath)} was empty`);return}let o=t.length>4e3?`\u2026
|
|
5
|
+
${t.slice(-4e3)}`:t;console.error(` ${P.basename(e.diagnosticLogPath)}:`),console.error(o)}catch(t){let o=t instanceof Error?t.message:String(t);console.error(` failed to read ${P.basename(e.diagnosticLogPath)}: ${o}`)}}function Ce(e){try{return process.kill(e,0),!0}catch(t){return t?.code==="EPERM"}}async function at(e,t=2500){let o=Date.now()+t;for(;Date.now()<o;){if(!Ce(e))return!0;await S(100)}return!Ce(e)}async function Q(e,t){let o=new Set(t),n=new Set;for(let r of e){if(!o.has(r.id))continue;let s=rt(r);s&&n.add(s)}for(let r of n){try{process.kill(r,"SIGTERM")}catch{}if(await at(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function F(e,t){if(t){let r=t.trim(),s=e.find(a=>a.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let o=e.find(r=>r.isPrimary&&r.readyState==="open");if(o)return o;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function _(e,t,o){console.log(` ${o==="current sim"?"loaded":"opened"}: ${e} [${o}]`),console.log(` current sim: ${t.id}`),console.log(JSON.stringify({simId:t.id,url:t.url},null,2))}async function E(e,t,o){if(o.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await lt(e,t,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:t,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:le})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&s.nodes>=ce&&de(s))){let d=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${d} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let i=`(async () => {
|
|
6
|
+
const t = window.__sootsimTest
|
|
7
|
+
const ms = window.SootSim?.bridges?.mainShell
|
|
8
|
+
if (!t) return null
|
|
9
|
+
let shell = null
|
|
10
|
+
try { shell = ms?.getState ? await ms.getState() : null } catch {}
|
|
11
|
+
const tree = await t.dumpTree(12, ${JSON.stringify({describe:!0,verbose:!1,filter:""})})
|
|
12
|
+
return { tree, shell }
|
|
13
|
+
})()`,l=await r.send({type:"evaluate",code:i});if(!l?.tree)return;if(console.log(""),l.shell?.state){let c=[`state=${l.shell.state}`,l.shell.activeApp?`app=${l.shell.activeApp}`:null].filter(Boolean);console.log(` shell: ${c.join(" ")}`)}console.log(l.tree)}finally{r.close()}}catch{}finally{n===void 0?delete process.env.SOOTSIM_QUIET_TARGET_NOTICE:process.env.SOOTSIM_QUIET_TARGET_NOTICE=n}}async function lt(e,t,o){let n=Date.now()+o.maxMs,r="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",s=v(e,{commandTimeoutMs:2e3,simId:t,simIdSource:"flag"});try{let a=-1,i=0;for(;Date.now()<n;){let l=-1;try{let c=await s.send({type:"evaluate",code:r});typeof c=="number"&&(l=c)}catch{}if(l>=0&&l===a){if(Date.now()-i>=o.stableMs)return}else a=l,i=Date.now();await S(50)}}finally{s.close()}}async function At(e,t={}){let o=I(e,{port:t.port,commandTimeoutMs:t.timeoutMs}),n=x(o);try{let r=await n.listSims();ot(r,o.simId)}finally{n.close()}}async function Ft(e,t={}){let o=I(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--new","--headless","--ephemeral"],stripValueFlags:["--base-url","--replace","--driver","--profile","--cdp-port"]}),n=e.find((u,p)=>e[p-1]==="--profile"),r=e.includes("--ephemeral"),s=e.find((u,p)=>e[p-1]==="--cdp-port"),a=s?Number(s):void 0;s&&(!Number.isFinite(a)||a<=0)&&(console.error(` sootsim open: --cdp-port must be a positive port number, got "${s}"`),process.exit(1)),n&&r&&(console.error(" sootsim open: --profile cannot be combined with --ephemeral"),process.exit(1));let i=n?pe(n).id:void 0,l=!!i||r,c=e.includes("--new")||l,d=Qe(e);c&&o.simIdSource==="flag"&&(console.error(" sootsim open: --new, --profile, and --ephemeral cannot be combined with --sim"),process.exit(1));let m=o.positional[0]||"";if(ze(m)){let u=(()=>{try{return/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(new URL(m).hostname)}catch{return!1}})();console.log(" that\u2019s a SootSim preview/build link \u2014 a full player page, not a driveable sim."),console.log(" opening it in your browser for viewing\u2026");try{await j(m,{background:!1})}catch(p){console.error(` could not launch a browser: ${p instanceof Error?p.message:String(p)}`),console.error(` open it yourself: ${m}`),process.exit(1)}console.log(u?" to drive it under the CLI, point `sootsim open` at the app\u2019s dev port instead (e.g. `sootsim open 8081`).":" the CLI can\u2019t drive a remote preview (the engine only attaches to the local bridge from localhost). to drive the app, run it locally and `sootsim open <port>`.");return}let h=e.find((u,p)=>e[p-1]==="--driver")||"",H=e.includes("--headless");a&&h!=="playwright"&&(console.error(" sootsim open: --cdp-port is only honored by the playwright driver \u2014 add `--driver playwright`"),process.exit(1));let k=e.find((u,p)=>e[p-1]==="--base-url")||Te(),ee=e.includes("--base-url"),te=C();if(!h&&!c&&(o.simIdSource==="flag"||o.simIdSource==="saved"&&!!te)){let u=x(o),p=o.simId?` --sim ${o.simId}`:"",f=!1;try{let g=null;try{let y=await u.listSims();if(o.simIdSource==="saved"?(g=y.find($=>$.id===te&&$.readyState==="open")??null,g||M()):g=F(y,o.simId),!g)if(o.simIdSource==="saved")f=!0;else throw new Error("no sim connected");if(!f&&g){let $=ee||Y(m)?k:Pe(g,k),O=await N(m,L($,d));u.send({type:"evaluate",simId:g.id,code:`window.location.href = ${JSON.stringify(O)}`}).catch(()=>{})}}catch(y){console.error(` open failed: ${y instanceof Error?y.message:String(y)}`),await B(u,{errorsCommand:`sootsim get errors 5${p}`,warningsCommand:`sootsim get warnings 5${p}`,requestsCommand:`sootsim get requests 5${p}`}),process.exit(1)}if(!f&&g){await S(1500);let y=await et(o.wsPort,o.commandTimeoutMs,g.id);y||(console.error(" timed out waiting for current sim to load target"),process.exit(1)),y.bridge.close(),w(g.id);let $=ee||Y(m)?k:Pe(g,k),O=await N(m,L($,d));_(O,{...g,url:O},"current sim"),await E(o.wsPort,g.id,e);return}}finally{u.close()}}let oe=L(k,d),Ee=await N(m,oe),ne=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,b=await Ze(m,oe,ne),K={newWindow:!0},R=u=>u.url?.includes(`inspectOpen=${ne}`)??!1;if(h){We(h)||(console.error(` unknown driver "${h}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let u=G(h);u||(console.error(` unknown driver "${h}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let p=Ke(),f=await u.launch({url:b,headless:H,newWindow:K.newWindow,profileId:i,ephemeralProfile:r,cdpPort:a,connectTimeoutMs:p.hostTimeoutMs});f.launched||(console.error(` ${u.name} driver: ${f.message}`),process.exit(1));let g=await D(o.wsPort,o.commandTimeoutMs,R,{attempts:p.attempts,intervalMs:p.intervalMs});if(!g){if(f.pid)try{process.kill(f.pid,"SIGTERM"),console.error(` closed ${u.name} host process ${f.pid}`)}catch{}it(f),console.error(` timed out after ${p.timeoutMs}ms waiting for opened sim to connect`),process.exit(1)}w(g.id),st(f),_(b,g,`${u.name} driver`),await E(o.wsPort,g.id,e);return}if(l){let u=T();u||(console.error(" profiles require electron or playwright; install the desktop companion or use `--driver playwright`"),process.exit(1));try{(await V(b,u,{profileId:i,ephemeralProfile:r})).launched||(console.error(" desktop companion failed to start"),process.exit(1))}catch(f){console.error(` desktop companion failed: ${f instanceof Error?f.message:String(f)}`),process.exit(1)}let p=await D(o.wsPort,o.commandTimeoutMs,R,{attempts:40,intervalMs:500});p||(console.error(" timed out waiting for profiled sim to connect"),process.exit(1)),w(p.id),_(b,p,"desktop companion"),await E(o.wsPort,p.id,e);return}let W=!1,z=!1;try{let u=v(o.wsPort,{commandTimeoutMs:2e3});try{await u.listSims(),W=!0}finally{u.close()}}catch{}if(W)try{let u=v(o.wsPort,{commandTimeoutMs:3e3});try{await u.openUrl(b,K),z=!0}finally{u.close()}}catch{}if(!z){let u=T();if(u)try{if((await V(b,u)).launched){let f=await D(o.wsPort,o.commandTimeoutMs,R,{attempts:20,intervalMs:500});if(f){w(f.id),_(b,f,"desktop companion"),await E(o.wsPort,f.id,e);return}}}catch{}try{await j(b,K)}catch(p){console.error(` open failed: ${p instanceof Error?p.message:String(p)}`),G("playwright")?.availability().available?console.error(" no system browser found \u2014 retry with `sootsim open \u2026 --driver playwright` for a headless sim."):console.error(" run `sootsim list --drivers` to see available drivers."),process.exit(1)}if(!W){console.log(` opened: ${Ee}`),$e(o.wsPort);return}}let U=await D(o.wsPort,o.commandTimeoutMs,R,{attempts:30,intervalMs:500});U||(console.error(" timed out waiting for opened sim to connect"),process.exit(1)),w(U.id),_(b,U,z?"bridge":"direct shell open"),await E(o.wsPort,U.id,e)}async function _e(e,t={}){let o=I(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=x(o),s=o.simId?` --sim ${o.simId}`:"";try{try{let a=await r.listSims(),i=F(a,o.positional[0]||o.simId);if(i.lockedBy&&i.lockExpiresAt&&i.lockExpiresAt>Date.now()){let l=Math.max(0,Math.round((i.lockExpiresAt-Date.now())/1e3));i.lockedByKind==="user-active"&&(console.error(` refused: ${i.id} is locked by the active user (${l}s) \u2014 that's a live human tab`),console.error(" run `sootsim open --new` for a fresh investigation sim"),process.exit(1)),n||(console.error(` refused: ${i.id} is leased by ${i.lockedBy} (${l}s)`),console.error(` \`sootsim use ${i.id} --force\` to take it, or \`sootsim open --new\` for a fresh sim`),process.exit(1))}await r.focusSim(i.id),w(i.id),console.log(` using: ${i.id}`)}catch(a){console.error(` use failed: ${a instanceof Error?a.message:String(a)}`),await B(r,{errorsCommand:`sootsim get errors 5${s}`,warningsCommand:`sootsim get warnings 5${s}`,requestsCommand:`sootsim get requests 5${s}`}),process.exit(1)}}finally{r.close()}}async function Ht(e,t={}){await _e(e,t)}async function Kt(e,t={}){await _e(e,t)}async function Wt(e,t={}){let o=I(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=x(o);try{try{let s=await r.listSims(),a=F(s,o.positional[0]||o.simId),i=n&&a.lockedBy&&a.lockedByKind!=="user-active"?a.lockedBy:null,l=await r.claim(a.id,{force:n});w(a.id);let c=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),d=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${c}s]${d}`),i&&console.log(` took over from: ${i}`)}catch(s){if(s instanceof ae){let a=Math.max(0,Math.round(s.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${s.lock.by} for ${a}s more`),console.error(" use --force to take it, or `sootsim open --new` for a fresh sim"),process.exit(1)}console.error(` claim failed: ${s instanceof Error?s.message:String(s)}`),process.exit(1)}}finally{r.close()}}async function ct(e,t,o,n){if(n.length===0)return{closed:[],remaining:[]};await Promise.all(n.map(s=>e.closeSim(s).catch(()=>{})));let r=new Set(n);for(let s=0;s<40;s++){let a=[];try{let i=v(t,{commandTimeoutMs:o});try{a=(await i.listSims()).filter(c=>r.has(c.id)&&c.readyState==="open").map(c=>c.id)}finally{i.close()}}catch{a=[]}if(a.length===0)return{closed:[...r],remaining:[]};if(s===39)return{closed:[...r].filter(i=>!a.includes(i)),remaining:a};await S(250)}return{closed:[...r],remaining:[]}}function dt(e,t){let o=e.filter(m=>m.readyState==="open"),n=o.map(m=>m.id),r=t.explicitKeepId?.trim()||"",s=t.savedKeepId?.trim()||"",a=s?o.some(m=>m.id===s):!1,i=s&&!a?s:null,l=null,c=null,d=null;if(t.closeOthers)if(r){let m=o.find(h=>h.id===r);m?l=m.id:c=r}else if(s&&a)l=s;else{let m=o.find(h=>h.isPrimary)??o[0]??null;m&&(l=m.id,s&&!a&&(d=m.id))}return{openIds:n,keepId:l,targets:c?[]:n.filter(m=>m!==l),staleSavedId:i,missingExplicitKeepId:c,fallbackKeepId:d}}async function zt(e,t={}){let o=I(e,{port:t.port,commandTimeoutMs:t.timeoutMs,stripBooleanFlags:["--all","--others"]}),n=x(o),r=o.simId?` --sim ${o.simId}`:"",s=e.includes("--all"),a=e.includes("--others");if(s||a){try{let i=await n.listSims(),l=C(),c=o.positional[0]||(o.simIdSource==="flag"?o.simId:void 0),d=dt(i,{closeOthers:a,explicitKeepId:c,savedKeepId:l});if(d.staleSavedId&&M(),d.fallbackKeepId&&(w(d.fallbackKeepId),console.log(` saved sim ${d.staleSavedId} is gone \u2014 keeping primary ${d.fallbackKeepId}`)),d.missingExplicitKeepId&&(console.error(` close failed: keep sim ${d.missingExplicitKeepId} is not connected; not closing other sims`),process.exit(1)),d.targets.length===0){console.log(d.keepId?` nothing to close \u2014 only the kept sim ${d.keepId} is connected`:d.staleSavedId?` nothing to close \u2014 no sims connected (cleared stale current sim ${d.staleSavedId})`:" nothing to close \u2014 no sims connected");return}let m=await ct(n,o.wsPort,o.commandTimeoutMs,d.targets);await Q(i,d.targets);let h=C();h&&m.closed.includes(h)&&(d.keepId?w(d.keepId):M());let H=` closed ${m.closed.length} sim(s)${d.keepId?` (kept ${d.keepId})`:""}`;console.log(H),m.remaining.length>0&&(console.error(` close failed: still connected: ${m.remaining.join(", ")}`),process.exit(1))}catch(i){console.error(` close failed: ${i instanceof Error?i.message:String(i)}`),process.exit(1)}finally{n.close()}return}try{try{let i=await n.listSims(),l=F(i,o.positional[0]||o.simId),c=i.find(m=>m.id!==l.id&&m.readyState==="open");await n.closeSim(l.id),await nt(o.wsPort,o.commandTimeoutMs,l.id)||(await Q(i,[l.id]),console.error(` close failed: ${l.id} is still connected`),process.exit(1)),await Q(i,[l.id]),C()===l.id&&(c?w(c.id):M()),console.log(` closed: ${l.id}`)}catch(i){console.error(` close failed: ${i instanceof Error?i.message:String(i)}`),await B(n,{errorsCommand:`sootsim get errors 5${r}`,warningsCommand:`sootsim get warnings 5${r}`,requestsCommand:`sootsim get requests 5${r}`}),process.exit(1)}}finally{n.close()}}export{wt as a,De as b,bt as c,Ke as d,Nt as e,Te as f,N as g,Ze as h,tt as i,ot as j,D as k,rt as l,st as m,Q as n,At as o,Ft as p,Ht as q,Kt as r,Wt as s,ct as t,dt as u,zt as v};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{l as P,n as a,y as m}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{l as P,n as a,y as m}from"./chunk-QGGKLFUV.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,"utf8"),l.renameSync(t,d()),r}function y(){return g(u()).profiles}function E(e){let r=o(e);return y().find(t=>t.id===r)??null}function _(e=s){let r=o(e),t=E(r);return t||D(r)}function D(e){let r=o(e),t=p(u());if(t.profiles.some(w=>w.id===r))throw new Error(`profile already exists: ${r}`);let f=new Date().toISOString(),n={id:r,createdAt:f,updatedAt:f};return g({version:i,profiles:[...t.profiles,n]}),n}function F(e){let r=o(e);if(r===s)throw new Error("the default profile cannot be deleted; clear it instead");let t=p(u()),f=t.profiles.find(n=>n.id===r);if(!f)throw new Error(`profile not found: ${r}`);return g({version:i,profiles:t.profiles.filter(n=>n.id!==r)}),v(r),f}function v(e){let r=o(e);for(let t of[h(r),A(r)])try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}export{A as a,y as b,_ as c,D as d,F as e,v as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (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,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var m={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},c=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),p=new Set(["do","get","wait","shell","debug"]),b={tap:"sootsim do tap","double-tap":"sootsim do double-tap","tap-text":"sootsim do tap-text","tap-id":"sootsim do tap-id",type:"sootsim do type","type-into":"sootsim do type-into",key:"sootsim do key",dispatch:"sootsim do dispatch",dismiss:"sootsim do dismiss",scroll:"sootsim do scroll",drag:"sootsim do drag",swipe:"sootsim do swipe",pinch:"sootsim do pinch",reload:"sootsim do reload",sleep:"sootsim do sleep",settle:"sootsim do settle",tree:"sootsim get tree",a11y:"sootsim get a11y",count:"sootsim get count",layout:"sootsim get layout",url:"sootsim get url",globals:"sootsim get globals",errors:"sootsim get errors",warnings:"sootsim get warnings",requests:"sootsim get requests",node:"sootsim get node",state:"sootsim debug state",js:"sootsim debug js",eval:"sootsim debug eval",perf:"sootsim debug perf","sample-color":"sootsim debug sample-color","find-id":"sootsim find --testid",query:"sootsim find --text|--role|--type|--pressable|--visible",capture:"sootsim screenshot"},u=new Set(["preview","test","detox","maestro","flow","record","profile","cpu-profile","react","screenshot","screenshots","screenshot-mode","three-mode","3d-mode","inspect","debug","timeline","what-happened","diagnose","shell","assert","device","open","list","use","focus","claim","close","config","compat","scan","electron","login","logout","whoami","install","setup-repo","install-desktop","server","daemon","runtime","upgrade","launch","start","skills","upload","keys","hints","agent-wrapper","agent",...c,...Object.keys(b)]);function h(g){let i=g.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<i.length;){let o=i[s];if(o==="--"){e.commandArgs.push(...i.slice(s+1));break}let a=Object.entries(m).find(([n,t])=>n===o||t.short===o);if(a){let[n,t]=a,l=n.replace(/^--/,"");if(t.type==="boolean")e.globalFlags[l]=!0,s++;else{let r=i[s+1];if(r===void 0||r.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(t.type==="number"){let d=Number(r);if(Number.isNaN(d)){console.error(` warning: ${o} requires a number, got "${r}"`),s+=2;continue}e.globalFlags[l]=d}else e.globalFlags[l]=r;s+=2}continue}if(!e.command&&!o.startsWith("-")){let n=o.indexOf("-");if(n>0){let t=o.slice(0,n),l=o.slice(n+1);if(p.has(t)&&l.length>0){e.command=t;let r=i.slice(s+1);e.commandArgs=[l,...r[0]==="--"?r.slice(1):r];break}}if(u.has(o)){e.command=o;let t=i.slice(s+1);e.commandArgs=t[0]==="--"?t.slice(1):t;break}e.commandArgs=i.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{c as a,b,h as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,b as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,b as v}from"./chunk-EOYZQWP3.js";import{d as j}from"./chunk-VRQJIUX4.js";import{a as b}from"./chunk-D3BOVAZY.js";import{execSync as A}from"child_process";import{existsSync as w,readFileSync as _,writeFileSync as x}from"fs";import{relative as B,resolve as d}from"path";import{existsSync as p,readFileSync as k,readdirSync as O,statSync as R}from"fs";import{basename as L,dirname as T,join as a}from"path";function D(e){let o=e;for(;;){if(p(a(o,"turbo.json"))||p(a(o,"nx.json"))||p(a(o,"lerna.json"))||p(a(o,"pnpm-workspace.yaml")))return o;let i=a(o,"package.json");if(p(i))try{if(JSON.parse(k(i,"utf8")).workspaces)return o}catch{}let r=T(o);if(r===o)break;o=r}return e}function W(e){return p(a(e,"bun.lock"))||p(a(e,"bun.lockb"))?"bun":p(a(e,"pnpm-lock.yaml"))?"pnpm":p(a(e,"yarn.lock"))?"yarn":"npm"}function J(e){if(p(a(e,"turbo.json")))return"turbo";if(p(a(e,"nx.json")))return"nx";if(p(a(e,"pnpm-workspace.yaml")))return"pnpm";let o=a(e,"package.json");if(p(o))try{if(JSON.parse(k(o,"utf8")).workspaces)return"npm-workspaces"}catch{}return"single"}function N(e){return e.one?"one":e.expo?"expo":e["react-native"]?"bare":"unknown"}function y(e){let o=a(e,"package.json");if(!p(o))return null;let i;try{i=JSON.parse(k(o,"utf8"))}catch{return null}let r={...i.dependencies,...i.devDependencies},s=N(r);return s==="unknown"?null:{dir:e,name:i.name||L(e),framework:s,hasViteConfig:p(a(e,"vite.config.ts"))||p(a(e,"vite.config.js")),hasMetroConfig:p(a(e,"metro.config.js"))||p(a(e,"metro.config.ts")),hasSootsimDependency:!!r.sootsim,devCommand:i.scripts?.dev||null}}function V(e){let o=[],i=a(e,"pnpm-workspace.yaml");if(p(i)){let t=k(i,"utf8").match(/packages:\s*\n((?:\s+-\s+.+\n?)+)/);if(t){let c=t[1].split(`
|
|
3
3
|
`).filter(Boolean);for(let n of c){let g=n.replace(/^\s*-\s*['"]?/,"").replace(/['"]?\s*$/,"");g&&o.push(...S(e,g))}}return o}let r=a(e,"package.json");if(p(r))try{let s=JSON.parse(k(r,"utf8")),t=Array.isArray(s.workspaces)?s.workspaces:s.workspaces?.packages||[];for(let c of t)o.push(...S(e,c))}catch{}return o}function S(e,o){let i=o.replace(/\/\*\*?$/,"").replace(/\*$/,""),r=a(e,i);if(!p(r))return[];try{return O(r).map(t=>a(r,t)).filter(t=>{try{return R(t).isDirectory()&&p(a(t,"package.json"))}catch{return!1}})}catch{return[]}}function M(e){let o=J(e),i=W(e);if(o==="single"){let c=y(e);return{root:e,type:o,packageManager:i,apps:c?[c]:[]}}let r=V(e),s=[],t=y(e);t&&s.push(t);for(let c of r){if(c===e)continue;let n=y(c);n&&s.push(n)}return{root:e,type:o,packageManager:i,apps:s}}function $(e){switch(e){case"bun":return"bun add -d sootsim";case"pnpm":return"pnpm add -D sootsim";case"yarn":return"yarn add -D sootsim";case"npm":return"npm install -D sootsim"}}async function ce(e){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim setup-repo \u2014 set up sootsim in your project
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-QGGKLFUV.js";import{spawn as I}from"child_process";import C from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as M}from"stream/promises";var N="https://sootbean.com",D="SOOTSIM_CDN_ORIGIN",E="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(O(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function d(e){let t=$();return(e||process.env[D]||t.cdnOrigin||N).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[E]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${d(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function P(e,t){return`${d(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=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 V(e={}){v();let t=d(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=U(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let g=o.tarball||P(n,t),m=l.join(S(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(g,m),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await j(m);if(h!==o.sha256)throw s.rmSync(m,{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 A(m,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(b){throw s.rmSync(u,{recursive:!0,force:!0}),b}return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function q(e={}){v();let t=d(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:f()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:f(),latestVersion:i};let a=f(),c=a?p(a):null,g=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!g||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await V({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function B(e={}){let t=f();try{let r=await y(d(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 M(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function j(e){return new Promise((t,r)=>{let n=C.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 A(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{N as a,D as b,E as c,d,x as e,T as f,P as g,y as h,U as i,V as j,q as k,B as l};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as Ae}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as Ae}from"./chunk-343L4O2H.js";import{a as _e}from"./chunk-GVXSOL74.js";import{a as Ee}from"./chunk-QU3ONULM.js";import{a as V,b as ye,c as be,d as Z,e as ee,f as ve,g as te,i as re,j as Se,k as Pe}from"./chunk-BDGVC3KF.js";import{g as $e,n as ke,p as Me,t as Ie}from"./chunk-GWDTIWZO.js";import{d as xe,f as Te}from"./chunk-DUEG4N2E.js";import{m as ge}from"./chunk-A6DEFUJM.js";import{c as X,d as Q,e as he}from"./chunk-WCPC4T7V.js";import{c as Y}from"./chunk-ZE72P7KW.js";import{a as Fe}from"./chunk-UBREMS4Z.js";import{a as pe,b as G}from"./chunk-D3BOVAZY.js";import{f as we}from"./chunk-FKIJAVLB.js";import*as A from"fs";import{tmpdir as Re}from"os";import*as y from"path";import*as g from"fs";import*as w from"path";var L=1e4,B=393,C=852,Ce="__sootsimCliPerf",He="maestroCopiedText",De=new Map;function f(o){return new Promise(e=>setTimeout(e,o))}function qe(o){return o?w.basename(o)===".maestro"?w.dirname(o):o:process.cwd()}function ze(o,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(w.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let i=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():qe(t.flowDir);return w.resolve(i,r)}return w.join(o,r)}function Ge(o){if(typeof o=="string")return{path:o,withFrame:!1};let e=o.path?.trim()||o.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:o.withFrame===!0,layers:o.layers}}function ie(o){let[e,t]=o.split(",").map(i=>i.trim()),r=(i,n)=>i.endsWith("%")?Number.parseFloat(i)/100*n:Number.parseFloat(i);return{x:r(e,B),y:r(t,C)}}function Ye(o){let e=o.split(/^---$/m),t=e.length>1?e[e.length-1]:o,r=be(ye.parse(t),De);return Array.isArray(r)?r:[]}var W=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;simRouteHint=null;lastFailedStep=null;get simId(){return this.opts.simId}setSimRouteHint(e){this.simRouteHint=this.normalizeSimRoute(e)}normalizeSimRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshSimId(){if(this.opts.simId)try{let e=await this.bridge.listSims(),t=e.find(a=>a.id===this.opts.simId);if(t&&(this.simRouteHint=this.normalizeSimRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.simId&&a.readyState==="open")||!this.simRouteHint)return;let i=this.simRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeSimRoute(a.url||a.origin)===this.simRouteHint);if(!i)return;let n=e.find(a=>a.isPrimary&&a.readyState==="open"),s=e.find(a=>a.readyState==="open"),l=i??n??s;l&&(this.opts.simId=l.id,console.log(` [flow] sim rotated to ${l.id}`))}catch{}}async evaluate(e,t){return this.bridge.send({type:"evaluate",simId:this.opts.simId,code:e},t?{timeoutMs:t}:void 0)}async callTest(e,...t){return this.bridge.send({type:"call",simId:this.opts.simId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=L){let t=Date.now()+e,r=Date.now(),i=null,n=0,s=0;for(;Date.now()<t;){try{let a=await this.evaluate(`(async () => {
|
|
3
3
|
const test = window.__sootsimTest
|
|
4
4
|
if (!test) return { count: 0, loading: true }
|
|
5
5
|
const count = (await test.getNodeCount?.()) || 0
|
|
@@ -372,7 +372,7 @@ flow extension:
|
|
|
372
372
|
+ completed (${M.length} steps)`),c>0&&console.log(` screenshots: ${c} \u2192 ${s}`),I&&Oe(I),S&&console.log(` video: ${S}`),console.log()}catch(u){if(r&&!I)try{I=await d.stopProfile()}catch{}if(T&&!S)try{S=await d.stopRecording(),_=d.getLastRecordingDurationMs()}catch(c){console.warn(` recording stop failed: ${c?.message||String(c)}`)}console.error(`
|
|
373
373
|
x failed: ${u.message}
|
|
374
374
|
`),I&&(console.log(" partial profile:"),Oe(I)),S&&console.log(` partial video: ${S}`);try{let c=d.lastFailedStep,h=c?`step-${String(c.index+1).padStart(2,"0")}-${c.kind}`:"unstaged",R=y.join(s,h);await d.captureFailureBundle(R,{error:u,stepIndex:c?.index,stepKind:c?.kind,stepTarget:c?.target}),console.log(` failure bundle: ${R}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(c){try{let h=y.join(s,"error.png");await d.captureFailureScreenshot(h),console.log(` error screenshot: ${h}`)}catch{}console.log(` (failure bundle capture failed: ${c instanceof Error?c.message:String(c)})`)}await ge($,{errorsCommand:`sootsim get errors 5${d.simId?` --sim ${d.simId}`:""}`,warningsCommand:`sootsim get warnings 5${d.simId?` --sim ${d.simId}`:""}`,requestsCommand:`sootsim get requests 5${d.simId?` --sim ${d.simId}`:""}`}),O=1}finally{$.close()}if(O===0&&v)try{let u=await et(z??[]),c=["--origin",U,"--events",u];oe&&c.push("--public-origin",oe),S&&c.push("--video",S),S&&_&&Number.isFinite(_)&&c.push("--video-duration-ms",String(Math.round(_))),d.simId&&c.push("--sim",d.simId),Ve&&c.push("--open"),se&&c.push("--owner",se),ne&&c.push("--repo",ne),console.log(`
|
|
375
|
-
preparing preview upload\u2026`);let{runUpload:h}=await import("./upload-
|
|
375
|
+
preparing preview upload\u2026`);let{runUpload:h}=await import("./upload-MRHDECMV.js");await h(c,{})}catch(u){console.error(` preview upload failed: ${u?.message||u}`),O=1}return J&&(d.simId&&H.add(d.simId),await Ze(b.wsPort,b.commandTimeoutMs,[...H])),await G(),O}async function Ze(o,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let i=Q(o,{commandTimeoutMs:e});try{let n=await i.listSims(),s=r.filter(a=>n.some(m=>m.id===a&&m.readyState==="open"));if(s.length===0)return;let l=await Ie(i,o,e,s);await ke(n,s),l.closed.length>0&&console.log(` closed flow sim(s): ${l.closed.join(", ")}`),l.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${l.remaining.join(", ")}`)}catch(n){console.warn(` warn: failed to close flow sim(s): ${n instanceof Error?n.message:String(n)}`)}finally{i.close()}}async function et(o){let{gzipSync:e}=await import("zlib"),t=o.map(n=>JSON.stringify(n)).join(`
|
|
376
376
|
`)+(o.length?`
|
|
377
377
|
`:""),r=e(Buffer.from(t,"utf8")),i=y.join(Re(),`sootsim-events-${Date.now()}.jsonl.gz`);return A.writeFileSync(i,r),console.log(` events: ${o.length} written to ${i} (${r.length} bytes gz)`),i}async function tt(o){let e=o[0],t=r=>o.find((i,n)=>o[n-1]===r);switch(e){case"start":{let{path:r,state:i}=ve();console.log(" flow draft started"),console.log(` session: ${r}`),console.log(` steps: ${i.steps.length}`);return}case"keep":case"good":{let r=re();if(r.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!r.kept){console.log(" no pending action to keep");return}console.log(` kept: ${r.candidate.summary}`),console.log(` steps: ${r.stepCount}`);return}case"end":{let r=t("--output")||(o[1]&&!o[1].startsWith("-")?o[1]:void 0),i=o.includes("--validate")||o.includes("--video"),n=o.includes("--video"),s=re();s.active&&s.kept&&console.log(` auto-kept trailing action: ${s.candidate.summary}`);let l=Se(r||(i?it():void 0));if(l.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!l.valid){console.error(" flow draft is not valid:");for(let a of l.issues)console.error(` - ${a}`);console.error(" draft preserved \u2014 keep at least one real interaction or run `sootsim flow start` to reset"),process.exit(1)}if(i){let a=ot(o,l.outputPath),m=await Ne(a);if(m!==0){console.error(`
|
|
378
378
|
validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=m;return}te(),console.log(` flow draft validated (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath&&console.log(` saved: ${l.outputPath}`),n&&console.log(" video: recorded during validation run");return}if(te(),console.log(` flow draft ended (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath){console.log(` saved: ${l.outputPath}`),console.log(` next: sootsim flow ${l.outputPath} --record`);return}console.log(""),process.stdout.write(l.yaml);return}case"validate":{let r=o[1];(!r||r.startsWith("-"))&&(console.error(" usage: sootsim flow validate <path>"),process.exit(1));let i=ee(r);if(i.length>0){console.error(` x ${r} failed validation:`);for(let n of i)console.error(` - ${n}`);process.exit(1)}console.log(` + ${r} looks valid`);return}}}function rt(o){return o[0]==="--sim"&&o.length>=2?[...o.slice(2),"--sim",o[1]]:o}async function kt(o){let e=rt(o),t=e[0];if(t==="start"||t==="keep"||t==="good"||t==="end"||t==="validate")return await tt(e),0;let r=await Ne(e);return r!==0&&(process.exitCode=r),r}function Oe(o){let e=o.avgMs>0?(1e3/o.avgMs).toFixed(1):"?",t=o.sampleCount>0?(o.jankFrames/o.sampleCount*100).toFixed(1):"0";console.log(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=4001,n="sootsim close";export{t as a,n as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as p,spawn as l}from"child_process";import{existsSync as s}from"fs";import{homedir as u}from"os";import{join as d}from"path";var g=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","~/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","~/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Arc.app/Contents/MacOS/Arc","~/Applications/Arc.app/Contents/MacOS/Arc"],f=["/usr/bin/google-chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/microsoft-edge","/usr/bin/brave-browser","/snap/bin/chromium"],h=["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe","C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"],C=["google-chrome","chromium","chromium-browser","microsoft-edge","brave-browser"],O=["chrome","msedge","brave"];function w(r){return r.startsWith("~/")?d(u(),r.slice(2)):r}function a(r){for(let n of r){let o=w(n);if(s(o))return o}return null}function U(r,n){try{let e=p(n==="win32"?"where":"which",[r],{encoding:"utf8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim();return e?e.split(/\r?\n/)[0]:null}catch{return null}}function M(r=process.platform){let n=process.env.CHROME_PATH||process.env.CHROMIUM_PATH;if(n&&s(n))return n;let o=a(r==="darwin"?g:r==="win32"?h:f);if(o)return o;let e=r==="win32"?O:C;for(let t of e){let i=U(t,r);if(i)return i}return null}function A(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform;return n.newWindow?c(r,{...n,platform:o,newWindow:!0}):o==="darwin"?{command:"open",args:n.background===!1?[r]:["-g",r],via:"system"}:o==="win32"?{command:"cmd",args:["/c","start","",r],via:"system"}:{command:"xdg-open",args:[r],via:"system"}}function c(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform,e="chromiumBinary"in n?n.chromiumBinary:M(o);if(!e)throw new Error("browser launch requires Chrome, Chromium, Edge, Brave, or Arc");let t=[];return n.newWindow!==!1&&t.push("--new-window"),t.push(r),{command:e,args:t,via:"chromium",target:e}}async function m(r,n,o){return new Promise((e,t)=>{let i=l(r,n,{detached:o,stdio:"ignore"});i.once("error",t),i.once("spawn",()=>{o&&i.unref(),e(i.pid)})})}async function x(r,n={}){let o=A(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function y(r,n={}){let o=c(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function E(r,n={}){await x(r,n)}export{M as a,x as b,y as c,E as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-2WV4ZOVO.js";import{l as D}from"./chunk-P6JIUAJU.js";import{a as T}from"./chunk-WAWSYREW.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("sootsim/scripts/demo-app-registry")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-3KAGEHTB.js";import{l as D}from"./chunk-QGGKLFUV.js";import{a as T}from"./chunk-TZNL7M5E.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("sootsim/scripts/demo-app-registry")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
3
3
|
`)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Re(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=j(e),n=h();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ne(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,f.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ee.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let c=I(d);c&&t(c)});let a=!1;return()=>{if(!a){a=!0;try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ae(e,t,r){let n=i.openSync(e,f.O_RDWR|f.O_NONBLOCK),o=Buffer.alloc(8192),s="",a=Date.now()+r;try{for(;Date.now()<a;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(c){if(c.code!=="EAGAIN")throw c;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let c;for(;(c=s.indexOf(`
|
|
4
4
|
`))>=0;){let g=s.slice(0,c);s=s.slice(c+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(c=>setTimeout(c,30))}return null}finally{i.closeSync(n)}}export{I as a,h as b,ge as c,F as d,ye as e,he as f,Se as g,we as h,k as i,C as j,v as k,ve as l,j as m,W as n,J as o,te as p,O as q,re as r,l as s,Te as t,De as u,Re as v,Ne as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.106 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import r from"node:fs";import{homedir as O}from"node:os";import n from"node:path";var L="SOOTSIM_HOME",E="active",A="daemon.json",j="config.json",I=3e4;function c(){let e=process.env[L];return e&&e.length>0?n.resolve(e):n.join(O(),".sootsim")}function K(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return r.realpathSync(t).includes(`${n.sep}packages${n.sep}sootsim${n.sep}`)}catch{return!1}}function f(){return n.join(c(),"runtimes")}function _(e){return n.join(f(),e)}function D(){return n.join(f(),E)}function S(){return n.join(c(),"electron")}function U(){return n.join(S(),"userData")}function Y(e){return n.join(S(),e)}function N(){return n.join(c(),"profiles")}function F(){return n.join(c(),"daemon-app")}function T(){return n.join(F(),"SootSim Daemon.app")}function G(){return n.join(T(),"Contents","MacOS","sootsim-daemon")}function C(){return n.join(c(),"cache")}function p(){return n.join(c(),A)}function d(){return n.join(c(),j)}function v(){try{let e=r.readFileSync(d(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function M(e){y();let t=v(),s={...t,...e};e.settings&&typeof e.settings=="object"&&(s.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let u=`${d()}.tmp`;return r.writeFileSync(u,`${JSON.stringify(s,null,2)}
|
|
3
3
|
`,"utf8"),r.renameSync(u,d()),s}function X(){return v().telemetry!==!1}function q(e){M({telemetry:e})}function y(){r.mkdirSync(c(),{recursive:!0}),r.mkdirSync(f(),{recursive:!0}),r.mkdirSync(S(),{recursive:!0}),r.mkdirSync(N(),{recursive:!0}),r.mkdirSync(C(),{recursive:!0})}function w(){try{let e=r.readFileSync(D(),"utf8").trim();return e.length>0?e:null}catch{return null}}function z(e){r.mkdirSync(f(),{recursive:!0}),r.writeFileSync(D(),`${e}
|
|
4
4
|
`,"utf8")}function Q(){try{return r.readdirSync(f(),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).sort(P)}catch{return[]}}function P(e,t){let s=i=>{let a=i.indexOf("-"),l=a>=0?i.slice(0,a):i,k=a>=0?i.slice(a+1):"",b=l.split(".").map(g=>Number.parseInt(g,10));return b.some(g=>!Number.isFinite(g))?[[Number.POSITIVE_INFINITY],i]:[b,k]},[u,o]=s(e),[x,m]=s(t);for(let i=0;i<Math.max(u.length,x.length);i++){let a=u[i]??0,l=x[i]??0;if(a!==l)return a-l}return o===m?0:o?m?o<m?-1:1:-1:1}function W(){let e=w();if(!e)return null;let t=_(e);try{if(r.statSync(t).isDirectory())return t}catch{}return null}var h=16*1024;function R(){try{let e=r.openSync(p(),"r");try{let t=Buffer.alloc(h),s=r.readSync(e,t,0,h,0),u=t.subarray(0,s).toString("utf8"),o=JSON.parse(u);return o&&o.schema===1&&typeof o.pid=="number"&&typeof o.bridgePort=="number"&&typeof o.runtimePort=="number"&&typeof o.startedAt=="number"&&typeof o.heartbeatAt=="number"?o:null}finally{r.closeSync(e)}}catch{return null}}function $(e,t=Date.now()){if(!e||t-e.heartbeatAt>I)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function H(e){y();let t=`${p()}.tmp`;r.writeFileSync(t,`${JSON.stringify(e,null,2)}
|