sootsim 0.1.110 → 0.1.112

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.
Files changed (142) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-ZWZKCPE7.js → agent-7LGWSKBP.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-FBQI5Q4O.js → agent-wrapper-GRVMTBFJ.js} +2 -2
  4. package/dist-cli/chunks/{assert-APLBBACE.js → assert-GSP3A337.js} +2 -2
  5. package/dist-cli/chunks/auto-bootstrap-736PQWPN.js +2 -0
  6. package/dist-cli/chunks/beta-BKLH7QSW.js +2 -0
  7. package/dist-cli/chunks/chunk-2ZZUG4LB.js +2 -0
  8. package/dist-cli/chunks/{chunk-LMRG7GED.js → chunk-3EE7UVER.js} +2 -2
  9. package/dist-cli/chunks/chunk-3ISNSUXK.js +1 -0
  10. package/dist-cli/chunks/{chunk-GAJUCRSY.js → chunk-5DW7CLVT.js} +2 -2
  11. package/dist-cli/chunks/{chunk-3ISSSGSB.js → chunk-6TPWDY6K.js} +2 -2
  12. package/dist-cli/chunks/{chunk-EC7554SU.js → chunk-6WK4XJLI.js} +2 -2
  13. package/dist-cli/chunks/{chunk-OZT2EDWT.js → chunk-7CCONVJK.js} +1 -1
  14. package/dist-cli/chunks/{chunk-AOTUH57K.js → chunk-AL4B57VD.js} +1 -1
  15. package/dist-cli/chunks/{chunk-OQOSDEJI.js → chunk-ALVFKTMD.js} +2 -2
  16. package/dist-cli/chunks/{chunk-MR4IWP5G.js → chunk-BYFAYZRV.js} +1 -1
  17. package/dist-cli/chunks/{chunk-3MMWA4L4.js → chunk-DKZKYTOM.js} +1 -1
  18. package/dist-cli/chunks/{chunk-MHTMPEID.js → chunk-DY7HYEEP.js} +1 -1
  19. package/dist-cli/chunks/{chunk-TGHB7R5L.js → chunk-DYBNT4T7.js} +1 -1
  20. package/dist-cli/chunks/{chunk-BLL5V7Q5.js → chunk-E3JNCJMG.js} +2 -2
  21. package/dist-cli/chunks/{chunk-K5HTRM2P.js → chunk-ERD5IQRP.js} +3 -3
  22. package/dist-cli/chunks/{chunk-BUCEYXAX.js → chunk-FKL3NMR5.js} +1 -1
  23. package/dist-cli/chunks/{chunk-PLCWJ5MR.js → chunk-FTRDTDJF.js} +2 -2
  24. package/dist-cli/chunks/{chunk-2VZB7DFH.js → chunk-GGBWCCP2.js} +3 -3
  25. package/dist-cli/chunks/{chunk-PMIXDCXB.js → chunk-GMXUIARA.js} +2 -2
  26. package/dist-cli/chunks/{chunk-KNJACPXD.js → chunk-GN7LBY6G.js} +3 -3
  27. package/dist-cli/chunks/chunk-ILDC36C5.js +1 -0
  28. package/dist-cli/chunks/{chunk-XRRR4MNB.js → chunk-K6U4PNYP.js} +1 -1
  29. package/dist-cli/chunks/{chunk-TRDV6XFV.js → chunk-KSQTJY3Z.js} +1 -1
  30. package/dist-cli/chunks/chunk-LSPX3IR3.js +1 -0
  31. package/dist-cli/chunks/{chunk-AVDLFCPN.js → chunk-MACTWR2J.js} +1 -1
  32. package/dist-cli/chunks/{chunk-D4XJE3IA.js → chunk-MSZWCIEH.js} +1 -1
  33. package/dist-cli/chunks/{chunk-DM3G2DDB.js → chunk-O7T3S7GK.js} +3 -3
  34. package/dist-cli/chunks/{chunk-2HD3QP2F.js → chunk-OXFTMHJQ.js} +2 -2
  35. package/dist-cli/chunks/{chunk-TN54LWCW.js → chunk-P37J53P3.js} +2 -2
  36. package/dist-cli/chunks/{chunk-W2B5DISJ.js → chunk-P74E724D.js} +2 -2
  37. package/dist-cli/chunks/{chunk-EVKLDCVG.js → chunk-QJL6QTAW.js} +1 -1
  38. package/dist-cli/chunks/{chunk-XF2JZ6U4.js → chunk-QTVNFT2F.js} +2 -2
  39. package/dist-cli/chunks/{chunk-KJWQZC2Q.js → chunk-QXBSCY2G.js} +2 -2
  40. package/dist-cli/chunks/{chunk-S2OLUKUG.js → chunk-RCDZBNJW.js} +2 -2
  41. package/dist-cli/chunks/{chunk-4HWRCHNE.js → chunk-RY25ZLAP.js} +1 -1
  42. package/dist-cli/chunks/{chunk-AFRTUFB3.js → chunk-SJPXB24I.js} +2 -2
  43. package/dist-cli/chunks/{chunk-XWWFJZVF.js → chunk-TOETDEFL.js} +1 -1
  44. package/dist-cli/chunks/{chunk-AMTHP2GY.js → chunk-UFHLNGFE.js} +2 -2
  45. package/dist-cli/chunks/{chunk-3OBTR7LC.js → chunk-UQ4WCJOG.js} +2 -2
  46. package/dist-cli/chunks/{chunk-Z3ITLQBV.js → chunk-WIO2R4W7.js} +2 -2
  47. package/dist-cli/chunks/{chunk-GJSM5EF5.js → chunk-XR6VRNF4.js} +2 -2
  48. package/dist-cli/chunks/{chunk-4HENO4MS.js → chunk-YEG6THC2.js} +1 -1
  49. package/dist-cli/chunks/{chunk-5576H3EW.js → chunk-ZGFOEFIT.js} +2 -2
  50. package/dist-cli/chunks/{chunk-WGOMBGUJ.js → chunk-ZTBVBNY2.js} +1 -1
  51. package/dist-cli/chunks/cli-version-7YTDRSHR.js +2 -0
  52. package/dist-cli/chunks/{compat-EWDJGLUH.js → compat-TDDZ65HJ.js} +3 -3
  53. package/dist-cli/chunks/{config-ZPV4443J.js → config-ZYXUW3HJ.js} +2 -2
  54. package/dist-cli/chunks/control-N5OQDWFT.js +2 -0
  55. package/dist-cli/chunks/{cpu-profile-M4HHPMPL.js → cpu-profile-Q3TJ6RXT.js} +2 -2
  56. package/dist-cli/chunks/{daemon-VISHRLZY.js → daemon-RITDRE4H.js} +2 -2
  57. package/dist-cli/chunks/{debug-XZMT7BKM.js → debug-XKFB4225.js} +3 -3
  58. package/dist-cli/chunks/{detox-6OIZZECY.js → detox-XIZ3DBRQ.js} +2 -2
  59. package/dist-cli/chunks/{device-T5E5IR4C.js → device-GZBJJJEB.js} +2 -2
  60. package/dist-cli/chunks/{diagnose-HQQOKYJP.js → diagnose-H2KIQ752.js} +2 -2
  61. package/dist-cli/chunks/drivers-KJ55BQZI.js +2 -0
  62. package/dist-cli/chunks/{electron-IVEEU7FV.js → electron-VFZYBO4G.js} +3 -3
  63. package/dist-cli/chunks/flow-TBVVFAO5.js +2 -0
  64. package/dist-cli/chunks/help-XPU3EWZ7.js +2 -0
  65. package/dist-cli/chunks/{hints-AK2GAWBE.js → hints-NYSBGRRV.js} +2 -2
  66. package/dist-cli/chunks/{home-paths-X2P7KKE4.js → home-paths-ISIMYDEJ.js} +2 -2
  67. package/dist-cli/chunks/{inspect-NYUUALML.js → inspect-FVGSOR3L.js} +3 -3
  68. package/dist-cli/chunks/install-HW4GGTYA.js +2 -0
  69. package/dist-cli/chunks/{install-desktop-BNAGWPS4.js → install-desktop-GACFW2HY.js} +3 -3
  70. package/dist-cli/chunks/{keys-7PYHN4F6.js → keys-LZLQVCHR.js} +2 -2
  71. package/dist-cli/chunks/{launch-BTLK4JXA.js → launch-JYZNGXU6.js} +3 -3
  72. package/dist-cli/chunks/{login-WUBZF6EH.js → login-WY3VAO3Y.js} +4 -4
  73. package/dist-cli/chunks/{logout-EPOYLHBF.js → logout-F74SOJ54.js} +2 -2
  74. package/dist-cli/chunks/{maestro-PMQUD7MS.js → maestro-ENB7YUJM.js} +2 -2
  75. package/dist-cli/chunks/{preview-HUHEUGHM.js → preview-KF5L3JID.js} +2 -2
  76. package/dist-cli/chunks/{profile-M6Q2ESCE.js → profile-IWEB6CZL.js} +2 -2
  77. package/dist-cli/chunks/{react-X55V6SKP.js → react-D2YTYZIP.js} +3 -3
  78. package/dist-cli/chunks/{record-X76COROF.js → record-BOUB4J4P.js} +2 -2
  79. package/dist-cli/chunks/runtime-4HPGMK52.js +2 -0
  80. package/dist-cli/chunks/{runtime-delivery-HQ536IE5.js → runtime-delivery-GZ5VNBLN.js} +2 -2
  81. package/dist-cli/chunks/{screenshot-EAN3XEIH.js → screenshot-TXB77HDC.js} +2 -2
  82. package/dist-cli/chunks/{screenshot-mode-5354H5HO.js → screenshot-mode-D7K5IYF3.js} +2 -2
  83. package/dist-cli/chunks/{screenshots-2HWBPD5O.js → screenshots-RUJ5NM3X.js} +2 -2
  84. package/dist-cli/chunks/{server-MRGMHZ56.js → server-KWY5Q5KH.js} +2 -2
  85. package/dist-cli/chunks/setup-repo-6ZFTYKUS.js +2 -0
  86. package/dist-cli/chunks/{skills-ZUKTSYS5.js → skills-S4H3WCQE.js} +2 -2
  87. package/dist-cli/chunks/{start-K55IT2OK.js → start-MTI2FM7W.js} +4 -4
  88. package/dist-cli/chunks/store-6Q4Y5VIK.js +2 -0
  89. package/dist-cli/chunks/telemetry-DJTKUHAH.js +2 -0
  90. package/dist-cli/chunks/{test-EGNDQY6T.js → test-MNVKQFII.js} +3 -3
  91. package/dist-cli/chunks/{three-mode-Z4LKWWJR.js → three-mode-V75AD5VC.js} +2 -2
  92. package/dist-cli/chunks/{timeline-5YCEZJWX.js → timeline-PFHSMH67.js} +2 -2
  93. package/dist-cli/chunks/{upgrade-AG75A2OX.js → upgrade-INEYUJTS.js} +2 -2
  94. package/dist-cli/chunks/upload-4GNZRMI4.js +2 -0
  95. package/dist-cli/chunks/{web-WGVVHTJL.js → web-L7FHHETW.js} +2 -2
  96. package/dist-cli/chunks/{what-happened-A3GIPB5O.js → what-happened-NY72VJPW.js} +2 -2
  97. package/dist-cli/chunks/{whoami-E3LJSWPW.js → whoami-XTTFI7QK.js} +2 -2
  98. package/dist-lib/agent-daemon-client.cjs +1 -1
  99. package/dist-lib/agent-events.cjs +1 -1
  100. package/dist-lib/agent-sessions.cjs +1 -1
  101. package/dist-lib/attached-projects.cjs +1 -1
  102. package/dist-lib/auth/shared-session.cjs +1 -1
  103. package/dist-lib/backend-origin.cjs +1 -1
  104. package/dist-lib/beta.cjs +1 -1
  105. package/dist-lib/beta.mjs +1 -1
  106. package/dist-lib/bridge-constants.cjs +1 -1
  107. package/dist-lib/cli-constants.cjs +1 -1
  108. package/dist-lib/config.cjs +1 -1
  109. package/dist-lib/detox/index.cjs +1 -1
  110. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  111. package/dist-lib/home-paths.cjs +1 -1
  112. package/dist-lib/host/bridge-host.cjs +1 -1
  113. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  114. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  115. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  116. package/dist-lib/host/websocket-proxy.cjs +1 -1
  117. package/dist-lib/index.cjs +1 -1
  118. package/dist-lib/metro.cjs +1 -1
  119. package/dist-lib/profiles.cjs +1 -1
  120. package/dist-lib/render-mode.cjs +1 -1
  121. package/dist-lib/scripts/demo-app-registry.cjs +1 -1
  122. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  123. package/dist-lib/skills.cjs +1 -1
  124. package/dist-lib/vite.cjs +1 -1
  125. package/package.json +2 -2
  126. package/dist-cli/chunks/auto-bootstrap-SO5IYWUX.js +0 -2
  127. package/dist-cli/chunks/beta-JN7FIH4I.js +0 -2
  128. package/dist-cli/chunks/chunk-56A3BWHW.js +0 -1
  129. package/dist-cli/chunks/chunk-EBMHC2MG.js +0 -1
  130. package/dist-cli/chunks/chunk-ONQMX227.js +0 -2
  131. package/dist-cli/chunks/chunk-TWYKPTP7.js +0 -1
  132. package/dist-cli/chunks/cli-version-334MA4Y3.js +0 -2
  133. package/dist-cli/chunks/control-EN5M5456.js +0 -2
  134. package/dist-cli/chunks/drivers-XS3SAAB3.js +0 -2
  135. package/dist-cli/chunks/flow-ILBKBWXI.js +0 -2
  136. package/dist-cli/chunks/help-PI46OPNX.js +0 -2
  137. package/dist-cli/chunks/install-NV25L5ZD.js +0 -2
  138. package/dist-cli/chunks/runtime-ZOP3UMPW.js +0 -2
  139. package/dist-cli/chunks/setup-repo-LBZPMYRX.js +0 -2
  140. package/dist-cli/chunks/store-B7YPTEES.js +0 -2
  141. package/dist-cli/chunks/telemetry-DEA3M2MM.js +0 -2
  142. package/dist-cli/chunks/upload-KP3LWUBL.js +0 -2
