sootsim 0.1.54 → 0.1.55
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-VZPUCYJ5.js → agent-K3IFO5CV.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-V7ALP2GU.js → agent-wrapper-QLSTAEJA.js} +2 -2
- package/dist-cli/chunks/{assert-7P4UILIO.js → assert-5YXZANCD.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-EXYDOLCY.js +2 -0
- package/dist-cli/chunks/beta-ER25Q3B4.js +2 -0
- package/dist-cli/chunks/chunk-2EGTJLOK.js +2 -0
- package/dist-cli/chunks/{chunk-ATMCM62D.js → chunk-4GLNQZFI.js} +2 -2
- package/dist-cli/chunks/{chunk-ZT6JZN2V.js → chunk-4OOZDIIQ.js} +2 -2
- package/dist-cli/chunks/{chunk-5FQNBWBM.js → chunk-6AEQVSS6.js} +2 -2
- package/dist-cli/chunks/{chunk-NZNOUWTN.js → chunk-6KGSLO4W.js} +1 -1
- package/dist-cli/chunks/{chunk-EE54B5YB.js → chunk-7CET27Q3.js} +2 -2
- package/dist-cli/chunks/{chunk-LHDZ4VZV.js → chunk-AO7LMODD.js} +10 -10
- package/dist-cli/chunks/chunk-APAO2IQW.js +1 -0
- package/dist-cli/chunks/{chunk-KK5EUVGJ.js → chunk-ATJEMKBT.js} +2 -2
- package/dist-cli/chunks/{chunk-ISHA4IUC.js → chunk-BNX3LAMN.js} +2 -2
- package/dist-cli/chunks/{chunk-E3P25GBM.js → chunk-BTP3PAIO.js} +2 -2
- package/dist-cli/chunks/{chunk-WYBVFDX7.js → chunk-CKNMXP6L.js} +1 -1
- package/dist-cli/chunks/{chunk-MAKAGEKD.js → chunk-CT3BVUCO.js} +2 -2
- package/dist-cli/chunks/{chunk-VWCU546H.js → chunk-DC7ANPA5.js} +1 -1
- package/dist-cli/chunks/{chunk-UYCFIVX6.js → chunk-DFNL55QN.js} +2 -2
- package/dist-cli/chunks/{chunk-VHKFU4S2.js → chunk-DVPSMF32.js} +1 -1
- package/dist-cli/chunks/{chunk-JBGQ23F4.js → chunk-EVARILGS.js} +1 -1
- package/dist-cli/chunks/{chunk-3HYJL6GY.js → chunk-ITS6IHOX.js} +1 -1
- package/dist-cli/chunks/{chunk-G33A5TWY.js → chunk-JHZ6QH6V.js} +2 -2
- package/dist-cli/chunks/{chunk-5SWIBDHV.js → chunk-LB4RU4OV.js} +1 -1
- package/dist-cli/chunks/{chunk-Y7ITI3X2.js → chunk-LBFWPKYG.js} +1 -1
- package/dist-cli/chunks/{chunk-QVCVU4DC.js → chunk-LOUL5QVO.js} +1 -1
- package/dist-cli/chunks/{chunk-XSZCYAXF.js → chunk-LXDHH3TW.js} +2 -2
- package/dist-cli/chunks/chunk-MTLPC2NY.js +2 -0
- package/dist-cli/chunks/{chunk-Z5YTYQHU.js → chunk-N5EKXLXC.js} +2 -2
- package/dist-cli/chunks/{chunk-IGM4OHW6.js → chunk-NCAKZ2QL.js} +2 -2
- package/dist-cli/chunks/{chunk-TJMYDDAG.js → chunk-OP4ALEJL.js} +1 -1
- package/dist-cli/chunks/{chunk-7FOK7RXF.js → chunk-PKYDQIBB.js} +3 -3
- package/dist-cli/chunks/{chunk-LZ7CVJAO.js → chunk-Q3LSFKVP.js} +2 -2
- package/dist-cli/chunks/{chunk-ACSKJEJV.js → chunk-Q5MLOHVB.js} +2 -2
- package/dist-cli/chunks/{chunk-NXR73Q5J.js → chunk-RN2SMUS4.js} +2 -2
- package/dist-cli/chunks/{chunk-MNGXYS2K.js → chunk-SDUNLEAF.js} +2 -2
- package/dist-cli/chunks/{chunk-TSXBCV5T.js → chunk-SPJQ6B6W.js} +2 -2
- package/dist-cli/chunks/chunk-T6NGCA35.js +1 -0
- package/dist-cli/chunks/{chunk-A2BA2KJN.js → chunk-UF27WZ7Q.js} +3 -3
- package/dist-cli/chunks/chunk-UNLFZUUU.js +1 -0
- package/dist-cli/chunks/{chunk-XFI4SBWQ.js → chunk-VPYEMRIC.js} +2 -2
- package/dist-cli/chunks/{chunk-DNTCQJWP.js → chunk-VZH3VTOY.js} +3 -3
- package/dist-cli/chunks/{chunk-DLINRAGW.js → chunk-W3M6NG6B.js} +1 -1
- package/dist-cli/chunks/{chunk-ZBR6H6LW.js → chunk-WZDVJFJX.js} +1 -1
- package/dist-cli/chunks/{chunk-M3KFUEUN.js → chunk-X46ROUJY.js} +1 -1
- package/dist-cli/chunks/chunk-X4VUDSXT.js +3 -0
- package/dist-cli/chunks/{chunk-EDU6E62D.js → chunk-YDKX4GPS.js} +2 -2
- package/dist-cli/chunks/{chunk-4PVSZ6GE.js → chunk-ZNXPOJDD.js} +1 -1
- package/dist-cli/chunks/cli-version-FQQ7DWZU.js +2 -0
- package/dist-cli/chunks/{compat-XQTJJGFN.js → compat-7EFQ4K63.js} +3 -3
- package/dist-cli/chunks/{config-SREAYZNH.js → config-BXQ5RYP3.js} +2 -2
- package/dist-cli/chunks/control-J7H2HTKN.js +2 -0
- package/dist-cli/chunks/{cpu-profile-CUXZKZ4Z.js → cpu-profile-P2HBDYZ3.js} +2 -2
- package/dist-cli/chunks/{daemon-MCR7OR22.js → daemon-EMP5NFIK.js} +2 -2
- package/dist-cli/chunks/{debug-XZBCUV3A.js → debug-VG2EYIRM.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-X3JPEPV6.js +2 -0
- package/dist-cli/chunks/{detox-X3G5ASPP.js → detox-6N2GHBJD.js} +2 -2
- package/dist-cli/chunks/{device-BV3VJE3V.js → device-L4MPWY7S.js} +2 -2
- package/dist-cli/chunks/{diagnose-F52LKBS6.js → diagnose-M7L2CKMA.js} +2 -2
- package/dist-cli/chunks/drivers-LCWLVDG3.js +2 -0
- package/dist-cli/chunks/{electron-VFZMSSGO.js → electron-TYPTY4Y7.js} +3 -3
- package/dist-cli/chunks/flow-IUMVR5GK.js +2 -0
- package/dist-cli/chunks/{hints-VANECRXI.js → hints-CLDM5YBJ.js} +2 -2
- package/dist-cli/chunks/{home-paths-J6PSRIMF.js → home-paths-CIRYHGNC.js} +2 -2
- package/dist-cli/chunks/{inspect-SNFMIN2L.js → inspect-IPLQLR2B.js} +94 -94
- package/dist-cli/chunks/install-3IBRZDCU.js +2 -0
- package/dist-cli/chunks/{install-desktop-X53RE7IV.js → install-desktop-DMIJXVAQ.js} +3 -3
- package/dist-cli/chunks/{keys-TS7M56JL.js → keys-6NSIIG5W.js} +2 -2
- package/dist-cli/chunks/{launch-OW5YEDFK.js → launch-WZPZT7QA.js} +3 -3
- package/dist-cli/chunks/{login-4TXQM3BF.js → login-DVAESD5E.js} +4 -4
- package/dist-cli/chunks/{logout-3C3FPCG7.js → logout-ZPNORUPW.js} +2 -2
- package/dist-cli/chunks/{maestro-N74HJGTI.js → maestro-TCIBCLOE.js} +2 -2
- package/dist-cli/chunks/{preview-FXVS46B5.js → preview-QXRUBXPI.js} +2 -2
- package/dist-cli/chunks/{profile-TPFRKRKJ.js → profile-YQMD5RSB.js} +2 -2
- package/dist-cli/chunks/{react-6Q34SQFO.js → react-TU4SHD4N.js} +2 -2
- package/dist-cli/chunks/{record-7F6XI6Z3.js → record-VWCIULWT.js} +2 -2
- package/dist-cli/chunks/runtime-AFEO53IB.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-7TRQ44Z6.js → runtime-delivery-U65W6ABO.js} +2 -2
- package/dist-cli/chunks/{screenshot-M2F3KS6M.js → screenshot-2NP6RB6K.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-HZAPMY7V.js → screenshot-mode-HTTJRZXJ.js} +2 -2
- package/dist-cli/chunks/{screenshots-PKBYEBBM.js → screenshots-YOGPCEDA.js} +2 -2
- package/dist-cli/chunks/{server-OU3NTCYI.js → server-ZTCVFCWZ.js} +2 -2
- package/dist-cli/chunks/setup-repo-ITPK57UJ.js +2 -0
- package/dist-cli/chunks/{skills-L5EPL5WL.js → skills-EC7Q2ISG.js} +2 -2
- package/dist-cli/chunks/{start-XLPRV6L7.js → start-MODFVXM3.js} +4 -4
- package/dist-cli/chunks/store-2EL3VFR5.js +2 -0
- package/dist-cli/chunks/telemetry-3CH4GAWO.js +2 -0
- package/dist-cli/chunks/{test-W5YAIGGY.js → test-QASBXD56.js} +3 -3
- package/dist-cli/chunks/{three-mode-NXKHTAYK.js → three-mode-ANW4NQAP.js} +2 -2
- package/dist-cli/chunks/{timeline-5UL2A7L2.js → timeline-NQUBPM67.js} +2 -2
- package/dist-cli/chunks/{upgrade-K4WXKMQI.js → upgrade-A3TXVNAC.js} +2 -2
- package/dist-cli/chunks/upload-URNEXJIS.js +2 -0
- package/dist-cli/chunks/{web-SLKO5KZU.js → web-DH4EW3I6.js} +2 -2
- package/dist-cli/chunks/{what-happened-NYYYNWGO.js → what-happened-AWHOPBQ3.js} +2 -2
- package/dist-cli/chunks/{whoami-OUJMAWR7.js → whoami-ZZYOBY77.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/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-45LPPN26.js +0 -2
- package/dist-cli/chunks/beta-YJTC67JV.js +0 -2
- package/dist-cli/chunks/chunk-76WUDRCG.js +0 -2
- package/dist-cli/chunks/chunk-ARLGT7VR.js +0 -1
- package/dist-cli/chunks/chunk-BS3ITOUF.js +0 -1
- package/dist-cli/chunks/chunk-CKZ4LXSQ.js +0 -1
- package/dist-cli/chunks/chunk-ISQUXL6J.js +0 -3
- package/dist-cli/chunks/chunk-J6CCM5BR.js +0 -2
- package/dist-cli/chunks/cli-version-TG76CSHZ.js +0 -2
- package/dist-cli/chunks/control-LZR3EEK6.js +0 -2
- package/dist-cli/chunks/demo-app-registry-TTMQ5X4I.js +0 -2
- package/dist-cli/chunks/drivers-A75SQEWU.js +0 -2
- package/dist-cli/chunks/flow-5LTGWXWP.js +0 -2
- package/dist-cli/chunks/install-NEFJEKEX.js +0 -2
- package/dist-cli/chunks/runtime-UHC43LJI.js +0 -2
- package/dist-cli/chunks/setup-repo-4WQXPADN.js +0 -2
- package/dist-cli/chunks/store-TUCLRZNK.js +0 -2
- package/dist-cli/chunks/telemetry-PHCMEH7N.js +0 -2
- package/dist-cli/chunks/upload-LVC4KCUG.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.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as l}from"./chunks/chunk-SDUNLEAF.js";import{a as A,b as k,c as S,d as L,e as u,f as T}from"./chunks/chunk-CKNMXP6L.js";import{a as d}from"./chunks/chunk-MTLPC2NY.js";import{a as v,d as _}from"./chunks/chunk-6KGSLO4W.js";import{a as E}from"./chunks/chunk-DC7ANPA5.js";import"./chunks/chunk-X46ROUJY.js";import"./chunks/chunk-2EGTJLOK.js";import{z as C}from"./chunks/chunk-WZDVJFJX.js";import"./chunks/chunk-OP4ALEJL.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-3CH4GAWO.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-3CH4GAWO.js");await e(),process.exit(t)}if(o.version){let{getCliVersion:t}=await import("./chunks/cli-version-FQQ7DWZU.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-ER25Q3B4.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${t()}${m}`);let{readActiveRuntime:I}=await import("./chunks/home-paths-CIRYHGNC.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-2EL3VFR5.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-MODFVXM3.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-EXYDOLCY.js"),i=e(s,a);await t(i);let{runInspect:m}=await import("./chunks/inspect-IPLQLR2B.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:t}=await import("./chunks/assert-5YXZANCD.js");await t(o.commandArgs);break}case"flow":{let{runFlow:t}=await import("./chunks/flow-IUMVR5GK.js"),e=await t(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:t}=await import("./chunks/test-QASBXD56.js");await t(o.commandArgs,{port:a,verbose:n});break}case"detox":{let{runDetox:t}=await import("./chunks/detox-6N2GHBJD.js");await t(o.commandArgs,{port:a,verbose:n});break}case"maestro":{let{runMaestro:t}=await import("./chunks/maestro-TCIBCLOE.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-QXRUBXPI.js");await t(o.commandArgs,{port:a,verbose:n});break}case"record":{let{runRecord:t}=await import("./chunks/record-VWCIULWT.js");await t(s,{port:a,verbose:n});break}case"profile":{let{runProfile:t}=await import("./chunks/profile-YQMD5RSB.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-P2HBDYZ3.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-TU4SHD4N.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-2NP6RB6K.js");await t(s,{port:a,verbose:n});break}case"screenshots":{let{runScreenshots:t}=await import("./chunks/screenshots-YOGPCEDA.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-HTTJRZXJ.js");await t(o.commandArgs,{port:a,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:t}=await import("./chunks/three-mode-ANW4NQAP.js");await t(o.commandArgs,{port:a,verbose:n});break}case"inspect":{let{runInspect:t}=await import("./chunks/inspect-IPLQLR2B.js");await t(s,{port:a,verbose:n});break}case"debug":{let{runDebug:t}=await import("./chunks/debug-VG2EYIRM.js");await t(s,{port:a,verbose:n});break}case"timeline":{let{runTimeline:t}=await import("./chunks/timeline-NQUBPM67.js");await t(s,{port:a,verbose:n});break}case"what-happened":{let{runWhatHappened:t}=await import("./chunks/what-happened-AWHOPBQ3.js");await t(s,{port:a,verbose:n});break}case"diagnose":{let{runDiagnose:t}=await import("./chunks/diagnose-M7L2CKMA.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-EXYDOLCY.js"),i=e(s,a);await t(i);let{runOpenCommand:m}=await import("./chunks/control-J7H2HTKN.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:t}=await import("./chunks/control-J7H2HTKN.js");await t(s,{port:a});break}case"claim":{let{runClaimCommand:t}=await import("./chunks/control-J7H2HTKN.js");await t(s,{port:a});break}case"close":{let{runCloseCommand:t}=await import("./chunks/control-J7H2HTKN.js");await t(s,{port:a});break}case"config":{let{runConfig:t}=await import("./chunks/config-BXQ5RYP3.js");await t(o.commandArgs);break}case"device":{let{runDeviceCommand:t}=await import("./chunks/device-L4MPWY7S.js");await t(s,{port:a});break}case"scan":case"compat":{let{runCompat:t}=await import("./chunks/compat-7EFQ4K63.js");await t(o.commandArgs);break}case"electron":{let{runElectron:t}=await import("./chunks/electron-TYPTY4Y7.js");await t(o.commandArgs,{port:a,device:p,driver:R});break}case"login":{let{runLogin:t}=await import("./chunks/login-DVAESD5E.js");await t(o.commandArgs);break}case"logout":{let{runLogout:t}=await import("./chunks/logout-ZPNORUPW.js");await t();break}case"whoami":{let{runWhoami:t}=await import("./chunks/whoami-ZZYOBY77.js");await t();break}case"keys":{let{runKeys:t}=await import("./chunks/keys-6NSIIG5W.js");await t(o.commandArgs);break}case"setup-repo":{let{runSetupRepo:t}=await import("./chunks/setup-repo-ITPK57UJ.js");await t(o.commandArgs);break}case"install":{let{runInstall:t}=await import("./chunks/install-3IBRZDCU.js");await t(o.commandArgs);break}case"install-desktop":{let{runInstallDesktop:t}=await import("./chunks/install-desktop-DMIJXVAQ.js");await t(o.commandArgs);break}case"server":{let{runServer:t}=await import("./chunks/server-ZTCVFCWZ.js");await t(o.commandArgs,{port:a});break}case"daemon":{let{runDaemon:t}=await import("./chunks/daemon-EMP5NFIK.js");await t(o.commandArgs,{port:a});break}case"runtime":{let{runRuntime:t}=await import("./chunks/runtime-AFEO53IB.js");await t(o.commandArgs);break}case"upgrade":{let{runUpgrade:t}=await import("./chunks/upgrade-A3TXVNAC.js");await t(o.commandArgs);break}case"launch":{let{runLaunch:t}=await import("./chunks/launch-WZPZT7QA.js");await t(o.commandArgs);break}case"start":{let{runStart:t}=await import("./chunks/start-MODFVXM3.js");await t(o.commandArgs,{port:a});break}case"agent":{let{runAgentCommand:t}=await import("./chunks/agent-K3IFO5CV.js"),e=await t(o.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:t}=await import("./chunks/agent-wrapper-QLSTAEJA.js"),e=await t(o.commandArgs);process.exit(e)}case"skills":{let{runSkills:t}=await import("./chunks/skills-EC7Q2ISG.js");await t(o.commandArgs);break}case"upload":{let{runUpload:t}=await import("./chunks/upload-URNEXJIS.js");await t(o.commandArgs,{port:a,verbose:n});break}case"hints":{let{runHints:t}=await import("./chunks/hints-CLDM5YBJ.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.55 | (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-BNX3LAMN.js";import"./chunk-DVPSMF32.js";import"./chunk-2EGTJLOK.js";import"./chunk-WZDVJFJX.js";import"./chunk-OP4ALEJL.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.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-DVPSMF32.js";import"./chunk-OP4ALEJL.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.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-OP4ALEJL.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.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-UF27WZ7Q.js";import"./chunk-SPJQ6B6W.js";import"./chunk-ZNXPOJDD.js";import"./chunk-2EGTJLOK.js";import"./chunk-WZDVJFJX.js";import"./chunk-OP4ALEJL.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 y,c as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as y,c as C}from"./chunk-LOUL5QVO.js";import{a as x}from"./chunk-4OOZDIIQ.js";import{exec as U}from"child_process";import _ from"http";import D from"net";import{promisify as T}from"util";var P=T(U),E=250,A=1500,M=120;function R(e,r=M){return new Promise(s=>{let t=new D.Socket,o=!1,i=a=>{o||(o=!0,t.destroy(),s(a))};t.setTimeout(r),t.once("connect",()=>i(!0)),t.once("timeout",()=>i(!1)),t.once("error",()=>i(!1)),t.connect(e,"localhost")})}function h(e,r,s="GET",t=E,o={}){return new Promise(i=>{let a=_.request({hostname:"localhost",port:e,path:r,method:s,timeout:t,headers:o},n=>{let c="";n.on("data",l=>c+=l.toString());let u=(()=>{let l=n.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();n.on("end",()=>i({statusCode:n.statusCode||0,body:c,contentType:u}))});a.on("error",()=>i(null)),a.setTimeout(t,()=>{a.destroy(),i(null)}),a.end()})}var N=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function v(e,r){return!(e<=0||e>=2e4||r.has(e)||e>=5170&&e<=5200)}async function L(e=[]){let r=new Set(e);try{let{stdout:s}=await P("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(s.trim()){let t=new Map;for(let o of s.trim().split(`
|
|
3
3
|
`)){let i=o.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),c=i[8].match(/:(\d+)$/);if(!c)continue;let u=Number(c[1]);v(u,r)&&(t.has(u)||t.set(u,a))}if(t.size>0)return[...t.entries()].map(([o,i])=>({port:o,pid:i}))}}catch{}try{let{stdout:s}=await P(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(s.trim()){let t=new Map;for(let o of s.trim().split(`
|
|
4
4
|
`)){let i=o.match(/:(\d+)\s/),a=o.match(/pid=(\d+)/);if(!i)continue;let n=Number(i[1]),c=a?Number(a[1]):0;v(n,r)&&(t.has(n)||t.set(n,c))}if(t.size>0)return[...t.entries()].map(([o,i])=>({port:o,pid:i}))}}catch{}return N.filter(s=>v(s.port,r))}var S=new Map;async function $(e){if(e<=0)return null;let r=S.get(e);if(r)return r;try{let{stdout:s}=await P(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let t of s.split(`
|
|
5
5
|
`))if(t.startsWith("n")&&t.length>1){let o=t.slice(1).trim();if(o)return S.set(e,o),o}}catch{}return null}function I(e,r){return{port:e,framework:r,bundleUrl:m(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function m(e,r){let s=x.find(o=>o.preferredPort===e),t=s?.runtimeConfig?y(r,s.runtimeConfig):r;return C(t)}function O(e){return e.includes("/node_modules/one/metro-entry.bundle")}function j(e){try{let r=JSON.parse(e);return r&&typeof r=="object"?r:null}catch{return null}}function w(e,r,s){if(!r)return e;try{let t=JSON.parse(r.body),o=t?.extra?.expoClient||t?.extra||{};o.name&&(e.projectName=o.name),o.ios?.bundleIdentifier&&(e.bundleId=o.ios.bundleIdentifier),e.framework==="metro"&&o.sdkVersion&&(e.framework="expo");let i=t?.launchAsset?.url;i&&!e.patched&&!O(e.bundleUrl)&&(e.bundleUrl=m(e.port,i));let a=o.iconUrl||o.ios?.iconUrl||o.icon||o.ios?.icon;if(a)if(e.iconPath=a,s)if(a.startsWith("http"))e.iconUrl=s(a);else{let n=a.replace(/^\.\//,"");e.iconUrl=s(`http://localhost:${e.port}/assets/${n}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var d=new Set,f=new Set,b=new Set;async function H(e,r){if(!await R(e))return null;let s="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[t,o,i,a,n]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),h(e,s,"HEAD"),b.has(e)?Promise.resolve(null):h(e,"/","GET",A,{"expo-platform":"ios"}),f.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);n&&n.statusCode===200?f.delete(e):f.has(e)||f.add(e);let c=a?j(a.body):null,u=typeof c?.launchAsset?.url=="string"?c.launchAsset.url:null,l=c?.extra?.expoClient||c?.extra||{};if(c&&(u||typeof l.name=="string")){d.add(e);let p=u||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,k=p.includes("/one/metro-entry.bundle")?"one":"expo";return w({port:e,framework:k,bundleUrl:m(e,p),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},a,r)}return i&&i.statusCode>0&&i.statusCode<400&&/application\/javascript/i.test(i.contentType||"")?(d.add(e),b.add(e),w({port:e,framework:"one",bundleUrl:m(e,`http://localhost:${e}${s}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},a,r)):o&&o.body.includes("packager-status:running")?(d.add(e),w(I(e,n&&n.statusCode===200?"expo":"metro"),a,r)):t&&t.statusCode===200&&t.body.includes("sootsim-patched")?(d.delete(e),w({port:e,framework:"one",bundleUrl:m(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},a,r)):(d.add(e),null)}function B(e){let r=e.projectName?.trim().toLowerCase();return!!(r==="soot"||r==="sootsim"||e.bundleId?.trim().toLowerCase()?.startsWith("dev.soot"))}var g=new Map,G=3e4,W=1500;function F(e){return!e||e.framework==="metro"||e.framework==="unknown"}function z(e){return e?m(e.port,e.bundleUrl)===e.bundleUrl:!0}function q(e,r,s=Date.now()){if(r===0||e.pid!==r||!z(e.result))return!1;let t=s-e.cachedAt;return!(e.result===null&&t>=G||F(e.result)&&t>=W)}async function ee(e={}){let r=await L(e.excludePorts),s=new Set(r.map(n=>n.port));for(let n of[...g.keys()])s.has(n)||g.delete(n);for(let n of[...d])s.has(n)||d.delete(n);for(let n of[...f])s.has(n)||f.delete(n);for(let n of[...b])s.has(n)||b.delete(n);let t=[],o=[];for(let{port:n,pid:c}of r){let u=g.get(n);if(u&&q(u,c)){u.result&&t.push(u.result);continue}u&&u.pid!==c&&(d.delete(n),f.delete(n),b.delete(n)),o.push({port:n,pid:c})}o.length>0&&(await Promise.all(o.map(c=>H(c.port,e.buildIconProxyUrl)))).forEach((c,u)=>{let{port:l,pid:p}=o[u];p!==0&&g.set(l,{pid:p,result:c,cachedAt:Date.now()}),c&&t.push(c)});let i=new Map;for(let{port:n,pid:c}of r)c>0&&i.set(n,c);await Promise.all(t.map(async n=>{let c=i.get(n.port);if(!c)return;n.pid=c;let u=await $(c);u&&(n.cwd=u)}));let a=new Set(i.values());for(let n of[...S.keys()])a.has(n)||S.delete(n);return t.filter(n=>!B(n))}export{ee as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as L}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as L}from"./chunk-OP4ALEJL.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 P,b as v}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as P,b as v}from"./chunk-W3M6NG6B.js";import{d as j}from"./chunk-UF27WZ7Q.js";import{a as b}from"./chunk-YDKX4GPS.js";import{execSync as A}from"child_process";import{existsSync as w,readFileSync as _,writeFileSync as x}from"fs";import{relative as B,resolve as d}from"path";import{existsSync as p,readFileSync as k,readdirSync as O,statSync as R}from"fs";import{basename as L,dirname as T,join as a}from"path";function D(e){let o=e;for(;;){if(p(a(o,"turbo.json"))||p(a(o,"nx.json"))||p(a(o,"lerna.json"))||p(a(o,"pnpm-workspace.yaml")))return o;let i=a(o,"package.json");if(p(i))try{if(JSON.parse(k(i,"utf8")).workspaces)return o}catch{}let r=T(o);if(r===o)break;o=r}return e}function W(e){return p(a(e,"bun.lock"))||p(a(e,"bun.lockb"))?"bun":p(a(e,"pnpm-lock.yaml"))?"pnpm":p(a(e,"yarn.lock"))?"yarn":"npm"}function J(e){if(p(a(e,"turbo.json")))return"turbo";if(p(a(e,"nx.json")))return"nx";if(p(a(e,"pnpm-workspace.yaml")))return"pnpm";let o=a(e,"package.json");if(p(o))try{if(JSON.parse(k(o,"utf8")).workspaces)return"npm-workspaces"}catch{}return"single"}function N(e){return e.one?"one":e.expo?"expo":e["react-native"]?"bare":"unknown"}function y(e){let o=a(e,"package.json");if(!p(o))return null;let i;try{i=JSON.parse(k(o,"utf8"))}catch{return null}let r={...i.dependencies,...i.devDependencies},s=N(r);return s==="unknown"?null:{dir:e,name:i.name||L(e),framework:s,hasViteConfig:p(a(e,"vite.config.ts"))||p(a(e,"vite.config.js")),hasMetroConfig:p(a(e,"metro.config.js"))||p(a(e,"metro.config.ts")),hasSootsimDependency:!!r.sootsim,devCommand:i.scripts?.dev||null}}function V(e){let o=[],i=a(e,"pnpm-workspace.yaml");if(p(i)){let t=k(i,"utf8").match(/packages:\s*\n((?:\s+-\s+.+\n?)+)/);if(t){let c=t[1].split(`
|
|
3
3
|
`).filter(Boolean);for(let n of c){let g=n.replace(/^\s*-\s*['"]?/,"").replace(/['"]?\s*$/,"");g&&o.push(...S(e,g))}}return o}let r=a(e,"package.json");if(p(r))try{let s=JSON.parse(k(r,"utf8")),t=Array.isArray(s.workspaces)?s.workspaces:s.workspaces?.packages||[];for(let c of t)o.push(...S(e,c))}catch{}return o}function S(e,o){let i=o.replace(/\/\*\*?$/,"").replace(/\*$/,""),r=a(e,i);if(!p(r))return[];try{return O(r).map(t=>a(r,t)).filter(t=>{try{return R(t).isDirectory()&&p(a(t,"package.json"))}catch{return!1}})}catch{return[]}}function M(e){let o=J(e),i=W(e);if(o==="single"){let c=y(e);return{root:e,type:o,packageManager:i,apps:c?[c]:[]}}let r=V(e),s=[],t=y(e);t&&s.push(t);for(let c of r){if(c===e)continue;let n=y(c);n&&s.push(n)}return{root:e,type:o,packageManager:i,apps:s}}function $(e){switch(e){case"bun":return"bun add -d sootsim";case"pnpm":return"pnpm add -D sootsim";case"yarn":return"yarn add -D sootsim";case"npm":return"npm install -D sootsim"}}async function ce(e){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
4
4
|
sootsim setup-repo \u2014 set up sootsim in your project
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=!0,e="1.0.0",o="public beta",n=`${o} \xB7 free until ${e}`,r="free for everyone until 1.0 \u2014 we send anonymous error and dependency data while you use it";export{t as a,e as b,o as c,n as d,r as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{c as i,e as d,h as c}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{c as i,e as d,h as c}from"./chunk-SPJQ6B6W.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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
async function
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
async function v(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function I(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function T(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
|
|
5
5
|
const kb = window.__sootsimKeyboard
|
|
@@ -87,7 +87,7 @@ async function x(e){let t=await e.send({type:"evaluate",code:"(async () => await
|
|
|
87
87
|
return all
|
|
88
88
|
.filter(n => isVisibleTarget(n) && hasAccessibleSignal(n))
|
|
89
89
|
.map(normalize)
|
|
90
|
-
})()`;async function
|
|
90
|
+
})()`;async function k(e){let t=await e.send({type:"evaluate",code:y});return Array.isArray(t)?t:[]}var l=`
|
|
91
91
|
const fromInspectable = async () => {
|
|
92
92
|
if (typeof t.listInspectable !== 'function') return null
|
|
93
93
|
const list = await t.listInspectable({})
|
|
@@ -181,7 +181,7 @@ ${l}
|
|
|
181
181
|
})()`}:e.visible?{mode:"visible",code:`(async () => {
|
|
182
182
|
const all = await window.__sootsimTest.queryAll({ pruneHidden: true })
|
|
183
183
|
return all.filter(n => n.layout && n.layout.width > 0 && n.layout.height > 0)
|
|
184
|
-
})()`}:e.text?{mode:"text",code:`(async () => await window.__sootsimTest.findByText(${JSON.stringify(e.text)}))()`}:null}async function
|
|
184
|
+
})()`}:e.text?{mode:"text",code:`(async () => await window.__sootsimTest.findByText(${JSON.stringify(e.text)}))()`}:null}async function L(e,t){let n=p(t);if(!n)return null;let s=await e.send({type:"evaluate",code:n.code});return{mode:n.mode,result:s}}function P(e){return[...e].sort((t,n)=>c(n)-c(t))}function c(e){let t=0;e.testID&&(t+=100),typeof e.text=="string"&&e.text.trim().length>0&&(t+=60),typeof e.accessibilityLabel=="string"&&e.accessibilityLabel.trim().length>0&&(t+=30),e.accessibilityRole&&(t+=15);let n=e.layout?.width??0,s=e.layout?.height??0,r=n*s;return r>=400&&r<=6e4?t+=25:r>6e4&&(t-=20),(e.absolutePosition?.y??0)<0&&(t-=30),t}function A(e){if(e.testID)return`sootsim do tap-id ${u(e.testID)}`;let t=typeof e.text=="string"?e.text.trim():"";if(t.length>0&&t.length<=80)return`sootsim do tap-text ${u(t)}`;let n=Math.round(((e.absolutePosition?.x??0)+(e.layout?.width??0)/2)*10)/10,s=Math.round(((e.absolutePosition?.y??0)+(e.layout?.height??0)/2)*10)/10;return`sootsim do tap ${n} ${s}`}function u(e){return/^[A-Za-z0-9_./@:-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}var b=`(async () => {
|
|
185
185
|
const t = window.__sootsimTest
|
|
186
186
|
let nodes = 0
|
|
187
187
|
try { nodes = (await t?.getNodeCount?.()) || 0 } catch {}
|
|
@@ -234,7 +234,7 @@ ${l}
|
|
|
234
234
|
targets,
|
|
235
235
|
errors,
|
|
236
236
|
}
|
|
237
|
-
})()`,
|
|
237
|
+
})()`,g=50,m=100,f=750;function w(e){return e.targets>0||e.nodes>=m}async function D(e,t=2e4){let n=Date.now(),s=n+t,r=-1,o=n,i={flag:void 0,at:0,nodes:0,targets:0,errors:0};for(;Date.now()<s;){try{i=await e.send({type:"evaluate",code:b})??i}catch{}let a=Date.now();if(i.nodes!==r&&(r=i.nodes,o=a),i.flag===!0&&i.nodes>=g&&w(i)&&a-o>=f)return{ready:!0,elapsedMs:a-n,nodes:i.nodes};await new Promise(d=>setTimeout(d,150))}return{ready:!1,elapsedMs:Date.now()-n,nodes:i.nodes}}async function R(e,t,n=5e3){return await e.send({type:"evaluate",code:`(async () => {
|
|
238
238
|
const start = Date.now()
|
|
239
239
|
const deadline = start + ${n}
|
|
240
240
|
const t = window.__sootsimTest
|
|
@@ -253,17 +253,17 @@ ${l}
|
|
|
253
253
|
await new Promise((r) => setTimeout(r, 80))
|
|
254
254
|
}
|
|
255
255
|
return { found: false, elapsed: Date.now() - start }
|
|
256
|
-
})()`})??{found:!1,elapsed:n}}async function
|
|
256
|
+
})()`})??{found:!1,elapsed:n}}async function E(e,t=20){let n=await e.send({type:"evaluate",code:`window.__sootsimConsole?.getErrors(${t}) || []`});return Array.isArray(n)?n:[]}async function H(e,t=20){let n=await e.send({type:"evaluate",code:`window.__sootsimConsole?.getWarnings(${t}) || []`});return Array.isArray(n)?n:[]}async function N(e){await e.send({type:"evaluate",code:'window.__sootsimConsole?.clear(); "cleared"'})}async function B(e,t={}){let n=t.limit??20,s=t.failed===!1?"getRequests":"getFailedRequests",r=await e.send({type:"call",path:`__sootsimTest.${s}`,args:[n]});return Array.isArray(r)?r:[]}async function C(e){await e.send({type:"call",path:"__sootsimTest.clearRequests",args:[]})}async function $(e){let t=await e.send({type:"evaluate",code:`(() => {
|
|
257
257
|
const obs = window.__sootsimObservability;
|
|
258
258
|
if (!obs) return { ok: false };
|
|
259
259
|
return { ok: true, entries: obs.logs.getSnapshot() };
|
|
260
|
-
})()`});if(!t||!t.ok)throw new Error("observability bridge not installed \u2014 is the engine running?");return t.entries??[]}async function
|
|
260
|
+
})()`});if(!t||!t.ok)throw new Error("observability bridge not installed \u2014 is the engine running?");return t.entries??[]}async function M(e){await e.send({type:"evaluate",code:'window.__sootsimObservability?.logs.clear(); "cleared"'})}function h(e,t){if(e.source===t.source||e.level!==t.level||Math.abs(e.ts-t.ts)>1e3||e.args.length!==t.args.length)return!1;let n=new Set([e.source,t.source]);return!n.has("sootsim-worker")||!n.has("render-worker")&&!n.has("forwarded-render-worker")?!1:e.args.every((s,r)=>s===t.args[r])}function O(e,t={}){let n=[];for(let s of e)n.some(r=>h(r,s))||n.push(s);if(t.showInternal||(n=n.filter(s=>{let r=s.args[0];return!(typeof r=="string"&&r.startsWith("[sootsim]"))})),t.level&&(n=n.filter(s=>t.level.has(s.level))),t.filter){let s=t.filter.toLowerCase();n=n.filter(r=>r.args.join(" ").toLowerCase().includes(s))}return n}async function F(e,t){return await e.send({type:"call",path:"SootSim.bridges.timeline.summary",args:[t]})}async function W(e,t){return await e.send({type:"call",path:"SootSim.bridges.timeline.recent",args:[t]})}async function z(e,t,n){await e.send({type:"call",path:"SootSim.bridges.timeline.cursorAdvance",args:[t,n]})}async function K(e){return await e.send({type:"evaluate",code:`(() => {
|
|
261
261
|
const kb = window.__sootsimKeyboard
|
|
262
262
|
if (!kb || typeof kb.getLayout !== 'function') {
|
|
263
263
|
return { error: 'keyboard bridge getLayout() not available' }
|
|
264
264
|
}
|
|
265
265
|
return kb.getLayout()
|
|
266
|
-
})()`})??{error:"keyboard bridge returned no result"}}function
|
|
266
|
+
})()`})??{error:"keyboard bridge returned no result"}}function S(e){let t=e instanceof Error?e.message:String(e);return t.includes("call target not found: SootSim.bridges.mainShell")||t.includes("test bridge unavailable before app-in-worker boot")}async function x(e,t=0){let n=Date.now()+Math.max(0,t);for(;;)try{return await e.send({type:"call",path:"SootSim.bridges.mainShell.getState",args:[]})}catch(s){if(!S(s)||Date.now()>=n)throw s;await new Promise(r=>setTimeout(r,50))}}async function J(e){let t=await e.send({type:"evaluate",code:`(async () => {
|
|
267
267
|
const test = window.__sootsimTest
|
|
268
268
|
const kb = window.__sootsimKeyboard
|
|
269
269
|
const navSnap =
|
|
@@ -287,7 +287,7 @@ ${l}
|
|
|
287
287
|
})()
|
|
288
288
|
: null
|
|
289
289
|
return { nav: navSnap, keyboard }
|
|
290
|
-
})()`});return{shell:await
|
|
290
|
+
})()`});return{shell:await x(e,500).catch(()=>null),nav:t?.nav??null,keyboard:t?.keyboard??null}}async function V(e){return e.send({type:"evaluate",code:"window.__sootsimDebug.status()"})}async function Q(e){return e.send({type:"evaluate",code:"window.__sootsimDebug.flags()"})}async function j(e,t){let n=t==="sheets"?"findSheets":"findPortals";return e.send({type:"evaluate",code:`window.__sootsimDebug.${n}()`})}async function Y(e,t,n=50){let s=t&&t!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(t)}, ${n})`:`window.__sootsimDebug.recent(undefined, ${n})`;return e.send({type:"evaluate",code:s})}async function q(e,t,n){let s=n.length>0?n.map(r=>JSON.stringify(r)).join(", "):t==="disable"?"'all'":"";return e.send({type:"evaluate",code:`window.__sootsimDebug.${t}(${s})`})}async function U(e){return await e.send({type:"evaluate",code:`(async () => {
|
|
291
291
|
const host = window.__sootsimRenderHost
|
|
292
292
|
const stats = host?.queryStats ? await host.queryStats() : null
|
|
293
293
|
const hostMem = performance.memory
|
|
@@ -302,4 +302,4 @@ ${l}
|
|
|
302
302
|
workerHeap: stats?.memory?.workerHeap ?? null,
|
|
303
303
|
hostHeap: hostMem,
|
|
304
304
|
}
|
|
305
|
-
})()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function
|
|
305
|
+
})()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function G(e){if(e.total===0)return"nothing recorded";let t=[],n=["error","warning","console","fetch","toast","alert","actionsheet","picker","notification","screen","route","keyboard","app-launch","shell","scroll","gesture","text-input","react-commit","animation","reanimated"],s=new Set;for(let r of n){let o=e.byKind[r];o&&(t.push(`${o} ${r}${o===1?"":"s"}`),s.add(r))}for(let[r,o]of Object.entries(e.byKind))!s.has(r)&&o&&t.push(`${o} ${r}${o===1?"":"s"}`);return t.join(" \xB7 ")}export{v as a,I as b,T as c,_ as d,k as e,L as f,P as g,A as h,b as i,g as j,f as k,w as l,D as m,R as n,E as o,H as p,N as q,B as r,C as s,$ as t,M as u,O as v,F as w,W as x,z as y,K as z,S as A,x as B,J as C,V as D,Q as E,j as F,Y as G,q as H,U as I,G as J};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as p}from"./chunk-NCAKZ2QL.js";import{d as c,e as l}from"./chunk-VPYEMRIC.js";import{a}from"./chunk-JHZ6QH6V.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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-VHKFU4S2.js";import{l as D}from"./chunk-ZBR6H6LW.js";import{a as T}from"./chunk-TJMYDDAG.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-TTMQ5X4I.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.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-DVPSMF32.js";import{l as D}from"./chunk-WZDVJFJX.js";import{a as T}from"./chunk-OP4ALEJL.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-X3JPEPV6.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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as ks}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.55 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as ks}from"./chunk-OP4ALEJL.js";var fi=`(async () => {
|
|
3
3
|
try { localStorage.clear() } catch {}
|
|
4
4
|
try { sessionStorage.clear() } catch {}
|
|
5
5
|
try {
|