sootsim 0.1.61 → 0.1.62
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-Y5DHXXIB.js → agent-VKARDTF5.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-JKTA44ZS.js → agent-wrapper-6QDQ77TJ.js} +2 -2
- package/dist-cli/chunks/{assert-RCHJYS4V.js → assert-PYSEWHJK.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-SUDPJ45T.js +2 -0
- package/dist-cli/chunks/beta-3HRWHUIR.js +2 -0
- package/dist-cli/chunks/{chunk-7IFCJ2IT.js → chunk-2JSZSUTN.js} +2 -2
- package/dist-cli/chunks/{chunk-4XUOL4AD.js → chunk-35UHLN73.js} +2 -2
- package/dist-cli/chunks/{chunk-VOIYKBUR.js → chunk-3BWDOYAV.js} +3 -3
- package/dist-cli/chunks/{chunk-O4GFKP3K.js → chunk-3N6CKIJG.js} +2 -2
- package/dist-cli/chunks/{chunk-GU4C6XUG.js → chunk-3VE2XCQM.js} +3 -3
- package/dist-cli/chunks/{chunk-ROBRQSBJ.js → chunk-3WZ7ZTIA.js} +1 -1
- package/dist-cli/chunks/{chunk-SBJZMEWR.js → chunk-4JXE3ZUG.js} +1 -1
- package/dist-cli/chunks/{chunk-3NBPI3RK.js → chunk-4MZLNYBR.js} +1 -1
- package/dist-cli/chunks/{chunk-FEAAP6XM.js → chunk-5POON745.js} +2 -2
- package/dist-cli/chunks/{chunk-J45J6PUU.js → chunk-63NGN7QH.js} +2 -2
- package/dist-cli/chunks/{chunk-GHPKHUMA.js → chunk-66KS2T62.js} +2 -2
- package/dist-cli/chunks/{chunk-CQVJMAK7.js → chunk-6EUVCG33.js} +1 -1
- package/dist-cli/chunks/{chunk-UXECVWRC.js → chunk-6RJRJRAW.js} +1 -1
- package/dist-cli/chunks/{chunk-7O43QYRW.js → chunk-6TJONB3X.js} +1 -1
- package/dist-cli/chunks/{chunk-U35XNNJY.js → chunk-6XLG7CQG.js} +1 -1
- package/dist-cli/chunks/{chunk-SDHFNWW6.js → chunk-BIZ4APXE.js} +2 -2
- package/dist-cli/chunks/{chunk-CJTUKYTH.js → chunk-C6LE22VK.js} +2 -2
- package/dist-cli/chunks/{chunk-PB7AQQSR.js → chunk-CEOCVI4R.js} +2 -2
- package/dist-cli/chunks/{chunk-XZLTYOHT.js → chunk-DN47N6UL.js} +3 -3
- package/dist-cli/chunks/{chunk-EZDINY66.js → chunk-DNAVJIEL.js} +2 -2
- package/dist-cli/chunks/{chunk-RESH7AUO.js → chunk-DV4MSLJL.js} +2 -2
- package/dist-cli/chunks/chunk-DYYNEGJV.js +2 -0
- package/dist-cli/chunks/{chunk-K23PH2GT.js → chunk-EIXXQDAI.js} +2 -2
- package/dist-cli/chunks/{chunk-JH7QZNMN.js → chunk-H2QWYBE2.js} +2 -2
- package/dist-cli/chunks/{chunk-FULJHRZT.js → chunk-J5RNZMJJ.js} +2 -2
- package/dist-cli/chunks/{chunk-6I65RLOE.js → chunk-JIEJ2O4W.js} +1 -1
- package/dist-cli/chunks/{chunk-MIGHBWF3.js → chunk-ND2UZFA4.js} +1 -1
- package/dist-cli/chunks/{chunk-7U5X273C.js → chunk-NXFXTJSP.js} +2 -2
- package/dist-cli/chunks/{chunk-PKUBEQ7T.js → chunk-OMSSLTQC.js} +1 -1
- package/dist-cli/chunks/{chunk-KILM2EVT.js → chunk-Q5EKBSA2.js} +2 -2
- package/dist-cli/chunks/{chunk-D7ELOJUV.js → chunk-RIYRSTXD.js} +2 -2
- package/dist-cli/chunks/chunk-S2RNIQCY.js +1 -0
- package/dist-cli/chunks/chunk-T6IRZEOS.js +1 -0
- package/dist-cli/chunks/{chunk-OXK76D2Y.js → chunk-TALVQX2P.js} +2 -2
- package/dist-cli/chunks/{chunk-2PMX6E4H.js → chunk-TIUEUINU.js} +1 -1
- package/dist-cli/chunks/chunk-TSGJJFFO.js +1 -0
- package/dist-cli/chunks/{chunk-WNOAY3OR.js → chunk-UEF3ZIEI.js} +2 -2
- package/dist-cli/chunks/{chunk-4E765KMB.js → chunk-V3TU7DR4.js} +1 -1
- package/dist-cli/chunks/{chunk-5HIFH66T.js → chunk-VBA6DIBD.js} +2 -2
- package/dist-cli/chunks/{chunk-FFLU7U2E.js → chunk-WN2ATVFO.js} +2 -2
- package/dist-cli/chunks/chunk-XTR4CILB.js +2 -0
- package/dist-cli/chunks/{chunk-UZYGDMBM.js → chunk-YAKDXQA7.js} +2 -2
- package/dist-cli/chunks/{chunk-OPYA7ZEE.js → chunk-YRKWTQ66.js} +1 -1
- package/dist-cli/chunks/cli-version-INI6PYTD.js +2 -0
- package/dist-cli/chunks/{compat-PPH5L7UC.js → compat-GO5ZKWUL.js} +3 -3
- package/dist-cli/chunks/{config-S6QN23OF.js → config-GWDGFFIB.js} +2 -2
- package/dist-cli/chunks/control-GMAG2HKS.js +2 -0
- package/dist-cli/chunks/{cpu-profile-J5KLARMT.js → cpu-profile-TQRN7NFF.js} +2 -2
- package/dist-cli/chunks/{daemon-6N7C25DV.js → daemon-XLTCNIET.js} +2 -2
- package/dist-cli/chunks/{debug-3FBARTDW.js → debug-324KIABR.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-OEAV2G5S.js +2 -0
- package/dist-cli/chunks/{detox-TXZELC5K.js → detox-QGITZG47.js} +2 -2
- package/dist-cli/chunks/{device-NBV6IVKX.js → device-6WFYBS5R.js} +2 -2
- package/dist-cli/chunks/{diagnose-DGRJ3BSK.js → diagnose-HBDMYEKJ.js} +2 -2
- package/dist-cli/chunks/drivers-TJSMGOQQ.js +2 -0
- package/dist-cli/chunks/{electron-HUTXPJJI.js → electron-5DX3DITH.js} +3 -3
- package/dist-cli/chunks/flow-HNHYMZO6.js +2 -0
- package/dist-cli/chunks/{hints-4473IWWZ.js → hints-CJ3ETNUR.js} +2 -2
- package/dist-cli/chunks/{home-paths-YIFLBNJ7.js → home-paths-OCOWHSRV.js} +2 -2
- package/dist-cli/chunks/{inspect-I3QAWTDQ.js → inspect-QPZXN3IK.js} +3 -3
- package/dist-cli/chunks/install-OVCWRSPD.js +2 -0
- package/dist-cli/chunks/{install-desktop-WY7UJ3Z6.js → install-desktop-RB3JNYHC.js} +3 -3
- package/dist-cli/chunks/{keys-BSBR3RLA.js → keys-HFOS3J5A.js} +2 -2
- package/dist-cli/chunks/{launch-CVEJVX4U.js → launch-XQGAPI6Q.js} +3 -3
- package/dist-cli/chunks/{login-CQD3S2ON.js → login-U6ZPN4IL.js} +4 -4
- package/dist-cli/chunks/{logout-KAXI55BQ.js → logout-VY2F5T4J.js} +2 -2
- package/dist-cli/chunks/{maestro-X5DOFIRM.js → maestro-32UN2FHS.js} +2 -2
- package/dist-cli/chunks/{preview-WIYOOZUK.js → preview-AJWIS25K.js} +2 -2
- package/dist-cli/chunks/{profile-OY2E3X2K.js → profile-4XPDQIQY.js} +2 -2
- package/dist-cli/chunks/{react-WR32MKDG.js → react-VSZ2RQEC.js} +2 -2
- package/dist-cli/chunks/{record-RRC2AFKD.js → record-W6ZTLQTB.js} +3 -3
- package/dist-cli/chunks/runtime-6UMHX7N7.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-NCBHWNDU.js → runtime-delivery-O7G4Y6GE.js} +2 -2
- package/dist-cli/chunks/{screenshot-APLXYLMG.js → screenshot-ALDT4B77.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-EHIGEDTE.js → screenshot-mode-5VYUB7G6.js} +2 -2
- package/dist-cli/chunks/{screenshots-2VO2ONBK.js → screenshots-TYQ4EVJR.js} +2 -2
- package/dist-cli/chunks/{server-HYBCDWZM.js → server-X2GDTWC6.js} +2 -2
- package/dist-cli/chunks/setup-repo-Q7SMPBCH.js +2 -0
- package/dist-cli/chunks/{skills-NR3LGYAG.js → skills-C6RSSO4R.js} +2 -2
- package/dist-cli/chunks/{start-OFEUKSPM.js → start-Y2S3LSL5.js} +4 -4
- package/dist-cli/chunks/store-ABVWLB26.js +2 -0
- package/dist-cli/chunks/telemetry-2LWDURQ5.js +2 -0
- package/dist-cli/chunks/{test-TYEMATPY.js → test-IAHTJWBS.js} +3 -3
- package/dist-cli/chunks/{three-mode-EIKE6HNC.js → three-mode-ZCZXY47S.js} +2 -2
- package/dist-cli/chunks/{timeline-O6EYX7EM.js → timeline-KZHGTPDV.js} +2 -2
- package/dist-cli/chunks/{upgrade-HKW6G5DV.js → upgrade-47JCBCFB.js} +2 -2
- package/dist-cli/chunks/upload-PNZ3UEOL.js +2 -0
- package/dist-cli/chunks/web-N6G3E6EE.js +2 -0
- package/dist-cli/chunks/{what-happened-YCDOVOKQ.js → what-happened-FULTHMRQ.js} +2 -2
- package/dist-cli/chunks/{whoami-NQYPKVCM.js → whoami-3KUBLDUA.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 +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/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 +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-OJZDXBR6.js +0 -2
- package/dist-cli/chunks/beta-RIJR4LYY.js +0 -2
- package/dist-cli/chunks/chunk-4ZZ2FEXT.js +0 -2
- package/dist-cli/chunks/chunk-6AJED4HB.js +0 -2
- package/dist-cli/chunks/chunk-EFPFJZQG.js +0 -1
- package/dist-cli/chunks/chunk-QAMASPCQ.js +0 -1
- package/dist-cli/chunks/chunk-RVDEV2FN.js +0 -1
- package/dist-cli/chunks/cli-version-YAMXXNI2.js +0 -2
- package/dist-cli/chunks/control-7GTHUVJB.js +0 -2
- package/dist-cli/chunks/demo-app-registry-BT3NTO6L.js +0 -2
- package/dist-cli/chunks/drivers-AJGSL6IM.js +0 -2
- package/dist-cli/chunks/flow-RBX5EOXV.js +0 -2
- package/dist-cli/chunks/install-ZI3J7HCK.js +0 -2
- package/dist-cli/chunks/runtime-URJZQE3L.js +0 -2
- package/dist-cli/chunks/setup-repo-I767FRBL.js +0 -2
- package/dist-cli/chunks/store-F6RPVKJL.js +0 -2
- package/dist-cli/chunks/telemetry-HGTHILVR.js +0 -2
- package/dist-cli/chunks/upload-KUD4O36E.js +0 -2
- package/dist-cli/chunks/web-GMKCHONH.js +0 -2
package/dist-cli/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
3
|
-
import{a as l}from"./chunks/chunk-
|
|
2
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as l}from"./chunks/chunk-VBA6DIBD.js";import{a as A,b as k,c as S,d as L,e as u,f as T}from"./chunks/chunk-ND2UZFA4.js";import{a as d}from"./chunks/chunk-XTR4CILB.js";import{a as v,d as _}from"./chunks/chunk-OMSSLTQC.js";import{a as E}from"./chunks/chunk-JIEJ2O4W.js";import"./chunks/chunk-TALVQX2P.js";import"./chunks/chunk-DYYNEGJV.js";import{z as C}from"./chunks/chunk-6EUVCG33.js";import"./chunks/chunk-6XLG7CQG.js";function y(){let t=C();return`sootsim CLI v${E()} \xB7 runtime ${t?`v${t}`:"not installed"}`}function g(){let t=k({bridgePort:7668,defaultShellUrl:d},l()),e=`
|
|
4
4
|
${_}
|
|
5
5
|
`;console.log(`${y()}
|
|
6
6
|
${e}${t}
|
|
@@ -28,4 +28,4 @@ show the current shared desktop account used by the CLI and electron.
|
|
|
28
28
|
it needs vite / electron / playwright from a project's node_modules.
|
|
29
29
|
install the npm package and run via bun or node instead:
|
|
30
30
|
npm i -g sootsim && sootsim ${t}
|
|
31
|
-
`),process.exit(1))}var o=T(process.argv);{let{trackCliEvent:t}=await import("./chunks/telemetry-
|
|
31
|
+
`),process.exit(1))}var o=T(process.argv);{let{trackCliEvent:t}=await import("./chunks/telemetry-2LWDURQ5.js");t({event:"cli_command_invoked",properties:{command:o.command||(o.version?"version":o.help?"help":"none"),arg_count:o.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(t){let{flushCliTelemetry:e}=await import("./chunks/telemetry-2LWDURQ5.js");await e(),process.exit(t)}if(o.version){let{getCliVersion:t}=await import("./chunks/cli-version-INI6PYTD.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-3HRWHUIR.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${t()}${m}`);let{readActiveRuntime:I}=await import("./chunks/home-paths-OCOWHSRV.js"),b=I();console.log(b?`runtime v${b}`:"runtime not installed"),await c(0)}o.help&&!o.command&&(g(),await c(0));var a=o.globalFlags.port,n=o.verbose,p=o.globalFlags.device,f=o.globalFlags.theme,R=o.globalFlags.driver,q=o.globalFlags.headless===!0,O=o.globalFlags.sim,s=O?["--sim",O,...o.commandArgs]:o.commandArgs;if(p||f){let{settingsStore:t}=await import("./chunks/store-ABVWLB26.js"),e={};p&&(e.deviceModel=p),f&&(e.colorScheme=f),t.apply(e)}if(!o.command&&o.commandArgs.length===0){let{runStart:t}=await import("./chunks/start-Y2S3LSL5.js");await t([],{port:a}),await c(0)}var r=o.command??"";if(!r){if(o.commandArgs.length>0){let t=o.commandArgs.find(e=>!e.startsWith("-"))??o.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}g(),await c(0)}if(r in u){let t=u[r],e=o.commandArgs.length>0?` ${o.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${t}\` instead.`),e&&console.error(` \u2192 ${t}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(o.help||o.commandArgs.includes("--help")||o.commandArgs.includes("-h")){let t=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=o.commandArgs.find(i=>!i.startsWith("-"));r==="shell"||(t&&!e?$(r)&&await c(0):(h(t&&e?e:r),await c(0)))}N(r);if(L.has(r)){let{ensureSootsimReady:t,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-SUDPJ45T.js"),i=e(s,a);await t(i);let{runInspect:m}=await import("./chunks/inspect-QPZXN3IK.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:t}=await import("./chunks/assert-PYSEWHJK.js");await t(o.commandArgs);break}case"flow":{let{runFlow:t}=await import("./chunks/flow-HNHYMZO6.js"),e=await t(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:t}=await import("./chunks/test-IAHTJWBS.js");await t(o.commandArgs,{port:a,verbose:n});break}case"detox":{let{runDetox:t}=await import("./chunks/detox-QGITZG47.js");await t(o.commandArgs,{port:a,verbose:n});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-32UN2FHS.js"),e=await t(s,{port:a,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:t}=await import("./chunks/preview-AJWIS25K.js");await t(o.commandArgs,{port:a,verbose:n});break}case"record":{let{runRecord:t}=await import("./chunks/record-W6ZTLQTB.js");await t(s,{port:a,verbose:n});break}case"profile":{let{runProfile:t}=await import("./chunks/profile-4XPDQIQY.js"),e=await t(o.commandArgs,{port:a,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:t}=await import("./chunks/cpu-profile-TQRN7NFF.js"),e=await t(s,{port:a,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:t}=await import("./chunks/react-VSZ2RQEC.js"),e=await t(s,{port:a,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:t}=await import("./chunks/screenshot-ALDT4B77.js");await t(s,{port:a,verbose:n});break}case"screenshots":{let{runScreenshots:t}=await import("./chunks/screenshots-TYQ4EVJR.js"),e=await t(s,{port:a,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:t}=await import("./chunks/screenshot-mode-5VYUB7G6.js");await t(o.commandArgs,{port:a,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:t}=await import("./chunks/three-mode-ZCZXY47S.js");await t(o.commandArgs,{port:a,verbose:n});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-QPZXN3IK.js");await t(s,{port:a,verbose:n});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-324KIABR.js");await t(s,{port:a,verbose:n});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-KZHGTPDV.js");await t(s,{port:a,verbose:n});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-FULTHMRQ.js");await t(s,{port:a,verbose:n});break}case"diagnose":{let{runDiagnose:t}=await import("./chunks/diagnose-HBDMYEKJ.js"),e=await t(s,{port:a,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:t,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-SUDPJ45T.js"),i=e(s,a);await t(i);let{runOpenCommand:m}=await import("./chunks/control-GMAG2HKS.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:t}=await import("./chunks/control-GMAG2HKS.js");await t(s,{port:a});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-GMAG2HKS.js");await t(s,{port:a});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-GMAG2HKS.js");await t(s,{port:a});break}case"config":{let{runConfig:t}=await import("./chunks/config-GWDGFFIB.js");await t(o.commandArgs);break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-6WFYBS5R.js");await t(s,{port:a});break}case"scan":case"compat":{let{runCompat:t}=await import("./chunks/compat-GO5ZKWUL.js");await t(o.commandArgs);break}case"electron":{let{runElectron:t}=await import("./chunks/electron-5DX3DITH.js");await t(o.commandArgs,{port:a,device:p,driver:R});break}case"login":{let{runLogin:t}=await import("./chunks/login-U6ZPN4IL.js");await t(o.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-VY2F5T4J.js");await t();break}case"whoami":{let{runWhoami:t}=await import("./chunks/whoami-3KUBLDUA.js");await t();break}case"keys":{let{runKeys:t}=await import("./chunks/keys-HFOS3J5A.js");await t(o.commandArgs);break}case"setup-repo":{let{runSetupRepo:t}=await import("./chunks/setup-repo-Q7SMPBCH.js");await t(o.commandArgs);break}case"install":{let{runInstall:t}=await import("./chunks/install-OVCWRSPD.js");await t(o.commandArgs);break}case"install-desktop":{let{runInstallDesktop:t}=await import("./chunks/install-desktop-RB3JNYHC.js");await t(o.commandArgs);break}case"server":{let{runServer:t}=await import("./chunks/server-X2GDTWC6.js");await t(o.commandArgs,{port:a});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-XLTCNIET.js");await t(o.commandArgs,{port:a});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-6UMHX7N7.js");await t(o.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-47JCBCFB.js");await t(o.commandArgs);break}case"launch":{let{runLaunch:t}=await import("./chunks/launch-XQGAPI6Q.js");await t(o.commandArgs);break}case"start":{let{runStart:t}=await import("./chunks/start-Y2S3LSL5.js");await t(o.commandArgs,{port:a});break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-VKARDTF5.js"),e=await t(o.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-6QDQ77TJ.js"),e=await t(o.commandArgs);process.exit(e)}case"skills":{let{runSkills:t}=await import("./chunks/skills-C6RSSO4R.js");await t(o.commandArgs);break}case"upload":{let{runUpload:t}=await import("./chunks/upload-PNZ3UEOL.js");await t(o.commandArgs,{port:a,verbose:n});break}case"hints":{let{runHints:t}=await import("./chunks/hints-CJ3ETNUR.js");t(o.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 y,b as $,c as b,d as l,e as E,g as A,h as j,j as S,m as I,n as T,o as x,p as g,q as k,r as D}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as y,b as $,c as b,d as l,e as E,g as A,h as j,j as S,m as I,n as T,o as x,p as g,q as k,r as D}from"./chunk-66KS2T62.js";import"./chunk-TIUEUINU.js";import"./chunk-DYYNEGJV.js";import"./chunk-6EUVCG33.js";import"./chunk-6XLG7CQG.js";import w from"node:fs";import d from"node:path";import{spawn as N}from"node:child_process";import U from"node:net";import{WebSocket as O}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 O(`ws://localhost:${this.port}`),this.ready=new Promise((t,s)=>{let r=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",r),s(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",r),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!==O.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let s=this.nextId++;return new Promise((r,o)=>{let i=setTimeout(()=>{this.pending.delete(s),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(s,{resolve:r,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:s,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(s),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 r of this.eventListeners)try{r({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let r of this.statusListeners)try{r(t.session)}catch{}return}if(typeof t.id!="number")return;let s=this.pending.get(t.id);s&&(this.pending.delete(t.id),clearTimeout(s.timer),t.error?s.reject(new c(t.error,t.code)):s.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(n=7668,e=400){return new Promise(t=>{let s=new U.Socket,r=!1,o=i=>{r||(r=!0,s.destroy(),t(i))};s.setTimeout(e),s.once("connect",()=>o(!0)),s.once("timeout",()=>o(!1)),s.once("error",()=>o(!1)),s.connect(n,"127.0.0.1")})}async function _(n={}){let e=n.port??7668;if(await R(e))return{alreadyRunning:!0};let{cmd:t,prefixArgs:s}=D(),r=[...s,"server","--quiet"];e!==7668&&r.push("--port",String(e));let o=N(t,r,{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 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(n={}){await _({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 ue(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return C(),0;case"attach":return await F(t);case"projects":return await B();case"project":return await W(t);case"sessions":return await J(t);case"start":return await V(t);case"prompt":return await q(t);case"watch":return await G(t);case"transcript":return await H(t);case"end":return await K(t);case"paths":return await z();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
3
3
|
`),C(),2}}catch(s){if(s instanceof c)return process.stderr.write(`${s.message}
|
|
4
4
|
`),1;throw s}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function C(){process.stdout.write(`sootsim agent \u2014 attached projects + local agent sessions
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as M}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-TIUEUINU.js";import"./chunk-6XLG7CQG.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.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-6XLG7CQG.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.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-3BWDOYAV.js";import"./chunk-C6LE22VK.js";import"./chunk-4JXE3ZUG.js";import"./chunk-DYYNEGJV.js";import"./chunk-6EUVCG33.js";import"./chunk-6XLG7CQG.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 p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as p}from"./chunk-DNAVJIEL.js";import{d as c,e as l}from"./chunk-J5RNZMJJ.js";import{a}from"./chunk-WN2ATVFO.js";async function g(e,t){if(t)return t.replace(/\/$/,"");if(e.kind==="session"&&e.origin)return e.origin.replace(/\/$/,"");let i=a();return i?.origin?i.origin.replace(/\/$/,""):(await p()).replace(/\/$/,"")}async function m(e,t={}){let i=c();if(i||(process.stderr.write(`
|
|
3
3
|
sootsim ${e} needs auth before it can check recording access.
|
|
4
4
|
|
|
5
5
|
pick one:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{l as P,n as a,y as m}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{l as P,n as a,y as m}from"./chunk-6EUVCG33.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,"utf8"),l.renameSync(t,d()),r}function y(){return g(u()).profiles}function E(e){let r=o(e);return y().find(t=>t.id===r)??null}function _(e=s){let r=o(e),t=E(r);return t||D(r)}function D(e){let r=o(e),t=p(u());if(t.profiles.some(w=>w.id===r))throw new Error(`profile already exists: ${r}`);let f=new Date().toISOString(),n={id:r,createdAt:f,updatedAt:f};return g({version:i,profiles:[...t.profiles,n]}),n}function F(e){let r=o(e);if(r===s)throw new Error("the default profile cannot be deleted; clear it instead");let t=p(u()),f=t.profiles.find(n=>n.id===r);if(!f)throw new Error(`profile not found: ${r}`);return g({version:i,profiles:t.profiles.filter(n=>n.id!==r)}),v(r),f}function v(e){let r=o(e);for(let t of[h(r),A(r)])try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}export{A as a,y as b,_ as c,D as d,F as e,v as f};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l}from"./chunk-C6LE22VK.js";import{E as c,F as m,g as p,i as h,z as w}from"./chunk-6EUVCG33.js";import{closeSync as v,existsSync as f,openSync as P,readSync as S,statSync as g}from"fs";import{homedir as k}from"os";import{resolve as T}from"path";import{WebSocket as D}from"ws";var E=6e4;async function L(){let t=w();if(t&&f(h(t)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:e}=await import("./runtime-6UMHX7N7.js");await e(["install"],{})}function I(t,e){return x(t)??e??l()}async function $(t=l(),e=E){if(await u(t,250)||await u(t,1500))return;let n=c();if(n&&m(n)){if(n.bootstrapping===!0&&(await b(e),await u(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}if(p())throw new Error(`sootsim bridge daemon is not running on port ${t}.
|
|
3
3
|
dev checkouts skip the auto-install of the persistent launchd / systemd
|
|
4
4
|
agent. start the daemon manually in another shell with:
|
|
5
5
|
bun sootsim server
|
|
6
|
-
(set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-
|
|
6
|
+
(set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-XLTCNIET.js");try{await o({port:t,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
|
|
7
7
|
if this keeps failing, run \`sootsim daemon uninstall\` and retry, or run \`sootsim server\` in a persistent shell as a workaround.`)}console.log(" waiting for runtime to come online...");let i=process.platform==="darwin"?B():null;try{await b(e);let r=Date.now()+5e3;for(;Date.now()<r;){if(await u(t,500))return;await new Promise(s=>setTimeout(s,200))}throw new Error(`daemon registered but the bridge never bound on port ${t} \u2014 see ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}finally{i?.stop()}}async function C(t=l()){await L(),await $(t)}function x(t){for(let e=0;e<t.length;e++){let n=t[e];if((n==="--port"||n==="-p")&&t[e+1]){let o=Number(t[e+1]);return Number.isFinite(o)?o:void 0}if(n.startsWith("--port=")){let o=Number(n.slice(7));return Number.isFinite(o)?o:void 0}}}function u(t,e){return new Promise(n=>{let o=new D(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,r=s=>{if(!i){i=!0;try{o.close()}catch{}n(s)}};o.once("open",()=>r(!0)),o.once("error",()=>r(!1)),setTimeout(()=>r(!1),e)})}async function b(t){let e=Date.now()+t,n;for(;Date.now()<e;){let o=c();if(o&&m(o)){if(o.bootstrapping!==!0)return;o.bootstrapping!==n&&(n=o.bootstrapping)}await new Promise(i=>setTimeout(i,250))}throw new Error(`daemon did not finish bootstrapping within ${Math.round(t/1e3)}s \u2014 check ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}function d(){return T(k(),"Library/Logs/sootsim/server.err.log")}function B(){let t=d(),e=0;try{f(t)&&(e=g(t).size)}catch{}let n=!1,o=()=>{if(!n){try{if(f(t)){let i=g(t).size;if(i>e){let r=Buffer.alloc(i-e),s=P(t,"r");try{S(s,r,0,r.length,e)}finally{v(s)}e=i;for(let y of r.toString("utf8").split(/\r?\n/)){let a=y.trim();a&&(a.startsWith("sootsim:")||a.startsWith("sootsim "))&&console.log(` ${a}`)}}else i<e&&(e=i)}}catch{}setTimeout(o,250)}};return o(),{stop:()=>{n=!0}}}export{L as a,I as b,$ as c,C as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as L}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as L}from"./chunk-6XLG7CQG.js";import{existsSync as o,readFileSync as p,writeFileSync as d}from"node:fs";import{homedir as j}from"node:os";import{dirname as $,join as s,resolve as P}from"node:path";var _=j();function Q(e){let t=e;for(;;){if(o(s(t,"pnpm-workspace.yaml"))||o(s(t,"turbo.json"))||o(s(t,"nx.json"))||o(s(t,"lerna.json")))return t;let r=s(t,"package.json");if(o(r))try{if(JSON.parse(p(r,"utf8")).workspaces)return t}catch{}let n=$(t);if(n===t)return null;t=n}}function S(e,t){let r=Q(process.cwd()),n=[r?P(r,e):null,P(process.cwd(),e),P(process.cwd(),t)].filter(a=>!!a);for(let a of n)if(o(a))return a;return n[0]??P(process.cwd(),e)}var X=()=>S("packages/sootsim-engine/scripts/expensify-web-proxy.ts","scripts/expensify-web-proxy.ts"),z=()=>S("packages/sootsim-engine/scripts/rainbow-metadata-proxy.ts","scripts/rainbow-metadata-proxy.ts"),Z=()=>S("packages/compat/src/stubs/mattermost-rnutils-native.ts","../compat/src/stubs/mattermost-rnutils-native.ts"),ee=()=>S("packages/compat/src/stubs/native-seams/react-native-keychain-manager.ts","../compat/src/stubs/native-seams/react-native-keychain-manager.ts"),v=()=>S("packages/compat/src/stubs/mattermost-network-client-native.ts","../compat/src/stubs/mattermost-network-client-native.ts"),D={USE_NGROK:"true",NGROK_URL:"http://localhost:9000/",SECURE_NGROK_URL:"http://localhost:9000/"},te=s(_,"github/mattermost-mobile"),I=s(_,"github/uniswap-interface"),ne=s(I,"apps/mobile"),T=s(I,".env.defaults.local"),re="stored-in-.env.local",W="# sootsim demo env overrides",se=s(I,"packages/uniswap/src/features/forceUpgrade/hooks/useForceUpgradeStatus.ts"),oe=s(I,"apps/mobile/src/notification-service/data-sources/createForceUpgradeNotificationDataSource.ts"),M="SOOTSIM_DEMO_DISABLE_FORCE_UPGRADE";function B(e){if(!o(e))return{};let t={},r=p(e,"utf8");for(let n of r.split(/\r?\n/)){let a=n.trim();if(!a||a.startsWith("#"))continue;let u=a.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(!u)continue;let i=u[2].trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),t[u[1]]=i}return t}function k(e){if(!e)return!1;let t=e.trim();return!(!t||t.includes(re)||t==="TRADING_API_KEY"||t==="UNISWAP_API_KEY")}function Y(e,t){for(let r of e)for(let n of t){let a=r[n];if(k(a))return a.trim()}}function J(){let e=B(T),t=B(s(I,"apps/web/.env")),r=[process.env,e,t],n={},a=[["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,l]of a){let R=Y(r,[i,...l]);if(R){n[i]=R;for(let m of l)n[m]=R}}if(!(k(n.TRADING_API_KEY)&&k(n.UNISWAP_API_KEY))){let i=Y(r,["GRAPHQL_URL_OVERRIDE","REACT_APP_AWS_API_ENDPOINT"])||"https://interface.gateway.uniswap.org/v1/graphql";n.API_BASE_URL_OVERRIDE="https://interface.gateway.uniswap.org",n.API_BASE_URL_V2_OVERRIDE="https://interface.gateway.uniswap.org/v2",n.GRAPHQL_URL_OVERRIDE=i,n.TRADING_API_URL_OVERRIDE="https://trading-api-labs.interface.gateway.uniswap.org",n.FOR_API_URL_OVERRIDE="https://for.interface.gateway.uniswap.org/v2/FOR.v1.FORService"}return n}function ae(){let e=o(T)?p(T,"utf8"):"";if(e&&!e.includes(W))return;let t=J(),r=[W];for(let[n,a]of Object.entries(t).sort(([u],[i])=>u.localeCompare(i)))r.push(`${n}=${JSON.stringify(a)}`);r.push(""),d(T,`${r.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`)}function ie(){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{a as Se}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as Se}from"./chunk-YAKDXQA7.js";import{a as Te}from"./chunk-2JSZSUTN.js";import{a as xe}from"./chunk-DNAVJIEL.js";import{a as R,b as pe,c as fe,d as q,e as G,f as we,g as Y,i as X,j as ge}from"./chunk-BIZ4APXE.js";import{f as be,m as ve}from"./chunk-EIXXQDAI.js";import{e as he}from"./chunk-NXFXTJSP.js";import{b as me}from"./chunk-6RJRJRAW.js";import{a as ye}from"./chunk-4MZLNYBR.js";import{a as le,b as H}from"./chunk-5POON745.js";import{f as ae}from"./chunk-TALVQX2P.js";import{c as z,d as ce,e as ue}from"./chunk-C6LE22VK.js";import{c as de}from"./chunk-4JXE3ZUG.js";import*as A from"fs";import{tmpdir as Me}from"os";import*as h from"path";import*as w from"fs";import*as f from"path";var V=1e4,B=393,_=852,Fe="__sootsimCliPerf",Oe="maestroCopiedText",$e=new Map;function p(o){return new Promise(e=>setTimeout(e,o))}function Ne(o){return o?f.basename(o)===".maestro"?f.dirname(o):o:process.cwd()}function Re(o,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(f.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let i=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():Ne(t.flowDir);return f.resolve(i,r)}return f.join(o,r)}function Ve(o){if(typeof o=="string")return{path:o,withFrame:!1};let e=o.path?.trim()||o.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:o.withFrame===!0}}function Q(o){let[e,t]=o.split(",").map(i=>i.trim()),r=(i,s)=>i.endsWith("%")?Number.parseFloat(i)/100*s:Number.parseFloat(i);return{x:r(e,B),y:r(t,_)}}function Be(o){let e=o.split(/^---$/m),t=e.length>1?e[e.length-1]:o,r=fe(pe.parse(t),$e);return Array.isArray(r)?r:[]}var U=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;simRouteHint=null;lastFailedStep=null;get simId(){return this.opts.simId}setSimRouteHint(e){this.simRouteHint=this.normalizeSimRoute(e)}normalizeSimRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshSimId(){if(this.opts.simId)try{let e=await this.bridge.listSims(),t=e.find(a=>a.id===this.opts.simId);if(t&&(this.simRouteHint=this.normalizeSimRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.simId&&a.readyState==="open")||!this.simRouteHint)return;let i=this.simRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeSimRoute(a.url||a.origin)===this.simRouteHint);if(!i)return;let s=e.find(a=>a.isPrimary&&a.readyState==="open"),n=e.find(a=>a.readyState==="open"),l=i??s??n;l&&(this.opts.simId=l.id,console.log(` [flow] sim rotated to ${l.id}`))}catch{}}async evaluate(e,t){return this.bridge.send({type:"evaluate",simId:this.opts.simId,code:e},t?{timeoutMs:t}:void 0)}async callTest(e,...t){return this.bridge.send({type:"call",simId:this.opts.simId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=V){let t=Date.now()+e,r=Date.now(),i=null,s=0,n=0;for(;Date.now()<t;){try{let a=await this.evaluate(`(async () => {
|
|
3
3
|
const test = window.__sootsimTest
|
|
4
4
|
if (!test) return { count: 0, loading: true }
|
|
5
5
|
const count = (await test.getNodeCount?.()) || 0
|
|
@@ -340,7 +340,7 @@ flow extension:
|
|
|
340
340
|
+ completed (${M.length} steps)`),k&&ke(k),b&&console.log(` video: ${b}`),console.log()}catch(u){if(r&&!k)try{k=await c.stopProfile()}catch{}if(S&&!b)try{b=await c.stopRecording(),E=c.getLastRecordingDurationMs()}catch(d){console.warn(` recording stop failed: ${d?.message||String(d)}`)}console.error(`
|
|
341
341
|
x failed: ${u.message}
|
|
342
342
|
`),k&&(console.log(" partial profile:"),ke(k)),b&&console.log(` partial video: ${b}`);try{let d=c.lastFailedStep,v=d?`step-${String(d.index+1).padStart(2,"0")}-${d.kind}`:"unstaged",O=h.join(n,v);await c.captureFailureBundle(O,{error:u,stepIndex:d?.index,stepKind:d?.kind,stepTarget:d?.target}),console.log(` failure bundle: ${O}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(d){try{let v=h.join(n,"error.png");await c.captureFailureScreenshot(v),console.log(` error screenshot: ${v}`)}catch{}console.log(` (failure bundle capture failed: ${d instanceof Error?d.message:String(d)})`)}await me(F,{errorsCommand:`sootsim get errors 5${c.simId?` --sim ${c.simId}`:""}`,warningsCommand:`sootsim get warnings 5${c.simId?` --sim ${c.simId}`:""}`,requestsCommand:`sootsim get requests 5${c.simId?` --sim ${c.simId}`:""}`}),D=1}finally{F.close()}if(D===0&&y)try{let u=await We(J??[]),d=["--origin",W,"--events",u];Z&&d.push("--public-origin",Z),b&&d.push("--video",b),b&&E&&Number.isFinite(E)&&d.push("--video-duration-ms",String(Math.round(E))),c.simId&&d.push("--sim",c.simId),Ae&&d.push("--open"),console.log(`
|
|
343
|
-
preparing preview upload\u2026`);let{runUpload:v}=await import("./upload-
|
|
343
|
+
preparing preview upload\u2026`);let{runUpload:v}=await import("./upload-PNZ3UEOL.js");await v(d,{})}catch(u){console.error(` preview upload failed: ${u?.message||u}`),D=1}return await H(),D}async function We(o){let{gzipSync:e}=await import("zlib"),t=o.map(s=>JSON.stringify(s)).join(`
|
|
344
344
|
`)+(o.length?`
|
|
345
345
|
`:""),r=e(Buffer.from(t,"utf8")),i=h.join(Me(),`sootsim-events-${Date.now()}.jsonl.gz`);return A.writeFileSync(i,r),console.log(` events: ${o.length} written to ${i} (${r.length} bytes gz)`),i}async function Le(o){let e=o[0],t=r=>o.find((i,s)=>o[s-1]===r);switch(e){case"start":{let{path:r,state:i}=we();console.log(" flow draft started"),console.log(` session: ${r}`),console.log(` steps: ${i.steps.length}`);return}case"keep":case"good":{let r=X();if(r.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!r.kept){console.log(" no pending action to keep");return}console.log(` kept: ${r.candidate.summary}`),console.log(` steps: ${r.stepCount}`);return}case"end":{let r=t("--output")||(o[1]&&!o[1].startsWith("-")?o[1]:void 0),i=o.includes("--validate")||o.includes("--video"),s=o.includes("--video"),n=X();n.active&&n.kept&&console.log(` auto-kept trailing action: ${n.candidate.summary}`);let l=ge(r||(i?Ke():void 0));if(l.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!l.valid){console.error(" flow draft is not valid:");for(let a of l.issues)console.error(` - ${a}`);console.error(" draft preserved \u2014 keep at least one real interaction or run `sootsim flow start` to reset"),process.exit(1)}if(i){let a=Je(o,l.outputPath),m=await Ie(a);if(m!==0){console.error(`
|
|
346
346
|
validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=m;return}Y(),console.log(` flow draft validated (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath&&console.log(` saved: ${l.outputPath}`),s&&console.log(" video: recorded during validation run");return}if(Y(),console.log(` flow draft ended (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath){console.log(` saved: ${l.outputPath}`),console.log(` next: sootsim flow ${l.outputPath} --record`);return}console.log(""),process.stdout.write(l.yaml);return}case"validate":{let r=o[1];(!r||r.startsWith("-"))&&(console.error(" usage: sootsim flow validate <path>"),process.exit(1));let i=G(r);if(i.length>0){console.error(` x ${r} failed validation:`);for(let s of i)console.error(` - ${s}`);process.exit(1)}console.log(` + ${r} looks valid`);return}}}function je(o){return o[0]==="--sim"&&o.length>=2?[...o.slice(2),"--sim",o[1]]:o}async function ut(o){let e=je(o),t=e[0];if(t==="start"||t==="keep"||t==="good"||t==="end"||t==="validate")return await Le(e),0;let r=await Ie(e);return r!==0&&(process.exitCode=r),r}function ke(o){let e=o.avgMs>0?(1e3/o.avgMs).toFixed(1):"?",t=o.sampleCount>0?(o.jankFrames/o.sampleCount*100).toFixed(1):"0";console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function t(_){return`(async () => {
|
|
3
3
|
const __t = window.__sootsimTest
|
|
4
4
|
if (!__t) throw new Error('__sootsimTest not available')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{existsSync as C,mkdirSync as D,readFileSync as O,rmSync as s,writeFileSync as g}from"fs";import{tmpdir as P}from"os";import{dirname as R,join as A,resolve as x}from"path";import{execFileSync as a}from"child_process";import{readFileSync as I}from"fs";import{createRequire as S}from"module";var o=null;function u(r){o||(o=_());try{return o(r)}catch{return null}}function _(){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=E();return n||T()}return()=>null}function y(){return r=>{try{let n=I(`/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,b=16;function E(){if(!process.versions?.bun)return null;try{let r=S(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 m=>{if(Number(i.symbols.proc_pidinfo(m,N,0n,e,d))<=0)return null;let p=e.readUInt32LE(b);return p>0?p:null}}catch{return null}}function T(){return r=>{try{let t=a("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",v=["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 F(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 v){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=F(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 l(){if(process.env[f])return x(process.env[f]);let r=L();return A(P(),`sootsim-current-sim-${r}.json`)}function h(){let r=l();if(!C(r))return null;try{let n=JSON.parse(O(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 j(r){let n=r.trim();if(!n)return;let t=l();D(R(t),{recursive:!0}),g(t,JSON.stringify({version:c,simId:n,updatedAt:new Date().toISOString()},null,2)+`
|
|
4
4
|
`)}function K(){s(l(),{force:!0})}export{k as a,L as b,J as c,j as d,K as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.62 | (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{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-WN2ATVFO.js";import{w as o}from"./chunk-6EUVCG33.js";function u(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!o()}function a(){if(u())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let t=process.env.SOOT_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:t.replace(/\/+$/,"")}}function c(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:"anonymous-cli":"anonymous-cli"}function p(e){let t=e.identity??{},n={$lib:"soot-cli",source:t.source??"cli",...e.properties};return t.userId&&(n.userId=t.userId),t.repoId&&(n.repoId=t.repoId),t.installationId!=null&&(n.installationId=String(t.installationId)),t.shareId&&(n.shareId=t.shareId),t.plan&&(n.plan=t.plan),{event:e.event,distinct_id:c(t),properties:n,timestamp:new Date().toISOString()}}var r=[],l=!1;async function i(){if(r.length===0)return;let e=a();if(!e){r.length=0;return}let t=r.splice(0,r.length).map(p);try{await fetch(`${e.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:e.apiKey,batch:t}),signal:AbortSignal.timeout(2e3)})}catch{}}function d(){l||(l=!0,process.on("beforeExit",()=>{i()}),process.on("exit",()=>{i()}))}function h(e){if(u())return;d();let t=null;try{t=s()?.user?.id??null}catch{t=null}r.push({...e,identity:{source:"cli",userId:t,...e.identity}})}async function g(){await i()}export{h as a,g as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as i,e as d,h as c}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as i,e as d,h as c}from"./chunk-C6LE22VK.js";function g(r){let e=r[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(r,e,t){let l=i(r,{port:e.port}),s=g(l.positional),a=d({...l,commandTimeoutMs:5e3});try{let n=!!(await c(a,"SootSim.bridges.settings.get"))?.[t.modeKey],o=s==="on"?!0:s==="off"?!1:!n;if(n===o)return console.log(` ${t.displayName}: already ${o?"on":"off"}`),{current:n,target:o,changed:!1};if(!await a.send({type:"evaluate",acquireLock:!0,code:`(async () => {
|
|
3
3
|
const modeKey = ${JSON.stringify(t.modeKey)}
|
|
4
4
|
const target = ${JSON.stringify(o)}
|
|
5
5
|
window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-2PMX6E4H.js";import{l as D}from"./chunk-CQVJMAK7.js";import{a as T}from"./chunk-U35XNNJY.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("./demo-app-registry-BT3NTO6L.js")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-TIUEUINU.js";import{l as D}from"./chunk-6EUVCG33.js";import{a as T}from"./chunk-6XLG7CQG.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import m from"node:fs";import y from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||D()}function h(){return _()}function U(){return y.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=m.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{m.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=U();m.mkdirSync(y.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=m.openSync(r,"w",384);try{m.writeFileSync(n,JSON.stringify(e,null,2)),m.fsyncSync(n)}finally{m.closeSync(n)}m.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function B(e){return q("sha256").update(y.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ge(e){let t=y.resolve(e.cwd),r=B(t),n;return w(o=>{let s=o.attachedProjects.find(c=>c.id===r);if(s){let c={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=c,n=c;return}let a=Date.now(),d={id:r,name:e.name??y.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:a,updatedAt:a};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function ye(){return S().attachedProjects}var Q=336*60*60*1e3;function he(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],a=o-Q,d=s.filter(c=>c.ts>=a);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Se(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function we(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let a=r.agentSessions.find(d=>d.id===e.id);if(a){let d={...a,...e,lastSeenAt:Date.now()},c=r.agentSessions.indexOf(a);r.agentSessions[c]=d,t=d;return}}let n=r.attachedProjects.find(a=>a.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function v(e,t){w(r=>{let n=r.agentSessions.find(s=>s.id===e);if(!n)return;let o=r.agentSessions.indexOf(n);r.agentSessions[o]={...n,...t,id:n.id,projectId:n.projectId,createdAt:n.createdAt,lastSeenAt:Date.now()}})}async function ve(){if(S().attachedProjects.length>0)return;let t;try{t=(await import("./demo-app-registry-OEAV2G5S.js")).APPS}catch(n){console.warn("[sootsim] seedFromDemoAppRegistry: could not load demo registry:",n.message);return}if(!Array.isArray(t))return;let r=t;w(n=>{for(let o of r){if(!m.existsSync(o.dir))continue;let s=y.resolve(o.dir),a=B(s);if(n.attachedProjects.some(c=>c.id===a))continue;let d=Date.now();n.attachedProjects.push({id:a,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as V,spawnSync as z}from"node:child_process";import{randomUUID as Z}from"node:crypto";import i,{constants as f}from"node:fs";import u from"node:path";import ee from"node:readline";function j(e){return u.join(h(),"sessions",e)}function W(e){return u.join(j(e),"prompt.in")}function J(e){return u.join(j(e),"events.out")}function te(e){return u.join(h(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(j(t)))}function re(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ne();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ne(){try{let e=se();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli` (watch:cli:binary builds dist-bin/ instead).")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function se(){try{let r=T.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=oe();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function oe(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ie(e,t,r){let n=u.join(h(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,a=null;for(;a===null;)try{a=i.openSync(o,f.O_WRONLY|f.O_CREAT|f.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let c=Number(i.readFileSync(o,"utf8").trim());if(c&&!ce(c)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(c=>setTimeout(c,50))}try{return i.writeFileSync(a,String(process.pid)),await r()}finally{try{i.closeSync(a)}catch{}try{i.unlinkSync(o)}catch{}}}function ce(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=z("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Te(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ie(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?Z():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),a=W(s.id),d=J(s.id),c=te(s.id);L(a),L(d);let g=u.dirname(c);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=re(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",a,"--events-out",d,"--transcript",c];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=V(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:h()}});x.unref();let E=e.readyTimeoutMs??6e3,b=await ae(d,p=>p.type==="ready"||p.type==="error",E);if(!b||b.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(j(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=b&&b.type==="error"?b.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function De(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,f.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
3
3
|
`)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Re(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=j(e),n=h();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ne(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,f.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ee.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let c=I(d);c&&t(c)});let a=!1;return()=>{if(!a){a=!0;try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ae(e,t,r){let n=i.openSync(e,f.O_RDWR|f.O_NONBLOCK),o=Buffer.alloc(8192),s="",a=Date.now()+r;try{for(;Date.now()<a;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(c){if(c.code!=="EAGAIN")throw c;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let c;for(;(c=s.indexOf(`
|
|
4
4
|
`))>=0;){let g=s.slice(0,c);s=s.slice(c+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(c=>setTimeout(c,30))}return null}finally{i.closeSync(n)}}export{I as a,h as b,ge as c,F as d,ye as e,he as f,Se as g,we as h,k as i,C as j,v as k,ve as l,j as m,W as n,J as o,te as p,O as q,re as r,l as s,Te as t,De as u,Re as v,Ne as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.62 | (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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function d(t){let e=t.displayUrl||t.url;return t.status!=null?`${t.method} ${e} -> ${t.status}${t.statusText?` ${t.statusText}`:""}`:t.error?`${t.method} ${e} -> ${t.error}`:`${t.method} ${e}`}async function u(t,e,...o){return t.send({type:"call",path:`__sootsimTest.${e}`,args:o})}async function g(t,e={}){let o=await t.send({type:"evaluate",code:"window.__sootsimConsole?.count?.() || { errors: 0, warnings: 0, total: 0 }"});if(!o||typeof o!="object")return;let n=Math.max(0,Number(o.errors)||0),s=Math.max(0,Number(o.warnings)||0);if(n===0&&s===0)return;let r=[];if(n>0&&r.push(`${n} console error${n===1?"":"s"}`),s>0&&r.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
3
3
|
console: ${r.join(", ")}`),e.errorsCommand&&console.log(` inspect: ${e.errorsCommand}`),s>0&&e.warningsCommand&&console.log(` inspect: ${e.warningsCommand}`),!e.includeTail||n===0)return;let i=await t.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors?.(5) || []"});if(!(!Array.isArray(i)||i.length===0)){console.log(`
|
|
4
4
|
recent console errors:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
async function T(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function v(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function I(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function _(e,t){let n=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.62 | (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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as Ns}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as Ns}from"./chunk-6XLG7CQG.js";var ui=`(async () => {
|
|
3
3
|
try { localStorage.clear() } catch {}
|
|
4
4
|
try { sessionStorage.clear() } catch {}
|
|
5
5
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as P,c as v,e as A}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,c as v,e as A}from"./chunk-4JXE3ZUG.js";import{E as k,F as T}from"./chunk-6EUVCG33.js";import{WebSocket as w}from"ws";function M(){let e=k();return e&&T(e)?e.bridgePort:7668}var h=class extends Error{lock;constructor(t,s){super(t),this.name="BridgeSimLockedError",this.lock=s}};function O(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,t={}){let s=new Set,l=t.port??M(),c=t.commandTimeoutMs??15e3,o,g="none",b=new Set(t.stripBooleanFlags??[]),p=new Set(t.stripValueFlags??[]);for(let i=0;i<e.length;i++){let a=e[i];if(a==="--port"||a==="-p"){s.add(i),i+1<e.length&&(s.add(i+1),l=Number(e[i+1])),i++;continue}if(a.startsWith("--port=")){s.add(i),l=Number(a.slice(7));continue}if(a==="--timeout"){s.add(i),i+1<e.length&&(s.add(i+1),c=Number(e[i+1])),i++;continue}if(a==="--sim"){s.add(i),i+1<e.length&&(s.add(i+1),o=e[i+1]?.trim()||void 0,g="flag"),i++;continue}if(b.has(a)){s.add(i);continue}p.has(a)&&(s.add(i),i+1<e.length&&s.add(i+1),i++)}if(!o){let i=v();i&&(o=i.trim()||void 0,g="saved")}return{positional:e.filter((i,a)=>!s.has(a)),wsPort:l,simId:o,simIdSource:g,commandTimeoutMs:c}}function W(e,t={}){let s=1,l=t.commandTimeoutMs??15e3,c=new Map,o=new w(`ws://localhost:${e}`),g=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:P(),b=new Promise((n,r)=>{o.on("open",()=>{try{o.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:g.key,cliIdentitySource:g.source,cliLabel:t.cliLabel}))}catch{}n()}),o.on("error",d=>{let u=d.message?`: ${d.message}`:"";r(new Error(`could not connect to ws://localhost:${e}${u}`))})}),p=!1,i=!1;function a(n,r){if(i||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||n.startsWith("bridge:")||n==="focus"||n==="close")return;i=!0;let d=r??"primary",u=O(r?t.simIdSource:"none");process.stderr.write(` \u2192 ${d} (${u})
|
|
3
3
|
`)}return o.on("message",n=>{let r;try{r=JSON.parse(n.toString())}catch{return}if(r.id===0)return;let d=c.get(r.id);d&&(c.delete(r.id),r.i>0&&!p&&(p=!0,process.stderr.write(`
|
|
4
4
|
\u26A0 ${r.i} other CLI identity/identities are driving this sim
|
|
5
5
|
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as c,b as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as c,b as p}from"./chunk-4MZLNYBR.js";import{a as m,c as h}from"./chunk-35UHLN73.js";import{a as l,b as u,c as d}from"./chunk-YRKWTQ66.js";function O(){let e=l();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function P(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=l();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await d(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var f={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:O,launch:P};function x(){let e=c();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim install-desktop`)"}}async function k(e){let r=c();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await p(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var v={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:x,launch:k};import{spawn as I}from"child_process";import{closeSync as L,mkdtempSync as _,openSync as R,readFileSync as A}from"fs";import{createRequire as M}from"module";import{tmpdir as g}from"os";import{join as w}from"path";var $=`
|
|
3
3
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
4
4
|
const url = process.env.SOOTSIM_PW_URL;
|
|
5
5
|
const headless = process.env.SOOTSIM_PW_HEADLESS === '1';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d}from"./chunk-C6LE22VK.js";import{a as p,d as w,h as $,j as y}from"./chunk-Q5EKBSA2.js";import{A as g,B as f,i as h,y as m,z as a}from"./chunk-6EUVCG33.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-OCOWHSRV.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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as Q,e as X}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as Q,e as X}from"./chunk-J5RNZMJJ.js";import{d as K}from"./chunk-YRKWTQ66.js";import{a as J,b as m}from"./chunk-5POON745.js";import{a as D}from"./chunk-WN2ATVFO.js";import{c as q,e as Y,g as v}from"./chunk-C6LE22VK.js";import{createHash as Te}from"crypto";import{readFileSync as te}from"fs";import{gzipSync as ne}from"zlib";function Z(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 H(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 be(e){let t=H(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 we(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 be(u),o++,r?.(o,a)}}))}function ve(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 Be(e){return e.replace(/\/+$/,"")}var _=class extends Error{constructor(r,s,o,a=""){super(r);this.status=s;this.phase=o;this.responseText=a;this.name="PresignedUploadError"}};async function ee(e){let t=Be(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=H(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 _(`init failed: ${o.status} ${h.slice(0,200)}`,o.status,"init",h)}let a=await o.json(),u=ve(a,e.bundleBytes,e.filesByHash,e.extras);await we(u,e.concurrency??8,e.onPutProgress);let b=H(3e4,"finalize"),p;try{p=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:a.token}),signal:b.signal})}finally{b.cancel()}if(!p.ok){let h=await p.text().catch(()=>"");throw new _(`finalize failed: ${p.status} ${h.slice(0,200)}`,p.status,"finalize",h)}let P=await p.json();return{init:a,finalize:P}}function Ie(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 ie=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://sootbean.com",ae=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",M="http://localhost:3000";async function Ue(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${M}/api/preview/upload/init`,{method:"OPTIONS"});if(t.ok||t.status===204||t.status===405)return M}catch{}return ie}function B(e){return e.replace(/\/$/,"")}function Pe(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 xe(e){try{let t=new URL(e).hostname.toLowerCase();return t==="sootbean.com"||t.endsWith(".sootbean.com")}catch{return!1}}function Se(e,t){return t?B(t):process.env.SOOTSIM_PREVIEW_ORIGIN?B(process.env.SOOTSIM_PREVIEW_ORIGIN):Pe(e)?B(e):xe(e)?B(ae):B(e)}function Oe(){console.log(`
|
|
3
3
|
sootsim upload \u2014 publish the current bundle as a /preview/<id> link
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as v,i as h,j as b,k as T,l as y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.62 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as v,i as h,j as b,k as T,l as y}from"./chunk-6TJONB3X.js";import{d as f,h as M,i as R}from"./chunk-C6LE22VK.js";var B={timeoutMs:1800,settleMs:48,startWindowMs:64};function p(e){return new Promise(t=>setTimeout(t,e))}function k(e){return e.includes("--json")}function D(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}async function I(e,t,...r){return M(e,`__sootsimTest.${t}`,...r)}async function x(e,t,...r){return R(e,`SootSim.bridges.mainShell.${t}`,...r)}async function _(e,t={}){try{let r=await I(e,"waitForScreenTransitions",B);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 P(e,t,r,...n){let i=Date.now()+Math.max(0,r);for(;;)try{return await x(e,t,...n)}catch(o){if(!v(o)||Date.now()>=i)throw o;await p(50)}}async function A(e,t,r,n={}){let i=n.attempts??30,o=n.intervalMs??500,d=n.minNodeCount??10;for(let s=0;s<i;s++){let u=f(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let a=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof a=="number"&&a>d)return{bridge:u,count:a}}catch{}u.close(),await p(o)}return null}async function E(e,t,r,n={}){let i=n.timeoutMs??8e3,o=n.intervalMs??250,d=Date.now()+i;for(;Date.now()<d;){let s=f(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await s.send({type:"evaluate",code:"1"}),s}catch{s.close()}await p(o)}return null}async function F(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,i=t.pollIntervalMs??200,o=Date.now(),d=o+r,s=-1,u=o,a={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,errors:0};for(;Date.now()<d;){try{let m=await e.send({type:"evaluate",code:h}),c=Date.now()-o,l=Number(m?.nodes)||0,w=Number(m?.targets)||0,g=Number(m?.errors)||0,S=m?.flag===!0;if(l!==s&&(s=l,u=c),a={ready:!1,source:"timeout",elapsedMs:c,nodes:l,targets:w,errors:g},S&&l>=b&&y({nodes:l,targets:w})&&c-u>=T)return{ready:!0,source:"flag",elapsedMs:c,nodes:l,targets:w,errors:g};if(c>=n&&g>0&&!S)return{ready:!1,source:"error-bail",elapsedMs:c,nodes:l,targets:w,errors:g}}catch{}await p(i)}return a.nodes>=b&&y(a)?{...a,ready:!0,source:"nodes-fallback"}:{...a,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}export{p as a,k as b,D as c,I as d,_ as e,P as f,A as g,E as h,F as i};
|