sootsim 0.1.119 → 0.1.120
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-HMYFFW3K.js → agent-JAQ76LFW.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-L5TRN5OW.js → agent-wrapper-UFBNAQR3.js} +2 -2
- package/dist-cli/chunks/{app-fonts-G5L5BPHX.js → app-fonts-66WNE562.js} +2 -2
- package/dist-cli/chunks/{assert-MN4TCTKK.js → assert-RXN5UUG3.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-WOBYOIE3.js +2 -0
- package/dist-cli/chunks/beta-TRSZJRLI.js +2 -0
- package/dist-cli/chunks/{chunk-CHHBZJBH.js → chunk-25PXT5BN.js} +1 -1
- package/dist-cli/chunks/{chunk-ZX4FJNIW.js → chunk-3OXUZ4YW.js} +1 -1
- package/dist-cli/chunks/{chunk-C3VO2MSV.js → chunk-3RTBGCJF.js} +2 -2
- package/dist-cli/chunks/{chunk-OS62SSOF.js → chunk-4XZ4WY4A.js} +2 -2
- package/dist-cli/chunks/{chunk-3MWC6EE2.js → chunk-527SSINQ.js} +2 -2
- package/dist-cli/chunks/{chunk-FUUXRMXG.js → chunk-52IG45RY.js} +2 -2
- package/dist-cli/chunks/{chunk-JP3PNWTD.js → chunk-663EI6DT.js} +1 -1
- package/dist-cli/chunks/{chunk-BBLE5DMP.js → chunk-6ECCKNU4.js} +1 -1
- package/dist-cli/chunks/{chunk-GEPWAAGG.js → chunk-7IJSQITG.js} +2 -2
- package/dist-cli/chunks/{chunk-4EQ5V4CA.js → chunk-7NLXLHEX.js} +1 -1
- package/dist-cli/chunks/{chunk-FCRJNHIA.js → chunk-BJH7O6J6.js} +1 -1
- package/dist-cli/chunks/{chunk-5OZHLK4L.js → chunk-BPSFMOFQ.js} +2 -2
- package/dist-cli/chunks/{chunk-TUJWNKG4.js → chunk-D4S3A7VQ.js} +1 -1
- package/dist-cli/chunks/{chunk-J6UPVQ37.js → chunk-DLVWPEI4.js} +2 -2
- package/dist-cli/chunks/{chunk-XYT2OO4N.js → chunk-E6MZZ2JK.js} +1 -1
- package/dist-cli/chunks/{chunk-O7SJH4E7.js → chunk-FPRRNX2V.js} +2 -2
- package/dist-cli/chunks/{chunk-AUKEEPZT.js → chunk-IGCYRC3B.js} +1 -1
- package/dist-cli/chunks/{chunk-H4F45EGT.js → chunk-IGRECENR.js} +1 -1
- package/dist-cli/chunks/{chunk-TGLPBQ4D.js → chunk-JHOXMDAW.js} +2 -2
- package/dist-cli/chunks/{chunk-LB7BYFMF.js → chunk-KPNFYPCM.js} +2 -2
- package/dist-cli/chunks/{chunk-AV6YDPVF.js → chunk-LK74SKOV.js} +2 -2
- package/dist-cli/chunks/{chunk-47SB3JEW.js → chunk-LRAMRKPE.js} +3 -3
- package/dist-cli/chunks/{chunk-SSQWBV2F.js → chunk-MB5HWJMY.js} +2 -2
- package/dist-cli/chunks/chunk-NUEWNRWO.js +1 -0
- package/dist-cli/chunks/{chunk-475TNRB7.js → chunk-O2M2AP7H.js} +2 -2
- package/dist-cli/chunks/{chunk-O552XDE7.js → chunk-O2ZEDQRY.js} +2 -2
- package/dist-cli/chunks/chunk-O7HUOQQ7.js +2 -0
- package/dist-cli/chunks/{chunk-MNILEOSP.js → chunk-OJQCMP4V.js} +1 -1
- package/dist-cli/chunks/{chunk-JFHETXYV.js → chunk-P3YMHC64.js} +1 -1
- package/dist-cli/chunks/{chunk-MJQXUHDS.js → chunk-PIMLP3CT.js} +2 -2
- package/dist-cli/chunks/{chunk-RF2STDGD.js → chunk-PISK5DP6.js} +2 -2
- package/dist-cli/chunks/chunk-PXMMDJOI.js +1 -0
- package/dist-cli/chunks/{chunk-EIAYJLBW.js → chunk-QL5FA4KK.js} +2 -2
- package/dist-cli/chunks/{chunk-DE6JMHEW.js → chunk-RKJS56NM.js} +2 -2
- package/dist-cli/chunks/{chunk-APWX6YCC.js → chunk-S5UDIVJX.js} +2 -2
- package/dist-cli/chunks/{chunk-QMU4MAG3.js → chunk-SLLX3SWM.js} +1 -1
- package/dist-cli/chunks/{chunk-BZH7FKZZ.js → chunk-SPM7MIOO.js} +22 -12
- package/dist-cli/chunks/{chunk-4KU7AIP7.js → chunk-SPNQRDT7.js} +1 -1
- package/dist-cli/chunks/{chunk-YZ6MQTDJ.js → chunk-UMR6DJZG.js} +2 -2
- package/dist-cli/chunks/{chunk-RAWQNHKI.js → chunk-V2UHENRM.js} +1 -1
- package/dist-cli/chunks/chunk-VCJ6CAP5.js +1 -0
- package/dist-cli/chunks/{chunk-HPTOFA3Y.js → chunk-WTPKU4YG.js} +3 -3
- package/dist-cli/chunks/{chunk-WNK5XRWG.js → chunk-WWFXKF3K.js} +2 -2
- package/dist-cli/chunks/{chunk-YBRJSW5C.js → chunk-ZYR5O6UT.js} +3 -3
- package/dist-cli/chunks/cli-version-IDCZT6SQ.js +2 -0
- package/dist-cli/chunks/{compat-3C3O2TKY.js → compat-6HRSZHAI.js} +3 -3
- package/dist-cli/chunks/{config-TEO7DXWJ.js → config-AAHNHDGM.js} +2 -2
- package/dist-cli/chunks/control-2AGQ4GUN.js +2 -0
- package/dist-cli/chunks/{cpu-profile-QSFGY7HA.js → cpu-profile-RBTXSQVS.js} +2 -2
- package/dist-cli/chunks/{daemon-R2TQX4HR.js → daemon-ZDL4HAJ6.js} +2 -2
- package/dist-cli/chunks/{debug-UMLASBX2.js → debug-GPCQOMPB.js} +3 -3
- package/dist-cli/chunks/{detox-Y6TFEKQU.js → detox-ZMUVIM6C.js} +2 -2
- package/dist-cli/chunks/{device-4NBQC4LP.js → device-7U2WD3LH.js} +2 -2
- package/dist-cli/chunks/{diagnose-DKXPE4P6.js → diagnose-AHAABGO2.js} +2 -2
- package/dist-cli/chunks/drivers-RKCUWIKI.js +2 -0
- package/dist-cli/chunks/{electron-3AZTVV3N.js → electron-5MXNHIMP.js} +3 -3
- package/dist-cli/chunks/flow-NOT2JPAQ.js +2 -0
- package/dist-cli/chunks/help-HBLSAWHF.js +2 -0
- package/dist-cli/chunks/{hints-K323Q4NQ.js → hints-6E337RVS.js} +2 -2
- package/dist-cli/chunks/{home-paths-H7GUBJAB.js → home-paths-CZ67HGJ7.js} +2 -2
- package/dist-cli/chunks/{inspect-UJFYMPE5.js → inspect-OFQEFD7A.js} +3 -3
- package/dist-cli/chunks/install-33SLF767.js +2 -0
- package/dist-cli/chunks/{install-desktop-NT5QJIPD.js → install-desktop-AGDDOM5C.js} +3 -3
- package/dist-cli/chunks/{keys-OJVAQQK5.js → keys-ILCZHN7X.js} +2 -2
- package/dist-cli/chunks/{launch-VMMQENF6.js → launch-4BT4CF5H.js} +3 -3
- package/dist-cli/chunks/{login-CRJE2OZK.js → login-EBW5MZ7B.js} +4 -4
- package/dist-cli/chunks/{logout-3DXVRPLM.js → logout-FACVEAU4.js} +2 -2
- package/dist-cli/chunks/{maestro-FPDCZ3NO.js → maestro-T5OJV4WN.js} +2 -2
- package/dist-cli/chunks/{preview-7WLF767D.js → preview-OGUTDHGA.js} +2 -2
- package/dist-cli/chunks/{profile-DE5LJZ5Y.js → profile-OM32C3WD.js} +2 -2
- package/dist-cli/chunks/{react-HLRPZFFH.js → react-BT3Q3HEE.js} +2 -2
- package/dist-cli/chunks/{record-VQAG2YYZ.js → record-SDAASQC5.js} +2 -2
- package/dist-cli/chunks/runtime-23HEVNFL.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-O2WD2RT6.js → runtime-delivery-2ET2INWI.js} +2 -2
- package/dist-cli/chunks/{screenshot-HYSJVWYN.js → screenshot-GDNEA6ET.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-ME7WKY7S.js → screenshot-mode-GX3PSJUV.js} +2 -2
- package/dist-cli/chunks/{screenshots-5MY3SHOW.js → screenshots-BHHQP5D4.js} +2 -2
- package/dist-cli/chunks/{server-LRSX4VKM.js → server-SISUV3YX.js} +2 -2
- package/dist-cli/chunks/setup-repo-NU5MACBJ.js +2 -0
- package/dist-cli/chunks/{skills-SHJHDYYU.js → skills-2F6XJMFM.js} +2 -2
- package/dist-cli/chunks/{start-FBIHKRWV.js → start-AVNDR55O.js} +4 -4
- package/dist-cli/chunks/store-IQBPTP5Z.js +2 -0
- package/dist-cli/chunks/telemetry-4ASKMD4D.js +2 -0
- package/dist-cli/chunks/{test-W5VLOO6C.js → test-X2EOPVCG.js} +3 -3
- package/dist-cli/chunks/{three-mode-OILRSRAU.js → three-mode-HOAKG3OJ.js} +2 -2
- package/dist-cli/chunks/{timeline-H4SFNSBA.js → timeline-U5LB2UAV.js} +2 -2
- package/dist-cli/chunks/{upgrade-4SYAHMAP.js → upgrade-JKGP376V.js} +2 -2
- package/dist-cli/chunks/upload-MSXXFBQA.js +2 -0
- package/dist-cli/chunks/{web-UXTXQNYW.js → web-XC36Y7B2.js} +2 -2
- package/dist-cli/chunks/{what-happened-SNC6DEIJ.js → what-happened-F7KIUJLJ.js} +2 -2
- package/dist-cli/chunks/{whoami-QDFN5LHP.js → whoami-MA2TQQQL.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/sdk.cjs +12 -2
- package/dist-lib/sdk.mjs +12 -2
- package/dist-lib/skills.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-QJ5PP7KT.js +0 -2
- package/dist-cli/chunks/beta-LAPRQ3TP.js +0 -2
- package/dist-cli/chunks/chunk-5AL4WWUG.js +0 -1
- package/dist-cli/chunks/chunk-IKVDJYRI.js +0 -2
- package/dist-cli/chunks/chunk-RIMNMM3O.js +0 -1
- package/dist-cli/chunks/chunk-YPLXVVG4.js +0 -1
- package/dist-cli/chunks/cli-version-JKOW3OL3.js +0 -2
- package/dist-cli/chunks/control-UUSQA7VO.js +0 -2
- package/dist-cli/chunks/drivers-TFUZRRDZ.js +0 -2
- package/dist-cli/chunks/flow-744L27RP.js +0 -2
- package/dist-cli/chunks/help-JUP3UEFR.js +0 -2
- package/dist-cli/chunks/install-D5J5LA2V.js +0 -2
- package/dist-cli/chunks/runtime-LBAJOT4M.js +0 -2
- package/dist-cli/chunks/setup-repo-5FHT7B6J.js +0 -2
- package/dist-cli/chunks/store-ZSAUNVP6.js +0 -2
- package/dist-cli/chunks/telemetry-E2ZAX2C6.js +0 -2
- package/dist-cli/chunks/upload-NPGWC7E5.js +0 -2
package/dist-cli/bin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
3
|
-
import{a as u,b as d,c as g}from"./chunks/chunk-
|
|
2
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as u,b as d,c as g}from"./chunks/chunk-SPNQRDT7.js";import"./chunks/chunk-IGCYRC3B.js";function f(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("sootsim bridge daemon is not running")||t.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
|
|
4
4
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
5
5
|
`):process.stderr.write(`${t}
|
|
6
6
|
`),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
|
|
7
7
|
it needs vite / electron / playwright from a project's node_modules.
|
|
8
8
|
install the npm package and run via bun or node instead:
|
|
9
9
|
npm i -g sootsim && sootsim ${a}
|
|
10
|
-
`),process.exit(1))}var e=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-
|
|
10
|
+
`),process.exit(1))}var e=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-4ASKMD4D.js");a({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-4ASKMD4D.js");await t(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-IDCZT6SQ.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-TRSZJRLI.js"),m=t?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-CZ67HGJ7.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-HBLSAWHF.js");a(),await c(0)}var o=e.globalFlags.port,n=e.verbose,p=e.globalFlags.device,l=e.globalFlags.theme,S=e.globalFlags.driver,E=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,s=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-IQBPTP5Z.js"),t={};p&&(t.deviceModel=p),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-AVNDR55O.js");await a([],{port:o}),await c(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let t=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-HBLSAWHF.js");a(),await c(0)}if(r in d){let a=d[r],t=e.commandArgs.length>0?` ${e.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),t&&console.error(` \u2192 ${a}${t}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",t=e.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!t){let{printGroupHelp:i}=await import("./chunks/help-HBLSAWHF.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-HBLSAWHF.js");i(a&&t?t:r,{prefer:a&&t?"verb":"command",group:a&&t?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-WOBYOIE3.js"),i=t(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-OFQEFD7A.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-RXN5UUG3.js");await a(e.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-NOT2JPAQ.js"),t=await a(s);process.exit(typeof t=="number"?t:0)}case"test":{let{runTest:a}=await import("./chunks/test-X2EOPVCG.js");await a(e.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-ZMUVIM6C.js");await a(e.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-T5OJV4WN.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-OGUTDHGA.js");await a(e.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-SDAASQC5.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-OM32C3WD.js"),t=await a(e.commandArgs,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-RBTXSQVS.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"react":{let{runReact:a}=await import("./chunks/react-BT3Q3HEE.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-GDNEA6ET.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-BHHQP5D4.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-GX3PSJUV.js");await a(e.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-HOAKG3OJ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-OFQEFD7A.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-GPCQOMPB.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-U5LB2UAV.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-F7KIUJLJ.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-AHAABGO2.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-WOBYOIE3.js"),i=t(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-2AGQ4GUN.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-2AGQ4GUN.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-2AGQ4GUN.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-2AGQ4GUN.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-AAHNHDGM.js");await a(e.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-7U2WD3LH.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-6HRSZHAI.js");await a(e.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-5MXNHIMP.js");await a(e.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-EBW5MZ7B.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-FACVEAU4.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-MA2TQQQL.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-ILCZHN7X.js");await a(e.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-NU5MACBJ.js");await a(e.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-33SLF767.js");await a(e.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-AGDDOM5C.js");await a(e.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-SISUV3YX.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-ZDL4HAJ6.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-23HEVNFL.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-JKGP376V.js");await a(e.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-4BT4CF5H.js");await a(e.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-AVNDR55O.js");await a(e.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-JAQ76LFW.js"),t=await a(e.commandArgs);process.exit(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-UFBNAQR3.js"),t=await a(e.commandArgs);process.exit(t)}case"skills":{let{runSkills:a}=await import("./chunks/skills-2F6XJMFM.js");await a(e.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-MSXXFBQA.js");await a(e.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-66WNE562.js");await a(e.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-6E337RVS.js");a(e.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as $,b,c as E,d as l,e as A,g as S,h as j,j as T,m as I,n as k,o as x,p as g,q as D,r as O}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as $,b,c as E,d as l,e as A,g as S,h as j,j as T,m as I,n as k,o as x,p as g,q as D,r as O}from"./chunk-KPNFYPCM.js";import"./chunk-P3YMHC64.js";import{c as y}from"./chunk-7IJSQITG.js";import"./chunk-UMR6DJZG.js";import"./chunk-E6MZZ2JK.js";import"./chunk-O7HUOQQ7.js";import"./chunk-SLLX3SWM.js";import"./chunk-D4S3A7VQ.js";import"./chunk-7NLXLHEX.js";import"./chunk-BJH7O6J6.js";import"./chunk-3OXUZ4YW.js";import"./chunk-IGCYRC3B.js";import w from"node:fs";import d from"node:path";import{spawn as U}from"node:child_process";import _ from"node:net";import{WebSocket as C}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new C(`ws://localhost:${this.port}`),this.ready=new Promise((t,n)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),n(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==C.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let n=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(n),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(n,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:n,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(n),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let n=this.pending.get(t.id);n&&(this.pending.delete(t.id),clearTimeout(n.timer),t.error?n.reject(new c(t.error,t.code)):n.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function R(r=7668,e=400){return new Promise(t=>{let n=new _.Socket,s=!1,o=i=>{s||(s=!0,n.destroy(),t(i))};n.setTimeout(e),n.once("connect",()=>o(!0)),n.once("timeout",()=>o(!1)),n.once("error",()=>o(!1)),n.connect(r,"127.0.0.1")})}async function F(r={}){let e=r.port??7668;if(await R(e))return{alreadyRunning:!0};let{cmd:t,prefixArgs:n}=O(),s=[...n,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=U(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(r.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await R(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(r={}){await F({port:r.port,startupTimeoutMs:r.startupTimeoutMs});let e=new f(r);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function me(r){let[e,...t]=r;try{switch(e){case void 0:case"--help":case"-h":case"help":return M(),0;case"attach":return await B(t);case"projects":return await W();case"project":return await J(t);case"sessions":return await V(t);case"start":return await G(t);case"prompt":return await H(t);case"watch":return await q(t);case"transcript":return await X(t);case"end":return await z(t);case"paths":return await Q();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
3
3
|
`),M(),2}}catch(n){if(n instanceof c)return process.stderr.write(`${n.message}
|
|
4
4
|
`),1;throw n}}async function v(r){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await r(e)}finally{e.close()}}function M(){y("agent")}function P(r,e){let t={},n=[];for(let s=0;s<r.length;s++){let o=r[s],i=e[o];i==="value"?(t[o]=r[s+1]??"",s++):i==="bool"?t[o]=!0:n.push(o)}return{flags:t,positional:n}}function N(r,e="codex"){return r==="codex"||r==="claude"?r:e}async function B(r){let{flags:e,positional:t}=P(r,{"--name":"value","--provider":"value"}),n=t[0];if(!n)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
|
|
5
5
|
`),2;let s=d.resolve(n);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as M}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-P3YMHC64.js";import"./chunk-IGCYRC3B.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
|
|
3
3
|
`)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return I(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let g=t[u];g&&(r[g]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
|
|
4
4
|
--provider codex|claude --cwd <path>
|
|
5
5
|
--prompt-in <fifo> --events-out <fifo>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as p}from"./chunk-IGRECENR.js";import"./chunk-IGCYRC3B.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-IGCYRC3B.js";import{spawn as x}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=x(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
|
|
3
3
|
`).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=x("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
|
|
4
4
|
`),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
|
|
5
5
|
supported: ${Array.from(w).sort().join(", ")}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-WTPKU4YG.js";import"./chunk-WWFXKF3K.js";import"./chunk-V2UHENRM.js";import"./chunk-SLLX3SWM.js";import"./chunk-3OXUZ4YW.js";import"./chunk-IGCYRC3B.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.120 | (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.
|
|
1
|
+
/*! sootsim v0.1.120 | (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)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d,b as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d,b as v}from"./chunk-663EI6DT.js";import{a as f,c as w}from"./chunk-JHOXMDAW.js";import{a as u,b as h,c as m}from"./chunk-25PXT5BN.js";import{c as p}from"./chunk-V2UHENRM.js";function _(){let e=u();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function M(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=u();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await m(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var g={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:_,launch:M};function I(){let e=d();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim install-desktop`)"}}async function x(e){let r=d();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await v(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var y={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:I,launch:x};import{spawn as E}from"child_process";import{closeSync as C,mkdtempSync as A,openSync as L,readFileSync as W}from"fs";import{createRequire as R}from"module";import{tmpdir as b}from"os";import{join as P}from"path";var N=`
|
|
3
3
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
4
4
|
const url = process.env.SOOTSIM_PW_URL;
|
|
5
5
|
const headless = process.env.SOOTSIM_PW_HEADLESS === '1';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{E as A,m as E,n as _,o as h}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{E as A,m as E,n as _,o as h}from"./chunk-SPM7MIOO.js";import{d as y,h as B,i as v}from"./chunk-WWFXKF3K.js";var W={timeoutMs:1800,settleMs:48,startWindowMs:64};function p(e){return new Promise(t=>setTimeout(t,e))}function J(e){return e.includes("--json")}function L(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}function U(e){process.stderr.write(`${e}
|
|
4
4
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function N(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function q(e,t,...r){return v(e,`SootSim.bridges.mainShell.${t}`,...r)}async function Y(e,t={}){try{let r=await N(e,"waitForScreenTransitions",W);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await q(e,t,...n)}catch(o){if(!A(o)||Date.now()>=s)throw o;await p(50)}}async function K(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await p(o)}return null}async function Q(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await p(o)}return null}async function V(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,m=!1,d={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:E}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,w=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",P=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=w,m=R,f!==a&&(a=f,u=g),d={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof w=="boolean"?w:null,externalStatus:P,externalError:M,errors:x},C&&w!==!1&&!R&&!T&&h({nodes:f,targets:$})&&g-u>=_)return{...d,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...d,ready:!1,source:"error-bail"}}catch{}await p(s)}return c!==!1&&!m&&!d.loadingText&&h(d)?{...d,ready:!0,source:"nodes-fallback"}:{...d,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function k(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function I(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function D(e,t={}){let r=await e.send({type:"evaluate",code:"window.__sootsimConsole?.count?.() || { errors: 0, warnings: 0, total: 0 }"});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
5
5
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await e.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors?.(5) || []"});if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as Ns}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as Ns}from"./chunk-IGCYRC3B.js";var ui=`(async () => {
|
|
3
3
|
try { localStorage.clear() } catch {}
|
|
4
4
|
try { sessionStorage.clear() } catch {}
|
|
5
5
|
try {
|
|
@@ -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.120 | (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-3OXUZ4YW.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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as h,spawn as g}from"child_process";import{existsSync as s,readdirSync as k}from"fs";import{dirname as m,join as l,resolve as a}from"path";import{fileURLToPath as v}from"url";var c;function p(){if(c!==void 0)return c;try{c=m(v(import.meta.resolve("sootsim-engine/package.json")))}catch{c=null}return c}var I="dev.sootsim.simulator";function x(){let n=p();if(!n)return null;let e=l(n,"dist-electron/main.cjs");if(!s(e))return null;let i=D(n);return i?{path:i,platform:process.platform,kind:"dev-electron",engineDir:n}:null}function b(){let n=p();return n?s(l(n,"src-electron/main.ts")):!1}function D(n){let e=n;for(let i=0;i<6;i++){let t=l(e,"node_modules/.bin/electron");if(s(t))return t;let r=m(e);if(r===e)break;e=r}return null}function C(){let n=p(),i=["/Applications/sootsim.app",a(process.env.HOME||"","Applications/sootsim.app"),...n?[a(n,"app/sootsim.app")]:[]].find(t=>s(t));if(i)return{path:i,platform:"darwin",kind:"mac-app"};try{let t=h("mdfind",[`kMDItemCFBundleIdentifier == "${I}"`],{encoding:"utf8",timeout:3e3}).trim();if(t)return{path:t.split(`
|
|
3
3
|
`)[0],platform:"darwin",kind:"mac-app"}}catch{}return null}function f(n){if(!s(n))return null;let e=k(n).filter(i=>i.startsWith("sootsim")&&i.endsWith(".AppImage")).sort().reverse()[0];return e?l(n,e):null}function w(){let n=p(),i=[a(process.env.HOME||"","Applications/sootsim.AppImage"),a(process.env.HOME||"",".local/bin/sootsim.AppImage"),"/opt/sootsim/sootsim.AppImage","/opt/sootsim/sootsim",...n?[a(n,"app/sootsim.AppImage"),a(n,"release/linux-unpacked/sootsim")]:[]].find(r=>s(r));if(i)return{path:i,platform:"linux",kind:i.endsWith(".AppImage")?"linux-appimage":"linux-binary"};let t=n?f(a(n,"app"))||f(a(n,"release")):null;return t?{path:t,platform:"linux",kind:"linux-appimage"}:null}function A(){let n=x();if(n)return n;if(b()){let e=p(),i=l(e,"dist-electron/main.cjs");return s(i)?console.error(` no node_modules/.bin/electron found near ${e}. run \`bun install\`.`):console.error(` dist-electron/main.cjs missing in ${e}.
|
|
4
4
|
run: bun run --cwd packages/sootsim-engine build:electron-main
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.120 | (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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as t}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as t}from"./chunk-UMR6DJZG.js";import{a as p,b as m,c as a}from"./chunk-E6MZZ2JK.js";import{a as r}from"./chunk-O7HUOQQ7.js";import{a as l}from"./chunk-D4S3A7VQ.js";import{a as u,d}from"./chunk-7NLXLHEX.js";import{z as i}from"./chunk-3OXUZ4YW.js";function c(){let o=i();return`sootsim CLI v${l()} \xB7 runtime ${o?`v${o}`:"not installed"}`}function S(){let o=m({bridgePort:7668,defaultShellUrl:r},t()),e=`
|
|
3
3
|
${d}
|
|
4
4
|
`;console.log(`${c()}
|
|
5
5
|
${e}${o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.120 | (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,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var o={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},m={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},c={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},p={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},r=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var h={"iphone-se":t({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:m}),"iphone-14":t({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:55,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15":t({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-plus":t({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-16":t({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-plus":t({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17":t({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-air":t({name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"ipad-pro-13":t({name:'iPad Pro 13"',width:1032,height:1376,scale:2,statusBarHeight:24,homeIndicatorHeight:20,cornerRadius:18,dynamicIsland:null,safeAreaInsets:{top:24,bottom:20,left:0,right:0},iosVersion:"18.2",physicalPPI:264,hardwareButtons:o}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:c},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:p},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:p}},u="iphone-17-pro";function S(e){return h[e]}function g(){return Object.keys(h)}var i={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},s={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},P={color:"#25c3ec",blur:120,spread:52,opacity:.34},v="iphone-17-pro";var f=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],x=Object.fromEntries(f.map(e=>[e.name,e.value]));function B(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function b(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(n=>({...n}))}}function I(e){return Object.prototype.hasOwnProperty.call(s,e)?b(s[e]):null}var d={deviceModel:{type:"enum",default:u,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:g(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(i),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(s),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function y(){if(typeof window>"u")return{};let e={};try{let n=new URLSearchParams(window.location.search),a=n.get("device");a&&d.deviceModel.options?.includes(a)&&(e.deviceModel=a);let l=n.get("colorScheme")??n.get("theme");l&&d.colorScheme.options?.includes(l)&&(e.colorScheme=l)}catch{}return e}function R(){let e={};for(let[n,a]of Object.entries(d))e[n]=a.default;return Object.assign(e,y()),e}export{P as a,v as b,B as c,b as d,I as e,h as f,S as g,g as h,d as i,y as j,R as k};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as x}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as x}from"./chunk-IGCYRC3B.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,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as D,b as q,c as de,e as me}from"./chunk-5OZHLK4L.js";import{m as B}from"./chunk-OS62SSOF.js";import{m as le,o as ce}from"./chunk-BZH7FKZZ.js";import{a as pe,b as fe,c as ge}from"./chunk-H4F45EGT.js";import{b as ae,c as I,d as v,e as x}from"./chunk-WNK5XRWG.js";import{g as G}from"./chunk-C3VO2MSV.js";import{a as M,b as V}from"./chunk-JP3PNWTD.js";import{c as ue}from"./chunk-TGLPBQ4D.js";import{d as j}from"./chunk-CHHBZJBH.js";import{d as k,e as w,f as T}from"./chunk-RAWQNHKI.js";import{a as ie}from"./chunk-IKVDJYRI.js";import{E as re,F as se}from"./chunk-ZX4FJNIW.js";import Y from"node:fs";import Ae from"node:os";import P from"node:path";function Re(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function J(e){let o=Re(e);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}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 Oe(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function ye(e,o,t){return`${e}//${o}:${t}`}function Ue(e){if(typeof window>"u")return!1;try{let o=new URL(e);return J(o.hostname)&&J(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function we(e,o){let t={...o,cache:o?.cache??"no-store"};return Ue(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Be(e){return e==="https:"?443:80}function De(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function ve(e,o){let t=e.replace(/\/+$/,"");try{let n=await we(`${t}/`,{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:de(a||`${t}${q}`),port:o,framework:Oe(a,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await we(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${q}`,port:o,framework:"metro"}}catch{}return null}async function be(e){return ve(ye("http:","localhost",e),e)}async function Se(e){let o=e.trim();if(/^\d+$/.test(o)){let i=parseInt(o,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 t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}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(De(n)){let i=await ve(a,s);if(i)return i;throw he(a)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function vt(){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 o=M();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){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 Le(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 St(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){Le(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),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 Ne=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(o=>setTimeout(o,e))}function xe(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function Ke(){let e=xe("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??xe("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Ne;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 N(e){return e.trim()}function X(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function ze(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Ht(e){let o=N(e);return(await Te(o)).bundleUrl}function je(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Te(e){let o=N(e),t=/^\d+$/.test(o)?Number(o):je(o);if(t&&t>0){let n=await me(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return Se(o)}function Z(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function qe(e,o){let t=N(e),n=new URL(o),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(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function Ve(e){let o=N(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Ge(e,o){let t=await Te(e),n=new URL(o),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",t.bundleUrl),n.toString()}function Je(e){return e.startsWith("~/")?P.join(Ae.homedir(),e.slice(2)):P.isAbsolute(e)?e:P.resolve(process.cwd(),e)}function Qe(e){let o={};for(let t=0;t<e.length;t++){if(e[t]!=="--replace")continue;let n=e[t+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());Y.existsSync(a)||(console.error(` sootsim open: replacement file not found: ${a}`),process.exit(1)),o[s]={file:a},t++}return Object.keys(o).length>0?{modules:o}:void 0}function Me(){let e=re();return se(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:ie}async function Xe(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await fe(t)||void 0,r=pe({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await Ye(r);return s.length===0?e:(o.searchParams.set("appFonts",ge(s)),o.toString())}catch{return e}}async function Ye(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let a=await fetch(n.url,{method:"HEAD",signal:r.signal});return a.status>=200&&a.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function Ze(e,o){if(!e)return new URL(o).toString();if(X(e))return new URL(e).toString();let t=He[e.toLowerCase()];if(t){let n=new URL(o),r=Z(n.pathname);return n.pathname=`${r}${t}`,n.toString()}return Ve(e)?Ge(e,o):qe(e,o)}async function A(e,o=Me()){let t=await Ze(e,o);return Xe(t)}function Pe(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);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.searchParams.delete("appFonts"),n.toString()}catch{return o}}async function et(e,o,t){let n=new URL(await A(e,o));return n.searchParams.set("inspectOpen",t),n.toString()}async function tt(e,o,t,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:o,simId:t,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 ot(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function nt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function rt(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
1
|
+
/*! sootsim v0.1.120 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as D,b as q,c as de,e as me}from"./chunk-BPSFMOFQ.js";import{m as B}from"./chunk-4XZ4WY4A.js";import{m as le,o as ce}from"./chunk-SPM7MIOO.js";import{a as pe,b as fe,c as ge}from"./chunk-IGRECENR.js";import{b as ae,c as I,d as v,e as x}from"./chunk-WWFXKF3K.js";import{g as G}from"./chunk-3RTBGCJF.js";import{a as M,b as V}from"./chunk-663EI6DT.js";import{c as ue}from"./chunk-JHOXMDAW.js";import{d as j}from"./chunk-25PXT5BN.js";import{d as k,e as w,f as T}from"./chunk-V2UHENRM.js";import{a as ie}from"./chunk-O7HUOQQ7.js";import{E as re,F as se}from"./chunk-3OXUZ4YW.js";import Y from"node:fs";import Ae from"node:os";import P from"node:path";function Re(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function J(e){let o=Re(e);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}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 Oe(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function ye(e,o,t){return`${e}//${o}:${t}`}function Ue(e){if(typeof window>"u")return!1;try{let o=new URL(e);return J(o.hostname)&&J(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function we(e,o){let t={...o,cache:o?.cache??"no-store"};return Ue(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Be(e){return e==="https:"?443:80}function De(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function ve(e,o){let t=e.replace(/\/+$/,"");try{let n=await we(`${t}/`,{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:de(a||`${t}${q}`),port:o,framework:Oe(a,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await we(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${q}`,port:o,framework:"metro"}}catch{}return null}async function be(e){return ve(ye("http:","localhost",e),e)}async function Se(e){let o=e.trim();if(/^\d+$/.test(o)){let i=parseInt(o,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 t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}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(De(n)){let i=await ve(a,s);if(i)return i;throw he(a)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function vt(){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 o=M();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){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 Le(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 St(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){Le(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),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 Ne=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(o=>setTimeout(o,e))}function xe(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function Ke(){let e=xe("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??xe("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Ne;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 N(e){return e.trim()}function X(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function ze(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Ht(e){let o=N(e);return(await Te(o)).bundleUrl}function je(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function Te(e){let o=N(e),t=/^\d+$/.test(o)?Number(o):je(o);if(t&&t>0){let n=await me(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return Se(o)}function Z(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function qe(e,o){let t=N(e),n=new URL(o),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(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function Ve(e){let o=N(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Ge(e,o){let t=await Te(e),n=new URL(o),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",t.bundleUrl),n.toString()}function Je(e){return e.startsWith("~/")?P.join(Ae.homedir(),e.slice(2)):P.isAbsolute(e)?e:P.resolve(process.cwd(),e)}function Qe(e){let o={};for(let t=0;t<e.length;t++){if(e[t]!=="--replace")continue;let n=e[t+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());Y.existsSync(a)||(console.error(` sootsim open: replacement file not found: ${a}`),process.exit(1)),o[s]={file:a},t++}return Object.keys(o).length>0?{modules:o}:void 0}function Me(){let e=re();return se(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:ie}async function Xe(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await fe(t)||void 0,r=pe({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await Ye(r);return s.length===0?e:(o.searchParams.set("appFonts",ge(s)),o.toString())}catch{return e}}async function Ye(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let a=await fetch(n.url,{method:"HEAD",signal:r.signal});return a.status>=200&&a.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function Ze(e,o){if(!e)return new URL(o).toString();if(X(e))return new URL(e).toString();let t=He[e.toLowerCase()];if(t){let n=new URL(o),r=Z(n.pathname);return n.pathname=`${r}${t}`,n.toString()}return Ve(e)?Ge(e,o):qe(e,o)}async function A(e,o=Me()){let t=await Ze(e,o);return Xe(t)}function Pe(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);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.searchParams.delete("appFonts"),n.toString()}catch{return o}}async function et(e,o,t){let n=new URL(await A(e,o));return n.searchParams.set("inspectOpen",t),n.toString()}async function tt(e,o,t,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:o,simId:t,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 ot(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function nt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function rt(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
3
3
|
`);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${nt(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[t.isPrimary?"primary":"",t.id===o?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",n].filter(Boolean);console.log(` ${t.id}${r.length?` [${r.join(", ")}]`:""}`);let s=ot(t.url);if(s)console.log(` loaded: ${s}`);else if(t.url){let i=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${i}`)}else t.origin&&console.log(` origin: ${t.origin}`);let a=st(t);a&&console.log(` engine: ${a}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${Ce(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${Ce(Date.now()-t.lastActiveAt)}`)}}function st(e){let o=e.url||e.origin||"";if(!o)return null;try{let t=new URL(o).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"soot app embedded (:3000)":`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function Ce(e){let o=Math.max(0,Math.round(e/1e3));return o<60?`${o}s ago`:o<3600?`${Math.round(o/60)}m ago`:o<86400?`${Math.round(o/3600)}h ago`:`${Math.round(o/86400)}d ago`}async function L(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let a=0;a<r;a++){let i=v(e,{commandTimeoutMs:o});try{let c=(await i.listSims()).find(t);if(c)return c}catch{}finally{i.close()}await S(s)}return null}async function it(e,o,t,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let a=0;a<r;a++){let i=v(e,{commandTimeoutMs:o});try{let c=(await i.listSims()).find(d=>d.id===t);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{i.close()}await S(s)}return!1}function at(e){let o=e.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let t=Number(o.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function lt(e){if(!e.connectAckFile)return!1;try{return Y.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
4
4
|
`,{flag:"w"}),!0}catch{return!1}}function ct(e){if(e.diagnosticLogPath)try{let o=Y.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${P.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
|
|
5
5
|
${o.slice(-4e3)}`:o;console.error(` ${P.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${P.basename(e.diagnosticLogPath)}: ${t}`)}}function ke(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function dt(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!ke(e))return!0;await S(100)}return!ke(e)}async function Q(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=at(r);s&&n.add(s)}for(let r of n){try{process.kill(r,"SIGTERM")}catch{}if(await dt(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,o){if(o){let r=o.trim(),s=e.find(a=>a.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let t=e.find(r=>r.isPrimary&&r.readyState==="open");if(t)return t;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function _(e,o,t){console.log(` ${t==="current sim"?"loaded":"opened"}: ${e} [${t}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function E(e,o,t){if(t.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await mt(e,o,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:o,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&&ce(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 () => {
|