sootsim 0.1.85 → 0.1.86
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-T3DUH5YJ.js → agent-S3WLX5Z4.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-NSBF4THI.js → agent-wrapper-PFPEQTPG.js} +2 -2
- package/dist-cli/chunks/{assert-X3F7TRCZ.js → assert-RQD66YGE.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-PWF7OYCV.js +2 -0
- package/dist-cli/chunks/beta-2HH7F2DQ.js +2 -0
- package/dist-cli/chunks/{chunk-WGDL5V6C.js → chunk-2IYMBWHL.js} +1 -1
- package/dist-cli/chunks/{chunk-5DIGWOY7.js → chunk-3GCSX5H5.js} +1 -1
- package/dist-cli/chunks/{chunk-OISHLFON.js → chunk-3TNIXR6J.js} +1 -1
- package/dist-cli/chunks/{chunk-5N3V7OCG.js → chunk-535UNERF.js} +2 -2
- package/dist-cli/chunks/{chunk-G7CIZ5S3.js → chunk-5DFVKWYQ.js} +3 -3
- package/dist-cli/chunks/{chunk-GTAD6IUV.js → chunk-5NW6W7YF.js} +1 -1
- package/dist-cli/chunks/{chunk-EKXK3SWK.js → chunk-5ZYANOOI.js} +2 -2
- package/dist-cli/chunks/{chunk-BZL6D4TV.js → chunk-6A7IWFXR.js} +63 -62
- package/dist-cli/chunks/{chunk-BHZJ6RIH.js → chunk-6LG7WJMD.js} +2 -2
- package/dist-cli/chunks/{chunk-EFM53PZ5.js → chunk-7YZHI7V6.js} +1 -1
- package/dist-cli/chunks/{chunk-QLJNSOS7.js → chunk-CMAANHYQ.js} +1 -1
- package/dist-cli/chunks/{chunk-KUSQ4NNJ.js → chunk-CQAQTU5K.js} +1 -1
- package/dist-cli/chunks/{chunk-AFNDVS4E.js → chunk-CSJS4MRN.js} +2 -2
- package/dist-cli/chunks/{chunk-7LKUN46F.js → chunk-DKW7Q4F3.js} +2 -2
- package/dist-cli/chunks/{chunk-ZO3VHP6W.js → chunk-EDWDFOPL.js} +1 -1
- package/dist-cli/chunks/{chunk-EBEL6TTJ.js → chunk-FF5KD3BS.js} +2 -2
- package/dist-cli/chunks/{chunk-BESAZ2HA.js → chunk-FO52BFW4.js} +2 -2
- package/dist-cli/chunks/chunk-I3JMONYJ.js +2 -0
- package/dist-cli/chunks/{chunk-UYRGCJ4N.js → chunk-JB467MUR.js} +45 -45
- package/dist-cli/chunks/{chunk-SBGOUA6F.js → chunk-JBYW57OA.js} +2 -2
- package/dist-cli/chunks/{chunk-NVTL3JQG.js → chunk-JITAVV2G.js} +1 -1
- package/dist-cli/chunks/{chunk-O6N2CEET.js → chunk-JMILXXI4.js} +2 -2
- package/dist-cli/chunks/chunk-KGYC4SZA.js +2 -0
- package/dist-cli/chunks/{chunk-H44IQHKZ.js → chunk-KQYOS5SM.js} +1 -1
- package/dist-cli/chunks/{chunk-HQDJ5BOF.js → chunk-M6GOCS27.js} +1 -1
- package/dist-cli/chunks/{chunk-DWTLRPEN.js → chunk-NBBH2PVW.js} +2 -2
- package/dist-cli/chunks/chunk-NIRJVBXJ.js +1 -0
- package/dist-cli/chunks/{chunk-PHPXGLME.js → chunk-NLH7FNSG.js} +1 -1
- package/dist-cli/chunks/{chunk-Y5PLPEEU.js → chunk-OBHJKTWA.js} +2 -2
- package/dist-cli/chunks/{chunk-5S6D7K4L.js → chunk-OCTDP37S.js} +2 -2
- package/dist-cli/chunks/{chunk-OUNLJM56.js → chunk-P7IKKZTG.js} +2 -2
- package/dist-cli/chunks/{chunk-3WGHC7JN.js → chunk-PVMX5UNR.js} +2 -2
- package/dist-cli/chunks/chunk-QUYC7CVV.js +1 -0
- package/dist-cli/chunks/{chunk-CF2LPRXD.js → chunk-STHMWSVN.js} +2 -2
- package/dist-cli/chunks/{chunk-OXOARRKR.js → chunk-TSNBQ4ZV.js} +10 -10
- package/dist-cli/chunks/{chunk-E2QE5FFP.js → chunk-UWSP2AT7.js} +1 -1
- package/dist-cli/chunks/{chunk-4EVSIUNB.js → chunk-V7CFSKMC.js} +2 -2
- package/dist-cli/chunks/{chunk-4QZHZ6BC.js → chunk-VFGAEMSI.js} +2 -2
- package/dist-cli/chunks/{chunk-RZHREO3M.js → chunk-VUYCS6QI.js} +2 -2
- package/dist-cli/chunks/chunk-XB4QIINM.js +24 -0
- package/dist-cli/chunks/{chunk-MAO7F5PH.js → chunk-XFJYEKYK.js} +3 -3
- package/dist-cli/chunks/{chunk-AC6QGW22.js → chunk-XZE53P4L.js} +2 -2
- package/dist-cli/chunks/chunk-Y7BXSTVX.js +1 -0
- package/dist-cli/chunks/cli-version-TGWWTYQX.js +2 -0
- package/dist-cli/chunks/{compat-PCXGGZBZ.js → compat-I2U3P4KP.js} +3 -3
- package/dist-cli/chunks/{config-LULEVEYL.js → config-S73CCGP5.js} +2 -2
- package/dist-cli/chunks/{control-6P6HY7UF.js → control-QR6MY7RA.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-NOK73ZYW.js → cpu-profile-RFYCTVAF.js} +2 -2
- package/dist-cli/chunks/{daemon-4A3DMUYL.js → daemon-D5MV2B22.js} +2 -2
- package/dist-cli/chunks/{debug-74BWB2ZG.js → debug-ZYEI75AG.js} +3 -3
- package/dist-cli/chunks/{detox-HEOMINSC.js → detox-J5IH52RV.js} +2 -2
- package/dist-cli/chunks/{device-TTXXBJFZ.js → device-NOBLSUOD.js} +2 -2
- package/dist-cli/chunks/{diagnose-QZ3GOHSE.js → diagnose-B6J5ZUHV.js} +2 -2
- package/dist-cli/chunks/drivers-RRHVOU6S.js +2 -0
- package/dist-cli/chunks/{electron-QVOWV44R.js → electron-PSX4KDCC.js} +3 -3
- package/dist-cli/chunks/flow-FWNVFKMP.js +2 -0
- package/dist-cli/chunks/{hints-YKWRNMJC.js → hints-ZE4I3YO3.js} +2 -2
- package/dist-cli/chunks/{home-paths-SFADSTJM.js → home-paths-N76MJE3D.js} +2 -2
- package/dist-cli/chunks/{inspect-LEWGQCIU.js → inspect-V2TXTDOG.js} +3 -3
- package/dist-cli/chunks/install-4PINRR2O.js +2 -0
- package/dist-cli/chunks/{install-desktop-22HYQZ2G.js → install-desktop-6ZRTRRCU.js} +3 -3
- package/dist-cli/chunks/{keys-3ZT3MICU.js → keys-L2RN4URM.js} +2 -2
- package/dist-cli/chunks/{launch-ZXW2NFLG.js → launch-BJGXPNZR.js} +3 -3
- package/dist-cli/chunks/{login-NJKJ7GZO.js → login-HYNEMAYR.js} +4 -4
- package/dist-cli/chunks/{logout-VMMQL7CB.js → logout-AO4YS27T.js} +2 -2
- package/dist-cli/chunks/{maestro-OJY4MTI7.js → maestro-PRACYFKV.js} +2 -2
- package/dist-cli/chunks/{preview-QU2GXTEV.js → preview-ZTANXVEK.js} +2 -2
- package/dist-cli/chunks/{profile-7APWK47T.js → profile-FNMAGUDB.js} +2 -2
- package/dist-cli/chunks/{react-RSVO5JZZ.js → react-6ZV2FQIM.js} +2 -2
- package/dist-cli/chunks/{record-UWH4MDEO.js → record-MLFVJZ6Y.js} +2 -2
- package/dist-cli/chunks/runtime-5762IE56.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-QMKGRV7N.js → runtime-delivery-ATYW2SQR.js} +2 -2
- package/dist-cli/chunks/{screenshot-43M27ALE.js → screenshot-UOMYMFZ4.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-EBYYN6TY.js → screenshot-mode-MWSVD4YG.js} +2 -2
- package/dist-cli/chunks/{screenshots-7TQZL6Z6.js → screenshots-GSA3VCWB.js} +2 -2
- package/dist-cli/chunks/server-YPFC6POG.js +40 -0
- package/dist-cli/chunks/setup-repo-QBQ4VWFO.js +2 -0
- package/dist-cli/chunks/{skills-RQA6EJQL.js → skills-YE5OPWMQ.js} +2 -2
- package/dist-cli/chunks/{start-ZT6MBYND.js → start-BSSQ5U2V.js} +4 -4
- package/dist-cli/chunks/store-EG4SONAH.js +2 -0
- package/dist-cli/chunks/telemetry-XXN4LRDS.js +2 -0
- package/dist-cli/chunks/{test-RNRX5SWV.js → test-5JMLBH2O.js} +3 -3
- package/dist-cli/chunks/{three-mode-TQZH25ZO.js → three-mode-TRBWZJQY.js} +2 -2
- package/dist-cli/chunks/{timeline-GGN3AY6P.js → timeline-YMZPIEB4.js} +2 -2
- package/dist-cli/chunks/{upgrade-XT22D67C.js → upgrade-JLAS7FIF.js} +2 -2
- package/dist-cli/chunks/upload-K6UNCFQH.js +2 -0
- package/dist-cli/chunks/{web-KEHVF5MB.js → web-D6S5UXOO.js} +2 -2
- package/dist-cli/chunks/{what-happened-PATQRJ5T.js → what-happened-65NXWU2S.js} +2 -2
- package/dist-cli/chunks/{whoami-CXVY26VV.js → whoami-6BSB6FQC.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +15 -0
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +244 -35
- package/dist-lib/host/fetch-proxy-handler.cjs +24 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +33 -0
- package/dist-lib/host/websocket-proxy.cjs +207 -0
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +14 -3
- package/dist-lib/scripts/dev-server-scanner.cjs +14 -3
- package/dist-lib/skills.cjs +290 -73
- package/dist-lib/vite.cjs +1 -1
- package/package.json +7 -1
- package/scripts/demo-app-registry.ts +17 -1
- package/src/host/bridge-host.ts +8 -1
- package/src/host/fetch-proxy-handler.ts +26 -3
- package/src/host/websocket-proxy.ts +201 -0
- package/dist-cli/chunks/auto-bootstrap-47RN2V5G.js +0 -2
- package/dist-cli/chunks/beta-BRCGAF2N.js +0 -2
- package/dist-cli/chunks/chunk-36RPD6JI.js +0 -2
- package/dist-cli/chunks/chunk-4DBPNLGI.js +0 -1
- package/dist-cli/chunks/chunk-PQFFUJR6.js +0 -24
- package/dist-cli/chunks/chunk-QQAECG5B.js +0 -2
- package/dist-cli/chunks/chunk-SSCA2AEA.js +0 -1
- package/dist-cli/chunks/chunk-ZFAM4N5B.js +0 -1
- package/dist-cli/chunks/cli-version-WPFDM2A6.js +0 -2
- package/dist-cli/chunks/drivers-QRPWNOIT.js +0 -2
- package/dist-cli/chunks/flow-QMA7GVN6.js +0 -2
- package/dist-cli/chunks/install-7N2N7Q32.js +0 -2
- package/dist-cli/chunks/runtime-3FUENRHM.js +0 -2
- package/dist-cli/chunks/server-VCFM25Z6.js +0 -35
- package/dist-cli/chunks/setup-repo-HFH4VKJQ.js +0 -2
- package/dist-cli/chunks/store-BJBTDSZE.js +0 -2
- package/dist-cli/chunks/telemetry-ZZZKTILZ.js +0 -2
- package/dist-cli/chunks/upload-NC2AYLC5.js +0 -2
package/dist-cli/bin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
3
|
-
import{a as d,b as g,c as b}from"./chunks/chunk-
|
|
2
|
+
/*! sootsim v0.1.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as d,b as g,c as b}from"./chunks/chunk-XB4QIINM.js";import"./chunks/chunk-DKW7Q4F3.js";import{a as f,b as l,c as h}from"./chunks/chunk-M6GOCS27.js";import"./chunks/chunk-JB467MUR.js";import"./chunks/chunk-KGYC4SZA.js";import"./chunks/chunk-JITAVV2G.js";import"./chunks/chunk-CMAANHYQ.js";import"./chunks/chunk-NLH7FNSG.js";import"./chunks/chunk-I3JMONYJ.js";import"./chunks/chunk-2IYMBWHL.js";import"./chunks/chunk-KQYOS5SM.js";function k(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("sootsim bridge daemon is not running")||t.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
|
|
4
4
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
5
5
|
`):process.stderr.write(`${t}
|
|
6
6
|
`),process.exit(1)}process.on("unhandledRejection",k);process.on("uncaughtException",k);var S=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,_=new Set(["preview","electron","install-desktop"]);function E(a){!S||!_.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
|
|
7
7
|
it needs vite / electron / playwright from a project's node_modules.
|
|
8
8
|
install the npm package and run via bun or node instead:
|
|
9
9
|
npm i -g sootsim && sootsim ${a}
|
|
10
|
-
`),process.exit(1))}var e=
|
|
10
|
+
`),process.exit(1))}var e=h(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-XXN4LRDS.js");a({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-XXN4LRDS.js");await t(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-TGWWTYQX.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-2HH7F2DQ.js"),m=t?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:v}=await import("./chunks/home-paths-N76MJE3D.js"),u=v();console.log(u?`runtime v${u}`:"runtime not installed"),await c(0)}e.help&&!e.command&&(d(),await c(0));var o=e.globalFlags.port,n=e.verbose,p=e.globalFlags.device,w=e.globalFlags.theme,O=e.globalFlags.driver,T=e.globalFlags.headless===!0,A=e.globalFlags.sim,s=A?["--sim",A,...e.commandArgs]:e.commandArgs;if(p||w){let{settingsStore:a}=await import("./chunks/store-EG4SONAH.js"),t={};p&&(t.deviceModel=p),w&&(t.colorScheme=w),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-BSSQ5U2V.js");await a([],{port:o}),await c(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let a=e.commandArgs.find(t=>!t.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${a}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}d(),await c(0)}if(r in l){let a=l[r],t=e.commandArgs.length>0?` ${e.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),t&&console.error(` \u2192 ${a}${t}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",t=e.commandArgs.find(i=>!i.startsWith("-"));r==="shell"||(a&&!t?g(r)&&await c(0):(b(a&&t?t:r,{prefer:a&&t?"verb":"command",group:a&&t?r:void 0}),await c(0)))}E(r);if(f.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-PWF7OYCV.js"),i=t(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-V2TXTDOG.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-RQD66YGE.js");await a(e.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-FWNVFKMP.js"),t=await a(s);process.exit(typeof t=="number"?t:0)}case"test":{let{runTest:a}=await import("./chunks/test-5JMLBH2O.js");await a(e.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-J5IH52RV.js");await a(e.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-PRACYFKV.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-ZTANXVEK.js");await a(e.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-MLFVJZ6Y.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-FNMAGUDB.js"),t=await a(e.commandArgs,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-RFYCTVAF.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"react":{let{runReact:a}=await import("./chunks/react-6ZV2FQIM.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-UOMYMFZ4.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-GSA3VCWB.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-MWSVD4YG.js");await a(e.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-TRBWZJQY.js");await a(e.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-V2TXTDOG.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-ZYEI75AG.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-YMZPIEB4.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-65NXWU2S.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-B6J5ZUHV.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-PWF7OYCV.js"),i=t(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-QR6MY7RA.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-QR6MY7RA.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-QR6MY7RA.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-QR6MY7RA.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-S73CCGP5.js");await a(e.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-NOBLSUOD.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-I2U3P4KP.js");await a(e.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-PSX4KDCC.js");await a(e.commandArgs,{port:o,device:p,driver:O});break}case"login":{let{runLogin:a}=await import("./chunks/login-HYNEMAYR.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-AO4YS27T.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-6BSB6FQC.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-L2RN4URM.js");await a(e.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-QBQ4VWFO.js");await a(e.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-4PINRR2O.js");await a(e.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-6ZRTRRCU.js");await a(e.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-YPFC6POG.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-D5MV2B22.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-5762IE56.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-JLAS7FIF.js");await a(e.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-BJGXPNZR.js");await a(e.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-BSSQ5U2V.js");await a(e.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-S3WLX5Z4.js"),t=await a(e.commandArgs);process.exit(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-PFPEQTPG.js"),t=await a(e.commandArgs);process.exit(t)}case"skills":{let{runSkills:a}=await import("./chunks/skills-YE5OPWMQ.js");await a(e.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-K6UNCFQH.js");await a(e.commandArgs,{port:o,verbose:n});break}case"hints":{let{runHints:a}=await import("./chunks/hints-ZE4I3YO3.js");a(e.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as $,b,c as E,d as l,e as A,g as S,h as j,j as T,m as I,n as k,o as x,p as g,q as D,r as O}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as $,b,c as E,d as l,e as A,g as S,h as j,j as T,m as I,n as k,o as x,p as g,q as D,r as O}from"./chunk-FF5KD3BS.js";import"./chunk-UWSP2AT7.js";import{c as y}from"./chunk-XB4QIINM.js";import"./chunk-DKW7Q4F3.js";import"./chunk-JB467MUR.js";import"./chunk-KGYC4SZA.js";import"./chunk-JITAVV2G.js";import"./chunk-CMAANHYQ.js";import"./chunk-NLH7FNSG.js";import"./chunk-I3JMONYJ.js";import"./chunk-2IYMBWHL.js";import"./chunk-KQYOS5SM.js";import w from"node:fs";import d from"node:path";import{spawn as U}from"node:child_process";import _ from"node:net";import{WebSocket as C}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new C(`ws://localhost:${this.port}`),this.ready=new Promise((t,n)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),n(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==C.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let n=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(n),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(n,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:n,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(n),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let n=this.pending.get(t.id);n&&(this.pending.delete(t.id),clearTimeout(n.timer),t.error?n.reject(new c(t.error,t.code)):n.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function R(r=7668,e=400){return new Promise(t=>{let n=new _.Socket,s=!1,o=i=>{s||(s=!0,n.destroy(),t(i))};n.setTimeout(e),n.once("connect",()=>o(!0)),n.once("timeout",()=>o(!1)),n.once("error",()=>o(!1)),n.connect(r,"127.0.0.1")})}async function F(r={}){let e=r.port??7668;if(await R(e))return{alreadyRunning:!0};let{cmd:t,prefixArgs:n}=O(),s=[...n,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=U(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(r.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await R(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(r={}){await F({port:r.port,startupTimeoutMs:r.startupTimeoutMs});let e=new f(r);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function me(r){let[e,...t]=r;try{switch(e){case void 0:case"--help":case"-h":case"help":return M(),0;case"attach":return await B(t);case"projects":return await W();case"project":return await J(t);case"sessions":return await V(t);case"start":return await G(t);case"prompt":return await H(t);case"watch":return await q(t);case"transcript":return await X(t);case"end":return await z(t);case"paths":return await Q();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
3
3
|
`),M(),2}}catch(n){if(n instanceof c)return process.stderr.write(`${n.message}
|
|
4
4
|
`),1;throw n}}async function v(r){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await r(e)}finally{e.close()}}function M(){y("agent")}function P(r,e){let t={},n=[];for(let s=0;s<r.length;s++){let o=r[s],i=e[o];i==="value"?(t[o]=r[s+1]??"",s++):i==="bool"?t[o]=!0:n.push(o)}return{flags:t,positional:n}}function N(r,e="codex"){return r==="codex"||r==="claude"?r:e}async function B(r){let{flags:e,positional:t}=P(r,{"--name":"value","--provider":"value"}),n=t[0];if(!n)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
|
|
5
5
|
`),2;let s=d.resolve(n);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as M}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-UWSP2AT7.js";import"./chunk-KQYOS5SM.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.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-KQYOS5SM.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.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-5DFVKWYQ.js";import"./chunk-5ZYANOOI.js";import"./chunk-3TNIXR6J.js";import"./chunk-I3JMONYJ.js";import"./chunk-2IYMBWHL.js";import"./chunk-KQYOS5SM.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.86 | (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.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
|
|
3
3
|
${o}
|
|
4
4
|
`);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.86 | (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,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-P7IKKZTG.js";import{l as o}from"./chunk-2IYMBWHL.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as h,join as y,resolve as k}from"node:path";function i(){return y(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(h(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
|
|
3
3
|
`);try{p(t,384)}catch{}}function E(){f(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function O(n){return!!(n&&n.length>=20&&n.length<=256&&m.some(t=>n.startsWith(t)))}function A(){let n=process.env.SOOT_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),r=n||t;if(!O(r))return null;let e=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!e)return null;let[l,u]=e.includes("/")?e.split("/",2):[null,null],c=(process.env.SOOT_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),a=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:e,repositoryId:c||null,owner:l||null,repo:u||null,installationId:a||null,source:n?"soot-runner":"github-actions"}}function x(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=A();if(t)return t;let r=S();if(r)return{kind:"api-key",secret:r,source:"file"};let e=s();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function H(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function N(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{S as a,w as b,E as c,x as d,H as e,N as f};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as l}from"./chunk-5ZYANOOI.js";import{E as c,F as m,g as p,i as h,z as w}from"./chunk-2IYMBWHL.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-5762IE56.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-D5MV2B22.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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.86 | (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,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as k,c as T,e as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.86 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as k,c as T,e as C}from"./chunk-3TNIXR6J.js";import{E as v,F as P}from"./chunk-2IYMBWHL.js";import{WebSocket as I}from"ws";function $(){let e=v();return e&&P(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(t,i){super(t),this.name="BridgeSimLockedError",this.lock=i}};function F(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function R(e,t={}){let i=new Set,d=t.port??$(),a=t.commandTimeoutMs??15e3,r,g="none",p=new Set(t.stripBooleanFlags??[]),y=new Set(t.stripValueFlags??[]);for(let n=0;n<e.length;n++){let l=e[n];if(l==="--port"||l==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),d=Number(e[n+1])),n++;continue}if(l.startsWith("--port=")){i.add(n),d=Number(l.slice(7));continue}if(l==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(l==="--sim"){i.add(n),n+1<e.length&&(i.add(n+1),r=e[n+1]?.trim()||void 0,g="flag"),n++;continue}if(p.has(l)){i.add(n);continue}y.has(l)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!r){let n=T();n&&(r=n.trim()||void 0,g="saved")}return{positional:e.filter((n,l)=>!i.has(l)),wsPort:d,simId:r,simIdSource:g,commandTimeoutMs:a}}function W(e,t={}){let i=1,d=t.commandTimeoutMs??15e3,a=new Map,r=new I(`ws://localhost:${e}`),g=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:k(),p=new Promise((s,o)=>{r.on("open",()=>{try{r.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:g.key,cliIdentitySource:g.source,cliLabel:t.cliLabel}))}catch{}s()}),r.on("error",c=>{let m=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${m}`))})}),y=!1,n=!1;function l(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",m=F(o?t.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
|
|
3
3
|
`)}return r.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=a.get(o.id);c&&(a.delete(o.id),o.i>0&&!y&&(y=!0,process.stderr.write(`
|
|
4
4
|
\u26A0 ${o.i} other CLI identity/identities are driving this sim
|
|
5
5
|
taps, scrolls, and keyboard input from multiple agents will collide on
|