sootsim 0.1.92 → 0.1.93
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-NLUI4O7V.js → agent-L6HIJY56.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-KPGUM7NZ.js → agent-wrapper-E46RJGKZ.js} +2 -2
- package/dist-cli/chunks/{assert-FJQ67TVS.js → assert-E35SQTDG.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-KTVZAENF.js +2 -0
- package/dist-cli/chunks/beta-AMLREMEK.js +2 -0
- package/dist-cli/chunks/{chunk-THZNZO3H.js → chunk-2JFC45SX.js} +2 -2
- package/dist-cli/chunks/{chunk-N7GBP6IK.js → chunk-352UPR2W.js} +2 -2
- package/dist-cli/chunks/{chunk-OJSVBBKS.js → chunk-3IFMI2MH.js} +1 -1
- package/dist-cli/chunks/{chunk-UCKGFOMN.js → chunk-3NEAT5UU.js} +2 -2
- package/dist-cli/chunks/{chunk-Q5424DRY.js → chunk-4DUFZAOO.js} +2 -2
- package/dist-cli/chunks/{chunk-Q25DKLP6.js → chunk-6MKI2ZHC.js} +2 -2
- package/dist-cli/chunks/{chunk-QWPMILSP.js → chunk-6T6RZPWU.js} +3 -3
- package/dist-cli/chunks/chunk-ALNQTDSH.js +1 -0
- package/dist-cli/chunks/{chunk-P5ZSDO3L.js → chunk-BXZDXBUA.js} +12 -12
- package/dist-cli/chunks/{chunk-53Q365IC.js → chunk-C343OFIG.js} +2 -2
- package/dist-cli/chunks/{chunk-WOUGDBHR.js → chunk-CCKZR7BU.js} +2 -2
- package/dist-cli/chunks/{chunk-G5RTPKMF.js → chunk-D62KWBZG.js} +2 -2
- package/dist-cli/chunks/{chunk-3NSZQ5I3.js → chunk-DIWDDWNK.js} +1 -1
- package/dist-cli/chunks/{chunk-2C6ZEOSP.js → chunk-DSHYPD5A.js} +2 -2
- package/dist-cli/chunks/{chunk-OERYXTZA.js → chunk-EOEORGPV.js} +1 -1
- package/dist-cli/chunks/{chunk-QI2OP27K.js → chunk-F5FIYZXA.js} +2 -2
- package/dist-cli/chunks/{chunk-CKQD5R75.js → chunk-FGWNYFSK.js} +1 -1
- package/dist-cli/chunks/{chunk-N4MF6AQR.js → chunk-FRFSAMOW.js} +2 -2
- package/dist-cli/chunks/chunk-G2SZI7US.js +2 -0
- package/dist-cli/chunks/{chunk-U3SHSZHL.js → chunk-HVOCWWIV.js} +1 -1
- package/dist-cli/chunks/{chunk-ARNVGMSD.js → chunk-I4M7NBKY.js} +3 -3
- package/dist-cli/chunks/{chunk-IGNHT6DT.js → chunk-IAR2LAOG.js} +2 -2
- package/dist-cli/chunks/{chunk-5EJHVAMZ.js → chunk-IQJE2PBU.js} +2 -2
- package/dist-cli/chunks/chunk-IWEKZVXW.js +2 -0
- package/dist-cli/chunks/{chunk-YV4PVT5P.js → chunk-JLEZDTOL.js} +3 -3
- package/dist-cli/chunks/{chunk-ZJ3GSKBY.js → chunk-JLFCHU45.js} +2 -2
- package/dist-cli/chunks/chunk-K3A7IH77.js +1 -0
- package/dist-cli/chunks/{chunk-J56Q4UGK.js → chunk-K4DWGJO2.js} +2 -2
- package/dist-cli/chunks/{chunk-FIVCAZN5.js → chunk-LWCVNHLT.js} +2 -2
- package/dist-cli/chunks/{chunk-FONTNW4J.js → chunk-M4QXOCCY.js} +1 -1
- package/dist-cli/chunks/{chunk-BFOGODVZ.js → chunk-M5P3ULHQ.js} +2 -2
- package/dist-cli/chunks/chunk-QHPFVK62.js +1 -0
- package/dist-cli/chunks/{chunk-4JH54GEL.js → chunk-RVUQAUXP.js} +1 -1
- package/dist-cli/chunks/{chunk-64DJFEK2.js → chunk-S3QCEBTB.js} +2 -2
- package/dist-cli/chunks/{chunk-YKDHVRVG.js → chunk-TRS52XH4.js} +1 -1
- package/dist-cli/chunks/{chunk-VFCSRW52.js → chunk-TZFDBDEI.js} +1 -1
- package/dist-cli/chunks/{chunk-MMPZMFFN.js → chunk-W5ET7GSK.js} +1 -1
- package/dist-cli/chunks/{chunk-4GI5BITR.js → chunk-WPPSP6UG.js} +1 -1
- package/dist-cli/chunks/{chunk-IHPNQBHL.js → chunk-WTUKAQUP.js} +2 -2
- package/dist-cli/chunks/{chunk-VTVQXZYR.js → chunk-WVNXRYKC.js} +2 -2
- package/dist-cli/chunks/{chunk-IISL4IFJ.js → chunk-XFBHJCF3.js} +1 -1
- package/dist-cli/chunks/{chunk-6BCZHTH6.js → chunk-XPLBMRUI.js} +1 -1
- package/dist-cli/chunks/{chunk-L2BJNX2E.js → chunk-YQRBB7YC.js} +2 -2
- package/dist-cli/chunks/cli-version-KG6WCABJ.js +2 -0
- package/dist-cli/chunks/{compat-VNOXPA3U.js → compat-E6YM3TJZ.js} +3 -3
- package/dist-cli/chunks/{config-N2GO3RXG.js → config-5QYHIZDT.js} +2 -2
- package/dist-cli/chunks/{control-ZTPKRBDY.js → control-JIXJTCK4.js} +2 -2
- package/dist-cli/chunks/{cpu-profile-ARWAKQCS.js → cpu-profile-M3TNUJW3.js} +2 -2
- package/dist-cli/chunks/{daemon-4MYXXXFY.js → daemon-POLLGYA2.js} +2 -2
- package/dist-cli/chunks/{debug-SRBNEU4R.js → debug-P6IGEYZR.js} +3 -3
- package/dist-cli/chunks/{detox-YP23O47K.js → detox-HIP5JDSQ.js} +2 -2
- package/dist-cli/chunks/{device-4RKD3ART.js → device-GL2LVHJD.js} +2 -2
- package/dist-cli/chunks/{diagnose-MDNGEQ4D.js → diagnose-JGJF6QJ2.js} +2 -2
- package/dist-cli/chunks/drivers-4CENGVIM.js +2 -0
- package/dist-cli/chunks/{electron-52YSIIZW.js → electron-HO2O3U5S.js} +3 -3
- package/dist-cli/chunks/flow-HC36VZGL.js +2 -0
- package/dist-cli/chunks/help-57FSVG47.js +2 -0
- package/dist-cli/chunks/{hints-3I7TU3SW.js → hints-K5KHWU2I.js} +2 -2
- package/dist-cli/chunks/{home-paths-IBLVLRBK.js → home-paths-VTUAIJ4X.js} +2 -2
- package/dist-cli/chunks/{inspect-URZKK2O7.js → inspect-5QTZ4446.js} +38 -38
- package/dist-cli/chunks/install-QHY443P7.js +2 -0
- package/dist-cli/chunks/{install-desktop-UTRYCIC4.js → install-desktop-P5IOBTJA.js} +3 -3
- package/dist-cli/chunks/{keys-G44ZUQPI.js → keys-H65MGEIF.js} +2 -2
- package/dist-cli/chunks/{launch-KFJ5JYJ3.js → launch-LGV3G4IE.js} +3 -3
- package/dist-cli/chunks/{login-XMJZWV32.js → login-SXC6PXZA.js} +4 -4
- package/dist-cli/chunks/{logout-UCTG6KKE.js → logout-JQVXXJQJ.js} +2 -2
- package/dist-cli/chunks/{maestro-QXGQ4PVN.js → maestro-LLK45LHK.js} +2 -2
- package/dist-cli/chunks/{preview-FO5A3WHP.js → preview-PCHLQQWW.js} +2 -2
- package/dist-cli/chunks/{profile-FOM2Q6ZB.js → profile-5SUWLDAA.js} +2 -2
- package/dist-cli/chunks/{react-YRVJNO5O.js → react-ASFY75YW.js} +2 -2
- package/dist-cli/chunks/{record-D3KCAA2Z.js → record-NYEORAUL.js} +2 -2
- package/dist-cli/chunks/runtime-KZJNKYOB.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-KCIHX2BK.js → runtime-delivery-YQVEY753.js} +2 -2
- package/dist-cli/chunks/{screenshot-YDMCOI47.js → screenshot-GCT4HM3M.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-TRG2F27T.js → screenshot-mode-AV2UYPI2.js} +2 -2
- package/dist-cli/chunks/{screenshots-US7T7ADG.js → screenshots-25JTW3MK.js} +2 -2
- package/dist-cli/chunks/{server-C7ZKVYEN.js → server-EMV5ZU3B.js} +2 -2
- package/dist-cli/chunks/setup-repo-MHZ7ELJO.js +2 -0
- package/dist-cli/chunks/{skills-AECFWJY6.js → skills-2MLJI75W.js} +2 -2
- package/dist-cli/chunks/{start-ZGWAKDNC.js → start-4MINIBCZ.js} +4 -4
- package/dist-cli/chunks/store-NKMSNUBC.js +2 -0
- package/dist-cli/chunks/telemetry-IJO3ZRR5.js +2 -0
- package/dist-cli/chunks/{test-2SYSK5H4.js → test-662YO2IZ.js} +3 -3
- package/dist-cli/chunks/{three-mode-YAKLIIN5.js → three-mode-VPDWTIYX.js} +2 -2
- package/dist-cli/chunks/{timeline-NROKUQ5E.js → timeline-4UOJQCTI.js} +2 -2
- package/dist-cli/chunks/{upgrade-ZZARTNNC.js → upgrade-NV4PNXNY.js} +2 -2
- package/dist-cli/chunks/upload-AJURIKDZ.js +2 -0
- package/dist-cli/chunks/web-6VVCC7QO.js +2 -0
- package/dist-cli/chunks/{what-happened-75XRWASG.js → what-happened-C7OMH2CO.js} +2 -2
- package/dist-cli/chunks/{whoami-MC6HJI5T.js → whoami-PO5M2KCL.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/skills.cjs +18 -4
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/auto-bootstrap-EAQHPWBH.js +0 -2
- package/dist-cli/chunks/beta-SWIGZTS7.js +0 -2
- package/dist-cli/chunks/chunk-6DAMSZFH.js +0 -1
- package/dist-cli/chunks/chunk-IFDIEAVZ.js +0 -1
- package/dist-cli/chunks/chunk-ISEYLN2N.js +0 -2
- package/dist-cli/chunks/chunk-NOD6DFSL.js +0 -2
- package/dist-cli/chunks/chunk-OE4Z6WGR.js +0 -1
- package/dist-cli/chunks/cli-version-3YXCAPTC.js +0 -2
- package/dist-cli/chunks/drivers-MQCDXQRI.js +0 -2
- package/dist-cli/chunks/flow-HT24JTDR.js +0 -2
- package/dist-cli/chunks/help-IU4RMZGO.js +0 -2
- package/dist-cli/chunks/install-3MSXLVMF.js +0 -2
- package/dist-cli/chunks/runtime-TIWRPSKS.js +0 -2
- package/dist-cli/chunks/setup-repo-HJQLCO7W.js +0 -2
- package/dist-cli/chunks/store-VTNB7WEH.js +0 -2
- package/dist-cli/chunks/telemetry-V6K2OLDO.js +0 -2
- package/dist-cli/chunks/upload-CYB6HOFW.js +0 -2
- package/dist-cli/chunks/web-KHUEEKAW.js +0 -2
package/dist-cli/bin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
3
|
-
import{a as u,b as d,c as g}from"./chunks/chunk-
|
|
2
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as u,b as d,c as g}from"./chunks/chunk-FGWNYFSK.js";import"./chunks/chunk-EOEORGPV.js";function f(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",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
|
|
7
7
|
it needs vite / electron / playwright from a project's node_modules.
|
|
8
8
|
install the npm package and run via bun or node instead:
|
|
9
9
|
npm i -g sootsim && sootsim ${a}
|
|
10
|
-
`),process.exit(1))}var e=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-
|
|
10
|
+
`),process.exit(1))}var e=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-IJO3ZRR5.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-IJO3ZRR5.js");await t(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-KG6WCABJ.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-AMLREMEK.js"),m=t?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-VTUAIJ4X.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-57FSVG47.js");a(),await c(0)}var o=e.globalFlags.port,n=e.verbose,p=e.globalFlags.device,l=e.globalFlags.theme,S=e.globalFlags.driver,E=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,s=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-NKMSNUBC.js"),t={};p&&(t.deviceModel=p),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-4MINIBCZ.js");await a([],{port:o}),await c(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let t=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-57FSVG47.js");a(),await c(0)}if(r in d){let a=d[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("-"));if(r!=="shell")if(a&&!t){let{printGroupHelp:i}=await import("./chunks/help-57FSVG47.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-57FSVG47.js");i(a&&t?t:r,{prefer:a&&t?"verb":"command",group:a&&t?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-KTVZAENF.js"),i=t(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-5QTZ4446.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-E35SQTDG.js");await a(e.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-HC36VZGL.js"),t=await a(s);process.exit(typeof t=="number"?t:0)}case"test":{let{runTest:a}=await import("./chunks/test-662YO2IZ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-HIP5JDSQ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-LLK45LHK.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-PCHLQQWW.js");await a(e.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-NYEORAUL.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-5SUWLDAA.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-M3TNUJW3.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-ASFY75YW.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-GCT4HM3M.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-25JTW3MK.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-AV2UYPI2.js");await a(e.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-VPDWTIYX.js");await a(e.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-5QTZ4446.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-P6IGEYZR.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-4UOJQCTI.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-C7OMH2CO.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-JGJF6QJ2.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-KTVZAENF.js"),i=t(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-JIXJTCK4.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-JIXJTCK4.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-JIXJTCK4.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-JIXJTCK4.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-5QYHIZDT.js");await a(e.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-GL2LVHJD.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-E6YM3TJZ.js");await a(e.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-HO2O3U5S.js");await a(e.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-SXC6PXZA.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-JQVXXJQJ.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-PO5M2KCL.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-H65MGEIF.js");await a(e.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-MHZ7ELJO.js");await a(e.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-QHY443P7.js");await a(e.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-P5IOBTJA.js");await a(e.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-EMV5ZU3B.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-POLLGYA2.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-KZJNKYOB.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-NV4PNXNY.js");await a(e.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-LGV3G4IE.js");await a(e.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-4MINIBCZ.js");await a(e.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-L6HIJY56.js"),t=await a(e.commandArgs);process.exit(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-E46RJGKZ.js"),t=await a(e.commandArgs);process.exit(t)}case"skills":{let{runSkills:a}=await import("./chunks/skills-2MLJI75W.js");await a(e.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-AJURIKDZ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"hints":{let{runHints:a}=await import("./chunks/hints-K5KHWU2I.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.93 | (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-3NEAT5UU.js";import"./chunk-XFBHJCF3.js";import{c as y}from"./chunk-6MKI2ZHC.js";import"./chunk-S3QCEBTB.js";import"./chunk-XPLBMRUI.js";import"./chunk-G2SZI7US.js";import"./chunk-IWEKZVXW.js";import"./chunk-DIWDDWNK.js";import"./chunk-RVUQAUXP.js";import"./chunk-W5ET7GSK.js";import"./chunk-M4QXOCCY.js";import"./chunk-EOEORGPV.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.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-XFBHJCF3.js";import"./chunk-EOEORGPV.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.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-EOEORGPV.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.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-I4M7NBKY.js";import"./chunk-JLFCHU45.js";import"./chunk-WPPSP6UG.js";import"./chunk-IWEKZVXW.js";import"./chunk-M4QXOCCY.js";import"./chunk-EOEORGPV.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as R,C as w,i as p,r as S,t as O,y as v,z as f}from"./chunk-M4QXOCCY.js";import{spawn as I}from"child_process";import C from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as M}from"stream/promises";var N="https://sootbean.com",D="SOOTSIM_CDN_ORIGIN",E="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(O(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function d(e){let t=$();return(e||process.env[D]||t.cdnOrigin||N).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[E]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${d(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function P(e,t){return`${d(t)}/runtimes/sootsim-runtime-${e}.tar.gz`}async function y(e){let t=T(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function U(e,t={}){let r=x(t.channel),n=t.version||e.channels[r]?.latest;if(!n)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let i=e.versions[n];if(!i)throw new Error(`version ${n} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:n,channel:r,entry:i}}async function V(e={}){v();let t=d(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=U(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let g=o.tarball||P(n,t),m=l.join(S(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(g,m),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await j(m);if(h!==o.sha256)throw s.rmSync(m,{force:!0}),new Error(`sha256 mismatch for runtime ${n}: expected ${o.sha256}, actual ${h}`);let u=l.join(l.dirname(a),`.installing-${n}-${process.pid}`);s.rmSync(u,{recursive:!0,force:!0}),s.mkdirSync(u,{recursive:!0});try{if(await A(m,u),!s.existsSync(l.join(u,"index.html")))throw new Error(`extracted tarball for runtime ${n} is missing index.html`);s.rmSync(a,{recursive:!0,force:!0}),s.renameSync(u,a)}catch(b){throw s.rmSync(u,{recursive:!0,force:!0}),b}return c&&R(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function q(e={}){v();let t=d(e.cdnOrigin),r=x(e.channel),n=await y(t),i=n.channels[r]?.latest;if(!i)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:f()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:f(),latestVersion:i};let a=f(),c=a?p(a):null,g=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!g||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await V({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function B(e={}){let t=f();try{let r=await y(d(e.cdnOrigin)),n=x(e.channel),i=r.channels[n]?.latest??null,o=!!(i&&(!t||w(i,t)>0));return{active:t,latest:i,outdated:o}}catch{return{active:t,latest:null,outdated:!1}}}async function _(e,t){let r=await fetch(e);if(!r.ok||!r.body)throw new Error(`download failed: ${r.status} ${r.statusText} (${e})`);s.mkdirSync(l.dirname(t),{recursive:!0});let n=`${t}.partial`;try{await M(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function j(e){return new Promise((t,r)=>{let n=C.createHash("sha256"),i=s.createReadStream(e);i.on("data",o=>n.update(o)),i.on("error",r),i.on("end",()=>t(n.digest("hex")))})}function A(e,t){return new Promise((r,n)=>{let i=I("tar",["-xzf",e,"-C",t],{stdio:["ignore","inherit","inherit"]});i.on("error",n),i.on("exit",o=>{o===0?r():n(new Error(`tar exited with code ${o}`))})})}export{N as a,D as b,E as c,d,x as e,T as f,P as g,y as h,U as i,V as j,q as k,B as l};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as y}from"./chunk-WPPSP6UG.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as p}from"fs";import{tmpdir as m}from"os";import{dirname as v,join as w}from"path";var d=new Map;function s(e,r){d.set(e,r)}var c=1;function i(){return w(m(),`sootsim-cli-hints-${y()}.json`)}function l(){return w(m(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:c,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==c||!r?.shown?{version:c,shown:{}}:r}catch{return{version:c,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
|
|
3
3
|
`)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let n=Date.now();if(r==="once-per-identity"){let t=u(i());return t.shown[e]?!1:(t.shown[e]=n,f(i(),t),!0)}if(r==="once-ever"){let t=u(l());return t.shown[e]?!1:(t.shown[e]=n,f(l(),t),!0)}if(typeof r=="object"&&"cooldownMs"in r){let t=u(i()),a=t.shown[e]??0;return n-a<r.cooldownMs?!1:(t.shown[e]=n,f(i(),t),!0)}return!0}function k(e,...r){let o=d.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let n=o.render(...r);if(n==null)return!1;let t=Array.isArray(n)?n:[n],a=o.stream==="error"?console.error:console.log;for(let g of t)a(` hint: ${g}`);return!0}function M(){p(i(),{force:!0})}function O(){p(l(),{force:!0})}function T(){return Array.from(d.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});s("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{k as a,M as b,O as c,T as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{execFileSync as p,spawn as l}from"child_process";import{existsSync as s}from"fs";import{homedir as u}from"os";import{join as d}from"path";var g=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","~/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","~/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","~/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Arc.app/Contents/MacOS/Arc","~/Applications/Arc.app/Contents/MacOS/Arc"],f=["/usr/bin/google-chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/microsoft-edge","/usr/bin/brave-browser","/snap/bin/chromium"],h=["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe","C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe","C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"],C=["google-chrome","chromium","chromium-browser","microsoft-edge","brave-browser"],O=["chrome","msedge","brave"];function w(r){return r.startsWith("~/")?d(u(),r.slice(2)):r}function a(r){for(let n of r){let o=w(n);if(s(o))return o}return null}function U(r,n){try{let e=p(n==="win32"?"where":"which",[r],{encoding:"utf8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim();return e?e.split(/\r?\n/)[0]:null}catch{return null}}function M(r=process.platform){let n=process.env.CHROME_PATH||process.env.CHROMIUM_PATH;if(n&&s(n))return n;let o=a(r==="darwin"?g:r==="win32"?h:f);if(o)return o;let e=r==="win32"?O:C;for(let t of e){let i=U(t,r);if(i)return i}return null}function A(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform;return n.newWindow?c(r,{...n,platform:o,newWindow:!0}):o==="darwin"?{command:"open",args:n.background===!1?[r]:["-g",r],via:"system"}:o==="win32"?{command:"cmd",args:["/c","start","",r],via:"system"}:{command:"xdg-open",args:[r],via:"system"}}function c(r,n={}){if(!r)throw new Error("openUrl requires a url");let o=n.platform??process.platform,e="chromiumBinary"in n?n.chromiumBinary:M(o);if(!e)throw new Error("browser launch requires Chrome, Chromium, Edge, Brave, or Arc");let t=[];return n.newWindow!==!1&&t.push("--new-window"),t.push(r),{command:e,args:t,via:"chromium",target:e}}async function m(r,n,o){return new Promise((e,t)=>{let i=l(r,n,{detached:o,stdio:"ignore"});i.once("error",t),i.once("spawn",()=>{o&&i.unref(),e(i.pid)})})}async function x(r,n={}){let o=A(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function y(r,n={}){let o=c(r,n),e=await m(o.command,o.args,n.detached??!0);return{...o,pid:e,attachUrl:r}}async function E(r,n={}){await x(r,n)}export{M as a,x as b,y as c,E as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as R}from"./chunk-IISL4IFJ.js";import{l as D}from"./chunk-FONTNW4J.js";import{a as T}from"./chunk-OERYXTZA.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("sootsim/scripts/demo-app-registry")).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.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-XFBHJCF3.js";import{l as D}from"./chunk-M4QXOCCY.js";import{a as T}from"./chunk-EOEORGPV.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("sootsim/scripts/demo-app-registry")).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{a as _,b as W,c as de,e as me}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as _,b as W,c as de,e as me}from"./chunk-IQJE2PBU.js";import{m as O}from"./chunk-CCKZR7BU.js";import{k as ae,l as le,n as ce}from"./chunk-BXZDXBUA.js";import{b as ie,c as I,d as S,e as x}from"./chunk-JLFCHU45.js";import{c as k,d as w,e as C}from"./chunk-WPPSP6UG.js";import{g as G}from"./chunk-DSHYPD5A.js";import{a as T,b as q}from"./chunk-TRS52XH4.js";import{c as ue}from"./chunk-FRFSAMOW.js";import{d as j}from"./chunk-3IFMI2MH.js";import{a as se}from"./chunk-G2SZI7US.js";import{E as ne,F as re}from"./chunk-M4QXOCCY.js";import Ie from"node:fs";import Oe from"node:os";import J from"node:path";function Te(t){return t.replace(/^\[|\]$/g,"").toLowerCase()}function V(t){let o=Te(t);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}function pe(t){return new Error(`could not resolve a native bundle for ${t}. pass an explicit bundle URL or open Connect and choose the app there.`)}function Be(t,o){return t?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function he(t,o,e){return`${t}//${o}:${e}`}function Me(t){if(typeof window>"u")return!1;try{let o=new URL(t);return V(o.hostname)&&V(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function fe(t,o){let e={...o,cache:o?.cache??"no-store"};return Me(t)?fetch(`/__fetch-proxy?url=${encodeURIComponent(t)}`,e):fetch(t,e)}function Ue(t){return t==="https:"?443:80}function Re(t){let o=t.pathname||"/";return(o==="/"||o==="")&&!t.search&&!t.hash}async function we(t,o){let e=t.replace(/\/+$/,"");try{let n=await fe(`${e}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},a=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(a||s.name)return{bundleUrl:de(a||`${e}${W}`),port:o,framework:Be(a,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await fe(`${e}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${e}${W}`,port:o,framework:"metro"}}catch{}return null}async function ge(t){return we(he("http:","localhost",t),t)}async function ye(t){let o=t.trim();if(/^\d+$/.test(o)){let i=parseInt(o,10),l=await ge(i);if(l)return l;let c=3;for(let d=1;d<=c;d++){let m=await ge(i+d);if(m)return m}throw pe(`localhost:${i} (also scanned +1..+${c})`)}let e=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(e)}catch{throw new Error(`could not parse "${t}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):Ue(r),a=he(r,n.hostname,s);if(Re(n)){let i=await we(a,s);if(i)return i;throw pe(a)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function lt(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim install-desktop"),console.error(""),console.error(" or wire sootsim into your own project so your dev server hosts the bridge:"),console.error(" sootsim setup-repo"),console.error("")}function be(t){let o=T();if(console.log(` note: no sootsim bridge detected on port ${t}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim electron");return}console.log(""),console.log(" to get a bridge running, either:"),console.log(" sootsim install-desktop # download the electron app"),console.log(" sootsim setup-repo # wire sootsim into your own project")}function Ee(t){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${t}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function ct(t,o,e){let n=[];try{n=await t.listSims()}catch{}if(console.error(""),n.length===0){Ee(o);return}console.error(` no sim with id "${e}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var _e={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function v(t){return new Promise(o=>setTimeout(o,t))}function A(t){return t.trim()}function Y(t){try{let o=new URL(t),e=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||e==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||e==="/rn"||/^\/rn\/[^/]+$/i.test(e)||/^\/app\/[^/]+$/i.test(e)||e==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(e)||/^\/__soot\/app\/[^/]+$/i.test(e)}catch{return!1}}function Le(t){try{let o=new URL(t).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Tt(t){let o=A(t);return(await xe(o)).bundleUrl}function De(t){try{let o=new URL(t.startsWith("http")?t:`http://${t}`),e=o.pathname||"/";if(e!=="/"&&e!==""||o.search||o.hash||!/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function xe(t){let o=A(t),e=/^\d+$/.test(o)?Number(o):De(o);if(e&&e>0){let n=await me(e);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return ye(o)}function X(t){let o=t.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Ae(t,o){let e=A(t),n=new URL(o),r=X(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(e)?n.pathname=`${r}/rn/${e}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",e)),n.toString()}function Ne(t){let o=A(t);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Fe(t,o){let e=await xe(t),n=new URL(o),r=X(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.set("bundle",e.bundleUrl),n.toString()}function He(t){return t.startsWith("~/")?J.join(Oe.homedir(),t.slice(2)):J.isAbsolute(t)?t:J.resolve(process.cwd(),t)}function Ke(t){let o={};for(let e=0;e<t.length;e++){if(t[e]!=="--replace")continue;let n=t[e+1];n||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let r=n.indexOf("=");(r<=0||r===n.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let s=n.slice(0,r).trim(),a=He(n.slice(r+1).trim());Ie.existsSync(a)||(console.error(` sootsim open: replacement file not found: ${a}`),process.exit(1)),o[s]={file:a},e++}return Object.keys(o).length>0?{modules:o}:void 0}function Pe(){let t=ne();return re(t)&&t.runtimePort>0?`http://localhost:${t.runtimePort}/`:se}function ze(t,o){if(!o)return t;try{let e=new URL(t);return e.searchParams.set("appFonts",o),e.toString()}catch{return t}}async function je(t,o){if(!t)return new URL(o).toString();if(Y(t))return new URL(t).toString();let e=_e[t.toLowerCase()];if(e){let n=new URL(o),r=X(n.pathname);return n.pathname=`${r}${e}`,n.toString()}return Ne(t)?Fe(t,o):Ae(t,o)}async function D(t,o=Pe(),e=process.env.SOOT_APP_FONTS||""){return ze(await je(t,o),e)}function Se(t,o){let e=t?.url||t?.origin||o;try{let n=new URL(e);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.toString()}catch{return o}}async function We(t,o,e){let n=new URL(await D(t,o));return n.searchParams.set("inspectOpen",e),n.toString()}async function qe(t,o,e,n={}){let r=n.attempts??30,s=n.intervalMs??500,a=n.minNodeCount??10;for(let i=0;i<r;i++){let l=S(t,{commandTimeoutMs:o,simId:e,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>a)return{bridge:l,count:c}}catch{}l.close(),await v(s)}return null}function Ge(t){if(!t)return null;try{let o=new URL(t);if(o.searchParams.has("bundle")){let e=o.searchParams.get("bundle")||"";try{let n=new URL(e),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function Ve(t,o){if(t.length===0){console.log(" no sims connected");return}console.log(` connected sims (${t.length}):
|
|
3
3
|
`);for(let e of t){let n=e.lockedBy&&e.lockExpiresAt?`locked by ${e.lockedBy} (${Math.max(0,Math.round((e.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[e.isPrimary?"primary":"",e.id===o?"selected":"",e.readyState,e.userVisible===!1?"hidden":e.userVisible===!0?"visible":"",e.attachedCliCount&&e.attachedCliCount>0?"in use":"",e.userFocused?"focused":"",n].filter(Boolean);console.log(` ${e.id}${r.length?` [${r.join(", ")}]`:""}`);let s=Ge(e.url);if(s)console.log(` loaded: ${s}`);else if(e.url){let a=e.url.length>96?`${e.url.slice(0,93)}\u2026`:e.url;console.log(` url: ${a}`)}else e.origin&&console.log(` origin: ${e.origin}`);e.title&&console.log(` title: ${e.title}`),e.visibilityState&&e.visibilityState!=="visible"&&console.log(` visibility: ${e.visibilityState}`),console.log(` connected: ${ve(Date.now()-e.connectedAt)}`),e.lastActiveAt&&e.lastActiveAt>0&&console.log(` last active: ${ve(Date.now()-e.lastActiveAt)}`)}}function ve(t){let o=Math.max(0,Math.round(t/1e3));return o<60?`${o}s ago`:o<3600?`${Math.round(o/60)}m ago`:o<86400?`${Math.round(o/3600)}h ago`:`${Math.round(o/86400)}d ago`}async function L(t,o,e,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let a=0;a<r;a++){let i=S(t,{commandTimeoutMs:o});try{let c=(await i.listSims()).find(e);if(c)return c}catch{}finally{i.close()}await v(s)}return null}async function Je(t,o,e,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let a=0;a<r;a++){let i=S(t,{commandTimeoutMs:o});try{let c=(await i.listSims()).find(d=>d.id===e);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{i.close()}await v(s)}return!1}function Qe(t){let o=t.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let e=Number(o.sootsimHostPid);return!Number.isInteger(e)||e<=1||e===process.pid?null:e}function Ye(t){if(!t.connectAckFile)return!1;try{return Ie.writeFileSync(t.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:t.pid??null})}
|
|
4
4
|
`,{flag:"w"}),!0}catch{return!1}}function $e(t){try{return process.kill(t,0),!0}catch(o){return o?.code==="EPERM"}}async function Xe(t,o=2500){let e=Date.now()+o;for(;Date.now()<e;){if(!$e(t))return!0;await v(100)}return!$e(t)}async function Q(t,o){let e=new Set(o),n=new Set;for(let r of t){if(!e.has(r.id))continue;let s=Qe(r);s&&n.add(s)}for(let r of n){try{process.kill(r,"SIGTERM")}catch{}if(await Xe(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function N(t,o){if(o){let r=o.trim(),s=t.find(a=>a.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let e=t.find(r=>r.isPrimary&&r.readyState==="open");if(e)return e;let n=t.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function B(t,o,e){console.log(` ${e==="current sim"?"loaded":"opened"}: ${t} [${e}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function M(t,o,e){if(e.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await Ze(t,o,{stableMs:150,maxMs:400});let r=S(t,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:ae})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&s.nodes>=le&&ce(s))){let d=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${d} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let i=`(async () => {
|
|
5
5
|
const t = window.__sootsimTest
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as t}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as t}from"./chunk-S3QCEBTB.js";import{a as p,b as m,c as a}from"./chunk-XPLBMRUI.js";import{a as r}from"./chunk-G2SZI7US.js";import{a as l}from"./chunk-DIWDDWNK.js";import{a as u,d}from"./chunk-RVUQAUXP.js";import{z as i}from"./chunk-M4QXOCCY.js";function c(){let o=i();return`sootsim CLI v${l()} \xB7 runtime ${o?`v${o}`:"not installed"}`}function S(){let o=m({bridgePort:7668,defaultShellUrl:r},t()),e=`
|
|
3
3
|
${d}
|
|
4
4
|
`;console.log(`${c()}
|
|
5
5
|
${e}${o}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as d}from"./chunk-JLFCHU45.js";import{a as p,d as w,h as $,j as y}from"./chunk-2JFC45SX.js";import{A as g,B as f,i as h,y as m,z as a}from"./chunk-M4QXOCCY.js";import b from"fs";import{WebSocket as D}from"ws";async function P(n,e={}){let[o,...t]=n;if(!o||o==="--help"||o==="-h"){R();return}switch(o){case"install":return O(t,e);case"list":case"ls":return S(t);case"use":return T(t);case"remove":case"rm":return N(t);case"which":case"active":return F();default:console.error(` unknown runtime subcommand: ${o}`),R(),process.exit(1)}}function R(){console.log(`
|
|
3
3
|
sootsim runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -22,4 +22,4 @@ examples:
|
|
|
22
22
|
sootsim runtime install 1.2.3
|
|
23
23
|
sootsim runtime install --channel beta
|
|
24
24
|
sootsim runtime use 1.2.3
|
|
25
|
-
`)}async function O(n,e){let{version:o,flags:t}=_(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await y({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await k(i.version)}catch(i){console.error(` ${I(i)}`),process.exit(1)}}async function k(n){g(n),console.log(` active: ${n}`),await A(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function A(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-
|
|
25
|
+
`)}async function O(n,e){let{version:o,flags:t}=_(n),s=t.channel??e.channel??"stable",l=t.force===!0,c=t.setActive!==!1;m(),console.log("sootsim runtime install"),console.log(` cdn: ${w()}`);try{let i=await y({version:o,channel:s,force:l,setActive:c});console.log(` version: ${i.version} (channel: ${i.channel})`),i.installed?console.log(` installed ${i.version}`):console.log(` already installed at ${i.runtimeDir}`),c&&await k(i.version)}catch(i){console.error(` ${I(i)}`),process.exit(1)}}async function k(n){g(n),console.log(` active: ${n}`),await A(n)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${n})`)}async function A(n){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-VTUAIJ4X.js"),t=o();if(!e(t))return!1;let s=d();return new Promise(l=>{let c=!1,i=!1,u=x=>{c||(c=!0,l(x))},r=new D(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),v=setTimeout(()=>{try{r.close()}catch{}u(i)},1500);r.on("open",()=>{try{r.send(JSON.stringify({type:"runtime:use",version:n,id:0})),i=!0}catch{}setTimeout(()=>{try{r.close()}catch{}},100)}),r.on("close",()=>{clearTimeout(v),u(i)}),r.on("error",()=>{clearTimeout(v),u(!1)})})}async function S(n){m();let e=f(),o=a();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let t of e)console.log(` ${t===o?"*":" "} ${t}`);try{let t=await $();console.log("available (latest per channel):");for(let[s,l]of Object.entries(t.channels))console.log(` ${s.padEnd(8)} ${l.latest}`)}catch(t){console.log(`available: (could not fetch manifest: ${I(t)})`)}}async function T(n){let e=n[0];e||(console.error(" usage: sootsim runtime use <version>"),process.exit(1));let o=f();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`sootsim runtime install ${e}\` first`),process.exit(1)),await k(e)}async function N(n){let e=n[0];e||(console.error(" usage: sootsim runtime remove <version>"),process.exit(1)),a()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `sootsim runtime use <other>` first, or install another version"),process.exit(1));let t=h(e);if(!b.existsSync(t)){console.error(` ${e} is not installed`);return}b.rmSync(t,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function F(){let n=a();if(!n){console.log(" no active runtime");return}console.log(n)}function _(n){let e={},o=[];for(let t=0;t<n.length;t++){let s=n[t];if(s==="--channel"&&t+1<n.length){e.channel=n[t+1],t++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function I(n){return n instanceof Error?n.message:String(n)}export{P as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
function
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
function A(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=e.indexOf(r);if(s>=0&&e[s+1]){let a=Number(e[s+1]);if(Number.isFinite(a))return Math.max(100,a)}}return t}var m=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function f(e){return typeof e=="string"&&m.has(e)}async function w(e){return await e.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function L(e,t){if(!f(t))return!1;try{return await w(e)}catch{return!1}}async function D(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function N(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function H(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function B(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
|
|
@@ -14,7 +14,7 @@ function k(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
|
|
|
14
14
|
const nodeCount = (await t.getNodeCount?.()) || 0
|
|
15
15
|
const keyboard = kb && typeof kb.getLayout === 'function' ? kb.getLayout() : null
|
|
16
16
|
return { tree, shell, nodeCount, keyboard }
|
|
17
|
-
})()`;return await e.send({type:"evaluate",code:n})??{}}var
|
|
17
|
+
})()`;return await e.send({type:"evaluate",code:n})??{}}var h=`(async () => {
|
|
18
18
|
const t = window.__sootsimTest
|
|
19
19
|
if (!t) return []
|
|
20
20
|
|
|
@@ -87,7 +87,7 @@ function k(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
|
|
|
87
87
|
return all
|
|
88
88
|
.filter(n => isVisibleTarget(n) && hasAccessibleSignal(n))
|
|
89
89
|
.map(normalize)
|
|
90
|
-
})()`;async function
|
|
90
|
+
})()`;async function C(e){let t=await e.send({type:"evaluate",code:h});return Array.isArray(t)?t:[]}var y=`
|
|
91
91
|
const fromInspectable = async () => {
|
|
92
92
|
if (typeof t.listInspectable !== 'function') return null
|
|
93
93
|
const list = await t.listInspectable({})
|
|
@@ -159,7 +159,7 @@ function k(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
|
|
|
159
159
|
abs.y < screenH
|
|
160
160
|
)
|
|
161
161
|
}
|
|
162
|
-
`;function
|
|
162
|
+
`;function x(e){return e.testId?{mode:"testid",code:`(async () => {
|
|
163
163
|
const t = window.__sootsimTest
|
|
164
164
|
return (await t.findByTestId(${JSON.stringify(e.testId)})) || (await t.findById(${JSON.stringify(e.testId)}))
|
|
165
165
|
})()`}:e.role?{mode:"role",code:`(async () => await window.__sootsimTest.queryAll({ hasRole: ${JSON.stringify(e.role)}, pruneHidden: true }))()`}:e.type?{mode:"type",code:`(async () => await window.__sootsimTest.queryAll({ type: ${JSON.stringify(e.type)}, pruneHidden: true }))()`}:e.pressable?{mode:"pressable",code:`(async () => {
|
|
@@ -181,7 +181,7 @@ ${y}
|
|
|
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 M(e,t){let n=x(t);if(!n)return null;let r=await e.send({type:"evaluate",code:n.code});return{mode:n.mode,result:r}}function $(e){return[...e].sort((t,n)=>p(n)-p(t))}function p(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,r=e.layout?.height??0,s=n*r;return s>=400&&s<=6e4?t+=25:s>6e4&&(t-=20),(e.absolutePosition?.y??0)<0&&(t-=30),t}function O(e){if(e.testID)return`sootsim do tap-id ${g(e.testID)}`;let t=typeof e.text=="string"?e.text.trim():"";if(t.length>0&&t.length<=80)return`sootsim do tap-text ${g(t)}`;let n=Math.round(((e.absolutePosition?.x??0)+(e.layout?.width??0)/2)*10)/10,r=Math.round(((e.absolutePosition?.y??0)+(e.layout?.height??0)/2)*10)/10;return`sootsim do tap ${n} ${r}`}function g(e){return/^[A-Za-z0-9_./@:-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}var S=`(async () => {
|
|
185
185
|
const t = window.__sootsimTest
|
|
186
186
|
let nodes = 0
|
|
187
187
|
try { nodes = (await t?.getNodeCount?.()) || 0 } catch {}
|
|
@@ -276,7 +276,7 @@ ${y}
|
|
|
276
276
|
externalStatus,
|
|
277
277
|
externalError,
|
|
278
278
|
}
|
|
279
|
-
})()`,
|
|
279
|
+
})()`,T=50,I=100,v=750,_=2e3;function k(e){return e.targets>0||e.nodes>=I}function W(e){return e.externalError?`guest app errored: ${e.externalError}`:e.loadingText?`still showing "${e.loadingText}"`:e.externalReady===!1?"guest app is still loading":e.flag!==!0?"guest app has not emitted sootsim:externalAppReady":e.targets<=0?"ready flag emitted but no visible app content is inspectable yet":"node tree is still changing"}async function F(e,t=2e4,n={}){let r=Date.now(),s=r+t,a=n.progressIntervalMs??_,l=r+a,c=-1,u=r,o={flag:void 0,at:0,nodes:0,targets:0,errors:0,loadingText:"",externalReady:null,externalStatus:"",externalError:""};for(;Date.now()<s;){try{o=await e.send({type:"evaluate",code:S})??o}catch{}let i=Date.now(),d={ready:!1,elapsedMs:i-r,nodes:o.nodes,targets:o.targets,flag:o.flag,loadingText:o.loadingText,externalReady:o.externalReady,externalStatus:o.externalStatus,externalError:o.externalError,errors:o.errors};if(o.nodes!==c&&(c=o.nodes,u=i),o.flag===!0&&o.externalReady!==!1&&!o.externalError&&!o.loadingText&&o.nodes>=T&&k(o)&&i-u>=v)return{...d,ready:!0};if(n.onProgress&&a>0&&i>=l){n.onProgress(d);do l+=a;while(i>=l)}await new Promise(b=>setTimeout(b,150))}return{ready:!1,elapsedMs:Date.now()-r,nodes:o.nodes,targets:o.targets,flag:o.flag,loadingText:o.loadingText,externalReady:o.externalReady,externalStatus:o.externalStatus,externalError:o.externalError,errors:o.errors}}async function K(e,t,n=5e3,r={}){let s=r.gone===!0;return await e.send({type:"evaluate",code:`(async () => {
|
|
280
280
|
const start = Date.now()
|
|
281
281
|
const deadline = start + ${n}
|
|
282
282
|
const gone = ${s}
|
|
@@ -307,17 +307,17 @@ ${y}
|
|
|
307
307
|
await new Promise((r) => setTimeout(r, 80))
|
|
308
308
|
}
|
|
309
309
|
return { found: false, elapsed: Date.now() - start }
|
|
310
|
-
})()`})??{found:!1,elapsed:n}}async function
|
|
310
|
+
})()`})??{found:!1,elapsed:n}}async function z(e,t=20){let n=await e.send({type:"evaluate",code:`window.__sootsimConsole?.getErrors(${t}) || []`});return Array.isArray(n)?n:[]}async function J(e,t=20){let n=await e.send({type:"evaluate",code:`window.__sootsimConsole?.getWarnings(${t}) || []`});return Array.isArray(n)?n:[]}async function V(e){await e.send({type:"evaluate",code:'window.__sootsimConsole?.clear(); "cleared"'})}async function j(e,t={}){let n=t.limit??20,r=t.failed===!1?"getRequests":"getFailedRequests",s=await e.send({type:"call",path:`__sootsimTest.${r}`,args:[n]});return Array.isArray(s)?s:[]}async function Q(e){await e.send({type:"call",path:"__sootsimTest.clearRequests",args:[]})}async function Y(e){let t=await e.send({type:"evaluate",code:`(() => {
|
|
311
311
|
const obs = window.__sootsimObservability;
|
|
312
312
|
if (!obs) return { ok: false };
|
|
313
313
|
return { ok: true, entries: obs.logs.getSnapshot() };
|
|
314
|
-
})()`});if(!t||!t.ok)throw new Error("observability bridge not installed \u2014 is the engine running?");return t.entries??[]}async function
|
|
314
|
+
})()`});if(!t||!t.ok)throw new Error("observability bridge not installed \u2014 is the engine running?");return t.entries??[]}async function q(e){await e.send({type:"evaluate",code:'window.__sootsimObservability?.logs.clear(); "cleared"'})}function R(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((r,s)=>r===t.args[s])}function G(e,t={}){let n=[];for(let r of e)n.some(s=>R(s,r))||n.push(r);if(t.showInternal||(n=n.filter(r=>{let s=r.args[0];return!(typeof s=="string"&&s.startsWith("[sootsim]"))})),t.level&&(n=n.filter(r=>t.level.has(r.level))),t.filter){let r=t.filter.toLowerCase();n=n.filter(s=>s.args.join(" ").toLowerCase().includes(r))}return n}async function U(e,t){return await e.send({type:"call",path:"SootSim.bridges.timeline.summary",args:[t]})}async function X(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 ee(e){return await e.send({type:"evaluate",code:`(() => {
|
|
315
315
|
const kb = window.__sootsimKeyboard
|
|
316
316
|
if (!kb || typeof kb.getLayout !== 'function') {
|
|
317
317
|
return { error: 'keyboard bridge getLayout() not available' }
|
|
318
318
|
}
|
|
319
319
|
return kb.getLayout()
|
|
320
|
-
})()`})??{error:"keyboard bridge returned no result"}}function
|
|
320
|
+
})()`})??{error:"keyboard bridge returned no result"}}function P(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 E(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(r){if(!P(r)||Date.now()>=n)throw r;await new Promise(s=>setTimeout(s,50))}}async function te(e){let t=await e.send({type:"evaluate",code:`(async () => {
|
|
321
321
|
const test = window.__sootsimTest
|
|
322
322
|
const kb = window.__sootsimKeyboard
|
|
323
323
|
const navSnap =
|
|
@@ -341,7 +341,7 @@ ${y}
|
|
|
341
341
|
})()
|
|
342
342
|
: null
|
|
343
343
|
return { nav: navSnap, keyboard }
|
|
344
|
-
})()`});return{shell:await
|
|
344
|
+
})()`});return{shell:await E(e,500).catch(()=>null),nav:t?.nav??null,keyboard:t?.keyboard??null}}async function ne(e){return e.send({type:"evaluate",code:"window.__sootsimDebug.status()"})}async function re(e){return e.send({type:"evaluate",code:"window.__sootsimDebug.flags()"})}async function se(e,t){let n=t==="sheets"?"findSheets":"findPortals";return e.send({type:"evaluate",code:`window.__sootsimDebug.${n}()`})}async function oe(e,t,n=50){let r=t&&t!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(t)}, ${n})`:`window.__sootsimDebug.recent(undefined, ${n})`;return e.send({type:"evaluate",code:r})}async function ae(e,t,n){let r=n.length>0?n.map(s=>JSON.stringify(s)).join(", "):t==="disable"?"'all'":"";return e.send({type:"evaluate",code:`window.__sootsimDebug.${t}(${r})`})}async function ie(e){return await e.send({type:"evaluate",code:`(async () => {
|
|
345
345
|
const host = window.__sootsimRenderHost
|
|
346
346
|
const stats = host?.queryStats ? await host.queryStats() : null
|
|
347
347
|
const hostMem = performance.memory
|
|
@@ -356,4 +356,4 @@ ${y}
|
|
|
356
356
|
workerHeap: stats?.memory?.workerHeap ?? null,
|
|
357
357
|
hostHeap: hostMem,
|
|
358
358
|
}
|
|
359
|
-
})()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function
|
|
359
|
+
})()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function le(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"],r=new Set;for(let s of n){let a=e.byKind[s];a&&(t.push(`${a} ${s}${a===1?"":"s"}`),r.add(s))}for(let[s,a]of Object.entries(e.byKind))!r.has(s)&&a&&t.push(`${a} ${s}${a===1?"":"s"}`);return t.join(" \xB7 ")}export{A as a,L as b,D as c,N as d,H as e,B as f,C as g,M as h,$ as i,O as j,S as k,T as l,v as m,k as n,W as o,F as p,K as q,z as r,J as s,V as t,j as u,Q as v,Y as w,q as x,G as y,U as z,X as A,Z as B,ee as C,P as D,E,te as F,ne as G,re as H,se as I,oe as J,ae as K,ie as L,le as M};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{g as u}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{g as u}from"./chunk-W5ET7GSK.js";var S=52,l=18,h=42,x=96,g=54,E=1.5,$="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",w=1;function y(e){let t=u(e),r=t.scale,o=!t.dynamicIsland&&t.homeIndicatorHeight===0&&t.cornerRadius===0,n=t.width,i=t.height,a=o?t.width+l*2:t.width+28,d=o?t.height+h+x:t.height+28,c=9.5,b=w,p=a+c*2,m=d+w*2,f=c+(o?l:14),B=o?h:14,H=o?S:t.cornerRadius+14,v=[{side:"right",top:t.hardwareButtons.lock.top,height:t.hardwareButtons.lock.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.ringToggle.top,height:t.hardwareButtons.ringToggle.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeUp.top,height:t.hardwareButtons.volumeUp.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeDown.top,height:t.hardwareButtons.volumeDown.height,width:t.hardwareButtons.width}];return{model:e,renderScale:r,outerWidth:Math.round(p*r),outerHeight:Math.round(m*r),logicalOuterWidth:p,logicalOuterHeight:m,logicalFrameWidth:a,logicalFrameHeight:d,logicalFrameLeft:c,logicalFrameTop:b,logicalScreenWidth:n,logicalScreenHeight:i,logicalScreenLeft:f,logicalScreenTop:B,logicalScreenRadius:o?0:t.cornerRadius,logicalFrameRadius:H,frameBackground:o?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:o?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:o?null:$,buttons:v,legacyHomeButton:o?{top:h+t.height+(x-g)/2,left:t.width/2-g/2+l,size:g,ring:E}:null,showHomeIndicator:t.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:t.homeIndicatorHeight}}function L(e){let t=e.side==="right",r=t?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
|
|
3
3
|
<div
|
|
4
4
|
aria-hidden="true"
|
|
5
5
|
style="
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{D as A,k as _,l as h,m as v,n as S}from"./chunk-BXZDXBUA.js";import{d as y,h as B,i as E}from"./chunk-JLFCHU45.js";var W={timeoutMs:1800,settleMs:48,startWindowMs:64};function p(e){return new Promise(t=>setTimeout(t,e))}function J(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
3
3
|
`)}function U(e){process.stderr.write(`${e}
|
|
4
4
|
`)}function $(e,t=Date.now()){let r=new Date(e),n=`${b(r.getHours())}:${b(r.getMinutes())}:${b(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function b(e){return e<10?`0${e}`:String(e)}async function D(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function q(e,t,...r){return E(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",W);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await q(e,t,...n)}catch(o){if(!A(o)||Date.now()>=s)throw o;await p(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await p(o)}return null}async function V(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await p(o)}return null}async function X(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,m=!1,d={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:_}),f=Date.now()-o,g=Number(i?.nodes)||0,x=Number(i?.targets)||0,C=Number(i?.errors)||0,T=i?.flag===!0,w=i?.externalReady,P=typeof i?.loadingText=="string"?i.loadingText.trim():"",N=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",R=typeof i?.externalError=="string"?i.externalError.trim():"",M=typeof i?.externalError=="string"&&R.length>0;if(c=w,m=M,g!==a&&(a=g,u=f),d={ready:!1,source:"timeout",elapsedMs:f,nodes:g,targets:x,flag:i?.flag,loadingText:P,externalReady:typeof w=="boolean"?w:null,externalStatus:N,externalError:R,errors:C},T&&w!==!1&&!M&&g>=h&&S({nodes:g,targets:x})&&f-u>=v)return{...d,ready:!0,source:"flag"};if(f>=n&&C>0&&!T)return{...d,ready:!1,source:"error-bail"}}catch{}await p(s)}return c!==!1&&!m&&d.nodes>=h&&S(d)?{...d,ready:!0,source:"nodes-fallback"}:{...d,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function k(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function I(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function O(e,t={}){let r=await e.send({type:"evaluate",code:"window.__sootsimConsole?.count?.() || { errors: 0, warnings: 0, total: 0 }"});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
5
5
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await e.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors?.(5) || []"});if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as Ns}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as Ns}from"./chunk-EOEORGPV.js";var ui=`(async () => {
|
|
3
3
|
try { localStorage.clear() } catch {}
|
|
4
4
|
try { sessionStorage.clear() } catch {}
|
|
5
5
|
try {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.93 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
|