sootsim 0.1.156 → 0.1.157
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-6SII2ADM.js → agent-GKCKPDQL.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-KCFNAXBX.js → agent-wrapper-H2U7JFCS.js} +2 -2
- package/dist-cli/chunks/{app-fonts-HA6TURSC.js → app-fonts-QUD2SV6L.js} +2 -2
- package/dist-cli/chunks/{assert-NFD4XONC.js → assert-NH2HHMN4.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-CT7E764X.js +2 -0
- package/dist-cli/chunks/beta-WWL6ZI74.js +2 -0
- package/dist-cli/chunks/{camera-EIXCV6T7.js → camera-BBIMVYXH.js} +2 -2
- package/dist-cli/chunks/{chunk-GTKPFFNK.js → chunk-2MWM7JD6.js} +2 -2
- package/dist-cli/chunks/{chunk-7CFLQ5RQ.js → chunk-2SQVUKGN.js} +1 -1
- package/dist-cli/chunks/{chunk-JT47D7AS.js → chunk-2V4FB2RT.js} +2 -2
- package/dist-cli/chunks/chunk-4HETKHPX.js +13 -0
- package/dist-cli/chunks/{chunk-IDXOP3UM.js → chunk-4POIDYSQ.js} +1 -1
- package/dist-cli/chunks/{chunk-WTYDDLVC.js → chunk-6CBI57IL.js} +2 -2
- package/dist-cli/chunks/{chunk-FZWSY6PU.js → chunk-7P2QJUZB.js} +1 -1
- package/dist-cli/chunks/{chunk-OQ4PEGZM.js → chunk-7WZEEFD3.js} +2 -2
- package/dist-cli/chunks/{chunk-FZSEG2L4.js → chunk-AES7K6P5.js} +1 -1
- package/dist-cli/chunks/chunk-AYTLC7QV.js +1 -0
- package/dist-cli/chunks/{chunk-UUUBY2MO.js → chunk-BJFLKJZI.js} +2 -2
- package/dist-cli/chunks/{chunk-MK4D3LRG.js → chunk-BRIWO44I.js} +1 -1
- package/dist-cli/chunks/{chunk-BUPUMQEH.js → chunk-C5BXRLHS.js} +1 -1
- package/dist-cli/chunks/{chunk-C6XY53D4.js → chunk-CQKIN4UH.js} +2 -2
- package/dist-cli/chunks/{chunk-XTTBLKSO.js → chunk-DHULHNVZ.js} +1 -1
- package/dist-cli/chunks/{chunk-5FLC7DTX.js → chunk-ESZY26WY.js} +2 -2
- package/dist-cli/chunks/{chunk-2IFYJBKM.js → chunk-FCICI3EX.js} +1 -1
- package/dist-cli/chunks/{chunk-EUW6WLU3.js → chunk-FTCNYGT4.js} +1 -1
- package/dist-cli/chunks/{chunk-3KS5W6VS.js → chunk-G4EHF2XU.js} +2 -2
- package/dist-cli/chunks/{chunk-R3K7I6OA.js → chunk-GAXCW6BZ.js} +57 -32
- package/dist-cli/chunks/{chunk-734YKCKK.js → chunk-GH25H5QD.js} +1 -1
- package/dist-cli/chunks/{chunk-TCWXT3TN.js → chunk-GPV6OYQI.js} +2 -2
- package/dist-cli/chunks/{chunk-IDVRZVWW.js → chunk-ISGEH5I6.js} +2 -2
- package/dist-cli/chunks/{chunk-AG4VJEME.js → chunk-J72RL5TX.js} +1 -1
- package/dist-cli/chunks/{chunk-LEPF5QPE.js → chunk-JMXKC7DE.js} +2 -2
- package/dist-cli/chunks/{chunk-DSPYCLAV.js → chunk-K4LDVZYP.js} +3 -3
- package/dist-cli/chunks/{chunk-MY7FJWXJ.js → chunk-KIMSPMBC.js} +3 -3
- package/dist-cli/chunks/{chunk-XNK3USYL.js → chunk-LV3DINZS.js} +1 -1
- package/dist-cli/chunks/{chunk-NL5LGUY6.js → chunk-NT6JVAUN.js} +1 -1
- package/dist-cli/chunks/chunk-O5HTYUHB.js +2 -0
- package/dist-cli/chunks/{chunk-AF3ZSUJT.js → chunk-OZ3UZ2VO.js} +2 -2
- package/dist-cli/chunks/{chunk-FOLKDVFM.js → chunk-P53GI4GU.js} +2 -2
- package/dist-cli/chunks/{chunk-5JOGV2HQ.js → chunk-PCW7AAPN.js} +2 -2
- package/dist-cli/chunks/chunk-PPH7UKZN.js +1 -0
- package/dist-cli/chunks/{chunk-PIVH54LG.js → chunk-QA7DWZXG.js} +2 -2
- package/dist-cli/chunks/{chunk-JQGIMV75.js → chunk-QIFVD5D2.js} +2 -2
- package/dist-cli/chunks/{chunk-UJ4B2V2Y.js → chunk-QSFSGKVF.js} +1 -1
- package/dist-cli/chunks/{chunk-CGRV5ZGV.js → chunk-QTFL2HSS.js} +1 -1
- package/dist-cli/chunks/chunk-RI6LUHT6.js +2 -0
- package/dist-cli/chunks/chunk-RJTJ67H3.js +1 -0
- package/dist-cli/chunks/chunk-S56YDDA7.js +79 -0
- package/dist-cli/chunks/{chunk-TJIHZA53.js → chunk-SKDLBR7B.js} +2 -2
- package/dist-cli/chunks/{chunk-6DN4FY5V.js → chunk-SMYZKDMS.js} +1 -1
- package/dist-cli/chunks/{chunk-ZFPDGGM2.js → chunk-XIG5BFQB.js} +2 -2
- package/dist-cli/chunks/{chunk-MAZZU3SS.js → chunk-ZJUIBQPS.js} +1 -1
- package/dist-cli/chunks/{chunk-TNN276C7.js → chunk-ZVELB7QY.js} +3 -3
- package/dist-cli/chunks/cli-version-BXPUDDCJ.js +2 -0
- package/dist-cli/chunks/{compat-GMFJB2QI.js → compat-AUXJQIHL.js} +3 -3
- package/dist-cli/chunks/{config-VN63ZIQQ.js → config-BXXIT3N3.js} +2 -2
- package/dist-cli/chunks/control-FSL5WY5D.js +2 -0
- package/dist-cli/chunks/{cpu-profile-TPSUYM3P.js → cpu-profile-YUS3WKAK.js} +2 -2
- package/dist-cli/chunks/{daemon-XLZOQISP.js → daemon-22L65BF7.js} +2 -2
- package/dist-cli/chunks/{debug-J3SO6XXZ.js → debug-XJN62JVM.js} +3 -3
- package/dist-cli/chunks/{detox-OUXMHQ66.js → detox-XTQMXYKU.js} +2 -2
- package/dist-cli/chunks/{device-MRE7PGNT.js → device-MAE44TQB.js} +2 -2
- package/dist-cli/chunks/{diagnose-IBGOIBXB.js → diagnose-HF3DUNXT.js} +2 -2
- package/dist-cli/chunks/drivers-6ZRVNWCU.js +2 -0
- package/dist-cli/chunks/{electron-GM7P45K6.js → electron-FM7ABQ55.js} +3 -3
- package/dist-cli/chunks/flow-4PJHUWIA.js +2 -0
- package/dist-cli/chunks/help-C4MKKA5E.js +2 -0
- package/dist-cli/chunks/{hints-ZXJEZ7VA.js → hints-5FKUHYYV.js} +2 -2
- package/dist-cli/chunks/{home-paths-R2BX3P5C.js → home-paths-2UT3LZCV.js} +2 -2
- package/dist-cli/chunks/{inspect-Q5DVSR33.js → inspect-EDWNKILW.js} +3 -3
- package/dist-cli/chunks/install-JJ2I2L3B.js +2 -0
- package/dist-cli/chunks/{install-desktop-P33GKIJF.js → install-desktop-MQV7A7LW.js} +3 -3
- package/dist-cli/chunks/{keys-DWT4BLAF.js → keys-5R3GN66Z.js} +2 -2
- package/dist-cli/chunks/{launch-ARXODF7Y.js → launch-3XQXJHU6.js} +3 -3
- package/dist-cli/chunks/{login-IOYQ6NED.js → login-RR3LSQ3A.js} +4 -4
- package/dist-cli/chunks/{logout-PX2G2SXA.js → logout-3GIZQ27A.js} +2 -2
- package/dist-cli/chunks/{maestro-GGSUWKYF.js → maestro-CS6JBEG4.js} +2 -2
- package/dist-cli/chunks/optional-demo-registry-BGV6FY2J.js +2 -0
- package/dist-cli/chunks/{preview-BQUWNLPH.js → preview-ZMOUSC43.js} +2 -2
- package/dist-cli/chunks/{profile-XVN2QFUN.js → profile-HGF54OC4.js} +2 -2
- package/dist-cli/chunks/{react-IARLUSNE.js → react-N6HTHJNA.js} +2 -2
- package/dist-cli/chunks/{record-HFSXL4SG.js → record-Z36PVVU7.js} +2 -2
- package/dist-cli/chunks/runtime-I64WAQIR.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-DELLWFH7.js → runtime-delivery-PJMSW4HO.js} +2 -2
- package/dist-cli/chunks/{screenshot-V5F65B2V.js → screenshot-4YKF4UBD.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-JS2NQ6VV.js → screenshot-mode-BGXJPIBS.js} +2 -2
- package/dist-cli/chunks/{screenshots-PFVIDRRE.js → screenshots-TRGYSPW5.js} +2 -2
- package/dist-cli/chunks/{server-YBXIAWME.js → server-CV7RETHK.js} +3 -3
- package/dist-cli/chunks/setup-repo-IZ44DI2U.js +2 -0
- package/dist-cli/chunks/{skills-2N75NKCV.js → skills-MTXAUNIT.js} +2 -2
- package/dist-cli/chunks/{slides-ECMGLFWX.js → slides-LDMZ3ZKO.js} +2 -2
- package/dist-cli/chunks/{start-5CZXOX5G.js → start-LTZH7NX6.js} +4 -4
- package/dist-cli/chunks/store-HTK26UWW.js +2 -0
- package/dist-cli/chunks/telemetry-YKO6WSAB.js +2 -0
- package/dist-cli/chunks/{test-W4ZCCSHY.js → test-MAGRP4B6.js} +3 -3
- package/dist-cli/chunks/{three-mode-KG3C4Q23.js → three-mode-QYIRSQBC.js} +2 -2
- package/dist-cli/chunks/{timeline-WK62L3NA.js → timeline-X5HZN2L5.js} +2 -2
- package/dist-cli/chunks/{upgrade-7UVLOEVQ.js → upgrade-JZPXC2WH.js} +2 -2
- package/dist-cli/chunks/upload-7DBFEXRG.js +2 -0
- package/dist-cli/chunks/{version-EVZ4PR3Y.js → version-YZNR4TYU.js} +2 -2
- package/dist-cli/chunks/web-CHLW4MAH.js +2 -0
- package/dist-cli/chunks/{what-happened-RSHNHEZ3.js → what-happened-P6YJADRY.js} +2 -2
- package/dist-cli/chunks/{whoami-LPQ5MGZQ.js → whoami-MK25C7TJ.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/menu.cjs +3 -2
- package/dist-lib/menu.mjs +3 -2
- 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/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +30 -5
- package/dist-lib/sdk.mjs +30 -5
- package/dist-lib/skills.cjs +51 -13
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/menu.ts +2 -1
- package/dist-cli/chunks/auto-bootstrap-DAU4P4W3.js +0 -2
- package/dist-cli/chunks/beta-EWOOAHUB.js +0 -2
- package/dist-cli/chunks/chunk-5KJC63UI.js +0 -1
- package/dist-cli/chunks/chunk-B6A7ZJMT.js +0 -1
- package/dist-cli/chunks/chunk-CAHWX2CJ.js +0 -2
- package/dist-cli/chunks/chunk-J53MOMRD.js +0 -79
- package/dist-cli/chunks/chunk-QH3FJHUA.js +0 -1
- package/dist-cli/chunks/chunk-VNPT6T3W.js +0 -13
- package/dist-cli/chunks/cli-version-26ALCPQY.js +0 -2
- package/dist-cli/chunks/control-26SFJCEB.js +0 -2
- package/dist-cli/chunks/drivers-UDWSV2BD.js +0 -2
- package/dist-cli/chunks/flow-2627URQN.js +0 -2
- package/dist-cli/chunks/help-V2AWDI3R.js +0 -2
- package/dist-cli/chunks/install-T7X3R2JD.js +0 -2
- package/dist-cli/chunks/optional-demo-registry-EUADUL22.js +0 -2
- package/dist-cli/chunks/runtime-DKE54MC6.js +0 -2
- package/dist-cli/chunks/setup-repo-E7MPL5GG.js +0 -2
- package/dist-cli/chunks/store-E6OLJAZN.js +0 -2
- package/dist-cli/chunks/telemetry-ANL2YCIC.js +0 -2
- package/dist-cli/chunks/upload-NPVSF5B7.js +0 -2
- package/dist-cli/chunks/web-DDAK4ZLY.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.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as u,b as d,c as g}from"./chunks/chunk-SMYZKDMS.js";import"./chunks/chunk-QTFL2HSS.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
|
|
4
4
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
5
5
|
`):process.stderr.write(`${e}
|
|
6
6
|
`),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
|
|
7
7
|
it needs vite / electron / playwright from a project's node_modules.
|
|
8
8
|
install the npm package and run via bun or node instead:
|
|
9
9
|
npm i -g sootsim && sootsim ${a}
|
|
10
|
-
`),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-
|
|
10
|
+
`),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-YKO6WSAB.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-YKO6WSAB.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-BXPUDDCJ.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-WWL6ZI74.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-2UT3LZCV.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-C4MKKA5E.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-HTK26UWW.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-LTZH7NX6.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-C4MKKA5E.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-C4MKKA5E.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-C4MKKA5E.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-CT7E764X.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-EDWNKILW.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-NH2HHMN4.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-4PJHUWIA.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-MAGRP4B6.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-XTQMXYKU.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-CS6JBEG4.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-ZMOUSC43.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-Z36PVVU7.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-HGF54OC4.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-YUS3WKAK.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-N6HTHJNA.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-4YKF4UBD.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-TRGYSPW5.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-BGXJPIBS.js");await a(t.commandArgs,{port:o,verbose:n});break}case"slides":{let{runSlides:a}=await import("./chunks/slides-LDMZ3ZKO.js");await a(s,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-QYIRSQBC.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-EDWNKILW.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-XJN62JVM.js");await a(s,{port:o,verbose:n});break}case"camera":{let{runCamera:a}=await import("./chunks/camera-BBIMVYXH.js");await a(s,{port:o});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-X5HZN2L5.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-P6YJADRY.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-HF3DUNXT.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-CT7E764X.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-FSL5WY5D.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-FSL5WY5D.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-FSL5WY5D.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-FSL5WY5D.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-BXXIT3N3.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-MAE44TQB.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-AUXJQIHL.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-FM7ABQ55.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-RR3LSQ3A.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-3GIZQ27A.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-MK25C7TJ.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-5R3GN66Z.js");await a(t.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-IZ44DI2U.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-JJ2I2L3B.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-MQV7A7LW.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-CV7RETHK.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-22L65BF7.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-I64WAQIR.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-JZPXC2WH.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-YZNR4TYU.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-3XQXJHU6.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-LTZH7NX6.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-GKCKPDQL.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-H2U7JFCS.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-MTXAUNIT.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-7DBFEXRG.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-QUD2SV6L.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-5FKUHYYV.js");a(t.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-QIFVD5D2.js";import"./chunk-AES7K6P5.js";import{c as b}from"./chunk-2MWM7JD6.js";import"./chunk-ESZY26WY.js";import"./chunk-DHULHNVZ.js";import"./chunk-RI6LUHT6.js";import"./chunk-LV3DINZS.js";import"./chunk-BRIWO44I.js";import"./chunk-2SQVUKGN.js";import"./chunk-C5BXRLHS.js";import{h as y,i as $}from"./chunk-GH25H5QD.js";import"./chunk-QTFL2HSS.js";import w from"node:fs";import d from"node:path";import{spawn as F}from"node:child_process";import B from"node:net";import{WebSocket as M}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new M(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==M.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function L(n=7668,e=400){return new Promise(t=>{let r=new B.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function W(n={}){let e=n.port??7668;if(await L(e))return{alreadyRunning:!0};if($()){let a=y()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new c(`no sootsim bridge on port ${e} and refusing to spawn a standalone daemon \u2014 ${a}. start the live \`bun dev\` stack so the bridge is up, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose.`,"DEV_HOST_REFUSED")}let{cmd:t,prefixArgs:r}=C(),s=[...r,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=F(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await L(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await W({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function fe(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return _(),0;case"attach":return await V(t);case"projects":return await J();case"project":return await G(t);case"sessions":return await H(t);case"start":return await q(t);case"prompt":return await K(t);case"watch":return await X(t);case"transcript":return await Q(t);case"end":return await Y(t);case"paths":return await Z();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
3
3
|
`),_(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
4
4
|
`),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function _(){b("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function V(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
|
|
5
5
|
`),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as M}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-AES7K6P5.js";import"./chunk-QTFL2HSS.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
|
|
3
3
|
`)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return I(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let g=t[u];g&&(r[g]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
|
|
4
4
|
--provider codex|claude --cwd <path>
|
|
5
5
|
--prompt-in <fifo> --events-out <fifo>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as p}from"./chunk-FCICI3EX.js";import"./chunk-QTFL2HSS.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-QTFL2HSS.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.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-K4LDVZYP.js";import"./chunk-PCW7AAPN.js";import"./chunk-ZJUIBQPS.js";import"./chunk-LV3DINZS.js";import"./chunk-GH25H5QD.js";import"./chunk-QTFL2HSS.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{m as f}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{m as f}from"./chunk-QA7DWZXG.js";import"./chunk-4POIDYSQ.js";import{c as m,e as l,g as p}from"./chunk-PCW7AAPN.js";import"./chunk-ZJUIBQPS.js";import"./chunk-LV3DINZS.js";import"./chunk-GH25H5QD.js";import"./chunk-QTFL2HSS.js";function d(){console.log(`
|
|
3
3
|
sootsim camera \u2014 drive the sim camera
|
|
4
4
|
|
|
5
5
|
usage:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as t}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as t}from"./chunk-ESZY26WY.js";import{a as p,b as m,c as a}from"./chunk-DHULHNVZ.js";import{a as r}from"./chunk-RI6LUHT6.js";import{a as l}from"./chunk-BRIWO44I.js";import{a as u,d}from"./chunk-2SQVUKGN.js";import{B as i}from"./chunk-GH25H5QD.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,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=!0,e="1.0.0",o="public beta",n=`${o} \xB7 free until ${e}`,r="free for everyone until 1.0 \u2014 we send anonymous error and dependency data while you use it";export{t as a,e as b,o as c,n as d,r as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{n as d}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{n as d}from"./chunk-GH25H5QD.js";import{chmodSync as S,existsSync as f,mkdirSync as k,readFileSync as A,rmSync as i,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as m}from"node:path";var s=1,p="SOOTSIM_SHARED_AUTH_FILE",u="https://sootbean.com";function w(){let t=process.env[p];return t?.trim()?c(m(t)):d()}function a(){let t=process.env[p];return t?.trim()?m(t):D(w(),"desktop-auth.json")}function g(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,githubUsername:typeof e.githubUsername=="string"?e.githubUsername:void 0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",o=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:g(e.user),origin:r,source:n,updatedAt:o,validatedAt:h}}function b(){let t=a();if(!f(t))return null;try{let e=JSON.parse(A(t,"utf8")),r=v(e);return r||(i(t,{force:!0}),null)}catch{return i(t,{force:!0}),null}}function O(t){let e=a();k(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?g(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
|
|
3
3
|
`);try{S(e,384)}catch{}return r}function l(){i(a(),{force:!0})}async function E(t){let e=b();if(!e?.token)return null;let r=t||e.origin||u;try{let n=await fetch(`${r.replace(/\/$/,"")}/api/auth/me`,{headers:{authorization:`Bearer ${e.token}`}});if(n.status===401)return l(),null;if(!n.ok)return e;let o=await n.json();return o.user?.id?O({token:e.token,user:o.user,origin:r,source:e.source,validatedAt:new Date().toISOString()}):(l(),null)}catch{return e}}export{b as a,O as b,l as c,E as d};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as B,b as V,c as me,d as ue}from"./chunk-BJFLKJZI.js";import{m as D}from"./chunk-QA7DWZXG.js";import{m as ce,o as de}from"./chunk-4POIDYSQ.js";import{a as he,b as we}from"./chunk-O5HTYUHB.js";import{a as fe,b as G,c as ge}from"./chunk-FCICI3EX.js";import{b as le,c as I,d as v,e as P}from"./chunk-PCW7AAPN.js";import{g as Q}from"./chunk-P53GI4GU.js";import{a as M,b as J}from"./chunk-NT6JVAUN.js";import{c as pe}from"./chunk-OZ3UZ2VO.js";import{d as q}from"./chunk-QSFSGKVF.js";import{d as C,e as w,f as T}from"./chunk-ZJUIBQPS.js";import{a as ae}from"./chunk-RI6LUHT6.js";import{G as se,H as ie}from"./chunk-GH25H5QD.js";import Z from"node:fs";import He from"node:os";import x from"node:path";function Oe(e){return e.replace(/^\[|\]$/g,"").toLowerCase()}function L(e){let o=Oe(e);return o==="localhost"||o.endsWith(".localhost")||o==="0.0.0.0"||o==="::1"||/^127(?:\.\d{1,3}){3}$/.test(o)}function be(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function De(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Se(e,o,t){return`${e}//${o}:${t}`}function Be(e){if(typeof window>"u")return!1;try{let o=new URL(e);return L(o.hostname)&&L(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function ye(e,o){let t={...o,cache:o?.cache??"no-store"};return Be(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Le(e){return e==="https:"?443:80}function Ae(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function Ne(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:n.bundleUrl,port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function $e(e,o){let t=e.replace(/\/+$/,"");try{if(L(new URL(t).hostname)){let n=await Ne(o);if(n)return n}}catch{}try{let n=await ye(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:me(i||`${t}${V}`),port:o,framework:De(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await ye(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${V}`,port:o,framework:"metro"}}catch{}return null}async function ve(e){return $e(Se("http:","localhost",e),e)}async function Ie(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await ve(a);if(l)return l;let c=3;for(let d=1;d<=c;d++){let m=await ve(a+d);if(m)return m}throw be(`localhost:${a} (also scanned +1..+${c})`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". 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):Le(r),i=Se(r,n.hostname,s);if(Ae(n)){let a=await $e(i,s);if(a)return a;throw be(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function xt(){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 Pe(e){let o=M();if(console.log(` note: no sootsim bridge detected on port ${e}`),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 Fe(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),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 kt(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){Fe(o);return}console.error(` no sim with id "${t}" 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 je=12e4,xe=500,Ke=5e3,We={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 S(e){return new Promise(o=>setTimeout(o,e))}function ke(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function ze(){let e=ke("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??ke("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??je;return{timeoutMs:e,hostTimeoutMs:e+Ke,intervalMs:xe,attempts:Math.max(1,Math.ceil(e/xe))}}function qe(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function F(e){return e.trim()}function Y(e){try{let o=new URL(e),t=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")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ve(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function Vt(e){let o=F(e);return(await Re(o)).bundleUrl}function Ge(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||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 Re(e){let o=F(e),t=/^\d+$/.test(o)?Number(o):Ge(o);if(t&&t>0){let n=await ue(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return Ie(o)}function ee(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Je(e,o){let t=F(e),n=new URL(o),r=ee(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(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function Qe(e){let o=F(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function Xe(e,o){let t=await Re(e),n=new URL(o),r=ee(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",t.bundleUrl),n.toString()}function Ye(e){return e.startsWith("~/")?x.join(He.homedir(),e.slice(2)):x.isAbsolute(e)?e:x.resolve(process.cwd(),e)}function Ze(e){let o={},t={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=Ye(s.slice(i+1).trim());Z.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}function _e(){let e=se();return ie(e)&&e.runtimePort>0?`http://localhost:${e.runtimePort}/`:ae}async function et(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await G(t)||void 0,r=fe({bundleUrl:t,repoDir:n});if(r.length===0)return e;let s=await tt(r);return s.length===0?e:(o.searchParams.set("appFonts",ge(s)),o.toString())}catch{return e}}async function tt(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function ot(e,o){if(!e)return new URL(o).toString();if(Y(e))return new URL(e).toString();let t=We[e.toLowerCase()];if(t){let n=new URL(o),r=ee(n.pathname);return n.pathname=`${r}${t}`,n.toString()}return Qe(e)?Xe(e,o):Je(e,o)}async function nt(e){try{let o=new URL(e),t=o.searchParams.get("bundle")||"";if(!t)return e;let n=process.env.SOOT_REPO_DIR||await G(t)||void 0,r=he({bundleUrl:t,repoDir:n});return!r||r.imageUrl&&!await rt(r.imageUrl)?e:(o.searchParams.set("appSplash",we(r)),o.toString())}catch{return e}}async function rt(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function N(e,o=_e()){let t=await ot(e,o);return nt(await et(t))}function Ce(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);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.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return o}}async function st(e,o,t){let n=new URL(await N(e,o));return n.searchParams.set("inspectOpen",t),n.toString()}async function it(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>i)return{bridge:l,count:c}}catch{}l.close(),await S(s)}return null}function at(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),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 lt(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function ct(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
3
|
+
`);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${lt(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[t.isPrimary?"primary":"",t.id===o?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",n].filter(Boolean);console.log(` ${t.id}${r.length?` [${r.join(", ")}]`:""}`);let s=at(t.url);if(s)console.log(` loaded: ${s}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let i=dt(t);i&&console.log(` engine: ${i}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${Te(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${Te(Date.now()-t.lastActiveAt)}`)}}function dt(e){let o=e.url||e.origin||"";if(!o)return null;try{let t=new URL(o).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"soot app embedded (:3000)":`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function Te(e){let o=Math.max(0,Math.round(e/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 A(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let c=(await a.listSims()).find(t);if(c)return c}catch{}finally{a.close()}await S(s)}return null}async function mt(e,o,t,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let c=(await a.listSims()).find(d=>d.id===t);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{a.close()}await S(s)}return!1}function ut(e){let o=e.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let t=Number(o.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function pt(e){if(!e.connectAckFile)return!1;try{return Z.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
4
|
+
`,{flag:"w"}),!0}catch{return!1}}function ft(e){if(e.diagnosticLogPath)try{let o=Z.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${x.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
|
|
5
|
+
${o.slice(-4e3)}`:o;console.error(` ${x.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${x.basename(e.diagnosticLogPath)}: ${t}`)}}function Me(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function gt(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!Me(e))return!0;await S(100)}return!Me(e)}async function X(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=ut(r);s&&n.add(s)}for(let r of n){try{process.kill(r,"SIGTERM")}catch{}if(await gt(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function H(e,o){if(o){let r=o.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let t=e.find(r=>r.isPrimary&&r.readyState==="open");if(t)return t;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function R(e,o,t){console.log(` ${t==="current sim"?"loaded":"opened"}: ${e} [${t}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function _(e,o,t){if(t.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await ht(e,o,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:ce})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&de(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 a=`(async () => {
|
|
6
|
+
const t = window.__sootsimTest
|
|
7
|
+
const ms = window.SootSim?.bridges?.mainShell
|
|
8
|
+
if (!t) return null
|
|
9
|
+
let shell = null
|
|
10
|
+
try { shell = ms?.getState ? await ms.getState() : null } catch {}
|
|
11
|
+
const tree = await t.dumpTree(12, ${JSON.stringify({describe:!0,verbose:!1,filter:""})})
|
|
12
|
+
return { tree, shell }
|
|
13
|
+
})()`,l=await r.send({type:"evaluate",code:a});if(!l?.tree)return;if(console.log(""),l.shell?.state){let c=[`state=${l.shell.state}`,l.shell.activeApp?`app=${l.shell.activeApp}`:null].filter(Boolean);console.log(` shell: ${c.join(" ")}`)}console.log(l.tree)}finally{r.close()}}catch{}finally{n===void 0?delete process.env.SOOTSIM_QUIET_TARGET_NOTICE:process.env.SOOTSIM_QUIET_TARGET_NOTICE=n}}async function ht(e,o,t){let n=Date.now()+t.maxMs,r="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",s=v(e,{commandTimeoutMs:2e3,simId:o,simIdSource:"flag"});try{let i=-1,a=0;for(;Date.now()<n;){let l=-1;try{let c=await s.send({type:"evaluate",code:r});typeof c=="number"&&(l=c)}catch{}if(l>=0&&l===i){if(Date.now()-a>=t.stableMs)return}else i=l,a=Date.now();await S(50)}}finally{s.close()}}async function Gt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs}),n=P(t);try{let r=await n.listSims();ct(r,t.simId)}finally{n.close()}}async function Jt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--new","--headless","--ephemeral"],stripValueFlags:["--base-url","--replace","--driver","--profile","--cdp-port"]}),n=e.find((u,p)=>e[p-1]==="--profile"),r=e.includes("--ephemeral"),s=e.find((u,p)=>e[p-1]==="--cdp-port"),i=s?Number(s):void 0;s&&(!Number.isFinite(i)||i<=0)&&(console.error(` sootsim open: --cdp-port must be a positive port number, got "${s}"`),process.exit(1)),n&&r&&(console.error(" sootsim open: --profile cannot be combined with --ephemeral"),process.exit(1));let a=n?pe(n).id:void 0,l=!!a||r,c=e.includes("--new")||l,d=Ze(e);c&&t.simIdSource==="flag"&&(console.error(" sootsim open: --new, --profile, and --ephemeral cannot be combined with --sim"),process.exit(1));let m=t.positional[0]||"";if(Ve(m)){let u=(()=>{try{return/^(localhost|127\.0\.0\.1|\[::1\]|::1)$/i.test(new URL(m).hostname)}catch{return!1}})();console.log(" that\u2019s a SootSim preview/build link \u2014 a full player page, not a driveable sim."),console.log(" opening it in your browser for viewing\u2026");try{await q(m,{background:!1})}catch(p){console.error(` could not launch a browser: ${p instanceof Error?p.message:String(p)}`),console.error(` open it yourself: ${m}`),process.exit(1)}console.log(u?" to drive it under the CLI, point `sootsim open` at the app\u2019s dev port instead (e.g. `sootsim open 8081`).":" the CLI can\u2019t drive a remote preview (the engine only attaches to the local bridge from localhost). to drive the app, run it locally and `sootsim open <port>`.");return}let h=e.find((u,p)=>e[p-1]==="--driver")||"",j=e.includes("--headless");i&&h!=="playwright"&&(console.error(" sootsim open: --cdp-port is only honored by the playwright driver \u2014 add `--driver playwright`"),process.exit(1));let k=e.find((u,p)=>e[p-1]==="--base-url")||_e(),te=e.includes("--base-url"),oe=C();if(!h&&!c&&(t.simIdSource==="flag"||t.simIdSource==="saved"&&!!oe)){let u=P(t),p=t.simId?` --sim ${t.simId}`:"",f=!1;try{let g=null;try{let y=await u.listSims();if(t.simIdSource==="saved"?(g=y.find($=>$.id===oe&&$.readyState==="open")??null,g||T()):g=H(y,t.simId),!g)if(t.simIdSource==="saved")f=!0;else throw new Error("no sim connected");if(!f&&g){let $=te||Y(m)?k:Ce(g,k),O=await N(m,B($,d));u.send({type:"evaluate",simId:g.id,code:`window.location.href = ${JSON.stringify(O)}`}).catch(()=>{})}}catch(y){console.error(` open failed: ${y instanceof Error?y.message:String(y)}`),await D(u,{errorsCommand:`sootsim get errors 5${p}`,warningsCommand:`sootsim get warnings 5${p}`,requestsCommand:`sootsim get requests 5${p}`}),process.exit(1)}if(!f&&g){await S(1500);let y=await it(t.wsPort,t.commandTimeoutMs,g.id);y||(console.error(" timed out waiting for current sim to load target"),process.exit(1)),y.bridge.close(),w(g.id);let $=te||Y(m)?k:Ce(g,k),O=await N(m,B($,d));R(O,{...g,url:O},"current sim"),await _(t.wsPort,g.id,e);return}}finally{u.close()}}let ne=B(k,d),Ee=await N(m,ne),re=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,b=await st(m,ne,re),K={newWindow:!0},U=u=>u.url?.includes(`inspectOpen=${re}`)??!1;if(h){qe(h)||(console.error(` unknown driver "${h}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let u=Q(h);u||(console.error(` unknown driver "${h}" \u2014 run \`sootsim list --drivers\``),process.exit(1));let p=ze(),f=await u.launch({url:b,headless:j,newWindow:K.newWindow,profileId:a,ephemeralProfile:r,cdpPort:i,connectTimeoutMs:p.hostTimeoutMs});f.launched||(console.error(` ${u.name} driver: ${f.message}`),process.exit(1));let g=await A(t.wsPort,t.commandTimeoutMs,U,{attempts:p.attempts,intervalMs:p.intervalMs});if(!g){if(f.pid)try{process.kill(f.pid,"SIGTERM"),console.error(` closed ${u.name} host process ${f.pid}`)}catch{}ft(f),console.error(` timed out after ${p.timeoutMs}ms waiting for opened sim to connect`),process.exit(1)}w(g.id),pt(f),R(b,g,`${u.name} driver`),await _(t.wsPort,g.id,e);return}if(l){let u=M();u||(console.error(" profiles require electron or playwright; install the desktop companion or use `--driver playwright`"),process.exit(1));try{(await J(b,u,{profileId:a,ephemeralProfile:r})).launched||(console.error(" desktop companion failed to start"),process.exit(1))}catch(f){console.error(` desktop companion failed: ${f instanceof Error?f.message:String(f)}`),process.exit(1)}let p=await A(t.wsPort,t.commandTimeoutMs,U,{attempts:40,intervalMs:500});p||(console.error(" timed out waiting for profiled sim to connect"),process.exit(1)),w(p.id),R(b,p,"desktop companion"),await _(t.wsPort,p.id,e);return}let W=!1,z=!1;try{let u=v(t.wsPort,{commandTimeoutMs:2e3});try{await u.listSims(),W=!0}finally{u.close()}}catch{}if(W)try{let u=v(t.wsPort,{commandTimeoutMs:3e3});try{await u.openUrl(b,K),z=!0}finally{u.close()}}catch{}if(!z){let u=M();if(u)try{if((await J(b,u)).launched){let f=await A(t.wsPort,t.commandTimeoutMs,U,{attempts:20,intervalMs:500});if(f){w(f.id),R(b,f,"desktop companion"),await _(t.wsPort,f.id,e);return}}}catch{}try{await q(b,K)}catch(p){console.error(` open failed: ${p instanceof Error?p.message:String(p)}`),Q("playwright")?.availability().available?console.error(" no system browser found \u2014 retry with `sootsim open \u2026 --driver playwright` for a headless sim."):console.error(" run `sootsim list --drivers` to see available drivers."),process.exit(1)}if(!W){console.log(` opened: ${Ee}`),Pe(t.wsPort);return}}let E=await A(t.wsPort,t.commandTimeoutMs,U,{attempts:30,intervalMs:500});E||(console.error(" timed out waiting for opened sim to connect"),process.exit(1)),w(E.id),R(b,E,z?"bridge":"direct shell open"),await _(t.wsPort,E.id,e)}async function Ue(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=P(t),s=t.simId?` --sim ${t.simId}`:"";try{try{let i=await r.listSims(),a=H(i,t.positional[0]||t.simId);if(a.lockedBy&&a.lockExpiresAt&&a.lockExpiresAt>Date.now()){let l=Math.max(0,Math.round((a.lockExpiresAt-Date.now())/1e3));a.lockedByKind==="user-active"&&(console.error(` refused: ${a.id} is locked by the active user (${l}s) \u2014 that's a live human tab`),console.error(" run `sootsim open --new` for a fresh investigation sim"),process.exit(1)),n||(console.error(` refused: ${a.id} is leased by ${a.lockedBy} (${l}s)`),console.error(` \`sootsim use ${a.id} --force\` to take it, or \`sootsim open --new\` for a fresh sim`),process.exit(1))}await r.focusSim(a.id),w(a.id),console.log(` using: ${a.id}`)}catch(i){console.error(` use failed: ${i instanceof Error?i.message:String(i)}`),await D(r,{errorsCommand:`sootsim get errors 5${s}`,warningsCommand:`sootsim get warnings 5${s}`,requestsCommand:`sootsim get requests 5${s}`}),process.exit(1)}}finally{r.close()}}async function Qt(e,o={}){await Ue(e,o)}async function Xt(e,o={}){await Ue(e,o)}async function Yt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--force"]}),n=e.includes("--force"),r=P(t);try{try{let s=await r.listSims(),i=H(s,t.positional[0]||t.simId),a=n&&i.lockedBy&&i.lockedByKind!=="user-active"?i.lockedBy:null,l=await r.claim(i.id,{force:n});w(i.id);let c=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),d=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${c}s]${d}`),a&&console.log(` took over from: ${a}`)}catch(s){if(s instanceof le){let i=Math.max(0,Math.round(s.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${s.lock.by} for ${i}s more`),console.error(" use --force to take it, or `sootsim open --new` for a fresh sim"),process.exit(1)}console.error(` claim failed: ${s instanceof Error?s.message:String(s)}`),process.exit(1)}}finally{r.close()}}async function wt(e,o,t,n){if(n.length===0)return{closed:[],remaining:[]};await Promise.all(n.map(s=>e.closeSim(s).catch(()=>{})));let r=new Set(n);for(let s=0;s<40;s++){let i=[];try{let a=v(o,{commandTimeoutMs:t});try{i=(await a.listSims()).filter(c=>r.has(c.id)&&c.readyState==="open").map(c=>c.id)}finally{a.close()}}catch{i=[]}if(i.length===0)return{closed:[...r],remaining:[]};if(s===39)return{closed:[...r].filter(a=>!i.includes(a)),remaining:i};await S(250)}return{closed:[...r],remaining:[]}}function bt(e,o){let t=e.filter(m=>m.readyState==="open"),n=t.map(m=>m.id),r=o.explicitKeepId?.trim()||"",s=o.savedKeepId?.trim()||"",i=s?t.some(m=>m.id===s):!1,a=s&&!i?s:null,l=null,c=null,d=null;if(o.closeOthers)if(r){let m=t.find(h=>h.id===r);m?l=m.id:c=r}else if(s&&i)l=s;else{let m=t.find(h=>h.isPrimary)??t[0]??null;m&&(l=m.id,s&&!i&&(d=m.id))}return{openIds:n,keepId:l,targets:c?[]:n.filter(m=>m!==l),staleSavedId:a,missingExplicitKeepId:c,fallbackKeepId:d}}async function Zt(e,o={}){let t=I(e,{port:o.port,commandTimeoutMs:o.timeoutMs,stripBooleanFlags:["--all","--others"]}),n=P(t),r=t.simId?` --sim ${t.simId}`:"",s=e.includes("--all"),i=e.includes("--others");if(s||i){try{let a=await n.listSims(),l=C(),c=t.positional[0]||(t.simIdSource==="flag"?t.simId:void 0),d=bt(a,{closeOthers:i,explicitKeepId:c,savedKeepId:l});if(d.staleSavedId&&T(),d.fallbackKeepId&&(w(d.fallbackKeepId),console.log(` saved sim ${d.staleSavedId} is gone \u2014 keeping primary ${d.fallbackKeepId}`)),d.missingExplicitKeepId&&(console.error(` close failed: keep sim ${d.missingExplicitKeepId} is not connected; not closing other sims`),process.exit(1)),d.targets.length===0){console.log(d.keepId?` nothing to close \u2014 only the kept sim ${d.keepId} is connected`:d.staleSavedId?` nothing to close \u2014 no sims connected (cleared stale current sim ${d.staleSavedId})`:" nothing to close \u2014 no sims connected");return}let m=await wt(n,t.wsPort,t.commandTimeoutMs,d.targets);await X(a,d.targets);let h=C();h&&m.closed.includes(h)&&(d.keepId?w(d.keepId):T());let j=` closed ${m.closed.length} sim(s)${d.keepId?` (kept ${d.keepId})`:""}`;console.log(j),m.remaining.length>0&&(console.error(` close failed: still connected: ${m.remaining.join(", ")}`),process.exit(1))}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}finally{n.close()}return}try{try{let a=await n.listSims(),l=H(a,t.positional[0]||t.simId),c=a.find(m=>m.id!==l.id&&m.readyState==="open");await n.closeSim(l.id),await mt(t.wsPort,t.commandTimeoutMs,l.id)||(await X(a,[l.id]),console.error(` close failed: ${l.id} is still connected`),process.exit(1)),await X(a,[l.id]),C()===l.id&&(c?w(c.id):T()),console.log(` closed: ${l.id}`)}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),await D(n,{errorsCommand:`sootsim get errors 5${r}`,warningsCommand:`sootsim get warnings 5${r}`,requestsCommand:`sootsim get requests 5${r}`}),process.exit(1)}}finally{n.close()}}export{xt as a,Fe as b,kt as c,ze as d,Vt as e,_e as f,N as g,st as h,at as i,ct as j,A as k,ut as l,pt as m,X as n,Gt as o,Jt as p,Qt as q,Xt as r,Yt as s,wt as t,bt as u,Zt as v};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function M(t,e){let r=["--max-ms","--maxMs","--maxms","--max_ms"];for(let n of r){let s=t.indexOf(n);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var w=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function S(t){return typeof t=="string"&&w.has(t)}async function v(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function H(t,e){if(!S(e))return!1;try{return await v(t)}catch{return!1}}async function C(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function B(t,e=5){let r=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}))()`});return{depth:e,tree:r}}async function W(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function F(t,e){let r=`(async () => {
|
|
3
3
|
const t = window.__sootsimTest
|
|
4
4
|
const mainShell = window.SootSim?.bridges?.mainShell
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as y}from"./chunk-ZJUIBQPS.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,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function t(_){return`(async () => {
|
|
3
3
|
const __t = window.__sootsimTest
|
|
4
4
|
if (!__t) throw new Error('__sootsimTest not available')
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-2V4FB2RT.js";import{n as o}from"./chunk-GH25H5QD.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as y,join as h,resolve as k}from"node:path";function i(){return h(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(y(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
|
|
3
3
|
`);try{p(t,384)}catch{}}function E(){f(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function O(n){return!!(n&&n.length>=20&&m.some(t=>n.startsWith(t)))}function A(){let n=process.env.SOOT_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),r=n||t;if(!O(r))return null;let e=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!e)return null;let[l,u]=e.includes("/")?e.split("/",2):[null,null],c=(process.env.SOOT_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),a=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:e,repositoryId:c||null,owner:l||null,repo:u||null,installationId:a||null,source:n?"soot-runner":"github-actions"}}function x(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=A();if(t)return t;let r=S();if(r)return{kind:"api-key",secret:r,source:"file"};let e=s();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function H(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function N(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{S as a,w as b,E as c,x as d,H as e,N as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as C,b as k}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as C,b as k}from"./chunk-FTCNYGT4.js";var x="sootsimConfig";function m(e){return!!e&&Object.keys(e).length>0}function D(e){return e?m(e.modules)||m(e.turboModules)||m(e.nativeModules)||m(e.env)||m(e.network?.remap)||m(e.settings)||m(e.initialState):!1}function M(e,o){let t=new URL(e);return D(o)?t.searchParams.set(x,JSON.stringify(o)):t.searchParams.delete(x),t.toString()}import{exec as N}from"child_process";import L from"http";import O from"net";import{promisify as $}from"util";var te="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function T(e){return/^https?:\/\//i.test(e)}function E(e){return e.endsWith(".bundle")}function A(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function U(e){try{let o=T(e),t=new URL(e,"http://soot.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),E(t.pathname)?(t.searchParams.delete("transform.bytecode"),A(t),o?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}var v=$(N);C();var I=250,B=1500,H=120;function j(e,o=H){return new Promise(t=>{let r=new O.Socket,s=!1,i=a=>{s||(s=!0,r.destroy(),t(a))};r.setTimeout(o),r.once("connect",()=>i(!0)),r.once("timeout",()=>i(!1)),r.once("error",()=>i(!1)),r.connect(e,"localhost")})}function h(e,o,t="GET",r=I,s={}){return new Promise(i=>{let a=L.request({hostname:"localhost",port:e,path:o,method:t,timeout:r,headers:s},n=>{let u="";n.on("data",l=>u+=l.toString());let c=(()=>{let l=n.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();n.on("end",()=>i({statusCode:n.statusCode||0,body:u,contentType:c}))});a.on("error",()=>i(null)),a.setTimeout(r,()=>{a.destroy(),i(null)}),a.end()})}var W=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function P(e,o){return!(e<=0||e>=2e4||o.has(e)||e>=5170&&e<=5200)}async function F(e=[]){let o=new Set(e);try{let{stdout:t}=await v("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let r=new Map;for(let s of t.trim().split(`
|
|
3
3
|
`)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),u=i[8].match(/:(\d+)$/);if(!u)continue;let c=Number(u[1]);P(c,o)&&(r.has(c)||r.set(c,a))}if(r.size>0)return[...r.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:t}=await v(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(t.trim()){let r=new Map;for(let s of t.trim().split(`
|
|
4
4
|
`)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let n=Number(i[1]),u=a?Number(a[1]):0;P(n,o)&&(r.has(n)||r.set(n,u))}if(r.size>0)return[...r.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return W.filter(t=>P(t.port,o))}var y=new Map;async function G(e){if(e<=0)return null;let o=y.get(e);if(o)return o;try{let{stdout:t}=await v(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let r of t.split(`
|
|
5
5
|
`))if(r.startsWith("n")&&r.length>1){let s=r.slice(1).trim();if(s)return y.set(e,s),s}}catch{}return null}function z(e,o){return{port:e,framework:o,bundleUrl:g(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function g(e,o){let t=k().find(s=>s.preferredPort===e),r=t?.runtimeConfig?M(o,t.runtimeConfig):o;return U(r)}function J(e){return e.includes("/node_modules/one/metro-entry.bundle")}function K(e){try{let o=JSON.parse(e);return o&&typeof o=="object"?o:null}catch{return null}}function w(e,o,t){if(!o)return e;try{let r=JSON.parse(o.body),s=r?.extra?.expoClient||r?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=r?.launchAsset?.url;i&&!e.patched&&!J(e.bundleUrl)&&(e.bundleUrl=g(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,t)if(a.startsWith("http"))e.iconUrl=t(a);else{let n=a.replace(/^\.\//,"");e.iconUrl=t(`http://localhost:${e.port}/assets/${n}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var d=new Set,p=new Set,S=new Set;async function V(e,o){if(!await j(e))return null;let t="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[r,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),S.has(e)?Promise.resolve(null):h(e,"/","GET",B,{"expo-platform":"ios"}),p.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?p.delete(e):p.has(e)||p.add(e);let n=i?K(i.body):null,u=typeof n?.launchAsset?.url=="string"?n.launchAsset.url:null,c=n?.extra?.expoClient||n?.extra||{};if(n&&(u||typeof c.name=="string")){d.add(e);let R=u||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,_=R.includes("/one/metro-entry.bundle")?"one":"expo";return w({port:e,framework:_,bundleUrl:g(e,R),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,o)}if(s&&s.body.includes("packager-status:running"))return d.add(e),w(z(e,a&&a.statusCode===200?"expo":"metro"),i,o);if(r&&r.statusCode===200&&r.body.includes("sootsim-patched"))return d.delete(e),w({port:e,framework:"one",bundleUrl:g(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,o);if(s&&s.statusCode===200||a&&a.statusCode===200||i&&i.statusCode===200&&n!=null)return null;let f=await h(e,t,"HEAD");return f&&f.statusCode>0&&f.statusCode<400&&/application\/javascript/i.test(f.contentType||"")?(d.add(e),S.add(e),w({port:e,framework:"one",bundleUrl:g(e,`http://localhost:${e}${t}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,o)):(d.add(e),null)}function q(e){let o=e.projectName?.trim().toLowerCase();return!!(o==="soot"||o==="sootsim"||e.bundleId?.trim().toLowerCase()?.startsWith("dev.soot"))}var b=new Map,Q=3e4,Y=1500;function X(e){return!e||e.framework==="metro"||e.framework==="unknown"}function Z(e){return e?g(e.port,e.bundleUrl)===e.bundleUrl:!0}function ee(e,o,t=Date.now()){if(o===0||e.pid!==o||!Z(e.result))return!1;let r=t-e.cachedAt;return!(e.result===null&&r>=Q||X(e.result)&&r>=Y)}async function de(e={}){let o=await F(e.excludePorts),t=new Set(o.map(n=>n.port));for(let n of[...b.keys()])t.has(n)||b.delete(n);for(let n of[...d])t.has(n)||d.delete(n);for(let n of[...p])t.has(n)||p.delete(n);for(let n of[...S])t.has(n)||S.delete(n);let r=[],s=[];for(let{port:n,pid:u}of o){let c=b.get(n);if(c&&ee(c,u)){c.result&&r.push(c.result);continue}c&&c.pid!==u&&(d.delete(n),p.delete(n),S.delete(n)),s.push({port:n,pid:u})}s.length>0&&(await Promise.all(s.map(u=>V(u.port,e.buildIconProxyUrl)))).forEach((u,c)=>{let{port:l,pid:f}=s[c];f!==0&&b.set(l,{pid:f,result:u,cachedAt:Date.now()}),u&&r.push(u)});let i=new Map;for(let{port:n,pid:u}of o)u>0&&i.set(n,u);await Promise.all(r.map(async n=>{let u=i.get(n.port);if(!u)return;n.pid=u;let c=await G(u);c&&(n.cwd=c)}));let a=new Set(i.values());for(let n of[...y.keys()])a.has(n)||y.delete(n);return r.filter(n=>!q(n))}export{M as a,te as b,U as c,V as d,de as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import{readFileSync as i}from"node:fs";import{fileURLToPath as e}from"node:url";var r=null;function l(){if(r!=null)return r;let o=[()=>e(import.meta.resolve("sootsim/package.json")),()=>e(new URL("../package.json",import.meta.url))];for(let n of o)try{let t=JSON.parse(i(n(),"utf8")).version;if(typeof t=="string"&&t)return r=t,r}catch{}return r="0.0.0",r}export{l as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var o={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},f={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},c={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},p={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},r=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var h={"iphone-se":t({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:f}),"iphone-14":t({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:55,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15":t({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-plus":t({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-16":t({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-plus":t({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17":t({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-air":t({name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"ipad-pro-13":t({name:'iPad Pro 13"',width:1032,height:1376,scale:2,statusBarHeight:24,homeIndicatorHeight:20,cornerRadius:18,dynamicIsland:null,safeAreaInsets:{top:24,bottom:20,left:0,right:0},iosVersion:"18.2",physicalPPI:264,hardwareButtons:o}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:c},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:p},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:p}},u="iphone-17-pro";function w(e){return h[e]}function g(){return Object.keys(h)}var i={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},s={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},v={color:"#25c3ec",blur:120,spread:52,opacity:.34},x="iphone-17-pro";var b=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],m=Object.fromEntries(b.map(e=>[e.name,e.value]));function B(e){return m[e]??m.gray}function I(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function y(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(n=>({...n}))}}function T(e){return Object.prototype.hasOwnProperty.call(s,e)?y(s[e]):null}var d={deviceModel:{type:"enum",default:u,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:g(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(i),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(s),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function S(){if(typeof window>"u")return{};let e={};try{let n=new URLSearchParams(window.location.search),a=n.get("device");a&&d.deviceModel.options?.includes(a)&&(e.deviceModel=a);let l=n.get("colorScheme")??n.get("theme");l&&d.colorScheme.options?.includes(l)&&(e.colorScheme=l)}catch{}return e}function N(){let e={};for(let[n,a]of Object.entries(d))e[n]=a.default;return Object.assign(e,S()),e}export{v as a,x as b,B as c,I as d,y as e,T as f,h as g,w as h,g as i,d as j,S as k,N as l};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{h as w,j as u,k as m,l}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.157 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{h as w,j as u,k as m,l}from"./chunk-C5BXRLHS.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
|