sootsim 0.1.125 → 0.1.126
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-TMQFLKPM.js → agent-XQDT2A2E.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-MI2RWK3D.js → agent-wrapper-ZIBULEDW.js} +2 -2
- package/dist-cli/chunks/{app-fonts-QKQGY2CT.js → app-fonts-J772RW3P.js} +2 -2
- package/dist-cli/chunks/{assert-7MQMKTB2.js → assert-LQ7RLUYW.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-5ORFQ7N7.js +2 -0
- package/dist-cli/chunks/beta-PECTKFDT.js +2 -0
- package/dist-cli/chunks/{chunk-SX5TEBK7.js → chunk-27SE7NM3.js} +2 -2
- package/dist-cli/chunks/{chunk-JF5I5XZH.js → chunk-2MMSLN4J.js} +2 -2
- package/dist-cli/chunks/{chunk-7565HNNY.js → chunk-2OLYZLVT.js} +75 -13
- package/dist-cli/chunks/chunk-2YI3QEGS.js +1 -0
- package/dist-cli/chunks/{chunk-Q426SNAV.js → chunk-46ALP2DD.js} +3 -3
- package/dist-cli/chunks/{chunk-JWMYDUYB.js → chunk-4F2WVZZP.js} +1 -1
- package/dist-cli/chunks/{chunk-YBFN6GLT.js → chunk-4HITITPE.js} +1 -1
- package/dist-cli/chunks/{chunk-N4KSAFXN.js → chunk-5X6X5LES.js} +1 -1
- package/dist-cli/chunks/{chunk-L7DT6B6A.js → chunk-AK7USIKQ.js} +2 -2
- package/dist-cli/chunks/{chunk-S33UAEVN.js → chunk-BBIGYURM.js} +1 -1
- package/dist-cli/chunks/{chunk-WFPQZ3U2.js → chunk-CQCMQFKK.js} +2 -2
- package/dist-cli/chunks/{chunk-HKYI3SXR.js → chunk-DA2PKV6Q.js} +2 -2
- package/dist-cli/chunks/{chunk-PVSGLWUQ.js → chunk-DDK42V36.js} +2 -2
- package/dist-cli/chunks/{chunk-V5AQVSWE.js → chunk-E2BIG4B3.js} +2 -2
- package/dist-cli/chunks/{chunk-R3YPAJKJ.js → chunk-E2X36IZI.js} +1 -1
- package/dist-cli/chunks/{chunk-DFMCHE2N.js → chunk-EGWYXC2Z.js} +2 -2
- package/dist-cli/chunks/{chunk-RJSGOTB5.js → chunk-G6DP2CFJ.js} +1 -1
- package/dist-cli/chunks/{chunk-344G6B3N.js → chunk-GLBMBO3X.js} +1 -1
- package/dist-cli/chunks/{chunk-XK55CEAQ.js → chunk-I2VAJ6SU.js} +3 -3
- package/dist-cli/chunks/{chunk-BIZBFZJY.js → chunk-IV4WDF54.js} +1 -1
- package/dist-cli/chunks/{chunk-EAQGB3YG.js → chunk-JQZUUDUN.js} +2 -2
- package/dist-cli/chunks/{chunk-BVKPXLEI.js → chunk-JWU65JVV.js} +1 -1
- package/dist-cli/chunks/{chunk-MAFDEPT6.js → chunk-KRLC6R5H.js} +2 -2
- package/dist-cli/chunks/{chunk-LN2UCRNK.js → chunk-LHXYIEZM.js} +1 -1
- package/dist-cli/chunks/chunk-LIICOU6Q.js +1 -0
- package/dist-cli/chunks/{chunk-YWZNEVYP.js → chunk-MJH6XTIY.js} +2 -2
- package/dist-cli/chunks/{chunk-SUWMHUJC.js → chunk-N3F5BP3M.js} +2 -2
- package/dist-cli/chunks/{chunk-DSR43SNY.js → chunk-NJ3435S4.js} +2 -2
- package/dist-cli/chunks/{chunk-HB7AHLC3.js → chunk-NONHFWQS.js} +2 -2
- package/dist-cli/chunks/chunk-NQJEALRY.js +1 -0
- package/dist-cli/chunks/{chunk-2AMF34XM.js → chunk-OTSWADHN.js} +1 -1
- package/dist-cli/chunks/chunk-OXWCMDNR.js +2 -0
- package/dist-cli/chunks/{chunk-TLFLH5ZC.js → chunk-OZSRMPSC.js} +2 -2
- package/dist-cli/chunks/{chunk-WVHJC5IC.js → chunk-QMPDHXRG.js} +2 -2
- package/dist-cli/chunks/{chunk-JOM2DZPL.js → chunk-R5DF7ZN7.js} +2 -2
- package/dist-cli/chunks/{chunk-MPX3A64M.js → chunk-R677VUUU.js} +1 -1
- package/dist-cli/chunks/{chunk-YRAYBIM5.js → chunk-RA3KPNRU.js} +2 -2
- package/dist-cli/chunks/{chunk-LDYNWRUI.js → chunk-TWAHJXNZ.js} +1 -1
- package/dist-cli/chunks/{chunk-W22TO5UO.js → chunk-W2RSCYDO.js} +1 -1
- package/dist-cli/chunks/{chunk-G3LKP7QV.js → chunk-W77EWJQA.js} +1 -1
- package/dist-cli/chunks/{chunk-YCWEOYJ7.js → chunk-WTSJ25RM.js} +2 -2
- package/dist-cli/chunks/{chunk-MW4OBNQC.js → chunk-XXNPMLXX.js} +3 -3
- package/dist-cli/chunks/{chunk-QZFUBR6C.js → chunk-Z72KJG4K.js} +2 -2
- package/dist-cli/chunks/{chunk-VO6U3ATJ.js → chunk-ZHJP6ENB.js} +2 -2
- package/dist-cli/chunks/cli-version-W4R5JOIM.js +2 -0
- package/dist-cli/chunks/{compat-JFXOOOOU.js → compat-KIIVGF6J.js} +3 -3
- package/dist-cli/chunks/{config-GFDWAKAZ.js → config-JFMHR2HE.js} +2 -2
- package/dist-cli/chunks/control-RNZSJAPQ.js +2 -0
- package/dist-cli/chunks/{cpu-profile-DDXXSU7Z.js → cpu-profile-3665LRD7.js} +2 -2
- package/dist-cli/chunks/{daemon-WNXU7ZNH.js → daemon-MDO3JYOH.js} +2 -2
- package/dist-cli/chunks/{debug-SXQD427O.js → debug-ARJ47K5P.js} +3 -3
- package/dist-cli/chunks/{detox-D4LSO32X.js → detox-72O6RLWW.js} +2 -2
- package/dist-cli/chunks/{device-LLY5W2PV.js → device-JARX3ONX.js} +2 -2
- package/dist-cli/chunks/{diagnose-TWY5FNQT.js → diagnose-ABHCJXCR.js} +2 -2
- package/dist-cli/chunks/drivers-6GTIP5QQ.js +2 -0
- package/dist-cli/chunks/{electron-BNDUCNBS.js → electron-G45U77TI.js} +3 -3
- package/dist-cli/chunks/flow-NLXHSQKP.js +2 -0
- package/dist-cli/chunks/help-BPIZ5CUD.js +2 -0
- package/dist-cli/chunks/{hints-U7Z7BKVC.js → hints-HM2ZYYIF.js} +2 -2
- package/dist-cli/chunks/{home-paths-BGHXDJYV.js → home-paths-232EBQYF.js} +2 -2
- package/dist-cli/chunks/{inspect-7MOP5JYW.js → inspect-YAG4RCQP.js} +3 -3
- package/dist-cli/chunks/install-PGEVZLOP.js +2 -0
- package/dist-cli/chunks/{install-desktop-MXAFEYOG.js → install-desktop-2PS3QFFK.js} +3 -3
- package/dist-cli/chunks/{keys-KDLUFI4P.js → keys-RRLRCDVB.js} +2 -2
- package/dist-cli/chunks/{launch-WDO73PK6.js → launch-65QAKBP6.js} +3 -3
- package/dist-cli/chunks/{login-7DTL6D72.js → login-VIYE4EAD.js} +4 -4
- package/dist-cli/chunks/{logout-XTKHXGWS.js → logout-ZI5LAJSV.js} +2 -2
- package/dist-cli/chunks/{maestro-QOAHZZNA.js → maestro-QD3LGRO7.js} +2 -2
- package/dist-cli/chunks/{preview-JGSC3EGX.js → preview-6CDC72XL.js} +2 -2
- package/dist-cli/chunks/{profile-P5IIGGN6.js → profile-4AYZP2AY.js} +2 -2
- package/dist-cli/chunks/{react-XUJ47FVL.js → react-FWQNHHU4.js} +2 -2
- package/dist-cli/chunks/{record-BBFCP57M.js → record-WNBQGMEW.js} +2 -2
- package/dist-cli/chunks/runtime-G23B2OOP.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-RGSGXTGK.js → runtime-delivery-QCPOLACM.js} +2 -2
- package/dist-cli/chunks/{screenshot-5J4I32FT.js → screenshot-YDRH5NYM.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-CFF7I73M.js → screenshot-mode-MWOV4YH5.js} +2 -2
- package/dist-cli/chunks/{screenshots-XCX3FUCB.js → screenshots-IVCQ4UP3.js} +2 -2
- package/dist-cli/chunks/{server-XLC7CVF4.js → server-NOUN6O5W.js} +3 -3
- package/dist-cli/chunks/setup-repo-UKUBUILR.js +2 -0
- package/dist-cli/chunks/{skills-ZXROA432.js → skills-ITSSQ57N.js} +2 -2
- package/dist-cli/chunks/{start-FOZE6SSC.js → start-MTBOHVZB.js} +4 -4
- package/dist-cli/chunks/store-3J3EUL4Z.js +2 -0
- package/dist-cli/chunks/telemetry-HVCJILV6.js +2 -0
- package/dist-cli/chunks/{test-ZJVCSOAS.js → test-GDUXGV4Z.js} +3 -3
- package/dist-cli/chunks/{three-mode-SNKIUD3Z.js → three-mode-U24VQDZC.js} +2 -2
- package/dist-cli/chunks/{timeline-KM6FMIW3.js → timeline-JSHRI4CQ.js} +2 -2
- package/dist-cli/chunks/{upgrade-HGVZ3VLY.js → upgrade-V4VYWIRP.js} +2 -2
- package/dist-cli/chunks/upload-P7IGFL7I.js +2 -0
- package/dist-cli/chunks/{version-QRWV5GJF.js → version-FDCSFJWE.js} +2 -2
- package/dist-cli/chunks/{web-YBMD3KIN.js → web-SMWZNE4P.js} +2 -2
- package/dist-cli/chunks/{what-happened-4M6BJK4Q.js → what-happened-T74NXSMP.js} +2 -2
- package/dist-cli/chunks/{whoami-Z4XW7B7W.js → whoami-ZVUNQW67.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 +64 -2
- package/dist-lib/sdk.mjs +64 -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-7ACFJL6A.js +0 -2
- package/dist-cli/chunks/beta-MAZIBPYH.js +0 -2
- package/dist-cli/chunks/chunk-DLKP3ARC.js +0 -1
- package/dist-cli/chunks/chunk-EGRWEXWI.js +0 -2
- package/dist-cli/chunks/chunk-ESOLWKGM.js +0 -1
- package/dist-cli/chunks/chunk-INBGGIAY.js +0 -1
- package/dist-cli/chunks/cli-version-CKN7AEYL.js +0 -2
- package/dist-cli/chunks/control-FXZUUFHY.js +0 -2
- package/dist-cli/chunks/drivers-YWYAKTA4.js +0 -2
- package/dist-cli/chunks/flow-BFSMTEGF.js +0 -2
- package/dist-cli/chunks/help-VXIFMK5V.js +0 -2
- package/dist-cli/chunks/install-6ZRS7EC5.js +0 -2
- package/dist-cli/chunks/runtime-P7GE3W7Y.js +0 -2
- package/dist-cli/chunks/setup-repo-JB6C7PT3.js +0 -2
- package/dist-cli/chunks/store-YYITLIOL.js +0 -2
- package/dist-cli/chunks/telemetry-FJO3ZTS3.js +0 -2
- package/dist-cli/chunks/upload-6PNSQEKU.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.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as u,b as d,c as g}from"./chunks/chunk-E2X36IZI.js";import"./chunks/chunk-OTSWADHN.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
|
|
4
4
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
5
5
|
`):process.stderr.write(`${e}
|
|
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 t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-
|
|
10
|
+
`),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-HVCJILV6.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-HVCJILV6.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-W4R5JOIM.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-PECTKFDT.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-232EBQYF.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-BPIZ5CUD.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-3J3EUL4Z.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-MTBOHVZB.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-BPIZ5CUD.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-BPIZ5CUD.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-BPIZ5CUD.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-5ORFQ7N7.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-YAG4RCQP.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-LQ7RLUYW.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-NLXHSQKP.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-GDUXGV4Z.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-72O6RLWW.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-QD3LGRO7.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-6CDC72XL.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-WNBQGMEW.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-4AYZP2AY.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-3665LRD7.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-FWQNHHU4.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-YDRH5NYM.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-IVCQ4UP3.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-MWOV4YH5.js");await a(t.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-U24VQDZC.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-YAG4RCQP.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-ARJ47K5P.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-JSHRI4CQ.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-T74NXSMP.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-ABHCJXCR.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-5ORFQ7N7.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-RNZSJAPQ.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-RNZSJAPQ.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-RNZSJAPQ.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-RNZSJAPQ.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-JFMHR2HE.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-JARX3ONX.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-KIIVGF6J.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-G45U77TI.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-VIYE4EAD.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-ZI5LAJSV.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-ZVUNQW67.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-RRLRCDVB.js");await a(t.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-UKUBUILR.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-PGEVZLOP.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-2PS3QFFK.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-NOUN6O5W.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-MDO3JYOH.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-G23B2OOP.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-V4VYWIRP.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-FDCSFJWE.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-65QAKBP6.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-MTBOHVZB.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-XQDT2A2E.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-ZIBULEDW.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-ITSSQ57N.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-P7IGFL7I.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-J772RW3P.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-HM2ZYYIF.js");a(t.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 E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-DDK42V36.js";import"./chunk-TWAHJXNZ.js";import{c as b}from"./chunk-WTSJ25RM.js";import"./chunk-KRLC6R5H.js";import"./chunk-IV4WDF54.js";import"./chunk-OXWCMDNR.js";import"./chunk-4HITITPE.js";import"./chunk-4F2WVZZP.js";import"./chunk-W77EWJQA.js";import"./chunk-GLBMBO3X.js";import{h as y,i as $}from"./chunk-R677VUUU.js";import"./chunk-OTSWADHN.js";import w from"node:fs";import d from"node:path";import{spawn as F}from"node:child_process";import B from"node:net";import{WebSocket as M}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 M(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(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!==M.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),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 r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.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 L(n=7668,e=400){return new Promise(t=>{let r=new B.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function W(n={}){let e=n.port??7668;if(await L(e))return{alreadyRunning:!0};if($()){let a=y()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new c(`no sootsim bridge on port ${e} and refusing to spawn a standalone daemon \u2014 ${a}. start the live \`bun dev\` stack so the bridge is up, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose.`,"DEV_HOST_REFUSED")}let{cmd:t,prefixArgs:r}=C(),s=[...r,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=F(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await L(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(n={}){await W({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function fe(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return _(),0;case"attach":return await V(t);case"projects":return await J();case"project":return await G(t);case"sessions":return await H(t);case"start":return await q(t);case"prompt":return await K(t);case"watch":return await X(t);case"transcript":return await Q(t);case"end":return await Y(t);case"paths":return await Z();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
3
3
|
`),_(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
4
4
|
`),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function _(){b("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function V(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
|
|
5
5
|
`),2;let s=d.resolve(r);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.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-TWAHJXNZ.js";import"./chunk-OTSWADHN.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.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as p}from"./chunk-LHXYIEZM.js";import"./chunk-OTSWADHN.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.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-OTSWADHN.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.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-I2VAJ6SU.js";import"./chunk-AK7USIKQ.js";import"./chunk-5X6X5LES.js";import"./chunk-4HITITPE.js";import"./chunk-R677VUUU.js";import"./chunk-OTSWADHN.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as x}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as x}from"./chunk-OTSWADHN.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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{F as P,m as v,n as A,o as h,s as I,u as N}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{F as P,m as v,n as A,o as h,s as I,u as N}from"./chunk-2OLYZLVT.js";import{d as y,h as B,i as E}from"./chunk-AK7USIKQ.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}function V(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 D(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return E(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);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 K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!P(o)||Date.now()>=s)throw o;await w(50)}}async function Q(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 w(o)}return null}async function X(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 w(o)}return null}async function Z(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,d=!1,m={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:v}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=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=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&h({nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(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 _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:N});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 I(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=t.indexOf(r);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var f=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function h(t){return typeof t=="string"&&f.has(t)}async function
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=t.indexOf(r);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var f=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function h(t){return typeof t=="string"&&f.has(t)}async function x(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function D(t,e){if(!h(e))return!1;try{return await x(t)}catch{return!1}}async function M(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function H(t,e=5){let n=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}))()`});return{depth:e,tree:n}}async function O(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function B(t,e){let n=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
5
5
|
const kb = window.__sootsimKeyboard
|
|
@@ -10,11 +10,73 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
|
|
|
10
10
|
shell = typeof mainShell?.getState === 'function' ? await mainShell.getState() : null
|
|
11
11
|
} catch {}
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const opts = ${JSON.stringify(e)}
|
|
14
|
+
const needsRecursiveDump = opts.verbose || opts.subtreeRoot || opts.includeOccluded
|
|
15
|
+
const globToRegex = (glob) => {
|
|
16
|
+
const escaped = String(glob).replace(/[.+^$(){}|[\\]\\\\]/g, '\\\\$&')
|
|
17
|
+
const body = escaped.replace(/\\*/g, '.*').replace(/\\?/g, '.')
|
|
18
|
+
return new RegExp('^' + body + '$', 'i')
|
|
19
|
+
}
|
|
20
|
+
const truncate = (value, max) => {
|
|
21
|
+
const text = typeof value === 'string' ? value.replace(/\\s+/g, ' ').trim() : ''
|
|
22
|
+
return text.length > max ? text.slice(0, max - 1).trimEnd() + '\u2026' : text
|
|
23
|
+
}
|
|
24
|
+
const formatInspectableTree = async () => {
|
|
25
|
+
if (typeof t.listInspectable !== 'function') return null
|
|
26
|
+
const list = await t.listInspectable({})
|
|
27
|
+
if (!Array.isArray(list)) return null
|
|
28
|
+
const filter = typeof opts.filter === 'string' ? opts.filter.toLowerCase() : ''
|
|
29
|
+
const testIdRegex = opts.testIdLike ? globToRegex(opts.testIdLike) : null
|
|
30
|
+
const onlyRegex = opts.onlyGlob ? globToRegex(opts.onlyGlob) : null
|
|
31
|
+
const lines = []
|
|
32
|
+
let matched = 0
|
|
33
|
+
for (const node of list) {
|
|
34
|
+
const testID = node?.testID || node?.testId || ''
|
|
35
|
+
const role = node?.role || ''
|
|
36
|
+
const label = node?.accessibilityLabel || node?.label || ''
|
|
37
|
+
const text = node?.text || ''
|
|
38
|
+
if (testIdRegex && !testIdRegex.test(testID)) continue
|
|
39
|
+
const joined = [role, label, text, testID].filter(Boolean).join(' ')
|
|
40
|
+
if (onlyRegex && !onlyRegex.test(joined)) continue
|
|
41
|
+
if (filter && !joined.toLowerCase().includes(filter)) continue
|
|
42
|
+
matched++
|
|
43
|
+
|
|
44
|
+
const type = String(node?.type || 'node').toLowerCase()
|
|
45
|
+
const handlers = Array.isArray(node?.handlers) ? node.handlers : []
|
|
46
|
+
const parts = []
|
|
47
|
+
if (role) parts.push('[' + role + ']')
|
|
48
|
+
else if (handlers.length > 0) parts.push('[tap]')
|
|
49
|
+
else parts.push('<' + type + '>')
|
|
50
|
+
const visibleText = truncate(text, 50)
|
|
51
|
+
if (visibleText) parts.push(JSON.stringify(visibleText))
|
|
52
|
+
if (testID) parts.push('#' + testID)
|
|
53
|
+
if (label && label !== text) parts.push('label=' + JSON.stringify(truncate(label, 50)))
|
|
54
|
+
if (!opts.hideXy) {
|
|
55
|
+
const abs = node?.absolute || {}
|
|
56
|
+
const layout = node?.layout || {}
|
|
57
|
+
const x = Math.round(Number(abs.x) || 0)
|
|
58
|
+
const y = Math.round(Number(abs.y) || 0)
|
|
59
|
+
const w = Math.round(Number(layout.width) || 0)
|
|
60
|
+
const h = Math.round(Number(layout.height) || 0)
|
|
61
|
+
parts.push('@(' + x + ',' + y + ') ' + w + 'x' + h)
|
|
62
|
+
}
|
|
63
|
+
if (handlers.length > 0) parts.push('(tap)')
|
|
64
|
+
lines.push(' ' + parts.join(' '))
|
|
65
|
+
}
|
|
66
|
+
return { tree: lines.join('\\n'), matched }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let tree = ''
|
|
70
|
+
const compactResult = needsRecursiveDump ? null : await formatInspectableTree()
|
|
71
|
+
if (compactResult) {
|
|
72
|
+
tree = compactResult.tree
|
|
73
|
+
} else {
|
|
74
|
+
tree = await t.dumpTree(12, opts)
|
|
75
|
+
}
|
|
14
76
|
const nodeCount = (await t.getNodeCount?.()) || 0
|
|
15
77
|
const keyboard = kb && typeof kb.getLayout === 'function' ? kb.getLayout() : null
|
|
16
78
|
return { tree, shell, nodeCount, keyboard }
|
|
17
|
-
})()`;return await t.send({type:"evaluate",code:n})??{}}var
|
|
79
|
+
})()`;return await t.send({type:"evaluate",code:n})??{}}var w=`(async () => {
|
|
18
80
|
const t = window.__sootsimTest
|
|
19
81
|
if (!t || typeof t.listInspectable !== 'function') return []
|
|
20
82
|
const list = await t.listInspectable({})
|
|
@@ -74,7 +136,7 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
|
|
|
74
136
|
fontSize: fontSizeOf(style),
|
|
75
137
|
}
|
|
76
138
|
})
|
|
77
|
-
})()`;async function C(t){let e=await t.send({type:"evaluate",code:
|
|
139
|
+
})()`;async function C(t){let e=await t.send({type:"evaluate",code:w});return Array.isArray(e)?e:[]}function W(t){return t.length===0?" no visible elements found":t.map(n=>{let s=[n.testID?`#${n.testID}`:n.selector?n.selector:n.role?`[${n.role}]`:`<${n.type}>`,`@(${n.box.x},${n.box.y})`,`${n.box.w}x${n.box.h}`];n.borderRadius>0&&s.push(`radius:${n.borderRadius}`);let o=n.padding;if(o.t||o.r||o.b||o.l){let i=o.t===o.r&&o.r===o.b&&o.b===o.l;s.push(i?`pad:${o.t}`:`pad:${o.t},${o.r},${o.b},${o.l}`)}if(n.fontSize>0&&s.push(`font:${n.fontSize}`),n.text){let i=n.text.length>40?`${n.text.slice(0,39)}\u2026`:n.text;s.push(`"${i}"`)}return` ${s.join(" ")}`}).join(`
|
|
78
140
|
`)}var S=`(async () => {
|
|
79
141
|
const t = window.__sootsimTest
|
|
80
142
|
if (!t) return []
|
|
@@ -148,7 +210,7 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
|
|
|
148
210
|
return all
|
|
149
211
|
.filter(n => isVisibleTarget(n) && hasAccessibleSignal(n))
|
|
150
212
|
.map(normalize)
|
|
151
|
-
})()`;async function F(t){let e=await t.send({type:"evaluate",code:S});return Array.isArray(e)?e:[]}var
|
|
213
|
+
})()`;async function F(t){let e=await t.send({type:"evaluate",code:S});return Array.isArray(e)?e:[]}var p=`
|
|
152
214
|
const fromInspectable = async () => {
|
|
153
215
|
if (typeof t.listInspectable !== 'function') return null
|
|
154
216
|
const list = await t.listInspectable({})
|
|
@@ -235,7 +297,7 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
|
|
|
235
297
|
})()`}:t.pressable?{mode:"pressable",code:`(async () => {
|
|
236
298
|
const t = window.__sootsimTest
|
|
237
299
|
if (!t) return []
|
|
238
|
-
${
|
|
300
|
+
${p}
|
|
239
301
|
const inspectable = await fromInspectable()
|
|
240
302
|
if (inspectable) return inspectable.filter(n => n.pressable && isVisibleTarget(n))
|
|
241
303
|
const all = await t.queryAll({ pruneHidden: true })
|
|
@@ -243,7 +305,7 @@ ${y}
|
|
|
243
305
|
})()`}:t.interactive?{mode:"interactive-targets",code:`(async () => {
|
|
244
306
|
const t = window.__sootsimTest
|
|
245
307
|
if (!t) return []
|
|
246
|
-
${
|
|
308
|
+
${p}
|
|
247
309
|
const inspectable = await fromInspectable()
|
|
248
310
|
if (inspectable) {
|
|
249
311
|
return inspectable.filter(n => n.pressable && isVisibleTarget(n))
|
|
@@ -259,7 +321,7 @@ ${y}
|
|
|
259
321
|
const t = window.__sootsimTest
|
|
260
322
|
if (!t) return null
|
|
261
323
|
return await t.findByText(${JSON.stringify(t.text)})
|
|
262
|
-
})()`}:null}async function z(t,e){let n=v(e);if(!n)return null;let r=await t.send({type:"evaluate",code:n.code});return{mode:n.mode,result:r}}function
|
|
324
|
+
})()`}:null}async function z(t,e){let n=v(e);if(!n)return null;let r=await t.send({type:"evaluate",code:n.code});return{mode:n.mode,result:r}}function j(t){return[...t].sort((e,n)=>y(n)-y(e))}function y(t){let e=0;t.testID&&(e+=100),typeof t.text=="string"&&t.text.trim().length>0&&(e+=60),typeof t.accessibilityLabel=="string"&&t.accessibilityLabel.trim().length>0&&(e+=30),t.accessibilityRole&&(e+=15);let n=t.layout?.width??0,r=t.layout?.height??0,s=n*r;return s>=400&&s<=6e4?e+=25:s>6e4&&(e-=20),(t.absolutePosition?.y??0)<0&&(e-=30),e}function K(t){if(t.testID)return`sootsim do tap-id ${g(t.testID)}`;let e=typeof t.text=="string"?t.text.trim():"";if(e.length>0&&e.length<=80)return`sootsim do tap-text ${g(e)}`;let n=Math.round(((t.absolutePosition?.x??0)+(t.layout?.width??0)/2)*10)/10,r=Math.round(((t.absolutePosition?.y??0)+(t.layout?.height??0)/2)*10)/10;return`sootsim do tap ${n} ${r}`}function g(t){return/^[A-Za-z0-9_./@:-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}var I=`(async () => {
|
|
263
325
|
const t = window.__sootsimTest
|
|
264
326
|
let nodes = 0
|
|
265
327
|
try { nodes = (await t?.getNodeCount?.()) || 0 } catch {}
|
|
@@ -354,7 +416,7 @@ ${y}
|
|
|
354
416
|
externalStatus,
|
|
355
417
|
externalError,
|
|
356
418
|
}
|
|
357
|
-
})()`,
|
|
419
|
+
})()`,T=100,k=750,R=2e3;function _(t){return t.targets>0||t.nodes>=T}function J(t){return t.externalError?`guest app errored: ${t.externalError}`:t.loadingText?`still showing "${t.loadingText}"`:t.externalReady===!1?"guest app is still loading":t.flag!==!0?"guest app has not emitted sootsim:externalAppReady":t.targets<=0?"ready flag emitted but no visible app content is inspectable yet":"node tree is still changing"}async function V(t,e=2e4,n={}){let r=Date.now(),s=r+e,o=n.progressIntervalMs??R,i=r+o,u=-1,c=r,a={flag:void 0,at:0,nodes:0,targets:0,errors:0,loadingText:"",externalReady:null,externalStatus:"",externalError:""};for(;Date.now()<s;){try{a=await t.send({type:"evaluate",code:I})??a}catch{}let l=Date.now(),d={ready:!1,elapsedMs:l-r,nodes:a.nodes,targets:a.targets,flag:a.flag,loadingText:a.loadingText,externalReady:a.externalReady,externalStatus:a.externalStatus,externalError:a.externalError,errors:a.errors};if(a.nodes!==u&&(u=a.nodes,c=l),a.flag===!0&&a.externalReady!==!1&&!a.externalError&&!a.loadingText&&_(a)&&l-c>=k)return{...d,ready:!0};if(n.onProgress&&o>0&&l>=i){n.onProgress(d);do i+=o;while(l>=i)}await new Promise(m=>setTimeout(m,150))}return{ready:!1,elapsedMs:Date.now()-r,nodes:a.nodes,targets:a.targets,flag:a.flag,loadingText:a.loadingText,externalReady:a.externalReady,externalStatus:a.externalStatus,externalError:a.externalError,errors:a.errors}}async function G(t,e,n=5e3,r={}){let s=r.gone===!0;return await t.send({type:"evaluate",code:`(async () => {
|
|
358
420
|
const start = Date.now()
|
|
359
421
|
const deadline = start + ${n}
|
|
360
422
|
const gone = ${s}
|
|
@@ -448,7 +510,7 @@ ${y}
|
|
|
448
510
|
const obs = window.__sootsimObservability;
|
|
449
511
|
if (!obs) return { ok: false };
|
|
450
512
|
return { ok: true, entries: obs.logs.getSnapshot() };
|
|
451
|
-
})()`});return!e||!e.ok?[]:e.entries??[]}async function te(t){await t.send({type:"evaluate",code:'window.__sootsimObservability?.logs.clear(); "cleared"'})}function
|
|
513
|
+
})()`});return!e||!e.ok?[]:e.entries??[]}async function te(t){await t.send({type:"evaluate",code:'window.__sootsimObservability?.logs.clear(); "cleared"'})}function $(t,e){if(t.source===e.source||t.level!==e.level||Math.abs(t.ts-e.ts)>1e3||t.args.length!==e.args.length)return!1;let n=new Set([t.source,e.source]);return!n.has("sootsim-worker")||!n.has("render-worker")&&!n.has("forwarded-render-worker")?!1:t.args.every((r,s)=>r===e.args[s])}function ne(t,e={}){let n=[];for(let r of t)n.some(s=>$(s,r))||n.push(r);if(e.showInternal||(n=n.filter(r=>{let s=r.args[0];return!(typeof s=="string"&&s.startsWith("[sootsim]"))})),e.level&&(n=n.filter(r=>e.level.has(r.level))),e.filter){let r=e.filter.toLowerCase();n=n.filter(s=>s.args.join(" ").toLowerCase().includes(r))}return n}async function re(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.summary",args:[e]})}async function se(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.recent",args:[e]})}async function oe(t,e,n){await t.send({type:"call",path:"SootSim.bridges.timeline.cursorAdvance",args:[e,n]})}async function ae(t){return await t.send({type:"evaluate",code:`(() => {
|
|
452
514
|
const kb = window.__sootsimKeyboard
|
|
453
515
|
if (!kb || typeof kb.getLayout !== 'function') {
|
|
454
516
|
return { error: 'keyboard bridge getLayout() not available' }
|
|
@@ -478,7 +540,7 @@ ${y}
|
|
|
478
540
|
})()
|
|
479
541
|
: null
|
|
480
542
|
return { nav: navSnap, keyboard }
|
|
481
|
-
})()`});return{shell:await A(t,500).catch(()=>null),nav:e?.nav??null,keyboard:e?.keyboard??null}}async function le(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.status()"})}async function ue(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.flags()"})}async function ce(t,e){let n=e==="sheets"?"findSheets":"findPortals";return t.send({type:"evaluate",code:`window.__sootsimDebug.${n}()`})}async function de(t,e,n=50){let r=e&&e!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(e)}, ${n})`:`window.__sootsimDebug.recent(undefined, ${n})`;return t.send({type:"evaluate",code:r})}async function
|
|
543
|
+
})()`});return{shell:await A(t,500).catch(()=>null),nav:e?.nav??null,keyboard:e?.keyboard??null}}async function le(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.status()"})}async function ue(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.flags()"})}async function ce(t,e){let n=e==="sheets"?"findSheets":"findPortals";return t.send({type:"evaluate",code:`window.__sootsimDebug.${n}()`})}async function de(t,e,n=50){let r=e&&e!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(e)}, ${n})`:`window.__sootsimDebug.recent(undefined, ${n})`;return t.send({type:"evaluate",code:r})}async function pe(t,e,n){let r=n.length>0?n.map(s=>JSON.stringify(s)).join(", "):e==="disable"?"'all'":"";return t.send({type:"evaluate",code:`window.__sootsimDebug.${e}(${r})`})}async function ye(t){return await t.send({type:"evaluate",code:`(async () => {
|
|
482
544
|
const host = window.__sootsimRenderHost
|
|
483
545
|
const stats = host?.queryStats ? await host.queryStats() : null
|
|
484
546
|
const hostMem = performance.memory
|
|
@@ -493,4 +555,4 @@ ${y}
|
|
|
493
555
|
workerHeap: stats?.memory?.workerHeap ?? null,
|
|
494
556
|
hostHeap: hostMem,
|
|
495
557
|
}
|
|
496
|
-
})()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function ge(t){if(t.total===0)return"nothing recorded";let e=[],n=["error","warning","console","fetch","toast","alert","actionsheet","picker","notification","screen","route","keyboard","app-launch","shell","scroll","gesture","text-input","react-commit","animation","reanimated"],r=new Set;for(let s of n){let o=t.byKind[s];o&&(e.push(`${o} ${s}${o===1?"":"s"}`),r.add(s))}for(let[s,o]of Object.entries(t.byKind))!r.has(s)&&o&&e.push(`${o} ${s}${o===1?"":"s"}`);return e.join(" \xB7 ")}var be=new Set(["react-commit","layout","scroll"]);function
|
|
558
|
+
})()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function ge(t){if(t.total===0)return"nothing recorded";let e=[],n=["error","warning","console","fetch","toast","alert","actionsheet","picker","notification","screen","route","keyboard","app-launch","shell","scroll","gesture","text-input","react-commit","animation","reanimated"],r=new Set;for(let s of n){let o=t.byKind[s];o&&(e.push(`${o} ${s}${o===1?"":"s"}`),r.add(s))}for(let[s,o]of Object.entries(t.byKind))!r.has(s)&&o&&e.push(`${o} ${s}${o===1?"":"s"}`);return e.join(" \xB7 ")}var be=new Set(["react-commit","layout","scroll"]);function L(t,e){if(e===null)return new Date(t).toLocaleTimeString();let n=(t-e)/1e3;return`${n>=0?"+":""}${n.toFixed(2)}s`}function P(t,e){switch(t){case"app-launch":return e.phase==="launch"?`launch ${e.appName??e.toAppId??""}`:`dismiss ${e.appName??e.fromAppId??""} \u2192 ${e.toAppId??""}`;case"toast":return`"${e.text??""}"${e.durationMs?` (${e.durationMs}ms)`:""}`;case"keyboard":return`${e.phase??"?"}${e.heightPx?` h=${e.heightPx}`:""}${e.mode?` ${e.mode}`:""}`;case"screen":return`${e.phase??"?"} ${e.name??e.activeName??""}`;case"route":return`${e.phase??"?"} ${e.path??e.pathname??""}`;case"alert":case"actionsheet":case"picker":return`${e.phase??"?"} ${e.title??e.message??""}`;case"notification":return`${e.title??""}${e.body?` \u2014 ${e.body}`:""}`;case"fetch":return`${e.method??"GET"} ${e.url??""}${e.status?` -> ${e.status}`:""}`;case"console":return`${e.level??"log"}: ${(e.message??"").toString().slice(0,120)}`;case"shell":return`${e.event??e.type??e.phase??""}`;case"scroll":return`${e.phase??"?"} ${e.target??""}`;case"gesture":return`${e.phase??"?"} ${e.type??""}`;case"text-input":return`${e.phase??"?"}${e.value!==void 0?` "${String(e.value).slice(0,40)}"`:""}`;case"layout":return`${e.kind??"?"} ${e.testID??e.type??""}${e.skipped?` skipped:${e.reason??"unknown"}`:""}`;case"react-commit":{let n=e.slowest;return`${e.fiberCount??"?"} fibers ${e.durationMs??"?"}ms${n?.displayName?` \xB7 ${n.displayName} ${n.durationMs??"?"}ms`:""}`}case"reanimated":case"animation":return`${e.kind??""} ${e.target??""}${e.durationMs?` ${e.durationMs}ms`:""}`}return""}function me(t,e){let n=L(t.t,e).padStart(8),r=t.context.padEnd(6),s=`[${t.kind}]`.padEnd(15),o=t.data,i=o&&typeof o=="object"?P(t.kind,o):"";return` ${n} ${r} ${s} ${i}`}export{N as a,D as b,M as c,H as d,O as e,B as f,C as g,W as h,F as i,z as j,j as k,K as l,I as m,k as n,_ as o,J as p,V as q,G as r,Q as s,Y as t,U as u,q as v,X as w,Z as x,ee as y,te as z,ne as A,re as B,se as C,oe as D,ae as E,E as F,A as G,ie as H,le as I,ue as J,ce as K,de as L,pe as M,ye as N,ge as O,be as P,me as Q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as $}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as $}from"./chunk-AK7USIKQ.js";import{a as w,d as y,h as R,j as b,l as k}from"./chunk-RA3KPNRU.js";import{A as h,B as u,C as p,D as g,k as d}from"./chunk-R677VUUU.js";import x from"fs";import{WebSocket as D}from"ws";async function G(e,t={}){let[s,...n]=e;if(!s||s==="--help"||s==="-h"){A();return}switch(s){case"install":return O(n,t);case"list":case"ls":return N(n);case"use":return S(n);case"remove":case"rm":return T(n);case"which":case"active":return F();case"notes":case"changelog":return _(n);default:console.error(` unknown runtime subcommand: ${s}`),A(),process.exit(1)}}function A(){console.log(`
|
|
3
3
|
sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -26,7 +26,7 @@ examples:
|
|
|
26
26
|
sootsim runtime notes
|
|
27
27
|
sootsim runtime notes 1.2.3
|
|
28
28
|
sootsim runtime notes --all
|
|
29
|
-
`)}async function O(e,t){let{version:s,flags:n}=C(e),i=n.channel??t.channel??"stable",l=n.force===!0,r=n.setActive!==!1;h(),console.log("sootsim runtime install"),console.log(` cdn: ${y()}`);try{let o=await k({version:s,channel:i,force:l,setActive:r});console.log(` version: ${o.version} (channel: ${o.channel})`),o.installed?console.log(` installed ${o.version}`):console.log(` already installed at ${o.runtimeDir}`),r&&await I(o.version)}catch(o){console.error(` ${v(o)}`),process.exit(1)}}async function I(e){p(e),console.log(` active: ${e}`),await E(e)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${e})`)}async function E(e){let{isDaemonLockfileFresh:t,readDaemonLockfile:s}=await import("./home-paths-
|
|
29
|
+
`)}async function O(e,t){let{version:s,flags:n}=C(e),i=n.channel??t.channel??"stable",l=n.force===!0,r=n.setActive!==!1;h(),console.log("sootsim runtime install"),console.log(` cdn: ${y()}`);try{let o=await k({version:s,channel:i,force:l,setActive:r});console.log(` version: ${o.version} (channel: ${o.channel})`),o.installed?console.log(` installed ${o.version}`):console.log(` already installed at ${o.runtimeDir}`),r&&await I(o.version)}catch(o){console.error(` ${v(o)}`),process.exit(1)}}async function I(e){p(e),console.log(` active: ${e}`),await E(e)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${e})`)}async function E(e){let{isDaemonLockfileFresh:t,readDaemonLockfile:s}=await import("./home-paths-232EBQYF.js"),n=s();if(!t(n))return!1;let i=$();return new Promise(l=>{let r=!1,o=!1,a=f=>{r||(r=!0,l(f))},c=new D(`ws://127.0.0.1:${i}`,{handshakeTimeout:800}),m=setTimeout(()=>{try{c.close()}catch{}a(o)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:e,id:0})),o=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(m),a(o)}),c.on("error",()=>{clearTimeout(m),a(!1)})})}async function N(e){h();let t=g(),s=u();if(console.log("installed:"),t.length===0)console.log(" (none)");else for(let n of t)console.log(` ${n===s?"*":" "} ${n}`);try{let n=await R();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`)}catch(n){console.log(`available: (could not fetch manifest: ${v(n)})`)}}async function S(e){let t=e[0];t||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let s=g();s.includes(t)||(console.error(` version ${t} is not installed`),console.error(` installed: ${s.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${t}\` first`),process.exit(1)),await I(t)}async function T(e){let t=e[0];t||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),u()===t&&(console.error(` cannot remove active runtime ${t}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let n=d(t);if(!x.existsSync(n)){console.error(` ${t} is not installed`);return}x.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${t}`)}async function F(){let e=u();if(!e){console.log(" no active runtime");return}console.log(e)}async function _(e){let t=e.includes("--all"),s=e.find(o=>!o.startsWith("-"))||null,n;try{n=await b()}catch(o){console.error(` could not fetch release notes: ${v(o)}`),process.exit(1)}if(n.length===0){console.log(" no release notes published yet");return}if(t){console.log(`sootsim runtime releases:
|
|
30
30
|
`);for(let o of n){let a=o.date.slice(0,10),c=o.sections.reduce((m,f)=>m+f.items.length,0);console.log(` v${o.version} ${a} (${o.channel}, ${c} change${c===1?"":"s"})`)}console.log(`
|
|
31
31
|
see one release: sootsim runtime notes <version>`);return}let i=u(),l=s||i||n[0]?.version,r=n.find(o=>o.version===l);r||(console.error(` no release notes for ${l}`),console.error(` published: ${n.map(o=>o.version).slice(0,10).join(", ")}`),console.error(" list all: sootsim runtime notes --all"),process.exit(1)),console.log(j(r,{active:i}))}function j(e,t={}){let s=[],n=e.date.slice(0,10),i=t.active===e.version?" (active)":"";if(s.push(`sootsim runtime v${e.version} \xB7 ${e.channel} \xB7 ${n}${i}`),e.sections.length===0)return s.push(" no notable changes"),s.join(`
|
|
32
32
|
`);for(let l of e.sections){s.push(""),s.push(` ${l.title}`);for(let r of l.items){let o=r.scope?`(${r.scope}) `:"",a=r.breaking?"\u26A0 ":"";s.push(` \u2022 ${a}${o}${r.summary} ${r.hash}`)}}return s.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.126 | (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,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=4001,n="sootsim close";export{t as a,n as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{existsSync as D,mkdirSync as O,readFileSync as g,rmSync as s,writeFileSync as P}from"fs";import{tmpdir as R}from"os";import{dirname as x,join as A,resolve as v}from"path";import{execFileSync as I}from"child_process";import{readFileSync as S}from"fs";import{createRequire as _}from"module";var o=null;function u(r){o||(o=b());try{return o(r)}catch{return null}}function b(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return y();if(process.platform==="darwin"){let n=T();return n||C()}return()=>null}function y(){return r=>{try{let n=S(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let i=n.slice(t+1).trim().split(/\s+/),e=Number(i[1]);return Number.isFinite(e)&&e>0?e:null}catch{return null}}}var N=3,d=216,E=16;function T(){if(!process.versions?.bun)return null;try{let r=_(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),i=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),e=Buffer.alloc(d);return a=>{if(Number(i.symbols.proc_pidinfo(a,N,0n,e,d))<=0)return null;let p=e.readUInt32LE(E);return p>0?p:null}}catch{return null}}function C(){return r=>{try{let t=I("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
3
|
`)[1];if(!t)return null;let i=t.trim().split(/\s+/),e=Number(i[2]);return Number.isFinite(e)&&e>1?e:null}catch{return null}}}var c=1,f="SOOTSIM_CLI_CURRENT_SIM_PATH",F=["SOOTSIM_CLI_IDENTITY","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"];function m(r,n=20){let t=u(r);if(!t||t<=1)return null;for(let i=0;i<n;i++){let e=u(t);if(!e||e<=1)return t;t=e}return t}function k(){for(let n of F){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=m(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function L(){return k().key}function J(){return m(process.ppid)}function l(){if(process.env[f])return v(process.env[f]);let r=L();return A(R(),`sootsim-current-sim-${r}.json`)}function h(){let r=l();if(!D(r))return null;try{let n=JSON.parse(g(r,"utf8"));return n.version!==c||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(s(r,{force:!0}),null):{version:c,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return s(r,{force:!0}),null}}function j(){return h()?.simId||null}function K(r){let n=r.trim();if(!n)return;let t=l();O(x(t),{recursive:!0}),P(t,JSON.stringify({version:c,simId:n,updatedAt:new Date().toISOString()},null,2)+`
|
|
4
4
|
`)}function X(){s(l(),{force:!0})}export{k as a,L as b,J as c,j as d,K as e,X as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,d as T,f as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,d as T,f as C}from"./chunk-5X6X5LES.js";import{G as k,H as v}from"./chunk-R677VUUU.js";import{WebSocket as I}from"ws";function x(){let e=k();return e&&v(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(r,i){super(r),this.name="BridgeSimLockedError",this.lock=i}};function $(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,r={}){let i=new Set,a=r.port??x(),l=r.commandTimeoutMs??15e3,t,m="none",h=new Set(r.stripBooleanFlags??[]),b=new Set(r.stripValueFlags??[]);for(let n=0;n<e.length;n++){let d=e[n];if(d==="--port"||d==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(d.startsWith("--port=")){i.add(n),a=Number(d.slice(7));continue}if(d==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),l=Number(e[n+1])),n++;continue}if(d==="--sim"||d==="--session"||d==="--tab"){i.add(n),n+1<e.length&&(i.add(n+1),t=e[n+1]?.trim()||void 0,m="flag"),n++;continue}let s=d.startsWith("--sim=")?d.slice(6):d.startsWith("--session=")?d.slice(10):d.startsWith("--tab=")?d.slice(6):void 0;if(s!==void 0){i.add(n),t=s.trim()||void 0,m="flag";continue}if(h.has(d)){i.add(n);continue}b.has(d)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,m="saved")}return{positional:e.filter((n,d)=>!i.has(d)),wsPort:a,simId:t,simIdSource:m,commandTimeoutMs:l}}function E(e,r={}){let i=1,a=r.commandTimeoutMs??15e3,l=new Map,t=new I(`ws://localhost:${e}`),m=P(),h=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:m.key,cliIdentitySource:m.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let g=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${g}`))})}),b=!1,n=!1;function d(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",g=$(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${g})
|
|
3
3
|
`)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!b&&(b=!0,process.stderr.write(`
|
|
4
4
|
\u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
|
|
5
5
|
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.126 | (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,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.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{g as w,i as u,j as m,k as l}from"./chunk-GLBMBO3X.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,b as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.126 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,b as v}from"./chunk-JWU65JVV.js";import{d as j}from"./chunk-I2VAJ6SU.js";import{a as b}from"./chunk-NONHFWQS.js";import{execSync as A}from"child_process";import{existsSync as w,readFileSync as _,writeFileSync as x}from"fs";import{relative as B,resolve as d}from"path";import{existsSync as p,readFileSync as k,readdirSync as O,statSync as R}from"fs";import{basename as L,dirname as T,join as a}from"path";function D(e){let o=e;for(;;){if(p(a(o,"turbo.json"))||p(a(o,"nx.json"))||p(a(o,"lerna.json"))||p(a(o,"pnpm-workspace.yaml")))return o;let i=a(o,"package.json");if(p(i))try{if(JSON.parse(k(i,"utf8")).workspaces)return o}catch{}let r=T(o);if(r===o)break;o=r}return e}function W(e){return p(a(e,"bun.lock"))||p(a(e,"bun.lockb"))?"bun":p(a(e,"pnpm-lock.yaml"))?"pnpm":p(a(e,"yarn.lock"))?"yarn":"npm"}function J(e){if(p(a(e,"turbo.json")))return"turbo";if(p(a(e,"nx.json")))return"nx";if(p(a(e,"pnpm-workspace.yaml")))return"pnpm";let o=a(e,"package.json");if(p(o))try{if(JSON.parse(k(o,"utf8")).workspaces)return"npm-workspaces"}catch{}return"single"}function N(e){return e.one?"one":e.expo?"expo":e["react-native"]?"bare":"unknown"}function y(e){let o=a(e,"package.json");if(!p(o))return null;let i;try{i=JSON.parse(k(o,"utf8"))}catch{return null}let r={...i.dependencies,...i.devDependencies},s=N(r);return s==="unknown"?null:{dir:e,name:i.name||L(e),framework:s,hasViteConfig:p(a(e,"vite.config.ts"))||p(a(e,"vite.config.js")),hasMetroConfig:p(a(e,"metro.config.js"))||p(a(e,"metro.config.ts")),hasSootsimDependency:!!r.sootsim,devCommand:i.scripts?.dev||null}}function V(e){let o=[],i=a(e,"pnpm-workspace.yaml");if(p(i)){let t=k(i,"utf8").match(/packages:\s*\n((?:\s+-\s+.+\n?)+)/);if(t){let c=t[1].split(`
|
|
3
3
|
`).filter(Boolean);for(let n of c){let g=n.replace(/^\s*-\s*['"]?/,"").replace(/['"]?\s*$/,"");g&&o.push(...S(e,g))}}return o}let r=a(e,"package.json");if(p(r))try{let s=JSON.parse(k(r,"utf8")),t=Array.isArray(s.workspaces)?s.workspaces:s.workspaces?.packages||[];for(let c of t)o.push(...S(e,c))}catch{}return o}function S(e,o){let i=o.replace(/\/\*\*?$/,"").replace(/\*$/,""),r=a(e,i);if(!p(r))return[];try{return O(r).map(t=>a(r,t)).filter(t=>{try{return R(t).isDirectory()&&p(a(t,"package.json"))}catch{return!1}})}catch{return[]}}function M(e){let o=J(e),i=W(e);if(o==="single"){let c=y(e);return{root:e,type:o,packageManager:i,apps:c?[c]:[]}}let r=V(e),s=[],t=y(e);t&&s.push(t);for(let c of r){if(c===e)continue;let n=y(c);n&&s.push(n)}return{root:e,type:o,packageManager:i,apps:s}}function $(e){switch(e){case"bun":return"bun add -d sootsim";case"pnpm":return"pnpm add -D sootsim";case"yarn":return"yarn add -D sootsim";case"npm":return"npm install -D sootsim"}}async function ce(e){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim setup-repo \u2014 set up sootsim in your project
|
|
5
5
|
|