package/dist-cli/bin.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
- import{a as u,b as d,c as g}from"./chunks/chunk-TRDV6XFV.js";import"./chunks/chunk-D4XJE3IA.js";function f(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("sootsim bridge daemon is not running")||t.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
2
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
+ import{a as u,b as d,c as g}from"./chunks/chunk-KSQTJY3Z.js";import"./chunks/chunk-MSZWCIEH.js";function f(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("sootsim bridge daemon is not running")||t.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
4
4
  `),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
5
5
  `):process.stderr.write(`${t}
6
6
  `),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
7
7
  it needs vite / electron / playwright from a project's node_modules.
8
8
  install the npm package and run via bun or node instead:
9
9
  npm i -g sootsim && sootsim ${a}
10
- `),process.exit(1))}var e=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-DEA3M2MM.js");a({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-DEA3M2MM.js");await t(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-334MA4Y3.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-JN7FIH4I.js"),m=t?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-X2P7KKE4.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-PI46OPNX.js");a(),await c(0)}var o=e.globalFlags.port,n=e.verbose,p=e.globalFlags.device,l=e.globalFlags.theme,S=e.globalFlags.driver,E=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,s=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-B7YPTEES.js"),t={};p&&(t.deviceModel=p),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-K55IT2OK.js");await a([],{port:o}),await c(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let t=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-PI46OPNX.js");a(),await c(0)}if(r in d){let a=d[r],t=e.commandArgs.length>0?` ${e.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),t&&console.error(` \u2192 ${a}${t}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",t=e.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!t){let{printGroupHelp:i}=await import("./chunks/help-PI46OPNX.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-PI46OPNX.js");i(a&&t?t:r,{prefer:a&&t?"verb":"command",group:a&&t?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-SO5IYWUX.js"),i=t(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-NYUUALML.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-APLBBACE.js");await a(e.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-ILBKBWXI.js"),t=await a(s);process.exit(typeof t=="number"?t:0)}case"test":{let{runTest:a}=await import("./chunks/test-EGNDQY6T.js");await a(e.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-6OIZZECY.js");await a(e.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-PMQUD7MS.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-HUHEUGHM.js");await a(e.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-X76COROF.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-M6Q2ESCE.js"),t=await a(e.commandArgs,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-M4HHPMPL.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"react":{let{runReact:a}=await import("./chunks/react-X55V6SKP.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-EAN3XEIH.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-2HWBPD5O.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-5354H5HO.js");await a(e.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-Z4LKWWJR.js");await a(e.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-NYUUALML.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-XZMT7BKM.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-5YCEZJWX.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-A3GIPB5O.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-HQQOKYJP.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-SO5IYWUX.js"),i=t(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-EN5M5456.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-EN5M5456.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-EN5M5456.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-EN5M5456.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-ZPV4443J.js");await a(e.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-T5E5IR4C.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-EWDJGLUH.js");await a(e.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-IVEEU7FV.js");await a(e.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-WUBZF6EH.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-EPOYLHBF.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-E3LJSWPW.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-7PYHN4F6.js");await a(e.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-LBZPMYRX.js");await a(e.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-NV25L5ZD.js");await a(e.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-BNAGWPS4.js");await a(e.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-MRGMHZ56.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-VISHRLZY.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-ZOP3UMPW.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-AG75A2OX.js");await a(e.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-BTLK4JXA.js");await a(e.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-K55IT2OK.js");await a(e.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-ZWZKCPE7.js"),t=await a(e.commandArgs);process.exit(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-FBQI5Q4O.js"),t=await a(e.commandArgs);process.exit(t)}case"skills":{let{runSkills:a}=await import("./chunks/skills-ZUKTSYS5.js");await a(e.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-KP3LWUBL.js");await a(e.commandArgs,{port:o,verbose:n});break}case"hints":{let{runHints:a}=await import("./chunks/hints-AK2GAWBE.js");a(e.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
10
+ `),process.exit(1))}var e=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-DJTKUHAH.js");a({event:"cli_command_invoked",properties:{command:e.command||(e.version?"version":e.help?"help":"none"),arg_count:e.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-DJTKUHAH.js");await t(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-7YTDRSHR.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-BKLH7QSW.js"),m=t?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-ISIMYDEJ.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-XPU3EWZ7.js");a(),await c(0)}var o=e.globalFlags.port,n=e.verbose,p=e.globalFlags.device,l=e.globalFlags.theme,S=e.globalFlags.driver,E=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,s=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-6Q4Y5VIK.js"),t={};p&&(t.deviceModel=p),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-MTI2FM7W.js");await a([],{port:o}),await c(0)}var r=e.command??"";if(!r){if(e.commandArgs.length>0){let t=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-XPU3EWZ7.js");a(),await c(0)}if(r in d){let a=d[r],t=e.commandArgs.length>0?` ${e.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),t&&console.error(` \u2192 ${a}${t}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",t=e.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!t){let{printGroupHelp:i}=await import("./chunks/help-XPU3EWZ7.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-XPU3EWZ7.js");i(a&&t?t:r,{prefer:a&&t?"verb":"command",group:a&&t?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-736PQWPN.js"),i=t(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-FVGSOR3L.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-GSP3A337.js");await a(e.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-TBVVFAO5.js"),t=await a(s);process.exit(typeof t=="number"?t:0)}case"test":{let{runTest:a}=await import("./chunks/test-MNVKQFII.js");await a(e.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-XIZ3DBRQ.js");await a(e.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-ENB7YUJM.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-KF5L3JID.js");await a(e.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-BOUB4J4P.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-IWEB6CZL.js"),t=await a(e.commandArgs,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-Q3TJ6RXT.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"react":{let{runReact:a}=await import("./chunks/react-D2YTYZIP.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-TXB77HDC.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-RUJ5NM3X.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-D7K5IYF3.js");await a(e.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-V75AD5VC.js");await a(e.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-FVGSOR3L.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-XKFB4225.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-PFHSMH67.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-NY72VJPW.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-H2KIQ752.js"),t=await a(s,{port:o,verbose:n});process.exit(typeof t=="number"?t:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:t}=await import("./chunks/auto-bootstrap-736PQWPN.js"),i=t(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-N5OQDWFT.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-N5OQDWFT.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-N5OQDWFT.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-N5OQDWFT.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-ZYXUW3HJ.js");await a(e.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-GZBJJJEB.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-TDDZ65HJ.js");await a(e.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-VFZYBO4G.js");await a(e.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-WY3VAO3Y.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-F74SOJ54.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-XTTFI7QK.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-LZLQVCHR.js");await a(e.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-6ZFTYKUS.js");await a(e.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-HW4GGTYA.js");await a(e.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-GACFW2HY.js");await a(e.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-KWY5Q5KH.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-RITDRE4H.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-4HPGMK52.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-INEYUJTS.js");await a(e.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-JYZNGXU6.js");await a(e.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-MTI2FM7W.js");await a(e.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-7LGWSKBP.js"),t=await a(e.commandArgs);process.exit(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-GRVMTBFJ.js"),t=await a(e.commandArgs);process.exit(t)}case"skills":{let{runSkills:a}=await import("./chunks/skills-S4H3WCQE.js");await a(e.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-4GNZRMI4.js");await a(e.commandArgs,{port:o,verbose:n});break}case"hints":{let{runHints:a}=await import("./chunks/hints-NYSBGRRV.js");a(e.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as $,b,c as E,d as l,e as A,g as S,h as j,j as T,m as I,n as k,o as x,p as g,q as D,r as O}from"./chunk-AFRTUFB3.js";import"./chunk-XRRR4MNB.js";import{c as y}from"./chunk-OQOSDEJI.js";import"./chunk-5576H3EW.js";import"./chunk-BUCEYXAX.js";import"./chunk-ONQMX227.js";import"./chunk-AVDLFCPN.js";import"./chunk-OZT2EDWT.js";import"./chunk-TGHB7R5L.js";import"./chunk-MR4IWP5G.js";import"./chunk-MHTMPEID.js";import"./chunk-D4XJE3IA.js";import w from"node:fs";import d from"node:path";import{spawn as U}from"node:child_process";import _ from"node:net";import{WebSocket as C}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new C(`ws://localhost:${this.port}`),this.ready=new Promise((t,n)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),n(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==C.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let n=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(n),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(n,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:n,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(n),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let n=this.pending.get(t.id);n&&(this.pending.delete(t.id),clearTimeout(n.timer),t.error?n.reject(new c(t.error,t.code)):n.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function R(r=7668,e=400){return new Promise(t=>{let n=new _.Socket,s=!1,o=i=>{s||(s=!0,n.destroy(),t(i))};n.setTimeout(e),n.once("connect",()=>o(!0)),n.once("timeout",()=>o(!1)),n.once("error",()=>o(!1)),n.connect(r,"127.0.0.1")})}async function F(r={}){let e=r.port??7668;if(await R(e))return{alreadyRunning:!0};let{cmd:t,prefixArgs:n}=O(),s=[...n,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=U(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(r.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await R(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(r={}){await F({port:r.port,startupTimeoutMs:r.startupTimeoutMs});let e=new f(r);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function me(r){let[e,...t]=r;try{switch(e){case void 0:case"--help":case"-h":case"help":return M(),0;case"attach":return await B(t);case"projects":return await W();case"project":return await J(t);case"sessions":return await V(t);case"start":return await G(t);case"prompt":return await H(t);case"watch":return await q(t);case"transcript":return await X(t);case"end":return await z(t);case"paths":return await Q();default:return process.stderr.write(`unknown agent subcommand: ${e}
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as $,b,c as E,d as l,e as A,g as S,h as j,j as T,m as I,n as k,o as x,p as g,q as D,r as O}from"./chunk-SJPXB24I.js";import"./chunk-K6U4PNYP.js";import{c as y}from"./chunk-ALVFKTMD.js";import"./chunk-ZGFOEFIT.js";import"./chunk-FKL3NMR5.js";import"./chunk-2ZZUG4LB.js";import"./chunk-MACTWR2J.js";import"./chunk-7CCONVJK.js";import"./chunk-DYBNT4T7.js";import"./chunk-BYFAYZRV.js";import"./chunk-DY7HYEEP.js";import"./chunk-MSZWCIEH.js";import w from"node:fs";import d from"node:path";import{spawn as U}from"node:child_process";import _ from"node:net";import{WebSocket as C}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new C(`ws://localhost:${this.port}`),this.ready=new Promise((t,n)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),n(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==C.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let n=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(n),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(n,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:n,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(n),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let n=this.pending.get(t.id);n&&(this.pending.delete(t.id),clearTimeout(n.timer),t.error?n.reject(new c(t.error,t.code)):n.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function R(r=7668,e=400){return new Promise(t=>{let n=new _.Socket,s=!1,o=i=>{s||(s=!0,n.destroy(),t(i))};n.setTimeout(e),n.once("connect",()=>o(!0)),n.once("timeout",()=>o(!1)),n.once("error",()=>o(!1)),n.connect(r,"127.0.0.1")})}async function F(r={}){let e=r.port??7668;if(await R(e))return{alreadyRunning:!0};let{cmd:t,prefixArgs:n}=O(),s=[...n,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=U(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(r.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await R(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(r={}){await F({port:r.port,startupTimeoutMs:r.startupTimeoutMs});let e=new f(r);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function me(r){let[e,...t]=r;try{switch(e){case void 0:case"--help":case"-h":case"help":return M(),0;case"attach":return await B(t);case"projects":return await W();case"project":return await J(t);case"sessions":return await V(t);case"start":return await G(t);case"prompt":return await H(t);case"watch":return await q(t);case"transcript":return await X(t);case"end":return await z(t);case"paths":return await Q();default:return process.stderr.write(`unknown agent subcommand: ${e}
3
3
  `),M(),2}}catch(n){if(n instanceof c)return process.stderr.write(`${n.message}
4
4
  `),1;throw n}}async function v(r){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await r(e)}finally{e.close()}}function M(){y("agent")}function P(r,e){let t={},n=[];for(let s=0;s<r.length;s++){let o=r[s],i=e[o];i==="value"?(t[o]=r[s+1]??"",s++):i==="bool"?t[o]=!0:n.push(o)}return{flags:t,positional:n}}function N(r,e="codex"){return r==="codex"||r==="claude"?r:e}async function B(r){let{flags:e,positional:t}=P(r,{"--name":"value","--provider":"value"}),n=t[0];if(!n)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
5
5
  `),2;let s=d.resolve(n);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-XRRR4MNB.js";import"./chunk-D4XJE3IA.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)+`
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-K6U4PNYP.js";import"./chunk-MSZWCIEH.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
3
3
  `)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return I(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let g=t[u];g&&(r[g]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
4
4
  --provider codex|claude --cwd <path>
5
5
  --prompt-in <fifo> --events-out <fifo>
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-D4XJE3IA.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(`
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-MSZWCIEH.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.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-GGBWCCP2.js";import"./chunk-P37J53P3.js";import"./chunk-RY25ZLAP.js";import"./chunk-MACTWR2J.js";import"./chunk-DY7HYEEP.js";import"./chunk-MSZWCIEH.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e}from"./chunk-DYBNT4T7.js";import"./chunk-MSZWCIEH.js";export{e as BETA_ASK_HEADLINE,c as BETA_LABEL,d as BETA_TAGLINE,b as BETA_VERSION_TARGET,a as IS_BETA};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var t="http://localhost:5173/";export{t as a};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as y}from"./chunk-4HWRCHNE.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)+`
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as y}from"./chunk-RY25ZLAP.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};
@@ -0,0 +1 @@
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{C as A,k as E,l as _,m as h}from"./chunk-3MMWA4L4.js";import{d as y,h as B,i as v}from"./chunk-TN54LWCW.js";var W={timeoutMs:1800,settleMs:48,startWindowMs:64};function p(e){return new Promise(t=>setTimeout(t,e))}function J(e){return e.includes("--json")}function L(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{C as A,k as E,l as _,m as h}from"./chunk-DKZKYTOM.js";import{d as y,h as B,i as v}from"./chunk-P37J53P3.js";var W={timeoutMs:1800,settleMs:48,startWindowMs:64};function p(e){return new Promise(t=>setTimeout(t,e))}function J(e){return e.includes("--json")}function L(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
3
3
  `)}function U(e){process.stderr.write(`${e}
4
4
  `)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function N(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function q(e,t,...r){return v(e,`SootSim.bridges.mainShell.${t}`,...r)}async function Y(e,t={}){try{let r=await N(e,"waitForScreenTransitions",W);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await q(e,t,...n)}catch(o){if(!A(o)||Date.now()>=s)throw o;await p(50)}}async function K(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await p(o)}return null}async function Q(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let a=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await a.send({type:"evaluate",code:"1"}),a}catch{a.close()}await p(o)}return null}async function V(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,a=-1,u=o,c=null,m=!1,d={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let i=await e.send({type:"evaluate",code:E}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,w=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",P=typeof i?.externalStatus=="string"?i.externalStatus.trim():"",M=typeof i?.externalError=="string"?i.externalError.trim():"",R=typeof i?.externalError=="string"&&M.length>0;if(c=w,m=R,f!==a&&(a=f,u=g),d={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof w=="boolean"?w:null,externalStatus:P,externalError:M,errors:x},C&&w!==!1&&!R&&!T&&h({nodes:f,targets:$})&&g-u>=_)return{...d,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...d,ready:!1,source:"error-bail"}}catch{}await p(s)}return c!==!1&&!m&&!d.loadingText&&h(d)?{...d,ready:!0,source:"nodes-fallback"}:{...d,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function k(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function I(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function D(e,t={}){let r=await e.send({type:"evaluate",code:"window.__sootsimConsole?.count?.() || { errors: 0, warnings: 0, total: 0 }"});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
5
5
  console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await e.send({type:"evaluate",code:"window.__sootsimConsole?.getErrors?.(5) || []"});if(!(!Array.isArray(l)||l.length===0)){console.log(`
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as i,e as d,h as c}from"./chunk-TN54LWCW.js";function g(r){let e=r[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(r,e,t){let l=i(r,{port:e.port}),s=g(l.positional),a=d({...l,commandTimeoutMs:5e3});try{let n=!!(await c(a,"SootSim.bridges.settings.get"))?.[t.modeKey],o=s==="on"?!0:s==="off"?!1:!n;if(n===o)return console.log(` ${t.displayName}: already ${o?"on":"off"}`),{current:n,target:o,changed:!1};if(!await a.send({type:"evaluate",acquireLock:!0,code:`(async () => {
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as i,e as d,h as c}from"./chunk-P37J53P3.js";function g(r){let e=r[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(r,e,t){let l=i(r,{port:e.port}),s=g(l.positional),a=d({...l,commandTimeoutMs:5e3});try{let n=!!(await c(a,"SootSim.bridges.settings.get"))?.[t.modeKey],o=s==="on"?!0:s==="off"?!1:!n;if(n===o)return console.log(` ${t.displayName}: already ${o?"on":"off"}`),{current:n,target:o,changed:!1};if(!await a.send({type:"evaluate",acquireLock:!0,code:`(async () => {
3
3
  const modeKey = ${JSON.stringify(t.modeKey)}
4
4
  const target = ${JSON.stringify(o)}
5
5
  window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as s}from"./chunk-BLL5V7Q5.js";import{l as o}from"./chunk-MHTMPEID.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as h,join as y,resolve as k}from"node:path";function i(){return y(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(h(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as s}from"./chunk-E3JNCJMG.js";import{l as o}from"./chunk-DY7HYEEP.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as h,join as y,resolve as k}from"node:path";function i(){return y(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(h(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
3
3
  `);try{p(t,384)}catch{}}function E(){f(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function O(n){return!!(n&&n.length>=20&&n.length<=256&&m.some(t=>n.startsWith(t)))}function A(){let n=process.env.SOOT_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),r=n||t;if(!O(r))return null;let e=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!e)return null;let[l,u]=e.includes("/")?e.split("/",2):[null,null],c=(process.env.SOOT_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),a=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:e,repositoryId:c||null,owner:l||null,repo:u||null,installationId:a||null,source:n?"soot-runner":"github-actions"}}function x(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=A();if(t)return t;let r=S();if(r)return{kind:"api-key",secret:r,source:"file"};let e=s();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function H(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function N(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{S as a,w as b,E as c,x as d,H as e,N as f};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.112 | (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,4 +1,4 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
3
3
  ${o}
4
4
  `);for(let e=0;e<n.length;e++)console.log(` ${e+1}. ${n[e]}`);if(console.log(),!process.stdin.isTTY)return console.log(` choose [1-${n.length}]: 1 (non-interactive)`),0;let r=await s(` choose [1-${n.length}]: `),t=parseInt(r,10);return t>=1&&t<=n.length?t-1:0}export{u as a,a as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as t}from"./chunk-5576H3EW.js";import{a as p,b as m,c as a}from"./chunk-BUCEYXAX.js";import{a as r}from"./chunk-ONQMX227.js";import{a as l}from"./chunk-OZT2EDWT.js";import{a as u,d}from"./chunk-TGHB7R5L.js";import{z as i}from"./chunk-MHTMPEID.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=`
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as t}from"./chunk-ZGFOEFIT.js";import{a as p,b as m,c as a}from"./chunk-FKL3NMR5.js";import{a as r}from"./chunk-2ZZUG4LB.js";import{a as l}from"./chunk-7CCONVJK.js";import{a as u,d}from"./chunk-DYBNT4T7.js";import{z as i}from"./chunk-DY7HYEEP.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.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.112 | (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}},m={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:m}),"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 S(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"}]}},P={color:"#25c3ec",blur:120,spread:52,opacity:.34},v="iphone-17-pro";var f=[{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"}],x=Object.fromEntries(f.map(e=>[e.name,e.value]));function B(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function b(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(n=>({...n}))}}function I(e){return Object.prototype.hasOwnProperty.call(s,e)?b(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 y(){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 R(){let e={};for(let[n,a]of Object.entries(d))e[n]=a.default;return Object.assign(e,y()),e}export{P as a,v as b,B as c,b as d,I as e,h as f,S as g,g as h,d as i,y as j,R as k};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  function A(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=e.indexOf(r);if(s>=0&&e[s+1]){let a=Number(e[s+1]);if(Number.isFinite(a))return Math.max(100,a)}}return t}var m=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function f(e){return typeof e=="string"&&m.has(e)}async function w(e){return await e.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function E(e,t){if(!f(t))return!1;try{return await w(e)}catch{return!1}}async function L(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function D(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function N(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function H(e,t){let n=`(async () => {
3
3
  const t = window.__sootsimTest
4
4
  const mainShell = window.SootSim?.bridges?.mainShell
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import r from"node:fs";import{homedir as O}from"node:os";import n from"node:path";var L="SOOTSIM_HOME",E="active",A="daemon.json",j="config.json",I=3e4;function c(){let e=process.env[L];return e&&e.length>0?n.resolve(e):n.join(O(),".sootsim")}function K(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return r.realpathSync(t).includes(`${n.sep}packages${n.sep}sootsim${n.sep}`)}catch{return!1}}function f(){return n.join(c(),"runtimes")}function _(e){return n.join(f(),e)}function D(){return n.join(f(),E)}function S(){return n.join(c(),"electron")}function U(){return n.join(S(),"userData")}function Y(e){return n.join(S(),e)}function N(){return n.join(c(),"profiles")}function F(){return n.join(c(),"daemon-app")}function T(){return n.join(F(),"SootSim Daemon.app")}function G(){return n.join(T(),"Contents","MacOS","sootsim-daemon")}function C(){return n.join(c(),"cache")}function p(){return n.join(c(),A)}function d(){return n.join(c(),j)}function v(){try{let e=r.readFileSync(d(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function M(e){y();let t=v(),s={...t,...e};e.settings&&typeof e.settings=="object"&&(s.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let u=`${d()}.tmp`;return r.writeFileSync(u,`${JSON.stringify(s,null,2)}
3
3
  `,"utf8"),r.renameSync(u,d()),s}function X(){return v().telemetry!==!1}function q(e){M({telemetry:e})}function y(){r.mkdirSync(c(),{recursive:!0}),r.mkdirSync(f(),{recursive:!0}),r.mkdirSync(S(),{recursive:!0}),r.mkdirSync(N(),{recursive:!0}),r.mkdirSync(C(),{recursive:!0})}function w(){try{let e=r.readFileSync(D(),"utf8").trim();return e.length>0?e:null}catch{return null}}function z(e){r.mkdirSync(f(),{recursive:!0}),r.writeFileSync(D(),`${e}
4
4
  `,"utf8")}function Q(){try{return r.readdirSync(f(),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).sort(P)}catch{return[]}}function P(e,t){let s=i=>{let a=i.indexOf("-"),l=a>=0?i.slice(0,a):i,k=a>=0?i.slice(a+1):"",b=l.split(".").map(g=>Number.parseInt(g,10));return b.some(g=>!Number.isFinite(g))?[[Number.POSITIVE_INFINITY],i]:[b,k]},[u,o]=s(e),[x,m]=s(t);for(let i=0;i<Math.max(u.length,x.length);i++){let a=u[i]??0,l=x[i]??0;if(a!==l)return a-l}return o===m?0:o?m?o<m?-1:1:-1:1}function W(){let e=w();if(!e)return null;let t=_(e);try{if(r.statSync(t).isDirectory())return t}catch{}return null}var h=16*1024;function R(){try{let e=r.openSync(p(),"r");try{let t=Buffer.alloc(h),s=r.readSync(e,t,0,h,0),u=t.subarray(0,s).toString("utf8"),o=JSON.parse(u);return o&&o.schema===1&&typeof o.pid=="number"&&typeof o.bridgePort=="number"&&typeof o.runtimePort=="number"&&typeof o.startedAt=="number"&&typeof o.heartbeatAt=="number"?o:null}finally{r.closeSync(e)}}catch{return null}}function $(e,t=Date.now()){if(!e||t-e.heartbeatAt>I)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function H(e){y();let t=`${p()}.tmp`;r.writeFileSync(t,`${JSON.stringify(e,null,2)}
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.112 | (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.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{l as d}from"./chunk-MHTMPEID.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)+`
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{l as d}from"./chunk-DY7HYEEP.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};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.110 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as Ns}from"./chunk-D4XJE3IA.js";var ui=`(async () => {
1
+ /*! sootsim v0.1.112 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as Ns}from"./chunk-MSZWCIEH.js";var ui=`(async () => {
3
3
  try { localStorage.clear() } catch {}
4
4
  try { sessionStorage.clear() } catch {}
5
5
  try {
@@ -171,7 +171,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
171
171
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
172
172
  `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ge(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(dn(t.key)&&!ge(t.sep,"newline")){let o=Ke(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ge(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Ke(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ge(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ge(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ge(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Kt(n),r=Ke(i);mn(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
173
173
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
174
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Kt(e),n=Ke(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Kt(e),n=Ke(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function gn(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Be||null,prettyErrors:e}}function yn(s,e={}){let{lineCounter:t,prettyErrors:n}=gn(e),i=new we(t?.addNewLine),r=new be(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(He(s,t)),a.warnings.forEach(He(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ps(s,e={}){let{lineCounter:t,prettyErrors:n}=gn(e),i=new we(t?.addNewLine),r=new be(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new x(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(He(s,t)),o.warnings.forEach(He(s,t))),o}function bn(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ps(s,t);if(!i)return null;if(i.warnings.forEach(r=>pt(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function wn(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return R(s)&&!n?s.toString(t):new se(s,n,t).toString(t)}var Se=ms;function ds(s,e){return typeof s=="string"?s.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(t,n)=>{if(e?.has(n))return e.get(n);let i=process.env[n];if(i===void 0)throw new Error(`missing environment variable for flow placeholder: ${n}`);return i}):Array.isArray(s)?s.map(t=>ds(t,e)):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([t,n])=>[t,ds(n,e)])):s}function ii(s,e={}){let t={},n=s,i=a=>Array.isArray(a)?e.resolveEnv?ds(a,e.scopedVars):a:[],r=s.match(/^---\n([\s\S]*?)\n---\n?/);if(r){try{t=Se.parse(r[1])??{}}catch(l){console.warn(` warn: could not parse frontmatter: ${l.message}`)}n=s.slice(r[0].length);let a=Se.parse(n);return{frontmatter:t,steps:i(a)}}if(/\n---\s*\n/.test(s))try{let a=Se.parseAllDocuments(s);if(a.length>=2){let l=a[0].toJS(),c=a[a.length-1].toJS();return{frontmatter:l&&typeof l=="object"?l:{},steps:i(c)}}}catch(a){console.warn(` warn: could not parse multi-doc flow: ${a.message}`)}let o=Se.parse(n);return{frontmatter:t,steps:i(o)}}var Sn=new Set(["tapOn","inputText","pressKey","dispatchKey","hideKeyboard","swipe","pinch","scroll","scrollUntilVisible"]);function gs(s){let e=[];if(!Array.isArray(s)||s.length===0)return e.push("flow body must be a non-empty YAML array of steps"),e;let t=0;for(let n of s)n&&typeof n=="object"?Object.keys(n).some(r=>Sn.has(r))&&(t+=1):typeof n=="string"&&Sn.has(n)&&(t+=1);return t===0&&e.push("no interaction steps found (expected at least one tapOn / inputText / pressKey / swipe / scroll)"),e}function Vc(s){if(!qt.existsSync(s))return[`file not found: ${s}`];let e;try{e=qt.readFileSync(s,"utf8")}catch(t){return[`cannot read file: ${t.message}`]}if(e.trim().length===0)return["file is empty"];try{let t=ii(e);return gs(t.steps)}catch(t){return[`yaml parse error: ${t.message}`]}}import{existsSync as ri,mkdirSync as kn,readFileSync as oi,rmSync as ys,writeFileSync as Nn}from"fs";import{tmpdir as ai}from"os";import{dirname as An,join as li,resolve as On}from"path";var bs=1;function jt(){return On(process.env.SOOTSIM_FLOW_SESSION_PATH||li(ai(),"sootsim-flow-session.json"))}function ws(s){let e=jt();kn(An(e),{recursive:!0}),Nn(e,JSON.stringify(s,null,2)+`
174
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Kt(e),n=Ke(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Kt(e),n=Ke(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function gn(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Be||null,prettyErrors:e}}function yn(s,e={}){let{lineCounter:t,prettyErrors:n}=gn(e),i=new we(t?.addNewLine),r=new be(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(He(s,t)),a.warnings.forEach(He(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function ps(s,e={}){let{lineCounter:t,prettyErrors:n}=gn(e),i=new we(t?.addNewLine),r=new be(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new x(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(He(s,t)),o.warnings.forEach(He(s,t))),o}function bn(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=ps(s,t);if(!i)return null;if(i.warnings.forEach(r=>pt(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function wn(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return R(s)&&!n?s.toString(t):new se(s,n,t).toString(t)}var Se=ms;function ds(s,e){return typeof s=="string"?s.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(t,n)=>{if(e?.has(n))return e.get(n);let i=process.env[n];if(i===void 0)throw new Error(`missing environment variable for flow placeholder: ${n}`);return i}):Array.isArray(s)?s.map(t=>ds(t,e)):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([t,n])=>[t,ds(n,e)])):s}function ii(s,e={}){let t={},n=s,i=a=>Array.isArray(a)?e.resolveEnv?ds(a,e.scopedVars):a:[],r=s.match(/^---\n([\s\S]*?)\n---\n?/);if(r){try{t=Se.parse(r[1])??{}}catch(l){console.warn(` warn: could not parse frontmatter: ${l.message}`)}n=s.slice(r[0].length);let a=Se.parse(n);return{frontmatter:t,steps:i(a)}}if(/\n---\s*\n/.test(s))try{let a=Se.parseAllDocuments(s);if(a.length>=2){let l=a[0].toJS(),c=a[a.length-1].toJS();return{frontmatter:l&&typeof l=="object"?l:{},steps:i(c)}}}catch(a){console.warn(` warn: could not parse multi-doc flow: ${a.message}`)}let o=Se.parse(n);return{frontmatter:t,steps:i(o)}}var Sn=new Set(["tapOn","inputText","pressKey","dispatchKey","hideKeyboard","swipe","pinch","scroll","scrollUntilVisible"]);function gs(s){let e=[];if(!Array.isArray(s)||s.length===0)return e.push("flow body must be a non-empty YAML array of steps"),e;let t=0;for(let n of s)n&&typeof n=="object"?Object.keys(n).some(r=>Sn.has(r))&&(t+=1):typeof n=="string"&&Sn.has(n)&&(t+=1);return t===0&&e.push("no interaction steps found (expected at least one tapOn / inputText / pressKey / swipe / scroll)"),e}function Vc(s){if(!qt.existsSync(s))return[`file not found: ${s}`];let e;try{e=qt.readFileSync(s,"utf8")}catch(t){return[`cannot read file: ${t.message}`]}if(e.trim().length===0)return["file is empty"];try{let t=ii(e);return gs(t.steps)}catch(t){return[`yaml parse error: ${t.message}`]}}import{existsSync as ri,mkdirSync as kn,readFileSync as oi,rmSync as ys,writeFileSync as Nn}from"fs";import{tmpdir as ai}from"os";import{dirname as An,join as li,resolve as On}from"path";var bs=1;function jt(){return On(process.env.SOOTSIM_FLOW_SESSION_PATH||li(ai(),"sootsim-flow-session.json"))}function ws(s){let e=jt();kn(An(e),{recursive:!0}),Nn(e,JSON.stringify(s,null,2)+`
175
175
  `)}function Ss(){let s=jt();if(!ri(s))return null;try{let e=JSON.parse(oi(s,"utf8"));return e.version!==bs||!Array.isArray(e.steps)||typeof e.startedAt!="string"||typeof e.updatedAt!="string"?(ys(s,{force:!0}),null):{version:bs,startedAt:e.startedAt,updatedAt:e.updatedAt,steps:e.steps,candidate:e.candidate??null}}catch{return ys(s,{force:!0}),null}}function Xc(){let s=new Date().toISOString(),e={version:bs,startedAt:s,updatedAt:s,steps:[],candidate:null};return ws(e),{path:jt(),state:e}}function ci(){ys(jt(),{force:!0})}function zc(){ci()}function Zc(s){let e=Ss();if(!e)return{active:!1};let t=e.candidate,n={...e,updatedAt:new Date().toISOString(),candidate:{step:s.step,summary:s.summary,source:s.source,recordedAt:new Date().toISOString()}};return ws(n),{active:!0,candidate:n.candidate,replaced:t}}function ef(){let s=Ss();if(!s)return{active:!1,kept:!1,reason:"no-session"};if(!s.candidate)return{active:!0,kept:!1,reason:"no-candidate"};let e=s.candidate,t={...s,updatedAt:new Date().toISOString(),steps:[...s.steps,e.step],candidate:null};return ws(t),{active:!0,kept:!0,candidate:e,stepCount:t.steps.length}}function fi(s){return Se.stringify(s).trimEnd()+`
176
176
  `}function tf(s){let e=Ss();if(!e)return{active:!1};let t=fi(e.steps),n=gs(e.steps);if(n.length>0)return{active:!0,valid:!1,issues:n,yaml:t,stepCount:e.steps.length,outputPath:null};let i=null;return s&&(i=On(s),kn(An(i),{recursive:!0}),Nn(i,t)),{active:!0,valid:!0,issues:[],yaml:t,stepCount:e.steps.length,outputPath:i}}async function nf({bridge:s,simId:e,maxMs:t,pollMs:n=50,stablePolls:i=3,strict:r=!1}){let o=await s.send({type:"evaluate",simId:e,code:`(async () => {
177
177
  const start = Date.now()