sootsim 0.1.125 → 0.1.127

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 (146) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-TMQFLKPM.js → agent-LUN4QHOL.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-MI2RWK3D.js → agent-wrapper-APEJDITM.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-QKQGY2CT.js → app-fonts-AKZ7ZDOK.js} +2 -2
  5. package/dist-cli/chunks/{assert-7MQMKTB2.js → assert-MFPNYG7R.js} +2 -2
  6. package/dist-cli/chunks/auto-bootstrap-LBKZGZZF.js +2 -0
  7. package/dist-cli/chunks/beta-VGO5KHIW.js +2 -0
  8. package/dist-cli/chunks/{chunk-YWZNEVYP.js → chunk-24GWVHOQ.js} +2 -2
  9. package/dist-cli/chunks/{chunk-WFPQZ3U2.js → chunk-2YJLYAL3.js} +2 -2
  10. package/dist-cli/chunks/{chunk-7565HNNY.js → chunk-36AO2O2R.js} +75 -13
  11. package/dist-cli/chunks/{chunk-S33UAEVN.js → chunk-3DHE4SHG.js} +1 -1
  12. package/dist-cli/chunks/{chunk-DFMCHE2N.js → chunk-3U2ZPTHG.js} +2 -2
  13. package/dist-cli/chunks/chunk-3WXNKHSH.js +1 -0
  14. package/dist-cli/chunks/{chunk-TLFLH5ZC.js → chunk-4JCC7SR2.js} +2 -2
  15. package/dist-cli/chunks/{chunk-L7DT6B6A.js → chunk-52XT4NSH.js} +2 -2
  16. package/dist-cli/chunks/{chunk-G3LKP7QV.js → chunk-5UWZ47FH.js} +1 -1
  17. package/dist-cli/chunks/{chunk-YBFN6GLT.js → chunk-5WIVTKYW.js} +1 -1
  18. package/dist-cli/chunks/{chunk-YCWEOYJ7.js → chunk-5WSDKWL7.js} +2 -2
  19. package/dist-cli/chunks/{chunk-JF5I5XZH.js → chunk-6D4U74IK.js} +2 -2
  20. package/dist-cli/chunks/{chunk-MW4OBNQC.js → chunk-7DAYDZ6K.js} +3 -3
  21. package/dist-cli/chunks/{chunk-VO6U3ATJ.js → chunk-7JJF24H4.js} +2 -2
  22. package/dist-cli/chunks/{chunk-Q426SNAV.js → chunk-7QBGAHCM.js} +3 -3
  23. package/dist-cli/chunks/{chunk-2AMF34XM.js → chunk-B56YQYVI.js} +1 -1
  24. package/dist-cli/chunks/{chunk-XK55CEAQ.js → chunk-BY4HZZZH.js} +3 -3
  25. package/dist-cli/chunks/{chunk-PVSGLWUQ.js → chunk-CSXM46RX.js} +2 -2
  26. package/dist-cli/chunks/{chunk-RJSGOTB5.js → chunk-DC6VXHIZ.js} +1 -1
  27. package/dist-cli/chunks/{chunk-JOM2DZPL.js → chunk-DQAWYKPD.js} +2 -2
  28. package/dist-cli/chunks/{chunk-344G6B3N.js → chunk-FG6YYUCT.js} +1 -1
  29. package/dist-cli/chunks/{chunk-SX5TEBK7.js → chunk-FGTMXDHE.js} +2 -2
  30. package/dist-cli/chunks/{chunk-W22TO5UO.js → chunk-FMCKRPCU.js} +1 -1
  31. package/dist-cli/chunks/{chunk-HKYI3SXR.js → chunk-FPVP3O53.js} +2 -2
  32. package/dist-cli/chunks/chunk-FW5SXCE2.js +2 -0
  33. package/dist-cli/chunks/{chunk-WVHJC5IC.js → chunk-GNG6W27T.js} +2 -2
  34. package/dist-cli/chunks/{chunk-BVKPXLEI.js → chunk-GNYI3JAB.js} +1 -1
  35. package/dist-cli/chunks/{chunk-HB7AHLC3.js → chunk-HNEBMDYQ.js} +2 -2
  36. package/dist-cli/chunks/{chunk-YRAYBIM5.js → chunk-IWSLRFIG.js} +2 -2
  37. package/dist-cli/chunks/{chunk-EAQGB3YG.js → chunk-L2CWZNGS.js} +2 -2
  38. package/dist-cli/chunks/{chunk-MAFDEPT6.js → chunk-LF3KGYGE.js} +2 -2
  39. package/dist-cli/chunks/{chunk-JWMYDUYB.js → chunk-MT6WASRO.js} +1 -1
  40. package/dist-cli/chunks/{chunk-BIZBFZJY.js → chunk-NDGBW36P.js} +1 -1
  41. package/dist-cli/chunks/{chunk-R3YPAJKJ.js → chunk-NKJJMS2M.js} +1 -1
  42. package/dist-cli/chunks/{chunk-V5AQVSWE.js → chunk-OKAG4ZKD.js} +2 -2
  43. package/dist-cli/chunks/chunk-QVIEWXVS.js +1 -0
  44. package/dist-cli/chunks/{chunk-LDYNWRUI.js → chunk-SM2JP7BO.js} +1 -1
  45. package/dist-cli/chunks/{chunk-SUWMHUJC.js → chunk-TGJWE3CN.js} +2 -2
  46. package/dist-cli/chunks/chunk-UWEGL2QF.js +1 -0
  47. package/dist-cli/chunks/{chunk-DSR43SNY.js → chunk-VIXWXLVX.js} +2 -2
  48. package/dist-cli/chunks/{chunk-MPX3A64M.js → chunk-Y4YKDIS6.js} +1 -1
  49. package/dist-cli/chunks/{chunk-LN2UCRNK.js → chunk-YVB5QNKO.js} +1 -1
  50. package/dist-cli/chunks/{chunk-QZFUBR6C.js → chunk-ZGXZQPYO.js} +2 -2
  51. package/dist-cli/chunks/{chunk-N4KSAFXN.js → chunk-ZP3CCVT7.js} +1 -1
  52. package/dist-cli/chunks/cli-version-YVYBW43E.js +2 -0
  53. package/dist-cli/chunks/{compat-JFXOOOOU.js → compat-JELEOJPN.js} +3 -3
  54. package/dist-cli/chunks/{config-GFDWAKAZ.js → config-REAVTZCI.js} +2 -2
  55. package/dist-cli/chunks/control-3AUN3AWZ.js +2 -0
  56. package/dist-cli/chunks/{cpu-profile-DDXXSU7Z.js → cpu-profile-OGVBRPW7.js} +2 -2
  57. package/dist-cli/chunks/{daemon-WNXU7ZNH.js → daemon-ZUOHTLAC.js} +2 -2
  58. package/dist-cli/chunks/{debug-SXQD427O.js → debug-G533AR4F.js} +3 -3
  59. package/dist-cli/chunks/{detox-D4LSO32X.js → detox-TBWG4AR3.js} +2 -2
  60. package/dist-cli/chunks/{device-LLY5W2PV.js → device-PQEM6FOV.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-TWY5FNQT.js → diagnose-4J75PLPF.js} +2 -2
  62. package/dist-cli/chunks/drivers-PNGLYCLQ.js +2 -0
  63. package/dist-cli/chunks/{electron-BNDUCNBS.js → electron-A2SD7F3N.js} +3 -3
  64. package/dist-cli/chunks/flow-THQYC2Y4.js +2 -0
  65. package/dist-cli/chunks/help-ASEA4FFM.js +2 -0
  66. package/dist-cli/chunks/{hints-U7Z7BKVC.js → hints-7PG63DKS.js} +2 -2
  67. package/dist-cli/chunks/{home-paths-BGHXDJYV.js → home-paths-QIX4W62B.js} +2 -2
  68. package/dist-cli/chunks/{inspect-7MOP5JYW.js → inspect-T3H6FTHE.js} +44 -49
  69. package/dist-cli/chunks/install-FXTDM3ZL.js +2 -0
  70. package/dist-cli/chunks/{install-desktop-MXAFEYOG.js → install-desktop-AJ7MV6OQ.js} +3 -3
  71. package/dist-cli/chunks/{keys-KDLUFI4P.js → keys-ODRTRJX7.js} +2 -2
  72. package/dist-cli/chunks/{launch-WDO73PK6.js → launch-5BF5JBYF.js} +3 -3
  73. package/dist-cli/chunks/{login-7DTL6D72.js → login-MQ2PDQNI.js} +4 -4
  74. package/dist-cli/chunks/{logout-XTKHXGWS.js → logout-KH374434.js} +2 -2
  75. package/dist-cli/chunks/{maestro-QOAHZZNA.js → maestro-J5GGRVH6.js} +2 -2
  76. package/dist-cli/chunks/{preview-JGSC3EGX.js → preview-CCPCRU6W.js} +2 -2
  77. package/dist-cli/chunks/{profile-P5IIGGN6.js → profile-MTL2HU6F.js} +2 -2
  78. package/dist-cli/chunks/{react-XUJ47FVL.js → react-UTYPZQWT.js} +2 -2
  79. package/dist-cli/chunks/{record-BBFCP57M.js → record-AFRD6E2J.js} +2 -2
  80. package/dist-cli/chunks/runtime-SE4VB7MF.js +2 -0
  81. package/dist-cli/chunks/{runtime-delivery-RGSGXTGK.js → runtime-delivery-PJZCHZOA.js} +2 -2
  82. package/dist-cli/chunks/{screenshot-5J4I32FT.js → screenshot-AQHIB3G7.js} +2 -2
  83. package/dist-cli/chunks/{screenshot-mode-CFF7I73M.js → screenshot-mode-NOOW6RL5.js} +2 -2
  84. package/dist-cli/chunks/{screenshots-XCX3FUCB.js → screenshots-KVKV2KAZ.js} +2 -2
  85. package/dist-cli/chunks/{server-XLC7CVF4.js → server-6KNS5Y7Q.js} +3 -3
  86. package/dist-cli/chunks/setup-repo-XXEF6YK3.js +2 -0
  87. package/dist-cli/chunks/{skills-ZXROA432.js → skills-62FUBTDY.js} +2 -2
  88. package/dist-cli/chunks/{start-FOZE6SSC.js → start-XBAW57QL.js} +4 -4
  89. package/dist-cli/chunks/store-FOWKJFEJ.js +2 -0
  90. package/dist-cli/chunks/telemetry-FDYR6W5E.js +2 -0
  91. package/dist-cli/chunks/{test-ZJVCSOAS.js → test-TSJ5PCO6.js} +3 -3
  92. package/dist-cli/chunks/{three-mode-SNKIUD3Z.js → three-mode-VK2D4NYV.js} +2 -2
  93. package/dist-cli/chunks/{timeline-KM6FMIW3.js → timeline-HY7B7HAW.js} +2 -2
  94. package/dist-cli/chunks/{upgrade-HGVZ3VLY.js → upgrade-BHZN6X5M.js} +2 -2
  95. package/dist-cli/chunks/upload-B6UNK5GQ.js +2 -0
  96. package/dist-cli/chunks/{version-QRWV5GJF.js → version-YFEE6ZGK.js} +2 -2
  97. package/dist-cli/chunks/{web-YBMD3KIN.js → web-KNX5TVQW.js} +2 -2
  98. package/dist-cli/chunks/{what-happened-4M6BJK4Q.js → what-happened-VDAD5V3N.js} +2 -2
  99. package/dist-cli/chunks/{whoami-Z4XW7B7W.js → whoami-ONERUEKE.js} +2 -2
  100. package/dist-lib/agent-daemon-client.cjs +1 -1
  101. package/dist-lib/agent-events.cjs +1 -1
  102. package/dist-lib/agent-sessions.cjs +1 -1
  103. package/dist-lib/attached-projects.cjs +1 -1
  104. package/dist-lib/auth/shared-session.cjs +1 -1
  105. package/dist-lib/backend-origin.cjs +1 -1
  106. package/dist-lib/beta.cjs +1 -1
  107. package/dist-lib/beta.mjs +1 -1
  108. package/dist-lib/bridge-constants.cjs +1 -1
  109. package/dist-lib/cli-constants.cjs +1 -1
  110. package/dist-lib/config.cjs +1 -1
  111. package/dist-lib/detox/index.cjs +1 -1
  112. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  113. package/dist-lib/home-paths.cjs +1 -1
  114. package/dist-lib/host/bridge-host.cjs +1 -1
  115. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  116. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  117. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  118. package/dist-lib/host/websocket-proxy.cjs +1 -1
  119. package/dist-lib/index.cjs +1 -1
  120. package/dist-lib/metro.cjs +1 -1
  121. package/dist-lib/profiles.cjs +1 -1
  122. package/dist-lib/render-mode.cjs +1 -1
  123. package/dist-lib/scripts/demo-app-registry.cjs +1 -1
  124. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  125. package/dist-lib/sdk.cjs +64 -2
  126. package/dist-lib/sdk.mjs +64 -2
  127. package/dist-lib/skills.cjs +1 -1
  128. package/dist-lib/vite.cjs +1 -1
  129. package/package.json +3 -3
  130. package/dist-cli/chunks/auto-bootstrap-7ACFJL6A.js +0 -2
  131. package/dist-cli/chunks/beta-MAZIBPYH.js +0 -2
  132. package/dist-cli/chunks/chunk-DLKP3ARC.js +0 -1
  133. package/dist-cli/chunks/chunk-EGRWEXWI.js +0 -2
  134. package/dist-cli/chunks/chunk-ESOLWKGM.js +0 -1
  135. package/dist-cli/chunks/chunk-INBGGIAY.js +0 -1
  136. package/dist-cli/chunks/cli-version-CKN7AEYL.js +0 -2
  137. package/dist-cli/chunks/control-FXZUUFHY.js +0 -2
  138. package/dist-cli/chunks/drivers-YWYAKTA4.js +0 -2
  139. package/dist-cli/chunks/flow-BFSMTEGF.js +0 -2
  140. package/dist-cli/chunks/help-VXIFMK5V.js +0 -2
  141. package/dist-cli/chunks/install-6ZRS7EC5.js +0 -2
  142. package/dist-cli/chunks/runtime-P7GE3W7Y.js +0 -2
  143. package/dist-cli/chunks/setup-repo-JB6C7PT3.js +0 -2
  144. package/dist-cli/chunks/store-YYITLIOL.js +0 -2
  145. package/dist-cli/chunks/telemetry-FJO3ZTS3.js +0 -2
  146. package/dist-cli/chunks/upload-6PNSQEKU.js +0 -2
