sootsim 0.1.78 → 0.1.80
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-GL53UEUD.js → agent-BOFSQL4D.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-PNWA5QWJ.js → agent-wrapper-VHXDLJ5Q.js} +2 -2
- package/dist-cli/chunks/{assert-EIMJFGRZ.js → assert-HKFZZDIH.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-IV33JYV7.js +2 -0
- package/dist-cli/chunks/beta-WERQ42O6.js +2 -0
- package/dist-cli/chunks/chunk-3FRJ3IQT.js +2 -0
- package/dist-cli/chunks/{chunk-QBLRSM7I.js → chunk-43YUWV4Y.js} +1 -1
- package/dist-cli/chunks/chunk-45ZDPOFK.js +73 -0
- package/dist-cli/chunks/{chunk-CWAAAYX6.js → chunk-5GNIETQW.js} +1 -1
- package/dist-cli/chunks/{chunk-66NGBQ7T.js → chunk-5JQLSFSU.js} +2 -2
- package/dist-cli/chunks/{chunk-UVPPKT3Y.js → chunk-6NFFFBRU.js} +1 -1
- package/dist-cli/chunks/{chunk-4EI27KJS.js → chunk-AVR2E37B.js} +3 -3
- package/dist-cli/chunks/{chunk-KKRRCLL2.js → chunk-BOBWMEVH.js} +2 -2
- package/dist-cli/chunks/{chunk-AQORMNKI.js → chunk-DMU4XTZG.js} +2 -2
- package/dist-cli/chunks/{chunk-5QGRGVUL.js → chunk-F6I3D46Z.js} +2 -2
- package/dist-cli/chunks/{chunk-EAUK4O7A.js → chunk-FFLG37RS.js} +2 -2
- package/dist-cli/chunks/{chunk-IBBLHQXG.js → chunk-FSBYGM4J.js} +1 -1
- package/dist-cli/chunks/{chunk-RIOBLGBB.js → chunk-HVRM6FSJ.js} +1 -1
- package/dist-cli/chunks/{chunk-K7VFVEJY.js → chunk-IX4IMVA5.js} +1 -1
- package/dist-cli/chunks/{chunk-U2W4HCN7.js → chunk-J5TKJD6U.js} +2 -2
- package/dist-cli/chunks/chunk-JQA5KAIE.js +1 -0
- package/dist-cli/chunks/{chunk-SDA56JHP.js → chunk-KT3MW6TT.js} +1 -1
- package/dist-cli/chunks/{chunk-3QLEQWRE.js → chunk-LA4X55X7.js} +2 -2
- package/dist-cli/chunks/{chunk-UVGNPZZI.js → chunk-LL37YEM2.js} +1 -1
- package/dist-cli/chunks/{chunk-TRT66CAX.js → chunk-LRHF2NHY.js} +1 -1
- package/dist-cli/chunks/chunk-MSIBILXN.js +1 -0
- package/dist-cli/chunks/{chunk-O6O4QOYW.js → chunk-NDDO5LJQ.js} +2 -2
- package/dist-cli/chunks/{chunk-LNGB6734.js → chunk-ODVLFSC5.js} +1 -1
- package/dist-cli/chunks/{chunk-MJE6VBIV.js → chunk-P3XP5CAJ.js} +3 -3
- package/dist-cli/chunks/{chunk-A73B66A2.js → chunk-PA6LEZXS.js} +3 -3
- package/dist-cli/chunks/{chunk-WMMY7RIG.js → chunk-PO2MKTNM.js} +2 -2
- package/dist-cli/chunks/{chunk-ZJNPNYR5.js → chunk-QG62KMJO.js} +2 -2
- package/dist-cli/chunks/chunk-QH2JVOUE.js +2 -0
- package/dist-cli/chunks/{chunk-W2FB2Z3E.js → chunk-QWWS5HES.js} +2 -2
- package/dist-cli/chunks/{chunk-2BFOSIPM.js → chunk-RLBHHZ7Q.js} +2 -2
- package/dist-cli/chunks/chunk-RZEIW2HF.js +64 -0
- package/dist-cli/chunks/chunk-SYNYE5TO.js +1 -0
- package/dist-cli/chunks/{chunk-I6UWPHLI.js → chunk-TUEWX5ZK.js} +2 -2
- package/dist-cli/chunks/{chunk-442WEACJ.js → chunk-VGPVE4F4.js} +2 -2
- package/dist-cli/chunks/{chunk-6SGWIJY3.js → chunk-VPUMU5AW.js} +1 -1
- package/dist-cli/chunks/{chunk-YGPNZOCC.js → chunk-VQ5DPLLF.js} +2 -2
- package/dist-cli/chunks/{chunk-WV5M5NOZ.js → chunk-W4RVWX6M.js} +2 -2
- package/dist-cli/chunks/{chunk-7PBQPUC5.js → chunk-WQ3BYT6L.js} +1 -1
- package/dist-cli/chunks/{chunk-55YSYZKQ.js → chunk-WQR3COSG.js} +1 -1
- package/dist-cli/chunks/chunk-YEPCS7AI.js +3 -0
- package/dist-cli/chunks/{chunk-BZF6S6LE.js → chunk-ZBG7W6NB.js} +2 -2
- package/dist-cli/chunks/{chunk-B33UAER2.js → chunk-ZF2YAFTR.js} +1 -1
- package/dist-cli/chunks/{chunk-4PZU4OMU.js → chunk-ZPHWYFVX.js} +2 -2
- package/dist-cli/chunks/{chunk-M4GEAARU.js → chunk-ZVNHBVPN.js} +2 -2
- package/dist-cli/chunks/cli-version-OV3H4YQZ.js +2 -0
- package/dist-cli/chunks/{compat-PR3MUSPJ.js → compat-IFZNDTXD.js} +3 -3
- package/dist-cli/chunks/{config-5OMIVCE4.js → config-5EC44WU2.js} +2 -2
- package/dist-cli/chunks/{control-4VVIBK32.js → control-MUARF7SZ.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-4OWQO3L3.js → cpu-profile-6NAXD4XK.js} +2 -2
- package/dist-cli/chunks/{daemon-FYFIYEIK.js → daemon-NPVAZ2UV.js} +2 -2
- package/dist-cli/chunks/{debug-SXO63EVL.js → debug-275YCTYT.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-2QV7XFDS.js +2 -0
- package/dist-cli/chunks/{detox-A77GD7F5.js → detox-NJK62KDQ.js} +2 -2
- package/dist-cli/chunks/{device-SGHZBJRP.js → device-WORHBYNF.js} +2 -2
- package/dist-cli/chunks/{diagnose-S2Z4JTYT.js → diagnose-2T5UCUZB.js} +2 -2
- package/dist-cli/chunks/drivers-OIPHMFKJ.js +2 -0
- package/dist-cli/chunks/{electron-O7SFQSVH.js → electron-ZUZXGYBI.js} +3 -3
- package/dist-cli/chunks/flow-ADDBJR62.js +2 -0
- package/dist-cli/chunks/{hints-OAIWQ7EA.js → hints-WLSIX5QI.js} +2 -2
- package/dist-cli/chunks/{home-paths-C53PSENO.js → home-paths-FHPG7JDF.js} +2 -2
- package/dist-cli/chunks/{inspect-EKW6OJTH.js → inspect-PB4D35DX.js} +3 -3
- package/dist-cli/chunks/install-BUIMX6TK.js +2 -0
- package/dist-cli/chunks/{install-desktop-QO4G6DRG.js → install-desktop-WK5A6OAT.js} +3 -3
- package/dist-cli/chunks/{keys-TI6GNOJU.js → keys-A4LALALU.js} +2 -2
- package/dist-cli/chunks/{launch-N4XA3JRI.js → launch-RBMKIP3M.js} +3 -3
- package/dist-cli/chunks/{login-6NOQYRSZ.js → login-IXRXVIFH.js} +4 -4
- package/dist-cli/chunks/{logout-KFEGKOGJ.js → logout-XGXHAQU3.js} +2 -2
- package/dist-cli/chunks/{maestro-IVKBIEDU.js → maestro-633VVDZT.js} +2 -2
- package/dist-cli/chunks/{preview-I55Q6Y6U.js → preview-VGFVGFZB.js} +2 -2
- package/dist-cli/chunks/{profile-YBCFWEBL.js → profile-LDX6EHIH.js} +2 -2
- package/dist-cli/chunks/{react-PXLM4OIA.js → react-6LDRB5SE.js} +2 -2
- package/dist-cli/chunks/{record-U35CODEJ.js → record-OHYVAFRN.js} +12 -12
- package/dist-cli/chunks/runtime-AH2JVKAE.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-IFZOTZM2.js → runtime-delivery-YCPQH2CF.js} +2 -2
- package/dist-cli/chunks/{screenshot-2RMAR7WI.js → screenshot-LPRVBOKU.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-XBHC3QNK.js → screenshot-mode-DQLYQ4J3.js} +2 -2
- package/dist-cli/chunks/{screenshots-3TQH4B5L.js → screenshots-Y62YKRVC.js} +2 -2
- package/dist-cli/chunks/{server-SBBT3XEP.js → server-GSCDPJD6.js} +2 -2
- package/dist-cli/chunks/setup-repo-MOIVUVU5.js +2 -0
- package/dist-cli/chunks/{skills-CTB4X7JR.js → skills-5KO7XVQ7.js} +2 -2
- package/dist-cli/chunks/{start-GXHYMB3J.js → start-MJ6AP5WQ.js} +4 -4
- package/dist-cli/chunks/store-VVMMNYXU.js +2 -0
- package/dist-cli/chunks/telemetry-5OQHMDJ6.js +2 -0
- package/dist-cli/chunks/{test-TWD3BN5T.js → test-SWPGWLJQ.js} +3 -3
- package/dist-cli/chunks/{three-mode-MGLLQBMU.js → three-mode-JCSQ72ZH.js} +2 -2
- package/dist-cli/chunks/{timeline-5XLJ7DTD.js → timeline-NTPONVEH.js} +2 -2
- package/dist-cli/chunks/{upgrade-BD4VVPL6.js → upgrade-Y2NECITB.js} +2 -2
- package/dist-cli/chunks/upload-QDOU2W3V.js +2 -0
- package/dist-cli/chunks/web-4DWNKFME.js +2 -0
- package/dist-cli/chunks/{what-happened-IQHMRBPU.js → what-happened-OVPXK3D5.js} +2 -2
- package/dist-cli/chunks/{whoami-QQRYBE6S.js → whoami-HWUWOOYW.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/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.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 +15 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.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/vite-base.cjs +26 -12
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-5CI2KARE.js +0 -2
- package/dist-cli/chunks/beta-KL67MHL3.js +0 -2
- package/dist-cli/chunks/chunk-2KHSIUKR.js +0 -1
- package/dist-cli/chunks/chunk-7KCYWJQ3.js +0 -1
- package/dist-cli/chunks/chunk-LNI4PLS3.js +0 -73
- package/dist-cli/chunks/chunk-LTP23FM5.js +0 -3
- package/dist-cli/chunks/chunk-NGKC2NYN.js +0 -2
- package/dist-cli/chunks/chunk-TWTDJQRF.js +0 -1
- package/dist-cli/chunks/chunk-UXQPRT4K.js +0 -2
- package/dist-cli/chunks/chunk-Z6MJESWJ.js +0 -64
- package/dist-cli/chunks/cli-version-RMUKOTDA.js +0 -2
- package/dist-cli/chunks/demo-app-registry-DCWNJ6PH.js +0 -2
- package/dist-cli/chunks/drivers-OZYC7ZR3.js +0 -2
- package/dist-cli/chunks/flow-SR5APU2B.js +0 -2
- package/dist-cli/chunks/install-34URVPJR.js +0 -2
- package/dist-cli/chunks/runtime-MNPDOQPK.js +0 -2
- package/dist-cli/chunks/setup-repo-3KTI6MSC.js +0 -2
- package/dist-cli/chunks/store-FPX6LBVL.js +0 -2
- package/dist-cli/chunks/telemetry-AB3RD6XQ.js +0 -2
- package/dist-cli/chunks/upload-2NZHCFLX.js +0 -2
- package/dist-cli/chunks/web-6MTG4UE3.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 d,b as g,c as b}from"./chunks/chunk-
|
|
2
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as d,b as g,c as b}from"./chunks/chunk-FFLG37RS.js";import"./chunks/chunk-VGPVE4F4.js";import{a as h,b as l,c as f}from"./chunks/chunk-WQR3COSG.js";import"./chunks/chunk-LL37YEM2.js";import"./chunks/chunk-QH2JVOUE.js";import"./chunks/chunk-FSBYGM4J.js";import"./chunks/chunk-43YUWV4Y.js";import"./chunks/chunk-VPUMU5AW.js";import"./chunks/chunk-3FRJ3IQT.js";import"./chunks/chunk-IX4IMVA5.js";import"./chunks/chunk-5GNIETQW.js";function k(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",k);process.on("uncaughtException",k);var S=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,_=new Set(["preview","electron","install-desktop"]);function E(a){!S||!_.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=f(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-
|
|
10
|
+
`),process.exit(1))}var e=f(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-5OQHMDJ6.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-5OQHMDJ6.js");await t(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-OV3H4YQZ.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-WERQ42O6.js"),m=t?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:v}=await import("./chunks/home-paths-FHPG7JDF.js"),u=v();console.log(u?`runtime v${u}`:"runtime not installed"),await c(0)}e.help&&!e.command&&(d(),await c(0));var o=e.globalFlags.port,n=e.verbose,p=e.globalFlags.device,w=e.globalFlags.theme,O=e.globalFlags.driver,T=e.globalFlags.headless===!0,A=e.globalFlags.sim,s=A?["--sim",A,...e.commandArgs]:e.commandArgs;if(p||w){let{settingsStore:a}=await import("./chunks/store-VVMMNYXU.js"),t={};p&&(t.deviceModel=p),w&&(t.colorScheme=w),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-MJ6AP5WQ.js");await a([],{port:o}),await c(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let a=e.commandArgs.find(t=>!t.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}d(),await c(0)}if(r in l){let a=l[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("-"));r==="shell"||(a&&!t?g(r)&&await c(0):(b(a&&t?t:r),await c(0)))}E(r);if(h.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-IV33JYV7.js"),i=t(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-PB4D35DX.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-HKFZZDIH.js");await a(e.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-ADDBJR62.js"),t=await a(s);process.exit(typeof t=="number"?t:0)}case"test":{let{runTest:a}=await import("./chunks/test-SWPGWLJQ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-NJK62KDQ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-633VVDZT.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-VGFVGFZB.js");await a(e.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-OHYVAFRN.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-LDX6EHIH.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-6NAXD4XK.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-6LDRB5SE.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-LPRVBOKU.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-Y62YKRVC.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-DQLYQ4J3.js");await a(e.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-JCSQ72ZH.js");await a(e.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-PB4D35DX.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-275YCTYT.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-NTPONVEH.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-OVPXK3D5.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-2T5UCUZB.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-IV33JYV7.js"),i=t(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-MUARF7SZ.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-MUARF7SZ.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-MUARF7SZ.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-MUARF7SZ.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-5EC44WU2.js");await a(e.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-WORHBYNF.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-IFZNDTXD.js");await a(e.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-ZUZXGYBI.js");await a(e.commandArgs,{port:o,device:p,driver:O});break}case"login":{let{runLogin:a}=await import("./chunks/login-IXRXVIFH.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-XGXHAQU3.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-HWUWOOYW.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-A4LALALU.js");await a(e.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-MOIVUVU5.js");await a(e.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-BUIMX6TK.js");await a(e.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-WK5A6OAT.js");await a(e.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-GSCDPJD6.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-NPVAZ2UV.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-AH2JVKAE.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-Y2NECITB.js");await a(e.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-RBMKIP3M.js");await a(e.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-MJ6AP5WQ.js");await a(e.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-BOFSQL4D.js"),t=await a(e.commandArgs);process.exit(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-VHXDLJ5Q.js"),t=await a(e.commandArgs);process.exit(t)}case"skills":{let{runSkills:a}=await import("./chunks/skills-5KO7XVQ7.js");await a(e.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-QDOU2W3V.js");await a(e.commandArgs,{port:o,verbose:n});break}case"hints":{let{runHints:a}=await import("./chunks/hints-WLSIX5QI.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.80 | (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-W4RVWX6M.js";import"./chunk-ZF2YAFTR.js";import{c as y}from"./chunk-FFLG37RS.js";import"./chunk-VGPVE4F4.js";import"./chunk-LL37YEM2.js";import"./chunk-QH2JVOUE.js";import"./chunk-FSBYGM4J.js";import"./chunk-43YUWV4Y.js";import"./chunk-VPUMU5AW.js";import"./chunk-3FRJ3IQT.js";import"./chunk-IX4IMVA5.js";import"./chunk-5GNIETQW.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.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-ZF2YAFTR.js";import"./chunk-5GNIETQW.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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-5GNIETQW.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.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-PA6LEZXS.js";import"./chunk-ZPHWYFVX.js";import"./chunk-WQ3BYT6L.js";import"./chunk-3FRJ3IQT.js";import"./chunk-IX4IMVA5.js";import"./chunk-5GNIETQW.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.80 | (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};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as re,e as se,f as oe}from"./chunk-YEPCS7AI.js";import{d as ee}from"./chunk-6NFFFBRU.js";import{a as Z,b as w}from"./chunk-J5TKJD6U.js";import{a as X}from"./chunk-BOBWMEVH.js";import{c as te,e as ne,g as v}from"./chunk-ZPHWYFVX.js";import{createHash as Se}from"crypto";import{readFileSync as le}from"fs";import{gzipSync as ue}from"zlib";function ie(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}function V(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function Ue(e){let t=V(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${r.status}: ${s.slice(0,200)}`)}}async function Pe(e,t=8,r){let s=0,o=0,a=e.length;await Promise.all(Array.from({length:Math.min(t,a)},async()=>{for(;s<a;){let u=e[s++];await Ue(u),o++,r?.(o,a)}}))}function Re(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let a of e.files){let u=r.get(a.urlhash);u&&o.push({url:a.putUrl,contentType:a.contentType,bytes:u})}return e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),o}function xe(e){return e.replace(/\/+$/,"")}var z=class extends Error{constructor(r,s,o,a=""){super(r);this.status=s;this.phase=o;this.responseText=a;this.name="PresignedUploadError"}};async function ae(e){let t=xe(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-soot-admin-upload-bypass"]=e.adminBypassToken);let s=V(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let h=await o.text().catch(()=>"");throw new z(`init failed: ${o.status} ${h.slice(0,200)}`,o.status,"init",h)}let a=await o.json(),u=Re(a,e.bundleBytes,e.filesByHash,e.extras);await Pe(u,e.concurrency??8,e.onPutProgress);let T=V(3e4,"finalize"),p;try{p=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:T.signal})}finally{T.cancel()}if(!p.ok){let h=await p.text().catch(()=>"");throw new z(`finalize failed: ${p.status} ${h.slice(0,200)}`,p.status,"finalize",h)}let O=await p.json();return{init:a,finalize:O}}function Oe(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}var ge=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",fe=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",q="http://localhost:3000";async function _e(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${q}/api/preview/upload/init`,{method:"OPTIONS"});if(t.ok||t.status===204||t.status===405)return q}catch{}return ge}function R(e){return e.replace(/\/$/,"")}function $e(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function ke(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Ee(e,t){return t?R(t):process.env.SOOTSIM_PREVIEW_ORIGIN?R(process.env.SOOTSIM_PREVIEW_ORIGIN):$e(e)?R(e):ke(e)?R(fe):R(e)}function ze(){console.log(`
|
|
3
|
+
sootsim upload \u2014 publish the current bundle as a /preview/<id> link
|
|
4
|
+
|
|
5
|
+
usage:
|
|
6
|
+
sootsim upload [--origin <url>] [--public-origin <url>] [--events <path>] [--sim <sim>] [--open] [--assets-only]
|
|
7
|
+
|
|
8
|
+
options:
|
|
9
|
+
--origin <url> upload target (default: auto)
|
|
10
|
+
prefers ${q} when available, otherwise
|
|
11
|
+
falls back to ${ge}
|
|
12
|
+
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
13
|
+
--public-origin <url>
|
|
14
|
+
public /preview link origin (default: ${fe}
|
|
15
|
+
for prod uploads, upload origin for localhost/custom origins).
|
|
16
|
+
override with SOOTSIM_PREVIEW_ORIGIN env var
|
|
17
|
+
--events <path> path to a gzipped events .jsonl.gz file to attach
|
|
18
|
+
--video <path> path to a webm/mp4/gif flow recording. embedded inline
|
|
19
|
+
in the pr sticky comment served at
|
|
20
|
+
/api/preview/flow-video?id=<share-id>
|
|
21
|
+
--video-duration-ms <ms>
|
|
22
|
+
duration hint for attached flow video
|
|
23
|
+
--sim <sim> target a specific sim (see: sootsim list)
|
|
24
|
+
--open open the resulting /preview/<id> url in the browser
|
|
25
|
+
--assets-only drop API/JSON/HTML records before upload; keep images,
|
|
26
|
+
fonts, css, js, and binary blobs. live-data demos hit
|
|
27
|
+
the real network at replay time instead of serving
|
|
28
|
+
recorded API snapshots
|
|
29
|
+
-h, --help
|
|
30
|
+
|
|
31
|
+
examples:
|
|
32
|
+
sootsim upload
|
|
33
|
+
sootsim upload --origin http://localhost:3000 --open
|
|
34
|
+
sootsim upload --events ./my-session.jsonl.gz
|
|
35
|
+
sootsim upload --video /tmp/soot-flow.webm
|
|
36
|
+
`)}function S(e,t){let r=e.findIndex(o=>o===t);if(r<0)return;let s=e[r+1];return e.splice(r,2),s}function ce(e,t){let r=e.findIndex(s=>s===t);return r<0?!1:(e.splice(r,1),!0)}function de(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function pe(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function Ae(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function Le(e){try{let t=new URL(e);return t.searchParams.get("lazy")==="true"?(t.searchParams.set("lazy","false"),t.toString()):e}catch{return e}}async function He(e,t){let s=[];for(let o=0;o<t;o+=15e5){let a=Math.min(o+15e5,t),u=await v(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${o}, ${a})`);if(typeof u!="string")return null;s.push(u)}return s.join("")}function D(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function Qe(e,t){(e.includes("--help")||e.includes("-h"))&&(ze(),process.exit(0));let r=[...e],s=await _e(S(r,"--origin")),o=Ee(s,S(r,"--public-origin")),a=S(r,"--events"),u=S(r,"--video"),T=S(r,"--video-duration-ms"),p=ce(r,"--open"),O=ce(r,"--assets-only"),h=te(r,{stripBooleanFlags:[],stripValueFlags:[]}),y=ne(h),l,j=[],g=[],A=null;try{if(l=await v(y,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),l?.bundleUrl){let n=new URL(l.bundleUrl).origin,[i,C]=await Promise.all([v(y,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(n)}) || [])`),v(y,`(async () => {
|
|
37
|
+
const list = window.__sootsimListWorkerFetchRecorder
|
|
38
|
+
return typeof list === 'function'
|
|
39
|
+
? await list(${JSON.stringify(n)})
|
|
40
|
+
: []
|
|
41
|
+
})()`)]);j=D([...i,...C]).filter(c=>{try{return!new URL(c.url).pathname.startsWith("/api/")}catch{return!0}});let x=await v(y,`(async () => {
|
|
42
|
+
const rec = window.__sootsimPreviewRecorder
|
|
43
|
+
const workerList = window.__sootsimListWorkerFetchRecorder
|
|
44
|
+
return {
|
|
45
|
+
main: rec?.list ? rec.list() : [],
|
|
46
|
+
worker: typeof workerList === 'function' ? await workerList() : [],
|
|
47
|
+
}
|
|
48
|
+
})()`),U=(x?D([...x.main,...x.worker]):[]).filter(c=>{try{return new URL(c.url).origin!==n}catch{return!1}}),b=U.length>0?{count:U.length,totalBytes:U.reduce((c,P)=>c+(P.size||0),0)}:null;if(b&&b.count>0){console.log(` ${b.count} recorded cross-origin responses (${(b.totalBytes/1024).toFixed(1)} KiB)`);let c=await v(y,`(async () => {
|
|
49
|
+
const rec = window.__sootsimPreviewRecorder
|
|
50
|
+
const workerDump = window.__sootsimDumpWorkerFetchRecorder
|
|
51
|
+
const bundleUrl = ${JSON.stringify(l.bundleUrl)}
|
|
52
|
+
const keep = (r) => {
|
|
53
|
+
try {
|
|
54
|
+
const u = new URL(r.url)
|
|
55
|
+
if (u.origin !== ${JSON.stringify(n)}) return true
|
|
56
|
+
// bundle-origin api responses came from the rewritten
|
|
57
|
+
// /__app-api proxy at record time (re-keyed by the
|
|
58
|
+
// recorder's unwrap step). they need bodies attached the
|
|
59
|
+
// same way as cross-origin records \u2014 direct re-fetch from
|
|
60
|
+
// the dev server lacks the bundle's session cookies.
|
|
61
|
+
if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
|
|
62
|
+
return false
|
|
63
|
+
} catch { return false }
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
main: rec?.dump ? rec.dump().filter(keep) : [],
|
|
67
|
+
worker: typeof workerDump === 'function'
|
|
68
|
+
? (await workerDump()).filter(keep)
|
|
69
|
+
: [],
|
|
70
|
+
}
|
|
71
|
+
})()`);if(g=D([...c.main,...c.worker]),O){let P=g.length;g=g.filter(W=>de(W.contentType));let N=b.totalBytes-g.reduce((W,Ie)=>W+(Ie.size||0),0);console.log(` --assets-only: kept ${g.length}/${P} records (dropped ${(N/1024).toFixed(1)} KiB of API responses)`)}}}l?.transformedBundle&&(A=await He(y,l.transformedBundle.byteLength))}finally{y.close()}l||(console.error(" could not read bundle snapshot \u2014 is sootsim running and is the bundle loaded?"),process.exit(2)),l.bundleUrl||(console.error(` no ?bundle= URL on the current sootsim tab.
|
|
72
|
+
open the app you want to share first (e.g. sootsim open 8082), then run upload.`),process.exit(2));let d,L=!1;if(A!==null)d=new TextEncoder().encode(A),L=!0,console.log(` using post-transform bundle: ${(d.byteLength/1024).toFixed(1)} KiB`);else{let n=Le(l.bundleUrl);n!==l.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),d=await pe(n),console.log(` main bundle: ${(d.byteLength/1024).toFixed(1)} KiB`)}let _=j.filter(n=>n.url!==l.bundleUrl);O&&(_=_.filter(n=>de(n.contentType))),console.log(` fetching ${_.length} extra files\u2026`);let $=(await Promise.all(_.map(async n=>{try{let i=await pe(n.url);return{...n,bytes:i}}catch(i){return console.error(` warning: failed to re-fetch ${n.url}: ${i instanceof Error?i.message:i}`),null}}))).filter(n=>!!n),he=$.reduce((n,i)=>n+i.bytes.byteLength,0);console.log(` ${$.length} extra files: ${(he/1024).toFixed(1)} KiB`);let m;a&&(m=le(a));let f,k,G;if(u){if(f=le(u),k=u.endsWith(".mp4")?"video/mp4":u.endsWith(".gif")?"image/gif":"video/webm",T){let n=Number(T);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${T}`),await w(),process.exit(1)),G=Math.round(n)}console.log(` attaching flow video: ${(f.byteLength/1024).toFixed(1)} KiB (${k})`)}let B=re(),I=oe(B),ye=X();Z({event:"preview_upload_started",identity:{userId:B?.kind==="session"?ye?.user?.id??null:null,repoId:I?.repoId??null,installationId:I?.installationId??null},properties:{origin:s,hasAuth:!!B,authMode:B?.kind??"none",bundleBytes:d.byteLength,isTransformed:L,extraFiles:$.length,recordedFetches:g.length,hasEvents:!!m,hasVideo:!!f}}),B||(console.error(" preview uploads need auth."),console.error(" set SOOTSIM_API_KEY=sk_sootsim_..., run `sootsim login`, or use the soot github runner."),await w(),process.exit(1));let me=se(B),be=(()=>{try{return new URL(l.bundleUrl).origin}catch{return null}})(),J=(n,i,C,x,Q,U,b,c)=>{let P=ie(U),N=P?ue(n):n;return{url:i,urlhash:C,method:x,bodyHash:Q,requestVaryHash:c,contentType:U,responseHeaders:b,bytes:N,encoding:P?"gzip":void 0}},H=[...$.map(n=>J(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...g.map(n=>J(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash))],F=ue(d),we=Se("sha256").update(d).digest("hex");console.log(` bundle raw=${(d.byteLength/1024).toFixed(1)} KiB gz=${(F.byteLength/1024).toFixed(1)} KiB`);let ve={contentHash:we,bundleSizeBytes:d.byteLength,bundleContentType:Ae(l.bundleUrl),bundleEncoding:"gzip",bundleOrigin:be,entry:l.entry,isTransformed:L,deviceSpec:l.deviceSpec,installationId:I?.installationId??void 0,repoId:I?.repoId,owner:I?.owner,repo:I?.repo,files:H.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,requestVaryHash:n.requestVaryHash,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:m?{sizeBytes:m.byteLength}:void 0,flowVideo:f&&k?{sizeBytes:f.byteLength,contentType:k,durationMs:G}:void 0},K=new Map;for(let n of H)K.set(n.urlhash,n.bytes);let Te=Date.now(),E=F.byteLength;for(let n of H)E+=n.bytes.byteLength;m&&(E+=m.byteLength),f&&(E+=f.byteLength);let Be=`${R(s)}/api/preview/upload/init`;console.log(` init: ${Be}`);let M;try{let n=await ae({originBase:s,initBody:ve,bundleBytes:F,filesByHash:K,extras:{eventsBytes:m,videoBytes:f},authHeader:me,concurrency:16});M=n.finalize;let i=1+n.init.files.length+(n.init.events?1:0)+(n.init.flowVideo?1:0);console.log(` PUT ${i} objects in ${Date.now()-Te}ms (${(E/1024).toFixed(1)} KiB)`)}catch(n){let i=n;i.phase==="init"&&i.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `sootsim login` and retry."),await w(),process.exit(1)),i.status===402&&(console.error(` ${Oe(i.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await w(),process.exit(1)),console.error(` ${i.message??`${i.phase??"upload"} failed: ${String(n)}`}`),await w(),process.exit(1)}let Y=`${o}${M.url}`;console.log(`
|
|
73
|
+
stored ${M.filesStored??0} extra files`),console.log(` preview: ${Y}`),p&&await ee(Y),await w()}export{_e as a,Ee as b,Qe as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var d=Object.defineProperty;var e=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var f=(a,b)=>{for(var c in b)d(a,c,{get:b[c],enumerable:!0})};export{e as a,f as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{g as w,i as u,j as m,k as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{g as w,i as u,j as m,k as l}from"./chunk-VPUMU5AW.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.80 | (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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d}from"./chunk-ZPHWYFVX.js";import{a as p,d as w,h as $,j as y}from"./chunk-F6I3D46Z.js";import{A as g,B as f,i as h,y as m,z as a}from"./chunk-IX4IMVA5.js";import b from"fs";import{WebSocket as D}from"ws";async function P(n,e={}){let[o,...t]=n;if(!o||o==="--help"||o==="-h"){R();return}switch(o){case"install":return O(t,e);case"list":case"ls":return S(t);case"use":return T(t);case"remove":case"rm":return N(t);case"which":case"active":return F();default:console.error(` unknown runtime subcommand: ${o}`),R(),process.exit(1)}}function R(){console.log(`
|
|
3
3
|
sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -22,4 +22,4 @@ examples:
|
|
|
22
22
|
sootsim runtime install 1.2.3
|
|
23
23
|
sootsim runtime install --channel beta
|
|
24
24
|
sootsim runtime use 1.2.3
|
|
25
|
-
`)}async function O(n,e){let{version:o,flags:t}=_(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await y({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await k(i.version)}catch(i){console.error(` ${I(i)}`),process.exit(1)}}async function k(n){g(n),console.log(` active: ${n}`),await A(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function A(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-
|
|
25
|
+
`)}async function O(n,e){let{version:o,flags:t}=_(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await y({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await k(i.version)}catch(i){console.error(` ${I(i)}`),process.exit(1)}}async function k(n){g(n),console.log(` active: ${n}`),await A(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function A(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-FHPG7JDF.js"),t=o();if(!e(t))return!1;let s=d();return new Promise(l=>{let c=!1,i=!1,u=x=>{c||(c=!0,l(x))},r=new D(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),v=setTimeout(()=>{try{r.close()}catch{}u(i)},1500);r.on("open",()=>{try{r.send(JSON.stringify({type:"runtime:use",version:n,id:0})),i=!0}catch{}setTimeout(()=>{try{r.close()}catch{}},100)}),r.on("close",()=>{clearTimeout(v),u(i)}),r.on("error",()=>{clearTimeout(v),u(!1)})})}async function S(n){m();let e=f(),o=a();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let t of e)console.log(` ${t===o?"*":" "} ${t}`);try{let t=await $();console.log("available (latest per channel):");for(let[s,l]of Object.entries(t.channels))console.log(` ${s.padEnd(8)} ${l.latest}`)}catch(t){console.log(`available: (could not fetch manifest: ${I(t)})`)}}async function T(n){let e=n[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let o=f();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await k(e)}async function N(n){let e=n[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),a()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let t=h(e);if(!b.existsSync(t)){console.error(` ${e} is not installed`);return}b.rmSync(t,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function F(){let n=a();if(!n){console.log(" no active runtime");return}console.log(n)}function _(n){let e={},o=[];for(let t=0;t<n.length;t++){let s=n[t];if(s==="--channel"&&t+1<n.length){e.channel=n[t+1],t++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function I(n){return n instanceof Error?n.message:String(n)}export{P as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{l as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{l as d}from"./chunk-IX4IMVA5.js";import{chmodSync as f,existsSync as g,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as p}from"node:path";var s=1,m="SOOTSIM_SHARED_AUTH_FILE",u="https://sootbean.com";function w(){let t=process.env[m];return t?.trim()?c(p(t)):d()}function a(){let t=process.env[m];return t?.trim()?p(t):D(w(),"desktop-auth.json")}function S(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:S(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function O(){let t=a();if(!g(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=v(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function b(t){let e=a();k(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?S(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
|
|
3
3
|
`);try{f(e,384)}catch{}return r}function l(){i(a(),{force:!0})}async function U(t){let e=O();if(!e?.token)return null;let r=t||e.origin||u;try{let n=await fetch(`${r.replace(/\/$/,"")}/api/auth/me`,{headers:{authorization:`Bearer ${e.token}`}});if(n.status===401)return l(),null;if(!n.ok)return e;let o=await n.json();return o.user?.id?b({token:e.token,user:o.user,origin:r,source:e.source,validatedAt:new Date().toISOString()}):(l(),null)}catch{return e}}export{O as a,b,l as c,U as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-RZEIW2HF.js";var C="sootsimConfig";function m(e){return!!e&&Object.keys(e).length>0}function U(e){return e?m(e.modules)||m(e.turboModules)||m(e.nativeModules)||m(e.env)||m(e.settings)||m(e.initialState):!1}function x(e,r){let t=new URL(e);return U(r)?t.searchParams.set(C,JSON.stringify(r)):t.searchParams.delete(C),t.toString()}import{exec as E}from"child_process";import A from"http";import N from"net";import{promisify as L}from"util";var ee="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function _(e){return/^https?:\/\//i.test(e)}function D(e){return e.endsWith(".bundle")}function T(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function k(e){try{let r=_(e),t=new URL(e,"http://soot.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),D(t.pathname)?(t.searchParams.delete("transform.bytecode"),T(t),r?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}var v=L(E),$=250,O=1500,I=120;function B(e,r=I){return new Promise(t=>{let o=new N.Socket,s=!1,i=u=>{s||(s=!0,o.destroy(),t(u))};o.setTimeout(r),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,r,t="GET",o=$,s={}){return new Promise(i=>{let u=A.request({hostname:"localhost",port:e,path:r,method:t,timeout:o,headers:s},n=>{let a="";n.on("data",l=>a+=l.toString());let c=(()=>{let l=n.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();n.on("end",()=>i({statusCode:n.statusCode||0,body:a,contentType:c}))});u.on("error",()=>i(null)),u.setTimeout(o,()=>{u.destroy(),i(null)}),u.end()})}var H=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function P(e,r){return!(e<=0||e>=2e4||r.has(e)||e>=5170&&e<=5200)}async function j(e=[]){let r=new Set(e);try{let{stdout:t}=await v("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
|
|
3
3
|
`)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let u=Number(i[1]),a=i[8].match(/:(\d+)$/);if(!a)continue;let c=Number(a[1]);P(c,r)&&(o.has(c)||o.set(c,u))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:t}=await v(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
|
|
4
4
|
`)){let i=s.match(/:(\d+)\s/),u=s.match(/pid=(\d+)/);if(!i)continue;let n=Number(i[1]),a=u?Number(u[1]):0;P(n,r)&&(o.has(n)||o.set(n,a))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return H.filter(t=>P(t.port,r))}var y=new Map;async function W(e){if(e<=0)return null;let r=y.get(e);if(r)return r;try{let{stdout:t}=await v(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let o of t.split(`
|
|
5
5
|
`))if(o.startsWith("n")&&o.length>1){let s=o.slice(1).trim();if(s)return y.set(e,s),s}}catch{}return null}function F(e,r){return{port:e,framework:r,bundleUrl:p(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function p(e,r){let t=R.find(s=>s.preferredPort===e),o=t?.runtimeConfig?x(r,t.runtimeConfig):r;return k(o)}function G(e){return e.includes("/node_modules/one/metro-entry.bundle")}function z(e){try{let r=JSON.parse(e);return r&&typeof r=="object"?r:null}catch{return null}}function b(e,r,t){if(!r)return e;try{let o=JSON.parse(r.body),s=o?.extra?.expoClient||o?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=o?.launchAsset?.url;i&&!e.patched&&!G(e.bundleUrl)&&(e.bundleUrl=p(e.port,i));let u=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(u)if(e.iconPath=u,t)if(u.startsWith("http"))e.iconUrl=t(u);else{let n=u.replace(/^\.\//,"");e.iconUrl=t(`http://localhost:${e.port}/assets/${n}`)}else e.iconUrl=u.startsWith("http")?u:`http://localhost:${e.port}/assets/${u.replace(/^\.\//,"")}`}catch{}return e}var d=new Set,f=new Set,S=new Set;async function J(e,r){if(!await B(e))return null;let t="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[o,s,i,u,n]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),h(e,t,"HEAD"),S.has(e)?Promise.resolve(null):h(e,"/","GET",O,{"expo-platform":"ios"}),f.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);n&&n.statusCode===200?f.delete(e):f.has(e)||f.add(e);let a=u?z(u.body):null,c=typeof a?.launchAsset?.url=="string"?a.launchAsset.url:null,l=a?.extra?.expoClient||a?.extra||{};if(a&&(c||typeof l.name=="string")){d.add(e);let g=c||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,M=g.includes("/one/metro-entry.bundle")?"one":"expo";return b({port:e,framework:M,bundleUrl:p(e,g),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},u,r)}return i&&i.statusCode>0&&i.statusCode<400&&/application\/javascript/i.test(i.contentType||"")?(d.add(e),S.add(e),b({port:e,framework:"one",bundleUrl:p(e,`http://localhost:${e}${t}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},u,r)):s&&s.body.includes("packager-status:running")?(d.add(e),b(F(e,n&&n.statusCode===200?"expo":"metro"),u,r)):o&&o.statusCode===200&&o.body.includes("sootsim-patched")?(d.delete(e),b({port:e,framework:"one",bundleUrl:p(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},u,r)):(d.add(e),null)}function K(e){let r=e.projectName?.trim().toLowerCase();return!!(r==="soot"||r==="sootsim"||e.bundleId?.trim().toLowerCase()?.startsWith("dev.soot"))}var w=new Map,V=3e4,q=1500;function Q(e){return!e||e.framework==="metro"||e.framework==="unknown"}function Y(e){return e?p(e.port,e.bundleUrl)===e.bundleUrl:!0}function X(e,r,t=Date.now()){if(r===0||e.pid!==r||!Y(e.result))return!1;let o=t-e.cachedAt;return!(e.result===null&&o>=V||Q(e.result)&&o>=q)}async function ce(e={}){let r=await j(e.excludePorts),t=new Set(r.map(n=>n.port));for(let n of[...w.keys()])t.has(n)||w.delete(n);for(let n of[...d])t.has(n)||d.delete(n);for(let n of[...f])t.has(n)||f.delete(n);for(let n of[...S])t.has(n)||S.delete(n);let o=[],s=[];for(let{port:n,pid:a}of r){let c=w.get(n);if(c&&X(c,a)){c.result&&o.push(c.result);continue}c&&c.pid!==a&&(d.delete(n),f.delete(n),S.delete(n)),s.push({port:n,pid:a})}s.length>0&&(await Promise.all(s.map(a=>J(a.port,e.buildIconProxyUrl)))).forEach((a,c)=>{let{port:l,pid:g}=s[c];g!==0&&w.set(l,{pid:g,result:a,cachedAt:Date.now()}),a&&o.push(a)});let i=new Map;for(let{port:n,pid:a}of r)a>0&&i.set(n,a);await Promise.all(o.map(async n=>{let a=i.get(n.port);if(!a)return;n.pid=a;let c=await W(a);c&&(n.cwd=c)}));let u=new Set(i.values());for(let n of[...y.keys()])u.has(n)||y.delete(n);return o.filter(n=>!K(n))}export{x as a,ee as b,k as c,J as d,ce as e};
|
|
@@ -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.80 | (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-IX4IMVA5.js";import{spawn as I}from"child_process";import C from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as M}from"stream/promises";var N="https://sootbean.com",D="SOOTSIM_CDN_ORIGIN",E="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(O(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function d(e){let t=$();return(e||process.env[D]||t.cdnOrigin||N).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[E]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${d(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function P(e,t){return`${d(t)}/runtimes/sootsim-runtime-${e}.tar.gz`}async function y(e){let t=T(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function U(e,t={}){let r=x(t.channel),n=t.version||e.channels[r]?.latest;if(!n)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let i=e.versions[n];if(!i)throw new Error(`version ${n} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:n,channel:r,entry:i}}async function V(e={}){v();let t=d(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=U(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let g=o.tarball||P(n,t),m=l.join(S(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(g,m),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await j(m);if(h!==o.sha256)throw s.rmSync(m,{force:!0}),new Error(`sha256 mismatch for runtime ${n}: expected ${o.sha256}, actual ${h}`);let u=l.join(l.dirname(a),`.installing-${n}-${process.pid}`);s.rmSync(u,{recursive:!0,force:!0}),s.mkdirSync(u,{recursive:!0});try{if(await A(m,u),!s.existsSync(l.join(u,"index.html")))throw new Error(`extracted tarball for runtime ${n} is missing index.html`);s.rmSync(a,{recursive:!0,force:!0}),s.renameSync(u,a)}catch(b){throw s.rmSync(u,{recursive:!0,force:!0}),b}return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function q(e={}){v();let t=d(e.cdnOrigin),r=x(e.channel),n=await y(t),i=n.channels[r]?.latest;if(!i)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:f()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:f(),latestVersion:i};let a=f(),c=a?p(a):null,g=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!g||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await V({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function B(e={}){let t=f();try{let r=await y(d(e.cdnOrigin)),n=x(e.channel),i=r.channels[n]?.latest??null,o=!!(i&&(!t||w(i,t)>0));return{active:t,latest:i,outdated:o}}catch{return{active:t,latest:null,outdated:!1}}}async function _(e,t){let r=await fetch(e);if(!r.ok||!r.body)throw new Error(`download failed: ${r.status} ${r.statusText} (${e})`);s.mkdirSync(l.dirname(t),{recursive:!0});let n=`${t}.partial`;try{await M(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function j(e){return new Promise((t,r)=>{let n=C.createHash("sha256"),i=s.createReadStream(e);i.on("data",o=>n.update(o)),i.on("error",r),i.on("end",()=>t(n.digest("hex")))})}function A(e,t){return new Promise((r,n)=>{let i=I("tar",["-xzf",e,"-C",t],{stdio:["ignore","inherit","inherit"]});i.on("error",n),i.on("exit",o=>{o===0?r():n(new Error(`tar exited with code ${o}`))})})}export{N as a,D as b,E as c,d,x as e,T as f,P as g,y as h,U as i,V as j,q as k,B as l};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as r}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as r}from"./chunk-VGPVE4F4.js";import{a as s,b as i,c as l}from"./chunk-LL37YEM2.js";import{a as t}from"./chunk-QH2JVOUE.js";import{a as u,d}from"./chunk-FSBYGM4J.js";import{a as p}from"./chunk-43YUWV4Y.js";import{z as a}from"./chunk-IX4IMVA5.js";function m(){let o=a();return`sootsim CLI v${p()} \xB7 runtime ${o?`v${o}`:"not installed"}`}function I(){let o=i({bridgePort:7668,defaultShellUrl:t},r()),e=`
|
|
3
3
|
${d}
|
|
4
4
|
`;console.log(`${m()}
|
|
5
5
|
${e}${o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.80 | (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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function k(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=e.indexOf(r);if(s>=0&&e[s+1]){let a=Number(e[s+1]);if(Number.isFinite(a))return Math.max(100,a)}}return t}async function E(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function P(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function A(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function L(e,t){let n=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.80 | (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,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-BOBWMEVH.js";import{w as o}from"./chunk-IX4IMVA5.js";function u(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!o()}function a(){if(u())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let t=process.env.SOOT_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:t.replace(/\/+$/,"")}}function c(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:"anonymous-cli":"anonymous-cli"}function p(e){let t=e.identity??{},n={$lib:"soot-cli",source:t.source??"cli",...e.properties};return t.userId&&(n.userId=t.userId),t.repoId&&(n.repoId=t.repoId),t.installationId!=null&&(n.installationId=String(t.installationId)),t.shareId&&(n.shareId=t.shareId),t.plan&&(n.plan=t.plan),{event:e.event,distinct_id:c(t),properties:n,timestamp:new Date().toISOString()}}var r=[],l=!1;async function i(){if(r.length===0)return;let e=a();if(!e){r.length=0;return}let t=r.splice(0,r.length).map(p);try{await fetch(`${e.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:e.apiKey,batch:t}),signal:AbortSignal.timeout(2e3)})}catch{}}function d(){l||(l=!0,process.on("beforeExit",()=>{i()}),process.on("exit",()=>{i()}))}function h(e){if(u())return;d();let t=null;try{t=s()?.user?.id??null}catch{t=null}r.push({...e,identity:{source:"cli",userId:t,...e.identity}})}async function g(){await i()}export{h as a,g as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.80 | (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{b as Ns}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.80 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as Ns}from"./chunk-5GNIETQW.js";var ui=`(async () => {
|
|
3
3
|
try { localStorage.clear() } catch {}
|
|
4
4
|
try { sessionStorage.clear() } catch {}
|
|
5
5
|
try {
|