package/dist-cli/bin.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
- import{a as u,b as d,c as g}from"./chunks/chunk-R3YPAJKJ.js";import"./chunks/chunk-2AMF34XM.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
2
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
3
+ import{a as u,b as d,c as g}from"./chunks/chunk-NKJJMS2M.js";import"./chunks/chunk-B56YQYVI.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
4
4
  `),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
5
5
  `):process.stderr.write(`${e}
6
6
  `),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
7
7
  it needs vite / electron / playwright from a project's node_modules.
8
8
  install the npm package and run via bun or node instead:
9
9
  npm i -g sootsim && sootsim ${a}
10
- `),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-FJO3ZTS3.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-FJO3ZTS3.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-CKN7AEYL.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-MAZIBPYH.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-BGHXDJYV.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-VXIFMK5V.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-YYITLIOL.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-FOZE6SSC.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-VXIFMK5V.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-VXIFMK5V.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-VXIFMK5V.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-7ACFJL6A.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-7MOP5JYW.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-7MQMKTB2.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-BFSMTEGF.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-ZJVCSOAS.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-D4LSO32X.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-QOAHZZNA.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-JGSC3EGX.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-BBFCP57M.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-P5IIGGN6.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-DDXXSU7Z.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-XUJ47FVL.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-5J4I32FT.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-XCX3FUCB.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-CFF7I73M.js");await a(t.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-SNKIUD3Z.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-7MOP5JYW.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-SXQD427O.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-KM6FMIW3.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-4M6BJK4Q.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-TWY5FNQT.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-7ACFJL6A.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-FXZUUFHY.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-FXZUUFHY.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-FXZUUFHY.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-FXZUUFHY.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-GFDWAKAZ.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-LLY5W2PV.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-JFXOOOOU.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-BNDUCNBS.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-7DTL6D72.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-XTKHXGWS.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-Z4XW7B7W.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-KDLUFI4P.js");await a(t.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-JB6C7PT3.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-6ZRS7EC5.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-MXAFEYOG.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-XLC7CVF4.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-WNXU7ZNH.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-P7GE3W7Y.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-HGVZ3VLY.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-QRWV5GJF.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-WDO73PK6.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-FOZE6SSC.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-TMQFLKPM.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-MI2RWK3D.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-ZXROA432.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-6PNSQEKU.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-QKQGY2CT.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-U7Z7BKVC.js");a(t.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 t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-FDYR6W5E.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-FDYR6W5E.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-YVYBW43E.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-VGO5KHIW.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-QIX4W62B.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-ASEA4FFM.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-FOWKJFEJ.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-XBAW57QL.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-ASEA4FFM.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-ASEA4FFM.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-ASEA4FFM.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-LBKZGZZF.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-T3H6FTHE.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-MFPNYG7R.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-THQYC2Y4.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-TSJ5PCO6.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-TBWG4AR3.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-J5GGRVH6.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-CCPCRU6W.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-AFRD6E2J.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-MTL2HU6F.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-OGVBRPW7.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-UTYPZQWT.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-AQHIB3G7.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-KVKV2KAZ.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-NOOW6RL5.js");await a(t.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-VK2D4NYV.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-T3H6FTHE.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-G533AR4F.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-HY7B7HAW.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-VDAD5V3N.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-4J75PLPF.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-LBKZGZZF.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-3AUN3AWZ.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-3AUN3AWZ.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-3AUN3AWZ.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-3AUN3AWZ.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-REAVTZCI.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-PQEM6FOV.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-JELEOJPN.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-A2SD7F3N.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-MQ2PDQNI.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-KH374434.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-ONERUEKE.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-ODRTRJX7.js");await a(t.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-XXEF6YK3.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-FXTDM3ZL.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-AJ7MV6OQ.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-6KNS5Y7Q.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-ZUOHTLAC.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-SE4VB7MF.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-BHZN6X5M.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-YFEE6ZGK.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-5BF5JBYF.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-XBAW57QL.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-LUN4QHOL.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-APEJDITM.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-62FUBTDY.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-B6UNK5GQ.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-AKZ7ZDOK.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-7PG63DKS.js");a(t.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-PVSGLWUQ.js";import"./chunk-LDYNWRUI.js";import{c as b}from"./chunk-YCWEOYJ7.js";import"./chunk-MAFDEPT6.js";import"./chunk-BIZBFZJY.js";import"./chunk-EGRWEXWI.js";import"./chunk-YBFN6GLT.js";import"./chunk-JWMYDUYB.js";import"./chunk-G3LKP7QV.js";import"./chunk-344G6B3N.js";import{h as y,i as $}from"./chunk-MPX3A64M.js";import"./chunk-2AMF34XM.js";import w from"node:fs";import d from"node:path";import{spawn as F}from"node:child_process";import B from"node:net";import{WebSocket as M}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new M(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==M.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function L(n=7668,e=400){return new Promise(t=>{let r=new B.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function W(n={}){let e=n.port??7668;if(await L(e))return{alreadyRunning:!0};if($()){let a=y()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new c(`no sootsim bridge on port ${e} and refusing to spawn a standalone daemon \u2014 ${a}. start the live \`bun dev\` stack so the bridge is up, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose.`,"DEV_HOST_REFUSED")}let{cmd:t,prefixArgs:r}=C(),s=[...r,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=F(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await L(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await W({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function fe(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return _(),0;case"attach":return await V(t);case"projects":return await J();case"project":return await G(t);case"sessions":return await H(t);case"start":return await q(t);case"prompt":return await K(t);case"watch":return await X(t);case"transcript":return await Q(t);case"end":return await Y(t);case"paths":return await Z();default:return process.stderr.write(`unknown agent subcommand: ${e}
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-CSXM46RX.js";import"./chunk-SM2JP7BO.js";import{c as b}from"./chunk-5WSDKWL7.js";import"./chunk-LF3KGYGE.js";import"./chunk-NDGBW36P.js";import"./chunk-FW5SXCE2.js";import"./chunk-5WIVTKYW.js";import"./chunk-MT6WASRO.js";import"./chunk-5UWZ47FH.js";import"./chunk-FG6YYUCT.js";import{h as y,i as $}from"./chunk-Y4YKDIS6.js";import"./chunk-B56YQYVI.js";import w from"node:fs";import d from"node:path";import{spawn as F}from"node:child_process";import B from"node:net";import{WebSocket as M}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new M(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==M.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function L(n=7668,e=400){return new Promise(t=>{let r=new B.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function W(n={}){let e=n.port??7668;if(await L(e))return{alreadyRunning:!0};if($()){let a=y()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new c(`no sootsim bridge on port ${e} and refusing to spawn a standalone daemon \u2014 ${a}. start the live \`bun dev\` stack so the bridge is up, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose.`,"DEV_HOST_REFUSED")}let{cmd:t,prefixArgs:r}=C(),s=[...r,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=F(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await L(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await W({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function fe(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return _(),0;case"attach":return await V(t);case"projects":return await J();case"project":return await G(t);case"sessions":return await H(t);case"start":return await q(t);case"prompt":return await K(t);case"watch":return await X(t);case"transcript":return await Q(t);case"end":return await Y(t);case"paths":return await Z();default:return process.stderr.write(`unknown agent subcommand: ${e}
3
3
  `),_(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
4
4
  `),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function _(){b("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function V(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
5
5
  `),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as M}from"./chunk-LDYNWRUI.js";import"./chunk-2AMF34XM.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.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as M}from"./chunk-SM2JP7BO.js";import"./chunk-B56YQYVI.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
3
3
  `)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return I(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let g=t[u];g&&(r[g]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
4
4
  --provider codex|claude --cwd <path>
5
5
  --prompt-in <fifo> --events-out <fifo>
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as p}from"./chunk-LN2UCRNK.js";import"./chunk-2AMF34XM.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as p}from"./chunk-YVB5QNKO.js";import"./chunk-B56YQYVI.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-2AMF34XM.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.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-B56YQYVI.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.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d}from"./chunk-BY4HZZZH.js";import"./chunk-52XT4NSH.js";import"./chunk-ZP3CCVT7.js";import"./chunk-5WIVTKYW.js";import"./chunk-Y4YKDIS6.js";import"./chunk-B56YQYVI.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a,b,c,d,e}from"./chunk-5UWZ47FH.js";import"./chunk-B56YQYVI.js";export{e as BETA_ASK_HEADLINE,c as BETA_LABEL,d as BETA_TAGLINE,b as BETA_VERSION_TARGET,a as IS_BETA};
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as y}from"./chunk-N4KSAFXN.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.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as y}from"./chunk-ZP3CCVT7.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as p}from"fs";import{tmpdir as m}from"os";import{dirname as v,join as w}from"path";var d=new Map;function s(e,r){d.set(e,r)}var c=1;function i(){return w(m(),`sootsim-cli-hints-${y()}.json`)}function l(){return w(m(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:c,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==c||!r?.shown?{version:c,shown:{}}:r}catch{return{version:c,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
3
3
  `)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let n=Date.now();if(r==="once-per-identity"){let t=u(i());return t.shown[e]?!1:(t.shown[e]=n,f(i(),t),!0)}if(r==="once-ever"){let t=u(l());return t.shown[e]?!1:(t.shown[e]=n,f(l(),t),!0)}if(typeof r=="object"&&"cooldownMs"in r){let t=u(i()),a=t.shown[e]??0;return n-a<r.cooldownMs?!1:(t.shown[e]=n,f(i(),t),!0)}return!0}function k(e,...r){let o=d.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let n=o.render(...r);if(n==null)return!1;let t=Array.isArray(n)?n:[n],a=o.stream==="error"?console.error:console.log;for(let g of t)a(` hint: ${g}`);return!0}function M(){p(i(),{force:!0})}function O(){p(l(),{force:!0})}function T(){return Array.from(d.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});s("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{k as a,M as b,O as c,T as d};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as w,i as u,j as m,k as l}from"./chunk-344G6B3N.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as w,i as u,j as m,k as l}from"./chunk-FG6YYUCT.js";var p="sootsim:settings",v=["errorReporting","colorScheme","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","agentProvider","onboardingComplete","betaConsentVersion","detailedTelemetry"];function S(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function g(e){let t={};for(let n of v){if(!(n in e))continue;let r=e[n],o=u[n];o.validate&&!o.validate(r)||o.options&&!o.options.includes(r)||(t[n]=r)}return t}function h(e){let t={};for(let n of v)t[n]=e[n];return t}function _(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(p);return e?g(JSON.parse(e)):{}}catch{return{}}}function V(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(p,JSON.stringify(h(e)))}catch{}}function E(){let t=S()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:g(t)}function K(e){let t=S();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:h(e)})}catch{}}function k(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function j(){let e=k()?.settings;return!e||typeof e!="object"?{}:g(e)}function D(e){if(!k())return;let t={settings:h(e)};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}function b(){let e=_(),t=j(),n=E();return{...e,...t,...n}}function R(e){V(e),K(e),D(e)}function C(e){if(typeof window>"u")return()=>{};let t=i=>{if(!(i.key!==p||i.newValue==null))try{e(g(JSON.parse(i.newValue)))}catch{}};window.addEventListener("storage",t);let n=S(),r;n?.onSharedConfigChanged&&(r=n.onSharedConfigChanged(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))}));let c=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(i=>{let d=i?.settings;!d||typeof d!="object"||e(g(d))});return()=>{window.removeEventListener("storage",t),r?.(),c?.()}}var M=l(),P=b();for(let e of Object.keys(m()))delete P[e];var s={...M,...P},f=[],a=null;function y(){for(let e of f)e();R(s)}C(e=>{let t={...s},n=!1;for(let[r,o]of Object.entries(e)){let c=r;t[c]!==o&&(t[c]=o,n=!0)}if(n){s=t,a=null;for(let r of f)r()}});var L={get(e){return s[e]},set(e,t){let n=u[e];n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]!==t&&(s={...s,[e]:t},e==="deviceModel"&&(a=null),y())},getAll(){return s},apply(e){let t=!1,n={...s};for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let c=r,i=u[c];i&&(i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||n[c]!==o&&(n[c]=o,t=!0))}t&&(s=n,a=null,y())},reset(){s=l(),a=null,y()},subscribe(e){return f.push(e),()=>{f=f.filter(t=>t!==e)}},getDeviceSpec(){return a||(a=w(s.deviceModel)),a},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{L as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=t.indexOf(r);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var f=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function h(t){return typeof t=="string"&&f.has(t)}async function w(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function D(t,e){if(!h(e))return!1;try{return await w(t)}catch{return!1}}async function M(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function H(t,e=5){let n=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}))()`});return{depth:e,tree:n}}async function O(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function B(t,e){let n=`(async () => {
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=t.indexOf(r);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var f=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function h(t){return typeof t=="string"&&f.has(t)}async function x(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function D(t,e){if(!h(e))return!1;try{return await x(t)}catch{return!1}}async function M(t){let e=await t.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof e=="number"?e:0}}async function H(t,e=5){let n=await t.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${e}))()`});return{depth:e,tree:n}}async function O(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}async function B(t,e){let n=`(async () => {
3
3
  const t = window.__sootsimTest
4
4
  const mainShell = window.SootSim?.bridges?.mainShell
5
5
  const kb = window.__sootsimKeyboard
@@ -10,11 +10,73 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
10
10
  shell = typeof mainShell?.getState === 'function' ? await mainShell.getState() : null
11
11
  } catch {}
12
12
 
13
- const tree = await t.dumpTree(12, ${JSON.stringify(e)})
13
+ const opts = ${JSON.stringify(e)}
14
+ const needsRecursiveDump = opts.verbose || opts.subtreeRoot || opts.includeOccluded
15
+ const globToRegex = (glob) => {
16
+ const escaped = String(glob).replace(/[.+^$(){}|[\\]\\\\]/g, '\\\\$&')
17
+ const body = escaped.replace(/\\*/g, '.*').replace(/\\?/g, '.')
18
+ return new RegExp('^' + body + '$', 'i')
19
+ }
20
+ const truncate = (value, max) => {
21
+ const text = typeof value === 'string' ? value.replace(/\\s+/g, ' ').trim() : ''
22
+ return text.length > max ? text.slice(0, max - 1).trimEnd() + '\u2026' : text
23
+ }
24
+ const formatInspectableTree = async () => {
25
+ if (typeof t.listInspectable !== 'function') return null
26
+ const list = await t.listInspectable({})
27
+ if (!Array.isArray(list)) return null
28
+ const filter = typeof opts.filter === 'string' ? opts.filter.toLowerCase() : ''
29
+ const testIdRegex = opts.testIdLike ? globToRegex(opts.testIdLike) : null
30
+ const onlyRegex = opts.onlyGlob ? globToRegex(opts.onlyGlob) : null
31
+ const lines = []
32
+ let matched = 0
33
+ for (const node of list) {
34
+ const testID = node?.testID || node?.testId || ''
35
+ const role = node?.role || ''
36
+ const label = node?.accessibilityLabel || node?.label || ''
37
+ const text = node?.text || ''
38
+ if (testIdRegex && !testIdRegex.test(testID)) continue
39
+ const joined = [role, label, text, testID].filter(Boolean).join(' ')
40
+ if (onlyRegex && !onlyRegex.test(joined)) continue
41
+ if (filter && !joined.toLowerCase().includes(filter)) continue
42
+ matched++
43
+
44
+ const type = String(node?.type || 'node').toLowerCase()
45
+ const handlers = Array.isArray(node?.handlers) ? node.handlers : []
46
+ const parts = []
47
+ if (role) parts.push('[' + role + ']')
48
+ else if (handlers.length > 0) parts.push('[tap]')
49
+ else parts.push('<' + type + '>')
50
+ const visibleText = truncate(text, 50)
51
+ if (visibleText) parts.push(JSON.stringify(visibleText))
52
+ if (testID) parts.push('#' + testID)
53
+ if (label && label !== text) parts.push('label=' + JSON.stringify(truncate(label, 50)))
54
+ if (!opts.hideXy) {
55
+ const abs = node?.absolute || {}
56
+ const layout = node?.layout || {}
57
+ const x = Math.round(Number(abs.x) || 0)
58
+ const y = Math.round(Number(abs.y) || 0)
59
+ const w = Math.round(Number(layout.width) || 0)
60
+ const h = Math.round(Number(layout.height) || 0)
61
+ parts.push('@(' + x + ',' + y + ') ' + w + 'x' + h)
62
+ }
63
+ if (handlers.length > 0) parts.push('(tap)')
64
+ lines.push(' ' + parts.join(' '))
65
+ }
66
+ return { tree: lines.join('\\n'), matched }
67
+ }
68
+
69
+ let tree = ''
70
+ const compactResult = needsRecursiveDump ? null : await formatInspectableTree()
71
+ if (compactResult) {
72
+ tree = compactResult.tree
73
+ } else {
74
+ tree = await t.dumpTree(12, opts)
75
+ }
14
76
  const nodeCount = (await t.getNodeCount?.()) || 0
15
77
  const keyboard = kb && typeof kb.getLayout === 'function' ? kb.getLayout() : null
16
78
  return { tree, shell, nodeCount, keyboard }
17
- })()`;return await t.send({type:"evaluate",code:n})??{}}var x=`(async () => {
79
+ })()`;return await t.send({type:"evaluate",code:n})??{}}var w=`(async () => {
18
80
  const t = window.__sootsimTest
19
81
  if (!t || typeof t.listInspectable !== 'function') return []
20
82
  const list = await t.listInspectable({})
@@ -74,7 +136,7 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
74
136
  fontSize: fontSizeOf(style),
75
137
  }
76
138
  })
77
- })()`;async function C(t){let e=await t.send({type:"evaluate",code:x});return Array.isArray(e)?e:[]}function W(t){return t.length===0?" no visible elements found":t.map(n=>{let s=[n.testID?`#${n.testID}`:n.selector?n.selector:n.role?`[${n.role}]`:`<${n.type}>`,`@(${n.box.x},${n.box.y})`,`${n.box.w}x${n.box.h}`];n.borderRadius>0&&s.push(`radius:${n.borderRadius}`);let o=n.padding;if(o.t||o.r||o.b||o.l){let i=o.t===o.r&&o.r===o.b&&o.b===o.l;s.push(i?`pad:${o.t}`:`pad:${o.t},${o.r},${o.b},${o.l}`)}if(n.fontSize>0&&s.push(`font:${n.fontSize}`),n.text){let i=n.text.length>40?`${n.text.slice(0,39)}\u2026`:n.text;s.push(`"${i}"`)}return` ${s.join(" ")}`}).join(`
139
+ })()`;async function C(t){let e=await t.send({type:"evaluate",code:w});return Array.isArray(e)?e:[]}function W(t){return t.length===0?" no visible elements found":t.map(n=>{let s=[n.testID?`#${n.testID}`:n.selector?n.selector:n.role?`[${n.role}]`:`<${n.type}>`,`@(${n.box.x},${n.box.y})`,`${n.box.w}x${n.box.h}`];n.borderRadius>0&&s.push(`radius:${n.borderRadius}`);let o=n.padding;if(o.t||o.r||o.b||o.l){let i=o.t===o.r&&o.r===o.b&&o.b===o.l;s.push(i?`pad:${o.t}`:`pad:${o.t},${o.r},${o.b},${o.l}`)}if(n.fontSize>0&&s.push(`font:${n.fontSize}`),n.text){let i=n.text.length>40?`${n.text.slice(0,39)}\u2026`:n.text;s.push(`"${i}"`)}return` ${s.join(" ")}`}).join(`
78
140
  `)}var S=`(async () => {
79
141
  const t = window.__sootsimTest
80
142
  if (!t) return []
@@ -148,7 +210,7 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
148
210
  return all
149
211
  .filter(n => isVisibleTarget(n) && hasAccessibleSignal(n))
150
212
  .map(normalize)
151
- })()`;async function F(t){let e=await t.send({type:"evaluate",code:S});return Array.isArray(e)?e:[]}var y=`
213
+ })()`;async function F(t){let e=await t.send({type:"evaluate",code:S});return Array.isArray(e)?e:[]}var p=`
152
214
  const fromInspectable = async () => {
153
215
  if (typeof t.listInspectable !== 'function') return null
154
216
  const list = await t.listInspectable({})
@@ -235,7 +297,7 @@ function N(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n
235
297
  })()`}:t.pressable?{mode:"pressable",code:`(async () => {
236
298
  const t = window.__sootsimTest
237
299
  if (!t) return []
238
- ${y}
300
+ ${p}
239
301
  const inspectable = await fromInspectable()
240
302
  if (inspectable) return inspectable.filter(n => n.pressable && isVisibleTarget(n))
241
303
  const all = await t.queryAll({ pruneHidden: true })
@@ -243,7 +305,7 @@ ${y}
243
305
  })()`}:t.interactive?{mode:"interactive-targets",code:`(async () => {
244
306
  const t = window.__sootsimTest
245
307
  if (!t) return []
246
- ${y}
308
+ ${p}
247
309
  const inspectable = await fromInspectable()
248
310
  if (inspectable) {
249
311
  return inspectable.filter(n => n.pressable && isVisibleTarget(n))
@@ -259,7 +321,7 @@ ${y}
259
321
  const t = window.__sootsimTest
260
322
  if (!t) return null
261
323
  return await t.findByText(${JSON.stringify(t.text)})
262
- })()`}:null}async function z(t,e){let n=v(e);if(!n)return null;let r=await t.send({type:"evaluate",code:n.code});return{mode:n.mode,result:r}}function K(t){return[...t].sort((e,n)=>p(n)-p(e))}function p(t){let e=0;t.testID&&(e+=100),typeof t.text=="string"&&t.text.trim().length>0&&(e+=60),typeof t.accessibilityLabel=="string"&&t.accessibilityLabel.trim().length>0&&(e+=30),t.accessibilityRole&&(e+=15);let n=t.layout?.width??0,r=t.layout?.height??0,s=n*r;return s>=400&&s<=6e4?e+=25:s>6e4&&(e-=20),(t.absolutePosition?.y??0)<0&&(e-=30),e}function V(t){if(t.testID)return`sootsim do tap-id ${g(t.testID)}`;let e=typeof t.text=="string"?t.text.trim():"";if(e.length>0&&e.length<=80)return`sootsim do tap-text ${g(e)}`;let n=Math.round(((t.absolutePosition?.x??0)+(t.layout?.width??0)/2)*10)/10,r=Math.round(((t.absolutePosition?.y??0)+(t.layout?.height??0)/2)*10)/10;return`sootsim do tap ${n} ${r}`}function g(t){return/^[A-Za-z0-9_./@:-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}var T=`(async () => {
324
+ })()`}:null}async function z(t,e){let n=v(e);if(!n)return null;let r=await t.send({type:"evaluate",code:n.code});return{mode:n.mode,result:r}}function j(t){return[...t].sort((e,n)=>y(n)-y(e))}function y(t){let e=0;t.testID&&(e+=100),typeof t.text=="string"&&t.text.trim().length>0&&(e+=60),typeof t.accessibilityLabel=="string"&&t.accessibilityLabel.trim().length>0&&(e+=30),t.accessibilityRole&&(e+=15);let n=t.layout?.width??0,r=t.layout?.height??0,s=n*r;return s>=400&&s<=6e4?e+=25:s>6e4&&(e-=20),(t.absolutePosition?.y??0)<0&&(e-=30),e}function K(t){if(t.testID)return`sootsim do tap-id ${g(t.testID)}`;let e=typeof t.text=="string"?t.text.trim():"";if(e.length>0&&e.length<=80)return`sootsim do tap-text ${g(e)}`;let n=Math.round(((t.absolutePosition?.x??0)+(t.layout?.width??0)/2)*10)/10,r=Math.round(((t.absolutePosition?.y??0)+(t.layout?.height??0)/2)*10)/10;return`sootsim do tap ${n} ${r}`}function g(t){return/^[A-Za-z0-9_./@:-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}var I=`(async () => {
263
325
  const t = window.__sootsimTest
264
326
  let nodes = 0
265
327
  try { nodes = (await t?.getNodeCount?.()) || 0 } catch {}
@@ -354,7 +416,7 @@ ${y}
354
416
  externalStatus,
355
417
  externalError,
356
418
  }
357
- })()`,I=100,k=750,_=2e3;function $(t){return t.targets>0||t.nodes>=I}function J(t){return t.externalError?`guest app errored: ${t.externalError}`:t.loadingText?`still showing "${t.loadingText}"`:t.externalReady===!1?"guest app is still loading":t.flag!==!0?"guest app has not emitted sootsim:externalAppReady":t.targets<=0?"ready flag emitted but no visible app content is inspectable yet":"node tree is still changing"}async function j(t,e=2e4,n={}){let r=Date.now(),s=r+e,o=n.progressIntervalMs??_,i=r+o,u=-1,c=r,a={flag:void 0,at:0,nodes:0,targets:0,errors:0,loadingText:"",externalReady:null,externalStatus:"",externalError:""};for(;Date.now()<s;){try{a=await t.send({type:"evaluate",code:T})??a}catch{}let l=Date.now(),d={ready:!1,elapsedMs:l-r,nodes:a.nodes,targets:a.targets,flag:a.flag,loadingText:a.loadingText,externalReady:a.externalReady,externalStatus:a.externalStatus,externalError:a.externalError,errors:a.errors};if(a.nodes!==u&&(u=a.nodes,c=l),a.flag===!0&&a.externalReady!==!1&&!a.externalError&&!a.loadingText&&$(a)&&l-c>=k)return{...d,ready:!0};if(n.onProgress&&o>0&&l>=i){n.onProgress(d);do i+=o;while(l>=i)}await new Promise(m=>setTimeout(m,150))}return{ready:!1,elapsedMs:Date.now()-r,nodes:a.nodes,targets:a.targets,flag:a.flag,loadingText:a.loadingText,externalReady:a.externalReady,externalStatus:a.externalStatus,externalError:a.externalError,errors:a.errors}}async function G(t,e,n=5e3,r={}){let s=r.gone===!0;return await t.send({type:"evaluate",code:`(async () => {
419
+ })()`,T=100,k=750,R=2e3;function _(t){return t.targets>0||t.nodes>=T}function J(t){return t.externalError?`guest app errored: ${t.externalError}`:t.loadingText?`still showing "${t.loadingText}"`:t.externalReady===!1?"guest app is still loading":t.flag!==!0?"guest app has not emitted sootsim:externalAppReady":t.targets<=0?"ready flag emitted but no visible app content is inspectable yet":"node tree is still changing"}async function V(t,e=2e4,n={}){let r=Date.now(),s=r+e,o=n.progressIntervalMs??R,i=r+o,u=-1,c=r,a={flag:void 0,at:0,nodes:0,targets:0,errors:0,loadingText:"",externalReady:null,externalStatus:"",externalError:""};for(;Date.now()<s;){try{a=await t.send({type:"evaluate",code:I})??a}catch{}let l=Date.now(),d={ready:!1,elapsedMs:l-r,nodes:a.nodes,targets:a.targets,flag:a.flag,loadingText:a.loadingText,externalReady:a.externalReady,externalStatus:a.externalStatus,externalError:a.externalError,errors:a.errors};if(a.nodes!==u&&(u=a.nodes,c=l),a.flag===!0&&a.externalReady!==!1&&!a.externalError&&!a.loadingText&&_(a)&&l-c>=k)return{...d,ready:!0};if(n.onProgress&&o>0&&l>=i){n.onProgress(d);do i+=o;while(l>=i)}await new Promise(m=>setTimeout(m,150))}return{ready:!1,elapsedMs:Date.now()-r,nodes:a.nodes,targets:a.targets,flag:a.flag,loadingText:a.loadingText,externalReady:a.externalReady,externalStatus:a.externalStatus,externalError:a.externalError,errors:a.errors}}async function G(t,e,n=5e3,r={}){let s=r.gone===!0;return await t.send({type:"evaluate",code:`(async () => {
358
420
  const start = Date.now()
359
421
  const deadline = start + ${n}
360
422
  const gone = ${s}
@@ -448,7 +510,7 @@ ${y}
448
510
  const obs = window.__sootsimObservability;
449
511
  if (!obs) return { ok: false };
450
512
  return { ok: true, entries: obs.logs.getSnapshot() };
451
- })()`});return!e||!e.ok?[]:e.entries??[]}async function te(t){await t.send({type:"evaluate",code:'window.__sootsimObservability?.logs.clear(); "cleared"'})}function R(t,e){if(t.source===e.source||t.level!==e.level||Math.abs(t.ts-e.ts)>1e3||t.args.length!==e.args.length)return!1;let n=new Set([t.source,e.source]);return!n.has("sootsim-worker")||!n.has("render-worker")&&!n.has("forwarded-render-worker")?!1:t.args.every((r,s)=>r===e.args[s])}function ne(t,e={}){let n=[];for(let r of t)n.some(s=>R(s,r))||n.push(r);if(e.showInternal||(n=n.filter(r=>{let s=r.args[0];return!(typeof s=="string"&&s.startsWith("[sootsim]"))})),e.level&&(n=n.filter(r=>e.level.has(r.level))),e.filter){let r=e.filter.toLowerCase();n=n.filter(s=>s.args.join(" ").toLowerCase().includes(r))}return n}async function re(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.summary",args:[e]})}async function se(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.recent",args:[e]})}async function oe(t,e,n){await t.send({type:"call",path:"SootSim.bridges.timeline.cursorAdvance",args:[e,n]})}async function ae(t){return await t.send({type:"evaluate",code:`(() => {
513
+ })()`});return!e||!e.ok?[]:e.entries??[]}async function te(t){await t.send({type:"evaluate",code:'window.__sootsimObservability?.logs.clear(); "cleared"'})}function $(t,e){if(t.source===e.source||t.level!==e.level||Math.abs(t.ts-e.ts)>1e3||t.args.length!==e.args.length)return!1;let n=new Set([t.source,e.source]);return!n.has("sootsim-worker")||!n.has("render-worker")&&!n.has("forwarded-render-worker")?!1:t.args.every((r,s)=>r===e.args[s])}function ne(t,e={}){let n=[];for(let r of t)n.some(s=>$(s,r))||n.push(r);if(e.showInternal||(n=n.filter(r=>{let s=r.args[0];return!(typeof s=="string"&&s.startsWith("[sootsim]"))})),e.level&&(n=n.filter(r=>e.level.has(r.level))),e.filter){let r=e.filter.toLowerCase();n=n.filter(s=>s.args.join(" ").toLowerCase().includes(r))}return n}async function re(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.summary",args:[e]})}async function se(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.recent",args:[e]})}async function oe(t,e,n){await t.send({type:"call",path:"SootSim.bridges.timeline.cursorAdvance",args:[e,n]})}async function ae(t){return await t.send({type:"evaluate",code:`(() => {
452
514
  const kb = window.__sootsimKeyboard
453
515
  if (!kb || typeof kb.getLayout !== 'function') {
454
516
  return { error: 'keyboard bridge getLayout() not available' }
@@ -478,7 +540,7 @@ ${y}
478
540
  })()
479
541
  : null
480
542
  return { nav: navSnap, keyboard }
481
- })()`});return{shell:await A(t,500).catch(()=>null),nav:e?.nav??null,keyboard:e?.keyboard??null}}async function le(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.status()"})}async function ue(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.flags()"})}async function ce(t,e){let n=e==="sheets"?"findSheets":"findPortals";return t.send({type:"evaluate",code:`window.__sootsimDebug.${n}()`})}async function de(t,e,n=50){let r=e&&e!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(e)}, ${n})`:`window.__sootsimDebug.recent(undefined, ${n})`;return t.send({type:"evaluate",code:r})}async function ye(t,e,n){let r=n.length>0?n.map(s=>JSON.stringify(s)).join(", "):e==="disable"?"'all'":"";return t.send({type:"evaluate",code:`window.__sootsimDebug.${e}(${r})`})}async function pe(t){return await t.send({type:"evaluate",code:`(async () => {
543
+ })()`});return{shell:await A(t,500).catch(()=>null),nav:e?.nav??null,keyboard:e?.keyboard??null}}async function le(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.status()"})}async function ue(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.flags()"})}async function ce(t,e){let n=e==="sheets"?"findSheets":"findPortals";return t.send({type:"evaluate",code:`window.__sootsimDebug.${n}()`})}async function de(t,e,n=50){let r=e&&e!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(e)}, ${n})`:`window.__sootsimDebug.recent(undefined, ${n})`;return t.send({type:"evaluate",code:r})}async function pe(t,e,n){let r=n.length>0?n.map(s=>JSON.stringify(s)).join(", "):e==="disable"?"'all'":"";return t.send({type:"evaluate",code:`window.__sootsimDebug.${e}(${r})`})}async function ye(t){return await t.send({type:"evaluate",code:`(async () => {
482
544
  const host = window.__sootsimRenderHost
483
545
  const stats = host?.queryStats ? await host.queryStats() : null
484
546
  const hostMem = performance.memory
@@ -493,4 +555,4 @@ ${y}
493
555
  workerHeap: stats?.memory?.workerHeap ?? null,
494
556
  hostHeap: hostMem,
495
557
  }
496
- })()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function ge(t){if(t.total===0)return"nothing recorded";let e=[],n=["error","warning","console","fetch","toast","alert","actionsheet","picker","notification","screen","route","keyboard","app-launch","shell","scroll","gesture","text-input","react-commit","animation","reanimated"],r=new Set;for(let s of n){let o=t.byKind[s];o&&(e.push(`${o} ${s}${o===1?"":"s"}`),r.add(s))}for(let[s,o]of Object.entries(t.byKind))!r.has(s)&&o&&e.push(`${o} ${s}${o===1?"":"s"}`);return e.join(" \xB7 ")}var be=new Set(["react-commit","layout","scroll"]);function P(t,e){if(e===null)return new Date(t).toLocaleTimeString();let n=(t-e)/1e3;return`${n>=0?"+":""}${n.toFixed(2)}s`}function L(t,e){switch(t){case"app-launch":return e.phase==="launch"?`launch ${e.appName??e.toAppId??""}`:`dismiss ${e.appName??e.fromAppId??""} \u2192 ${e.toAppId??""}`;case"toast":return`"${e.text??""}"${e.durationMs?` (${e.durationMs}ms)`:""}`;case"keyboard":return`${e.phase??"?"}${e.heightPx?` h=${e.heightPx}`:""}${e.mode?` ${e.mode}`:""}`;case"screen":return`${e.phase??"?"} ${e.name??e.activeName??""}`;case"route":return`${e.phase??"?"} ${e.path??e.pathname??""}`;case"alert":case"actionsheet":case"picker":return`${e.phase??"?"} ${e.title??e.message??""}`;case"notification":return`${e.title??""}${e.body?` \u2014 ${e.body}`:""}`;case"fetch":return`${e.method??"GET"} ${e.url??""}${e.status?` -> ${e.status}`:""}`;case"console":return`${e.level??"log"}: ${(e.message??"").toString().slice(0,120)}`;case"shell":return`${e.event??e.type??e.phase??""}`;case"scroll":return`${e.phase??"?"} ${e.target??""}`;case"gesture":return`${e.phase??"?"} ${e.type??""}`;case"text-input":return`${e.phase??"?"}${e.value!==void 0?` "${String(e.value).slice(0,40)}"`:""}`;case"layout":return`${e.kind??"?"} ${e.testID??e.type??""}${e.skipped?` skipped:${e.reason??"unknown"}`:""}`;case"react-commit":{let n=e.slowest;return`${e.fiberCount??"?"} fibers ${e.durationMs??"?"}ms${n?.displayName?` \xB7 ${n.displayName} ${n.durationMs??"?"}ms`:""}`}case"reanimated":case"animation":return`${e.kind??""} ${e.target??""}${e.durationMs?` ${e.durationMs}ms`:""}`}return""}function me(t,e){let n=P(t.t,e).padStart(8),r=t.context.padEnd(6),s=`[${t.kind}]`.padEnd(15),o=t.data,i=o&&typeof o=="object"?L(t.kind,o):"";return` ${n} ${r} ${s} ${i}`}export{N as a,D as b,M as c,H as d,O as e,B as f,C as g,W as h,F as i,z as j,K as k,V as l,T as m,k as n,$ as o,J as p,j as q,G as r,Q as s,Y as t,U as u,q as v,X as w,Z as x,ee as y,te as z,ne as A,re as B,se as C,oe as D,ae as E,E as F,A as G,ie as H,le as I,ue as J,ce as K,de as L,ye as M,pe as N,ge as O,be as P,me as Q};
558
+ })()`})??{imageLoader:null,workerHeap:null,hostHeap:null}}function ge(t){if(t.total===0)return"nothing recorded";let e=[],n=["error","warning","console","fetch","toast","alert","actionsheet","picker","notification","screen","route","keyboard","app-launch","shell","scroll","gesture","text-input","react-commit","animation","reanimated"],r=new Set;for(let s of n){let o=t.byKind[s];o&&(e.push(`${o} ${s}${o===1?"":"s"}`),r.add(s))}for(let[s,o]of Object.entries(t.byKind))!r.has(s)&&o&&e.push(`${o} ${s}${o===1?"":"s"}`);return e.join(" \xB7 ")}var be=new Set(["react-commit","layout","scroll"]);function L(t,e){if(e===null)return new Date(t).toLocaleTimeString();let n=(t-e)/1e3;return`${n>=0?"+":""}${n.toFixed(2)}s`}function P(t,e){switch(t){case"app-launch":return e.phase==="launch"?`launch ${e.appName??e.toAppId??""}`:`dismiss ${e.appName??e.fromAppId??""} \u2192 ${e.toAppId??""}`;case"toast":return`"${e.text??""}"${e.durationMs?` (${e.durationMs}ms)`:""}`;case"keyboard":return`${e.phase??"?"}${e.heightPx?` h=${e.heightPx}`:""}${e.mode?` ${e.mode}`:""}`;case"screen":return`${e.phase??"?"} ${e.name??e.activeName??""}`;case"route":return`${e.phase??"?"} ${e.path??e.pathname??""}`;case"alert":case"actionsheet":case"picker":return`${e.phase??"?"} ${e.title??e.message??""}`;case"notification":return`${e.title??""}${e.body?` \u2014 ${e.body}`:""}`;case"fetch":return`${e.method??"GET"} ${e.url??""}${e.status?` -> ${e.status}`:""}`;case"console":return`${e.level??"log"}: ${(e.message??"").toString().slice(0,120)}`;case"shell":return`${e.event??e.type??e.phase??""}`;case"scroll":return`${e.phase??"?"} ${e.target??""}`;case"gesture":return`${e.phase??"?"} ${e.type??""}`;case"text-input":return`${e.phase??"?"}${e.value!==void 0?` "${String(e.value).slice(0,40)}"`:""}`;case"layout":return`${e.kind??"?"} ${e.testID??e.type??""}${e.skipped?` skipped:${e.reason??"unknown"}`:""}`;case"react-commit":{let n=e.slowest;return`${e.fiberCount??"?"} fibers ${e.durationMs??"?"}ms${n?.displayName?` \xB7 ${n.displayName} ${n.durationMs??"?"}ms`:""}`}case"reanimated":case"animation":return`${e.kind??""} ${e.target??""}${e.durationMs?` ${e.durationMs}ms`:""}`}return""}function me(t,e){let n=L(t.t,e).padStart(8),r=t.context.padEnd(6),s=`[${t.kind}]`.padEnd(15),o=t.data,i=o&&typeof o=="object"?P(t.kind,o):"";return` ${n} ${r} ${s} ${i}`}export{N as a,D as b,M as c,H as d,O as e,B as f,C as g,W as h,F as i,z as j,j as k,K as l,I as m,k as n,_ as o,J as p,V as q,G as r,Q as s,Y as t,U as u,q as v,X as w,Z as x,ee as y,te as z,ne as A,re as B,se as C,oe as D,ae as E,E as F,A as G,ie as H,le as I,ue as J,ce as K,de as L,pe as M,ye as N,ge as O,be as P,me as Q};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{execFileSync as h,spawn as g}from"child_process";import{existsSync as s,readdirSync as k}from"fs";import{dirname as m,join as l,resolve as a}from"path";import{fileURLToPath as v}from"url";var c;function p(){if(c!==void 0)return c;try{c=m(v(import.meta.resolve("sootsim-engine/package.json")))}catch{c=null}return c}var I="dev.sootsim.simulator";function x(){let n=p();if(!n)return null;let e=l(n,"dist-electron/main.cjs");if(!s(e))return null;let i=D(n);return i?{path:i,platform:process.platform,kind:"dev-electron",engineDir:n}:null}function b(){let n=p();return n?s(l(n,"src-electron/main.ts")):!1}function D(n){let e=n;for(let i=0;i<6;i++){let t=l(e,"node_modules/.bin/electron");if(s(t))return t;let r=m(e);if(r===e)break;e=r}return null}function C(){let n=p(),i=["/Applications/sootsim.app",a(process.env.HOME||"","Applications/sootsim.app"),...n?[a(n,"app/sootsim.app")]:[]].find(t=>s(t));if(i)return{path:i,platform:"darwin",kind:"mac-app"};try{let t=h("mdfind",[`kMDItemCFBundleIdentifier == "${I}"`],{encoding:"utf8",timeout:3e3}).trim();if(t)return{path:t.split(`
3
3
  `)[0],platform:"darwin",kind:"mac-app"}}catch{}return null}function f(n){if(!s(n))return null;let e=k(n).filter(i=>i.startsWith("sootsim")&&i.endsWith(".AppImage")).sort().reverse()[0];return e?l(n,e):null}function w(){let n=p(),i=[a(process.env.HOME||"","Applications/sootsim.AppImage"),a(process.env.HOME||"",".local/bin/sootsim.AppImage"),"/opt/sootsim/sootsim.AppImage","/opt/sootsim/sootsim",...n?[a(n,"app/sootsim.AppImage"),a(n,"release/linux-unpacked/sootsim")]:[]].find(r=>s(r));if(i)return{path:i,platform:"linux",kind:i.endsWith(".AppImage")?"linux-appimage":"linux-binary"};let t=n?f(a(n,"app"))||f(a(n,"release")):null;return t?{path:t,platform:"linux",kind:"linux-appimage"}:null}function A(){let n=x();if(n)return n;if(b()){let e=p(),i=l(e,"dist-electron/main.cjs");return s(i)?console.error(` no node_modules/.bin/electron found near ${e}. run \`bun install\`.`):console.error(` dist-electron/main.cjs missing in ${e}.
4
4
  run: bun run --cwd packages/sootsim-engine build:electron-main
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{g as u}from"./chunk-344G6B3N.js";var S=52,l=18,h=42,x=96,g=54,E=1.5,$="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",w=1;function y(e){let t=u(e),r=t.scale,o=!t.dynamicIsland&&t.homeIndicatorHeight===0&&t.cornerRadius===0,n=t.width,i=t.height,a=o?t.width+l*2:t.width+28,d=o?t.height+h+x:t.height+28,c=9.5,b=w,p=a+c*2,m=d+w*2,f=c+(o?l:14),B=o?h:14,H=o?S:t.cornerRadius+14,v=[{side:"right",top:t.hardwareButtons.lock.top,height:t.hardwareButtons.lock.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.ringToggle.top,height:t.hardwareButtons.ringToggle.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeUp.top,height:t.hardwareButtons.volumeUp.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeDown.top,height:t.hardwareButtons.volumeDown.height,width:t.hardwareButtons.width}];return{model:e,renderScale:r,outerWidth:Math.round(p*r),outerHeight:Math.round(m*r),logicalOuterWidth:p,logicalOuterHeight:m,logicalFrameWidth:a,logicalFrameHeight:d,logicalFrameLeft:c,logicalFrameTop:b,logicalScreenWidth:n,logicalScreenHeight:i,logicalScreenLeft:f,logicalScreenTop:B,logicalScreenRadius:o?0:t.cornerRadius,logicalFrameRadius:H,frameBackground:o?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:o?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:o?null:$,buttons:v,legacyHomeButton:o?{top:h+t.height+(x-g)/2,left:t.width/2-g/2+l,size:g,ring:E}:null,showHomeIndicator:t.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:t.homeIndicatorHeight}}function L(e){let t=e.side==="right",r=t?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{g as u}from"./chunk-FG6YYUCT.js";var S=52,l=18,h=42,x=96,g=54,E=1.5,$="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",w=1;function y(e){let t=u(e),r=t.scale,o=!t.dynamicIsland&&t.homeIndicatorHeight===0&&t.cornerRadius===0,n=t.width,i=t.height,a=o?t.width+l*2:t.width+28,d=o?t.height+h+x:t.height+28,c=9.5,b=w,p=a+c*2,m=d+w*2,f=c+(o?l:14),B=o?h:14,H=o?S:t.cornerRadius+14,v=[{side:"right",top:t.hardwareButtons.lock.top,height:t.hardwareButtons.lock.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.ringToggle.top,height:t.hardwareButtons.ringToggle.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeUp.top,height:t.hardwareButtons.volumeUp.height,width:t.hardwareButtons.width},{side:"left",top:t.hardwareButtons.volumeDown.top,height:t.hardwareButtons.volumeDown.height,width:t.hardwareButtons.width}];return{model:e,renderScale:r,outerWidth:Math.round(p*r),outerHeight:Math.round(m*r),logicalOuterWidth:p,logicalOuterHeight:m,logicalFrameWidth:a,logicalFrameHeight:d,logicalFrameLeft:c,logicalFrameTop:b,logicalScreenWidth:n,logicalScreenHeight:i,logicalScreenLeft:f,logicalScreenTop:B,logicalScreenRadius:o?0:t.cornerRadius,logicalFrameRadius:H,frameBackground:o?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:o?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:o?null:$,buttons:v,legacyHomeButton:o?{top:h+t.height+(x-g)/2,left:t.width/2-g/2+l,size:g,ring:E}:null,showHomeIndicator:t.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:t.homeIndicatorHeight}}function L(e){let t=e.side==="right",r=t?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
3
3
  <div
4
4
  aria-hidden="true"
5
5
  style="
@@ -0,0 +1 @@
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as i,e as d,h as c}from"./chunk-L7DT6B6A.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.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as i,e as d,h as c}from"./chunk-52XT4NSH.js";function g(r){let e=r[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(r,e,t){let l=i(r,{port:e.port}),s=g(l.positional),a=d({...l,commandTimeoutMs:5e3});try{let n=!!(await c(a,"SootSim.bridges.settings.get"))?.[t.modeKey],o=s==="on"?!0:s==="off"?!1:!n;if(n===o)return console.log(` ${t.displayName}: already ${o?"on":"off"}`),{current:n,target:o,changed:!1};if(!await a.send({type:"evaluate",acquireLock:!0,code:`(async () => {
3
3
  const modeKey = ${JSON.stringify(t.modeKey)}
4
4
  const target = ${JSON.stringify(o)}
5
5
  window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as P,d as T,f as C}from"./chunk-N4KSAFXN.js";import{G as k,H as v}from"./chunk-MPX3A64M.js";import{WebSocket as I}from"ws";function x(){let e=k();return e&&v(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(r,i){super(r),this.name="BridgeSimLockedError",this.lock=i}};function $(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,r={}){let i=new Set,a=r.port??x(),l=r.commandTimeoutMs??15e3,t,m="none",h=new Set(r.stripBooleanFlags??[]),b=new Set(r.stripValueFlags??[]);for(let n=0;n<e.length;n++){let d=e[n];if(d==="--port"||d==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(d.startsWith("--port=")){i.add(n),a=Number(d.slice(7));continue}if(d==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),l=Number(e[n+1])),n++;continue}if(d==="--sim"||d==="--session"||d==="--tab"){i.add(n),n+1<e.length&&(i.add(n+1),t=e[n+1]?.trim()||void 0,m="flag"),n++;continue}let s=d.startsWith("--sim=")?d.slice(6):d.startsWith("--session=")?d.slice(10):d.startsWith("--tab=")?d.slice(6):void 0;if(s!==void 0){i.add(n),t=s.trim()||void 0,m="flag";continue}if(h.has(d)){i.add(n);continue}b.has(d)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,m="saved")}return{positional:e.filter((n,d)=>!i.has(d)),wsPort:a,simId:t,simIdSource:m,commandTimeoutMs:l}}function E(e,r={}){let i=1,a=r.commandTimeoutMs??15e3,l=new Map,t=new I(`ws://localhost:${e}`),m=P(),h=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:m.key,cliIdentitySource:m.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let g=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${g}`))})}),b=!1,n=!1;function d(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",g=$(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${g})
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as P,d as T,f as C}from"./chunk-ZP3CCVT7.js";import{G as k,H as v}from"./chunk-Y4YKDIS6.js";import{WebSocket as I}from"ws";function x(){let e=k();return e&&v(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(r,i){super(r),this.name="BridgeSimLockedError",this.lock=i}};function $(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function N(e,r={}){let i=new Set,a=r.port??x(),l=r.commandTimeoutMs??15e3,t,m="none",h=new Set(r.stripBooleanFlags??[]),b=new Set(r.stripValueFlags??[]);for(let n=0;n<e.length;n++){let d=e[n];if(d==="--port"||d==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(d.startsWith("--port=")){i.add(n),a=Number(d.slice(7));continue}if(d==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),l=Number(e[n+1])),n++;continue}if(d==="--sim"||d==="--session"||d==="--tab"){i.add(n),n+1<e.length&&(i.add(n+1),t=e[n+1]?.trim()||void 0,m="flag"),n++;continue}let s=d.startsWith("--sim=")?d.slice(6):d.startsWith("--session=")?d.slice(10):d.startsWith("--tab=")?d.slice(6):void 0;if(s!==void 0){i.add(n),t=s.trim()||void 0,m="flag";continue}if(h.has(d)){i.add(n);continue}b.has(d)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,m="saved")}return{positional:e.filter((n,d)=>!i.has(d)),wsPort:a,simId:t,simIdSource:m,commandTimeoutMs:l}}function E(e,r={}){let i=1,a=r.commandTimeoutMs??15e3,l=new Map,t=new I(`ws://localhost:${e}`),m=P(),h=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:m.key,cliIdentitySource:m.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let g=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${g}`))})}),b=!1,n=!1;function d(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",g=$(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${g})
3
3
  `)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!b&&(b=!0,process.stderr.write(`
4
4
  \u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
5
5
  taps, scrolls, and keyboard input from multiple agents will collide on
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.127 | (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,2 +1,2 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var t=4001,n="sootsim close";export{t as a,n as b};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as t}from"./chunk-MAFDEPT6.js";import{a as p,b as m,c as a}from"./chunk-BIZBFZJY.js";import{a as r}from"./chunk-EGRWEXWI.js";import{a as l}from"./chunk-JWMYDUYB.js";import{a as u,d}from"./chunk-G3LKP7QV.js";import{B as i}from"./chunk-MPX3A64M.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.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as t}from"./chunk-LF3KGYGE.js";import{a as p,b as m,c as a}from"./chunk-NDGBW36P.js";import{a as r}from"./chunk-FW5SXCE2.js";import{a as l}from"./chunk-MT6WASRO.js";import{a as u,d}from"./chunk-5UWZ47FH.js";import{B as i}from"./chunk-Y4YKDIS6.js";function c(){let o=i();return`sootsim CLI v${l()} \xB7 runtime ${o?`v${o}`:"not installed"}`}function S(){let o=m({bridgePort:7668,defaultShellUrl:r},t()),e=`
3
3
  ${d}
4
4
  `;console.log(`${c()}
5
5
  ${e}${o}
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{F as P,m as v,n as A,o as h,s as I,u as N}from"./chunk-7565HNNY.js";import{d as y,h as B,i as E}from"./chunk-L7DT6B6A.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{F as P,m as v,n as A,o as h,s as I,u as N}from"./chunk-36AO2O2R.js";import{d as y,h as B,i as E}from"./chunk-52XT4NSH.js";var q={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function U(e){return e.includes("--json")}function Y(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
3
3
  `)}function V(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 D(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function k(e,t,...r){return E(e,`SootSim.bridges.mainShell.${t}`,...r)}async function z(e,t={}){try{let r=await D(e,"waitForScreenTransitions",q);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function K(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await k(e,t,...n)}catch(o){if(!P(o)||Date.now()>=s)throw o;await w(50)}}async function Q(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let a=0;a<s;a++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function X(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 w(o)}return null}async function Z(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,d=!1,m={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:v}),g=Date.now()-o,f=Number(i?.nodes)||0,$=Number(i?.targets)||0,x=Number(i?.errors)||0,C=i?.flag===!0,p=i?.externalReady,T=typeof i?.loadingText=="string"?i.loadingText.trim():"",W=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=p,d=R,f!==a&&(a=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,flag:i?.flag,loadingText:T,externalReady:typeof p=="boolean"?p:null,externalStatus:W,externalError:M,errors:x},C&&p!==!1&&!R&&!T&&h({nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!C)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function O(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 _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function F(e,t={}){let r=await e.send({type:"evaluate",code:N});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 I(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.125 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as Ae}from"./chunk-DFMCHE2N.js";import{a as _e}from"./chunk-QZFUBR6C.js";import{a as Ee}from"./chunk-EAQGB3YG.js";import{a as V,b as ye,c as be,d as Z,e as ee,f as ve,g as te,i as re,j as Se,k as xe}from"./chunk-JOM2DZPL.js";import{g as ke,n as Me,p as Ie,t as Pe}from"./chunk-VO6U3ATJ.js";import{d as Te,f as Fe}from"./chunk-SX5TEBK7.js";import{m as ge}from"./chunk-JF5I5XZH.js";import{c as X,d as Q,e as he}from"./chunk-L7DT6B6A.js";import{a as $e}from"./chunk-S33UAEVN.js";import{d as Y}from"./chunk-N4KSAFXN.js";import{a as pe,b as G}from"./chunk-HB7AHLC3.js";import{f as we}from"./chunk-344G6B3N.js";import*as A from"fs";import{tmpdir as Re}from"os";import*as y from"path";import*as g from"fs";import*as w from"path";var L=1e4,B=393,C=852,Ce="__sootsimCliPerf",He="maestroCopiedText",De=new Map;function f(o){return new Promise(e=>setTimeout(e,o))}function qe(o){return o?w.basename(o)===".maestro"?w.dirname(o):o:process.cwd()}function ze(o,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(w.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let i=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():qe(t.flowDir);return w.resolve(i,r)}return w.join(o,r)}function Ge(o){if(typeof o=="string")return{path:o,withFrame:!1};let e=o.path?.trim()||o.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:o.withFrame===!0,layers:o.layers}}function ie(o){let[e,t]=o.split(",").map(i=>i.trim()),r=(i,n)=>i.endsWith("%")?Number.parseFloat(i)/100*n:Number.parseFloat(i);return{x:r(e,B),y:r(t,C)}}function Ye(o){let e=o.split(/^---$/m),t=e.length>1?e[e.length-1]:o,r=be(ye.parse(t),De);return Array.isArray(r)?r:[]}var W=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;simRouteHint=null;lastFailedStep=null;get simId(){return this.opts.simId}setSimRouteHint(e){this.simRouteHint=this.normalizeSimRoute(e)}normalizeSimRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshSimId(){if(this.opts.simId)try{let e=await this.bridge.listSims(),t=e.find(a=>a.id===this.opts.simId);if(t&&(this.simRouteHint=this.normalizeSimRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.simId&&a.readyState==="open")||!this.simRouteHint)return;let i=this.simRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeSimRoute(a.url||a.origin)===this.simRouteHint);if(!i)return;let n=e.find(a=>a.isPrimary&&a.readyState==="open"),s=e.find(a=>a.readyState==="open"),l=i??n??s;l&&(this.opts.simId=l.id,console.log(` [flow] sim rotated to ${l.id}`))}catch{}}async evaluate(e,t){return this.bridge.send({type:"evaluate",simId:this.opts.simId,code:e},t?{timeoutMs:t}:void 0)}async callTest(e,...t){return this.bridge.send({type:"call",simId:this.opts.simId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=L){let t=Date.now()+e,r=Date.now(),i=null,n=0,s=0;for(;Date.now()<t;){try{let a=await this.evaluate(`(async () => {
1
+ /*! sootsim v0.1.127 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as Ae}from"./chunk-3U2ZPTHG.js";import{a as _e}from"./chunk-ZGXZQPYO.js";import{a as Ee}from"./chunk-L2CWZNGS.js";import{a as V,b as ye,c as be,d as Z,e as ee,f as ve,g as te,i as re,j as Se,k as xe}from"./chunk-DQAWYKPD.js";import{g as ke,n as Me,p as Ie,t as Pe}from"./chunk-7JJF24H4.js";import{d as Te,f as Fe}from"./chunk-FGTMXDHE.js";import{m as ge}from"./chunk-6D4U74IK.js";import{c as X,d as Q,e as he}from"./chunk-52XT4NSH.js";import{a as $e}from"./chunk-3DHE4SHG.js";import{d as Y}from"./chunk-ZP3CCVT7.js";import{a as pe,b as G}from"./chunk-HNEBMDYQ.js";import{f as we}from"./chunk-FG6YYUCT.js";import*as A from"fs";import{tmpdir as Re}from"os";import*as y from"path";import*as g from"fs";import*as w from"path";var L=1e4,B=393,C=852,Ce="__sootsimCliPerf",He="maestroCopiedText",De=new Map;function f(o){return new Promise(e=>setTimeout(e,o))}function qe(o){return o?w.basename(o)===".maestro"?w.dirname(o):o:process.cwd()}function ze(o,e,t){let r=e.endsWith(".png")?e:`${e}.png`;if(w.isAbsolute(r))return r;if(t.mode==="flow"&&/[\\/]/.test(r)){let i=r.startsWith("./")||r.startsWith("../")?t.flowDir??process.cwd():qe(t.flowDir);return w.resolve(i,r)}return w.join(o,r)}function Ge(o){if(typeof o=="string")return{path:o,withFrame:!1};let e=o.path?.trim()||o.name?.trim();if(!e)throw new Error("takeScreenshot object form requires path or name");return{path:e,withFrame:o.withFrame===!0,layers:o.layers}}function ie(o){let[e,t]=o.split(",").map(i=>i.trim()),r=(i,n)=>i.endsWith("%")?Number.parseFloat(i)/100*n:Number.parseFloat(i);return{x:r(e,B),y:r(t,C)}}function Ye(o){let e=o.split(/^---$/m),t=e.length>1?e[e.length-1]:o,r=be(ye.parse(t),De);return Array.isArray(r)?r:[]}var W=class{constructor(e,t){this.bridge=e;this.opts=t}stepDelay=0;firstLaunchDone=!1;profilingEnabled=!1;recordingEnabled=!1;recordingAccessChecked=!1;recordingStartedAtMs=null;lastRecordingDurationMs=null;simRouteHint=null;lastFailedStep=null;get simId(){return this.opts.simId}setSimRouteHint(e){this.simRouteHint=this.normalizeSimRoute(e)}normalizeSimRoute(e){if(!e)return null;try{let t=new URL(e);t.searchParams.delete("inspectOpen");let r=t.searchParams.toString();return`${t.origin}${t.pathname}${r?`?${r}`:""}`}catch{return e}}async refreshSimId(){if(this.opts.simId)try{let e=await this.bridge.listSims(),t=e.find(a=>a.id===this.opts.simId);if(t&&(this.simRouteHint=this.normalizeSimRoute(t.url||t.origin)),e.find(a=>a.id===this.opts.simId&&a.readyState==="open")||!this.simRouteHint)return;let i=this.simRouteHint&&e.find(a=>a.readyState==="open"&&this.normalizeSimRoute(a.url||a.origin)===this.simRouteHint);if(!i)return;let n=e.find(a=>a.isPrimary&&a.readyState==="open"),s=e.find(a=>a.readyState==="open"),l=i??n??s;l&&(this.opts.simId=l.id,console.log(` [flow] sim rotated to ${l.id}`))}catch{}}async evaluate(e,t){return this.bridge.send({type:"evaluate",simId:this.opts.simId,code:e},t?{timeoutMs:t}:void 0)}async callTest(e,...t){return this.bridge.send({type:"call",simId:this.opts.simId,path:`__sootsimTest.${e}`,args:t})}async waitForTree(e=L){let t=Date.now()+e,r=Date.now(),i=null,n=0,s=0;for(;Date.now()<t;){try{let a=await this.evaluate(`(async () => {
3
3
  const test = window.__sootsimTest
4
4
  if (!test) return { count: 0, loading: true }
5
5
  const count = (await test.getNodeCount?.()) || 0
@@ -372,7 +372,7 @@ flow extension:
372
372
  + completed (${M.length} steps)`),c>0&&console.log(` screenshots: ${c} \u2192 ${s}`),I&&Oe(I),S&&console.log(` video: ${S}`),console.log()}catch(u){if(r&&!I)try{I=await d.stopProfile()}catch{}if(T&&!S)try{S=await d.stopRecording(),_=d.getLastRecordingDurationMs()}catch(c){console.warn(` recording stop failed: ${c?.message||String(c)}`)}console.error(`
373
373
  x failed: ${u.message}
374
374
  `),I&&(console.log(" partial profile:"),Oe(I)),S&&console.log(` partial video: ${S}`);try{let c=d.lastFailedStep,h=c?`step-${String(c.index+1).padStart(2,"0")}-${c.kind}`:"unstaged",R=y.join(s,h);await d.captureFailureBundle(R,{error:u,stepIndex:c?.index,stepKind:c?.kind,stepTarget:c?.target}),console.log(` failure bundle: ${R}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(c){try{let h=y.join(s,"error.png");await d.captureFailureScreenshot(h),console.log(` error screenshot: ${h}`)}catch{}console.log(` (failure bundle capture failed: ${c instanceof Error?c.message:String(c)})`)}await ge($,{errorsCommand:`sootsim get errors 5${d.simId?` --sim ${d.simId}`:""}`,warningsCommand:`sootsim get warnings 5${d.simId?` --sim ${d.simId}`:""}`,requestsCommand:`sootsim get requests 5${d.simId?` --sim ${d.simId}`:""}`}),O=1}finally{$.close()}if(O===0&&v)try{let u=await et(z??[]),c=["--origin",U,"--events",u];oe&&c.push("--public-origin",oe),S&&c.push("--video",S),S&&_&&Number.isFinite(_)&&c.push("--video-duration-ms",String(Math.round(_))),d.simId&&c.push("--sim",d.simId),Ve&&c.push("--open"),se&&c.push("--owner",se),ne&&c.push("--repo",ne),console.log(`
375
- preparing preview upload\u2026`);let{runUpload:h}=await import("./upload-6PNSQEKU.js");await h(c,{})}catch(u){console.error(` preview upload failed: ${u?.message||u}`),O=1}return J&&(d.simId&&H.add(d.simId),await Ze(b.wsPort,b.commandTimeoutMs,[...H])),await G(),O}async function Ze(o,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let i=Q(o,{commandTimeoutMs:e});try{let n=await i.listSims(),s=r.filter(a=>n.some(m=>m.id===a&&m.readyState==="open"));if(s.length===0)return;let l=await Pe(i,o,e,s);await Me(n,s),l.closed.length>0&&console.log(` closed flow sim(s): ${l.closed.join(", ")}`),l.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${l.remaining.join(", ")}`)}catch(n){console.warn(` warn: failed to close flow sim(s): ${n instanceof Error?n.message:String(n)}`)}finally{i.close()}}async function et(o){let{gzipSync:e}=await import("zlib"),t=o.map(n=>JSON.stringify(n)).join(`
375
+ preparing preview upload\u2026`);let{runUpload:h}=await import("./upload-B6UNK5GQ.js");await h(c,{})}catch(u){console.error(` preview upload failed: ${u?.message||u}`),O=1}return J&&(d.simId&&H.add(d.simId),await Ze(b.wsPort,b.commandTimeoutMs,[...H])),await G(),O}async function Ze(o,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let i=Q(o,{commandTimeoutMs:e});try{let n=await i.listSims(),s=r.filter(a=>n.some(m=>m.id===a&&m.readyState==="open"));if(s.length===0)return;let l=await Pe(i,o,e,s);await Me(n,s),l.closed.length>0&&console.log(` closed flow sim(s): ${l.closed.join(", ")}`),l.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${l.remaining.join(", ")}`)}catch(n){console.warn(` warn: failed to close flow sim(s): ${n instanceof Error?n.message:String(n)}`)}finally{i.close()}}async function et(o){let{gzipSync:e}=await import("zlib"),t=o.map(n=>JSON.stringify(n)).join(`
376
376
  `)+(o.length?`
377
377
  `:""),r=e(Buffer.from(t,"utf8")),i=y.join(Re(),`sootsim-events-${Date.now()}.jsonl.gz`);return A.writeFileSync(i,r),console.log(` events: ${o.length} written to ${i} (${r.length} bytes gz)`),i}async function tt(o){let e=o[0],t=r=>o.find((i,n)=>o[n-1]===r);switch(e){case"start":{let{path:r,state:i}=ve();console.log(" flow draft started"),console.log(` session: ${r}`),console.log(` steps: ${i.steps.length}`);return}case"keep":case"good":{let r=re();if(r.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!r.kept){console.log(" no pending action to keep");return}console.log(` kept: ${r.candidate.summary}`),console.log(` steps: ${r.stepCount}`);return}case"end":{let r=t("--output")||(o[1]&&!o[1].startsWith("-")?o[1]:void 0),i=o.includes("--validate")||o.includes("--video"),n=o.includes("--video"),s=re();s.active&&s.kept&&console.log(` auto-kept trailing action: ${s.candidate.summary}`);let l=Se(r||(i?it():void 0));if(l.active||(console.error(" no active flow draft \u2014 run `sootsim flow start` first"),process.exit(1)),!l.valid){console.error(" flow draft is not valid:");for(let a of l.issues)console.error(` - ${a}`);console.error(" draft preserved \u2014 keep at least one real interaction or run `sootsim flow start` to reset"),process.exit(1)}if(i){let a=ot(o,l.outputPath),m=await Ne(a);if(m!==0){console.error(`
378
378
  validation failed \u2014 draft preserved so you can keep iterating`),process.exitCode=m;return}te(),console.log(` flow draft validated (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath&&console.log(` saved: ${l.outputPath}`),n&&console.log(" video: recorded during validation run");return}if(te(),console.log(` flow draft ended (${l.stepCount} step${l.stepCount===1?"":"s"})`),l.outputPath){console.log(` saved: ${l.outputPath}`),console.log(` next: sootsim flow ${l.outputPath} --record`);return}console.log(""),process.stdout.write(l.yaml);return}case"validate":{let r=o[1];(!r||r.startsWith("-"))&&(console.error(" usage: sootsim flow validate <path>"),process.exit(1));let i=ee(r);if(i.length>0){console.error(` x ${r} failed validation:`);for(let n of i)console.error(` - ${n}`);process.exit(1)}console.log(` + ${r} looks valid`);return}}}function rt(o){return o[0]==="--sim"&&o.length>=2?[...o.slice(2),"--sim",o[1]]:o}async function kt(o){let e=rt(o),t=e[0];if(t==="start"||t==="keep"||t==="good"||t==="end"||t==="validate")return await tt(e),0;let r=await Ne(e);return r!==0&&(process.exitCode=r),r}function Oe(o){let e=o.avgMs>0?(1e3/o.avgMs).toFixed(1):"?",t=o.sampleCount>0?(o.jankFrames/o.sampleCount*100).toFixed(1):"0";console.log(`