sootsim 0.1.73 → 0.1.74

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 (136) hide show
  1. package/dist-cli/bin.js +3 -3
  2. package/dist-cli/chunks/{agent-SW2JYVPF.js → agent-ICM2IR3D.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-EO2WOYDP.js → agent-wrapper-JFUYRDHY.js} +2 -2
  4. package/dist-cli/chunks/{assert-PY5JI2AM.js → assert-YEM4SRV6.js} +2 -2
  5. package/dist-cli/chunks/auto-bootstrap-D2IMKRRD.js +2 -0
  6. package/dist-cli/chunks/beta-LEHZTTTV.js +2 -0
  7. package/dist-cli/chunks/{chunk-QDYFRHQK.js → chunk-27A45VIL.js} +2 -2
  8. package/dist-cli/chunks/{chunk-UJUJJDJH.js → chunk-2LR6NOP2.js} +2 -2
  9. package/dist-cli/chunks/{chunk-GYXN4445.js → chunk-3HWWX5E3.js} +2 -2
  10. package/dist-cli/chunks/{chunk-G6Y6PFGR.js → chunk-5DR2FIO5.js} +2 -2
  11. package/dist-cli/chunks/{chunk-FVQOPALM.js → chunk-5JZ6Z32G.js} +2 -2
  12. package/dist-cli/chunks/chunk-63G2GUFJ.js +2 -0
  13. package/dist-cli/chunks/chunk-6TJBW53J.js +1 -0
  14. package/dist-cli/chunks/{chunk-ODLY2N63.js → chunk-6U6RQ6NC.js} +2 -2
  15. package/dist-cli/chunks/chunk-A7HWACJO.js +1 -0
  16. package/dist-cli/chunks/{chunk-WCM7INZL.js → chunk-C6RVANMG.js} +3 -3
  17. package/dist-cli/chunks/{chunk-6SLYUGPA.js → chunk-CIHPCQIH.js} +1 -1
  18. package/dist-cli/chunks/{chunk-K2KVNO7W.js → chunk-CTIBRJOB.js} +1 -1
  19. package/dist-cli/chunks/{chunk-HPJIWPPC.js → chunk-DHMFHEWO.js} +1 -1
  20. package/dist-cli/chunks/{chunk-VB7Z7JWH.js → chunk-DPEKE6KI.js} +1 -1
  21. package/dist-cli/chunks/{chunk-XCFP4FKE.js → chunk-FLPSZKTX.js} +2 -2
  22. package/dist-cli/chunks/{chunk-SPWIBWDN.js → chunk-FMZY67DH.js} +1 -1
  23. package/dist-cli/chunks/{chunk-P3WJGZTF.js → chunk-G7YSDJ47.js} +1 -1
  24. package/dist-cli/chunks/{chunk-6EMLKJ4H.js → chunk-GUEPTURI.js} +1 -1
  25. package/dist-cli/chunks/chunk-GWXDYAFY.js +1 -0
  26. package/dist-cli/chunks/{chunk-AZGYCSFY.js → chunk-H3OREY3F.js} +2 -2
  27. package/dist-cli/chunks/{chunk-M4QW7HLC.js → chunk-HYHZ6RNF.js} +2 -2
  28. package/dist-cli/chunks/chunk-I56WNY6G.js +119 -0
  29. package/dist-cli/chunks/{chunk-LVLOAXDS.js → chunk-JXMRUEWU.js} +6 -5
  30. package/dist-cli/chunks/{chunk-6K2OMU5N.js → chunk-K2VUO3X2.js} +2 -2
  31. package/dist-cli/chunks/{chunk-SL4MHVAB.js → chunk-K3SEMIKF.js} +2 -2
  32. package/dist-cli/chunks/{chunk-LAZ7FFOW.js → chunk-KXOXMNFV.js} +2 -2
  33. package/dist-cli/chunks/{chunk-GOU7IGMA.js → chunk-LP6PSZDR.js} +2 -2
  34. package/dist-cli/chunks/{chunk-JJQQMLVH.js → chunk-M4E2KH4M.js} +2 -2
  35. package/dist-cli/chunks/{chunk-7LR7PVW4.js → chunk-PWXZFYQK.js} +2 -2
  36. package/dist-cli/chunks/{chunk-HKLWUXFK.js → chunk-Q33MTWNZ.js} +2 -2
  37. package/dist-cli/chunks/{chunk-34TWXW7Z.js → chunk-RI4ITM2W.js} +1 -1
  38. package/dist-cli/chunks/{chunk-VEMJA4YX.js → chunk-RVPUXBNC.js} +3 -3
  39. package/dist-cli/chunks/{chunk-2WOD3LBI.js → chunk-SMNILGN7.js} +2 -2
  40. package/dist-cli/chunks/chunk-UJ3GDA34.js +2 -0
  41. package/dist-cli/chunks/{chunk-YVKR7SWO.js → chunk-VQYMMPDN.js} +2 -2
  42. package/dist-cli/chunks/{chunk-MRFTVZDW.js → chunk-VWFDFIPL.js} +2 -2
  43. package/dist-cli/chunks/{chunk-RRPKIYG7.js → chunk-WB6M53YK.js} +2 -2
  44. package/dist-cli/chunks/{chunk-ZGHJUI77.js → chunk-WC5LXGUR.js} +1 -1
  45. package/dist-cli/chunks/{chunk-RA3I4BJI.js → chunk-WIMYX5KS.js} +1 -1
  46. package/dist-cli/chunks/{chunk-3OCOCDGT.js → chunk-YAAFZCFV.js} +3 -3
  47. package/dist-cli/chunks/{chunk-UASODA4K.js → chunk-YEAJZSES.js} +1 -1
  48. package/dist-cli/chunks/{chunk-5OJK5LYU.js → chunk-YUSYVLWH.js} +2 -2
  49. package/dist-cli/chunks/{chunk-742HTWNM.js → chunk-YVQOKBWA.js} +1 -1
  50. package/dist-cli/chunks/{chunk-YXZHBYID.js → chunk-ZF2JD3AH.js} +1 -1
  51. package/dist-cli/chunks/cli-version-6UUGWGRT.js +2 -0
  52. package/dist-cli/chunks/{compat-4TPMCNAE.js → compat-BLQPNMHM.js} +3 -3
  53. package/dist-cli/chunks/{config-ILFOUQJM.js → config-ED3I6M2J.js} +2 -2
  54. package/dist-cli/chunks/{control-OWLNXD2F.js → control-EOP4YTGC.js} +2 -2
  55. package/dist-cli/chunks/{cpu-profile-VKLUDIWH.js → cpu-profile-FRTFJGQE.js} +2 -2
  56. package/dist-cli/chunks/{daemon-ATQGFZTH.js → daemon-JHIYKE5I.js} +2 -2
  57. package/dist-cli/chunks/{debug-4Y5ICJVS.js → debug-L24VAAAH.js} +3 -3
  58. package/dist-cli/chunks/demo-app-registry-WJVXQHOV.js +2 -0
  59. package/dist-cli/chunks/{detox-N7C6N2G6.js → detox-4ERYJEBG.js} +2 -2
  60. package/dist-cli/chunks/{device-COHW52UV.js → device-7AF7FWY6.js} +2 -2
  61. package/dist-cli/chunks/{diagnose-HOHSNKU2.js → diagnose-EBVIZPLT.js} +2 -2
  62. package/dist-cli/chunks/drivers-UYPTYLEX.js +2 -0
  63. package/dist-cli/chunks/{electron-ZKAWZYPP.js → electron-6TKRHPLC.js} +3 -3
  64. package/dist-cli/chunks/flow-EYIYZEMV.js +2 -0
  65. package/dist-cli/chunks/{hints-6YEZ3CHA.js → hints-LG6Q2IHA.js} +2 -2
  66. package/dist-cli/chunks/{home-paths-4J2QXP5S.js → home-paths-VPE5WQXV.js} +2 -2
  67. package/dist-cli/chunks/{inspect-XVHQ25HJ.js → inspect-3FXRWDUZ.js} +3 -3
  68. package/dist-cli/chunks/install-ABZAAUCG.js +2 -0
  69. package/dist-cli/chunks/{install-desktop-2LYXUCKU.js → install-desktop-EORTVZKX.js} +3 -3
  70. package/dist-cli/chunks/{keys-HVV6DUSK.js → keys-XYJL7B24.js} +2 -2
  71. package/dist-cli/chunks/{launch-UUHH3TZU.js → launch-N4BLHRFE.js} +3 -3
  72. package/dist-cli/chunks/{login-3RO6QARB.js → login-QZ4XHZTO.js} +4 -4
  73. package/dist-cli/chunks/{logout-GRDAYZ44.js → logout-5FRXIM5B.js} +2 -2
  74. package/dist-cli/chunks/{maestro-N3FBWTNP.js → maestro-JAT4S4KG.js} +2 -2
  75. package/dist-cli/chunks/{preview-CY4346UC.js → preview-BZLOGTZY.js} +2 -2
  76. package/dist-cli/chunks/{profile-HXOUKA4R.js → profile-HJ2UP5NW.js} +2 -2
  77. package/dist-cli/chunks/{react-4J5QOUJA.js → react-KDZANJ4F.js} +2 -2
  78. package/dist-cli/chunks/{record-2JLCQ2FZ.js → record-XUCGOIUY.js} +2 -2
  79. package/dist-cli/chunks/runtime-AK263273.js +2 -0
  80. package/dist-cli/chunks/{runtime-delivery-BKYWXH3W.js → runtime-delivery-MBSKMVJ3.js} +2 -2
  81. package/dist-cli/chunks/{screenshot-CNNVQFQ2.js → screenshot-4ZYWVBLL.js} +2 -2
  82. package/dist-cli/chunks/{screenshot-mode-JVSFP7VK.js → screenshot-mode-3NIQQBOQ.js} +2 -2
  83. package/dist-cli/chunks/{screenshots-WQZKOILE.js → screenshots-YE7JXASF.js} +2 -2
  84. package/dist-cli/chunks/{server-YGVOWKPO.js → server-L4TIWW5I.js} +2 -2
  85. package/dist-cli/chunks/setup-repo-C25IUKCT.js +2 -0
  86. package/dist-cli/chunks/{skills-2QTH66LZ.js → skills-DHGINBI6.js} +2 -2
  87. package/dist-cli/chunks/{start-CIZKCHP3.js → start-Q3XDXBRY.js} +4 -4
  88. package/dist-cli/chunks/store-FP2IGXW7.js +2 -0
  89. package/dist-cli/chunks/telemetry-H2HZFBM3.js +2 -0
  90. package/dist-cli/chunks/{test-4BLC6GOA.js → test-HP3EZPX7.js} +3 -3
  91. package/dist-cli/chunks/{three-mode-6R4RFOBE.js → three-mode-VCKTQFZA.js} +2 -2
  92. package/dist-cli/chunks/{timeline-NYQB3AED.js → timeline-RISUYTRT.js} +2 -2
  93. package/dist-cli/chunks/{upgrade-LZCXPLDS.js → upgrade-4XSHIJ2Z.js} +2 -2
  94. package/dist-cli/chunks/upload-AVQNF2CZ.js +2 -0
  95. package/dist-cli/chunks/{web-CDNAUTDO.js → web-JGAPJJM5.js} +2 -2
  96. package/dist-cli/chunks/{what-happened-ZHIENSWK.js → what-happened-EKY5HFW3.js} +2 -2
  97. package/dist-cli/chunks/{whoami-4PSGWETO.js → whoami-7VQQA55G.js} +2 -2
  98. package/dist-lib/agent-daemon-client.cjs +1 -1
  99. package/dist-lib/agent-events.cjs +1 -1
  100. package/dist-lib/agent-sessions.cjs +1 -1
  101. package/dist-lib/attached-projects.cjs +1 -1
  102. package/dist-lib/auth/shared-session.cjs +1 -1
  103. package/dist-lib/backend-origin.cjs +1 -1
  104. package/dist-lib/bridge-constants.cjs +1 -1
  105. package/dist-lib/cli-constants.cjs +1 -1
  106. package/dist-lib/config.cjs +1 -1
  107. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  108. package/dist-lib/home-paths.cjs +1 -1
  109. package/dist-lib/host/bridge-host.cjs +1 -1
  110. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  111. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  112. package/dist-lib/index.cjs +1 -1
  113. package/dist-lib/metro.cjs +1 -1
  114. package/dist-lib/profiles.cjs +1 -1
  115. package/dist-lib/render-mode.cjs +1 -1
  116. package/dist-lib/vite-base.cjs +1 -1
  117. package/dist-lib/vite.cjs +1 -1
  118. package/package.json +1 -1
  119. package/dist-cli/chunks/auto-bootstrap-NWH74JAV.js +0 -2
  120. package/dist-cli/chunks/beta-IFJKR2TQ.js +0 -2
  121. package/dist-cli/chunks/chunk-5CPW2643.js +0 -1
  122. package/dist-cli/chunks/chunk-FWROUGUO.js +0 -2
  123. package/dist-cli/chunks/chunk-H532JOZV.js +0 -2
  124. package/dist-cli/chunks/chunk-IZ3CWZNF.js +0 -119
  125. package/dist-cli/chunks/chunk-OAATHYER.js +0 -1
  126. package/dist-cli/chunks/chunk-OYRL6RAD.js +0 -1
  127. package/dist-cli/chunks/cli-version-5UHOEZTW.js +0 -2
  128. package/dist-cli/chunks/demo-app-registry-HQVTQIKZ.js +0 -2
  129. package/dist-cli/chunks/drivers-YFPP36NV.js +0 -2
  130. package/dist-cli/chunks/flow-AHV3ENLY.js +0 -2
  131. package/dist-cli/chunks/install-JR57X6Y4.js +0 -2
  132. package/dist-cli/chunks/runtime-H4NZF64R.js +0 -2
  133. package/dist-cli/chunks/setup-repo-XYPPB2UA.js +0 -2
  134. package/dist-cli/chunks/store-6GSASPZT.js +0 -2
  135. package/dist-cli/chunks/telemetry-FMUIUQIW.js +0 -2
  136. package/dist-cli/chunks/upload-DLFGYLCF.js +0 -2
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ var O="sootsim close";export{O as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as k,c as T,e as C}from"./chunk-YXZHBYID.js";import{E as v,F as P}from"./chunk-ZGHJUI77.js";import{WebSocket as I}from"ws";function $(){let e=v();return e&&P(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(t,i){super(t),this.name="BridgeSimLockedError",this.lock=i}};function F(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function R(e,t={}){let i=new Set,d=t.port??$(),a=t.commandTimeoutMs??15e3,r,g="none",p=new Set(t.stripBooleanFlags??[]),y=new Set(t.stripValueFlags??[]);for(let n=0;n<e.length;n++){let l=e[n];if(l==="--port"||l==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),d=Number(e[n+1])),n++;continue}if(l.startsWith("--port=")){i.add(n),d=Number(l.slice(7));continue}if(l==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(l==="--sim"){i.add(n),n+1<e.length&&(i.add(n+1),r=e[n+1]?.trim()||void 0,g="flag"),n++;continue}if(p.has(l)){i.add(n);continue}y.has(l)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!r){let n=T();n&&(r=n.trim()||void 0,g="saved")}return{positional:e.filter((n,l)=>!i.has(l)),wsPort:d,simId:r,simIdSource:g,commandTimeoutMs:a}}function W(e,t={}){let i=1,d=t.commandTimeoutMs??15e3,a=new Map,r=new I(`ws://localhost:${e}`),g=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:k(),p=new Promise((s,o)=>{r.on("open",()=>{try{r.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:g.key,cliIdentitySource:g.source,cliLabel:t.cliLabel}))}catch{}s()}),r.on("error",c=>{let m=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${m}`))})}),y=!1,n=!1;function l(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",m=F(o?t.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as k,c as T,e as C}from"./chunk-ZF2JD3AH.js";import{E as v,F as P}from"./chunk-WC5LXGUR.js";import{WebSocket as I}from"ws";function $(){let e=v();return e&&P(e)?e.bridgePort:7668}var w=class extends Error{lock;constructor(t,i){super(t),this.name="BridgeSimLockedError",this.lock=i}};function F(e){return e==="flag"?"via --sim":e==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function R(e,t={}){let i=new Set,d=t.port??$(),a=t.commandTimeoutMs??15e3,r,g="none",p=new Set(t.stripBooleanFlags??[]),y=new Set(t.stripValueFlags??[]);for(let n=0;n<e.length;n++){let l=e[n];if(l==="--port"||l==="-p"){i.add(n),n+1<e.length&&(i.add(n+1),d=Number(e[n+1])),n++;continue}if(l.startsWith("--port=")){i.add(n),d=Number(l.slice(7));continue}if(l==="--timeout"){i.add(n),n+1<e.length&&(i.add(n+1),a=Number(e[n+1])),n++;continue}if(l==="--sim"){i.add(n),n+1<e.length&&(i.add(n+1),r=e[n+1]?.trim()||void 0,g="flag"),n++;continue}if(p.has(l)){i.add(n);continue}y.has(l)&&(i.add(n),n+1<e.length&&i.add(n+1),n++)}if(!r){let n=T();n&&(r=n.trim()||void 0,g="saved")}return{positional:e.filter((n,l)=>!i.has(l)),wsPort:d,simId:r,simIdSource:g,commandTimeoutMs:a}}function W(e,t={}){let i=1,d=t.commandTimeoutMs??15e3,a=new Map,r=new I(`ws://localhost:${e}`),g=t.simId?{key:`sim:${t.simId}`,source:"explicit-sim-id",stable:!0}:k(),p=new Promise((s,o)=>{r.on("open",()=>{try{r.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:g.key,cliIdentitySource:g.source,cliLabel:t.cliLabel}))}catch{}s()}),r.on("error",c=>{let m=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${e}${m}`))})}),y=!1,n=!1;function l(s,o){if(n||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||s.startsWith("bridge:")||s==="focus"||s==="close")return;n=!0;let c=o??"primary",m=F(o?t.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
3
3
  `)}return r.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=a.get(o.id);c&&(a.delete(o.id),o.i>0&&!y&&(y=!0,process.stderr.write(`
4
4
  \u26A0 ${o.i} other CLI identity/identities are driving this sim
5
5
  taps, scrolls, and keyboard input from multiple agents will collide on
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as i,e as d,h as c}from"./chunk-YVKR7SWO.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.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as i,e as d,h as c}from"./chunk-VQYMMPDN.js";function g(r){let e=r[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function u(r,e,t){let l=i(r,{port:e.port}),s=g(l.positional),a=d({...l,commandTimeoutMs:5e3});try{let n=!!(await c(a,"SootSim.bridges.settings.get"))?.[t.modeKey],o=s==="on"?!0:s==="off"?!1:!n;if(n===o)return console.log(` ${t.displayName}: already ${o?"on":"off"}`),{current:n,target:o,changed:!1};if(!await a.send({type:"evaluate",acquireLock:!0,code:`(async () => {
3
3
  const modeKey = ${JSON.stringify(t.modeKey)}
4
4
  const target = ${JSON.stringify(o)}
5
5
  window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as y}from"./chunk-YXZHBYID.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.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as y}from"./chunk-ZF2JD3AH.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as p}from"fs";import{tmpdir as m}from"os";import{dirname as v,join as w}from"path";var d=new Map;function s(e,r){d.set(e,r)}var c=1;function i(){return w(m(),`sootsim-cli-hints-${y()}.json`)}function l(){return w(m(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:c,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==c||!r?.shown?{version:c,shown:{}}:r}catch{return{version:c,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
3
3
  `)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let n=Date.now();if(r==="once-per-identity"){let t=u(i());return t.shown[e]?!1:(t.shown[e]=n,f(i(),t),!0)}if(r==="once-ever"){let t=u(l());return t.shown[e]?!1:(t.shown[e]=n,f(l(),t),!0)}if(typeof r=="object"&&"cooldownMs"in r){let t=u(i()),a=t.shown[e]??0;return n-a<r.cooldownMs?!1:(t.shown[e]=n,f(i(),t),!0)}return!0}function k(e,...r){let o=d.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let n=o.render(...r);if(n==null)return!1;let t=Array.isArray(n)?n:[n],a=o.stream==="error"?console.error:console.log;for(let g of t)a(` hint: ${g}`);return!0}function M(){p(i(),{force:!0})}function O(){p(l(),{force:!0})}function T(){return Array.from(d.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});s("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{k as a,M as b,O as c,T as d};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import r from"node:fs";import{homedir as O}from"node:os";import n from"node:path";var L="SOOTSIM_HOME",E="active",A="daemon.json",j="config.json",I=3e4;function c(){let e=process.env[L];return e&&e.length>0?n.resolve(e):n.join(O(),".sootsim")}function K(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return r.realpathSync(t).includes(`${n.sep}packages${n.sep}sootsim${n.sep}`)}catch{return!1}}function f(){return n.join(c(),"runtimes")}function _(e){return n.join(f(),e)}function D(){return n.join(f(),E)}function S(){return n.join(c(),"electron")}function U(){return n.join(S(),"userData")}function Y(e){return n.join(S(),e)}function N(){return n.join(c(),"profiles")}function F(){return n.join(c(),"daemon-app")}function T(){return n.join(F(),"SootSim Daemon.app")}function G(){return n.join(T(),"Contents","MacOS","sootsim-daemon")}function C(){return n.join(c(),"cache")}function p(){return n.join(c(),A)}function d(){return n.join(c(),j)}function v(){try{let e=r.readFileSync(d(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function M(e){y();let t=v(),s={...t,...e};e.settings&&typeof e.settings=="object"&&(s.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let u=`${d()}.tmp`;return r.writeFileSync(u,`${JSON.stringify(s,null,2)}
3
3
  `,"utf8"),r.renameSync(u,d()),s}function X(){return v().telemetry!==!1}function q(e){M({telemetry:e})}function y(){r.mkdirSync(c(),{recursive:!0}),r.mkdirSync(f(),{recursive:!0}),r.mkdirSync(S(),{recursive:!0}),r.mkdirSync(N(),{recursive:!0}),r.mkdirSync(C(),{recursive:!0})}function w(){try{let e=r.readFileSync(D(),"utf8").trim();return e.length>0?e:null}catch{return null}}function z(e){r.mkdirSync(f(),{recursive:!0}),r.writeFileSync(D(),`${e}
4
4
  `,"utf8")}function Q(){try{return r.readdirSync(f(),{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).sort(P)}catch{return[]}}function P(e,t){let s=i=>{let a=i.indexOf("-"),l=a>=0?i.slice(0,a):i,k=a>=0?i.slice(a+1):"",b=l.split(".").map(g=>Number.parseInt(g,10));return b.some(g=>!Number.isFinite(g))?[[Number.POSITIVE_INFINITY],i]:[b,k]},[u,o]=s(e),[x,m]=s(t);for(let i=0;i<Math.max(u.length,x.length);i++){let a=u[i]??0,l=x[i]??0;if(a!==l)return a-l}return o===m?0:o?m?o<m?-1:1:-1:1}function W(){let e=w();if(!e)return null;let t=_(e);try{if(r.statSync(t).isDirectory())return t}catch{}return null}var h=16*1024;function R(){try{let e=r.openSync(p(),"r");try{let t=Buffer.alloc(h),s=r.readSync(e,t,0,h,0),u=t.subarray(0,s).toString("utf8"),o=JSON.parse(u);return o&&o.schema===1&&typeof o.pid=="number"&&typeof o.bridgePort=="number"&&typeof o.runtimePort=="number"&&typeof o.startedAt=="number"&&typeof o.heartbeatAt=="number"?o:null}finally{r.closeSync(e)}}catch{return null}}function $(e,t=Date.now()){if(!e||t-e.heartbeatAt>I)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function H(e){y();let t=`${p()}.tmp`;r.writeFileSync(t,`${JSON.stringify(e,null,2)}
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var o={width:3,lock:{top:253,height:103},ringToggle:{top:152,height:32},volumeUp:{top:214,height:61},volumeDown:{top:290,height:61}},m={width:2.5,lock:{top:130,height:78},ringToggle:{top:94,height:22},volumeUp:{top:126,height:48},volumeDown:{top:188,height:48}},c={width:3,lock:{top:238,height:78},ringToggle:{top:-1e3,height:0},volumeUp:{top:336,height:62},volumeDown:{top:408,height:62}},p={width:3,lock:{top:248,height:72},ringToggle:{top:-1e3,height:0},volumeUp:{top:144,height:62},volumeDown:{top:216,height:62}},r=48;function t(e){return{...e,platform:"ios",navigationBarHeight:0,navigationBarMode:e.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:e.dynamicIsland?e.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:e.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:e.name}}var h={"iphone-se":t({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:m}),"iphone-14":t({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:55,dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15":t({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-plus":t({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro":t({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-15-pro-max":t({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:o}),"iphone-16":t({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-plus":t({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro":t({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-16-pro-max":t({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17":t({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:37.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-air":t({name:"iPhone 17 Air",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro":t({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"iphone-17-pro-max":t({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:58,dynamicIsland:{width:126,height:38},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:o}),"ipad-pro-13":t({name:'iPad Pro 13"',width:1032,height:1376,scale:2,statusBarHeight:24,homeIndicatorHeight:20,cornerRadius:18,dynamicIsland:null,safeAreaInsets:{top:24,bottom:20,left:0,right:0},iosVersion:"18.2",physicalPPI:264,hardwareButtons:o}),"pixel-8":{platform:"android",name:"Pixel 8",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:412,height:915,scale:2.625,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:39,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:48,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:c},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:c},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:p},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:824,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:r,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:r,left:0,right:0},osVersion:"15",iosVersion:"",androidApiLevel:35,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:p}},u="iphone-17-pro";function S(e){return h[e]}function g(){return Object.keys(h)}var i={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"ipad-13":{name:"ipad-13",label:'iPad 13"',width:2064,height:2752,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},s={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},v={color:"#25c3ec",blur:120,spread:52,opacity:.34},w="iphone-17-pro";var f=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],B=Object.fromEntries(f.map(e=>[e.name,e.value]));function x(e){return Object.prototype.hasOwnProperty.call(i,e)?i[e]:null}function b(e){return{type:e.type,color:e.color,direction:e.direction,glow:e.glow,stops:e.stops?.map(n=>({...n}))}}function I(e){return Object.prototype.hasOwnProperty.call(s,e)?b(s[e]):null}var d={deviceModel:{type:"enum",default:u,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:g(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:e=>e>=.5&&e<=2},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showTopBar:{type:"boolean",default:!0,description:"show simulator top bar",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(i),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(s),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},errorReporting:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"},onboardingComplete:{type:"boolean",default:!1,description:"first-run onboarding completed",group:"beta"},betaConsentVersion:{type:"number",default:0,description:"last accepted beta telemetry policy version",group:"beta"},detailedTelemetry:{type:"boolean",default:!0,description:"send detailed usage telemetry (sessions, perf samples)",group:"beta"}};function y(){if(typeof window>"u")return{};let e={};try{let n=new URLSearchParams(window.location.search),a=n.get("device");a&&d.deviceModel.options?.includes(a)&&(e.deviceModel=a);let l=n.get("colorScheme")??n.get("theme");l&&d.colorScheme.options?.includes(l)&&(e.colorScheme=l)}catch{}return e}function R(){let e={};for(let[n,a]of Object.entries(d))e[n]=a.default;return Object.assign(e,y()),e}export{v as a,w as b,x as c,b as d,I as e,h as f,S as g,g as h,d as i,y as j,R as k};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as l}from"./chunk-YVKR7SWO.js";import{E as c,F as m,g as p,i as h,z as w}from"./chunk-ZGHJUI77.js";import{closeSync as v,existsSync as f,openSync as P,readSync as S,statSync as g}from"fs";import{homedir as k}from"os";import{resolve as T}from"path";import{WebSocket as D}from"ws";var E=6e4;async function L(){let t=w();if(t&&f(h(t)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:e}=await import("./runtime-H4NZF64R.js");await e(["install"],{})}function I(t,e){return x(t)??e??l()}async function $(t=l(),e=E){if(await u(t,250)||await u(t,1500))return;let n=c();if(n&&m(n)){if(n.bootstrapping===!0&&(await b(e),await u(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}if(p())throw new Error(`sootsim bridge daemon is not running on port ${t}.
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as l}from"./chunk-VQYMMPDN.js";import{E as c,F as m,g as p,i as h,z as w}from"./chunk-WC5LXGUR.js";import{closeSync as v,existsSync as f,openSync as P,readSync as S,statSync as g}from"fs";import{homedir as k}from"os";import{resolve as T}from"path";import{WebSocket as D}from"ws";var E=6e4;async function L(){let t=w();if(t&&f(h(t)))return;console.log(" first run \u2014 installing sootsim engine runtime (~6 MB)...");let{runRuntime:e}=await import("./runtime-AK263273.js");await e(["install"],{})}function I(t,e){return x(t)??e??l()}async function $(t=l(),e=E){if(await u(t,250)||await u(t,1500))return;let n=c();if(n&&m(n)){if(n.bootstrapping===!0&&(await b(e),await u(n.bridgePort,500)))return;throw new Error(`sootsim daemon lockfile is fresh (port ${n.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`)}if(p())throw new Error(`sootsim bridge daemon is not running on port ${t}.
3
3
  dev checkouts skip the auto-install of the persistent launchd / systemd
4
4
  agent. start the daemon manually in another shell with:
5
5
  bun sootsim server
6
- (set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-ATQGFZTH.js");try{await o({port:t,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
6
+ (set SOOTSIM_FORCE_DAEMON_INSTALL=1 to allow auto-install from this repo.)`);console.log(" registering sootsim bridge daemon...");let{daemonInstall:o}=await import("./daemon-JHIYKE5I.js");try{await o({port:t,force:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`${s}
7
7
  if this keeps failing, run \`sootsim daemon uninstall\` and retry, or run \`sootsim server\` in a persistent shell as a workaround.`)}console.log(" waiting for runtime to come online...");let i=process.platform==="darwin"?B():null;try{await b(e);let r=Date.now()+5e3;for(;Date.now()<r;){if(await u(t,500))return;await new Promise(s=>setTimeout(s,200))}throw new Error(`daemon registered but the bridge never bound on port ${t} \u2014 see ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}finally{i?.stop()}}async function C(t=l()){await L(),await $(t)}function x(t){for(let e=0;e<t.length;e++){let n=t[e];if((n==="--port"||n==="-p")&&t[e+1]){let o=Number(t[e+1]);return Number.isFinite(o)?o:void 0}if(n.startsWith("--port=")){let o=Number(n.slice(7));return Number.isFinite(o)?o:void 0}}}function u(t,e){return new Promise(n=>{let o=new D(`ws://127.0.0.1:${t}`,{handshakeTimeout:e}),i=!1,r=s=>{if(!i){i=!0;try{o.close()}catch{}n(s)}};o.once("open",()=>r(!0)),o.once("error",()=>r(!1)),setTimeout(()=>r(!1),e)})}async function b(t){let e=Date.now()+t,n;for(;Date.now()<e;){let o=c();if(o&&m(o)){if(o.bootstrapping!==!0)return;o.bootstrapping!==n&&(n=o.bootstrapping)}await new Promise(i=>setTimeout(i,250))}throw new Error(`daemon did not finish bootstrapping within ${Math.round(t/1e3)}s \u2014 check ${d()} (mac) or \`journalctl --user -u sootsim-server\` (linux).`)}function d(){return T(k(),"Library/Logs/sootsim/server.err.log")}function B(){let t=d(),e=0;try{f(t)&&(e=g(t).size)}catch{}let n=!1,o=()=>{if(!n){try{if(f(t)){let i=g(t).size;if(i>e){let r=Buffer.alloc(i-e),s=P(t,"r");try{S(s,r,0,r.length,e)}finally{v(s)}e=i;for(let y of r.toString("utf8").split(/\r?\n/)){let a=y.trim();a&&(a.startsWith("sootsim:")||a.startsWith("sootsim "))&&console.log(` ${a}`)}}else i<e&&(e=i)}}catch{}setTimeout(o,250)}};return o(),{stop:()=>{n=!0}}}export{L as a,I as b,$ as c,C as d};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  function k(e,t){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=e.indexOf(r);if(s>=0&&e[s+1]){let a=Number(e[s+1]);if(Number.isFinite(a))return Math.max(100,a)}}return t}async function E(e){let t=await e.send({type:"evaluate",code:"(async () => await window.__sootsimTest.getNodeCount())()"});return{nodes:typeof t=="number"?t:0}}async function P(e,t=5){let n=await e.send({type:"evaluate",code:`(async () => await window.__sootsimTest.dumpTree(${t}))()`});return{depth:t,tree:n}}async function A(e){let t=await e.send({type:"evaluate",code:"window.location.href"});return{url:typeof t=="string"?t:""}}async function L(e,t){let n=`(async () => {
3
3
  const t = window.__sootsimTest
4
4
  const mainShell = window.SootSim?.bridges?.mainShell
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as o}from"./chunk-GYXN4445.js";import{l as s}from"./chunk-ZGHJUI77.js";import{chmodSync as c,existsSync as a,mkdirSync as l,readFileSync as d,rmSync as p,writeFileSync as h}from"node:fs";import{dirname as g,join as f,resolve as k}from"node:path";function i(){return f(s(),"credentials.json")}function _(){let t=i();if(!a(t))return null;try{let e=JSON.parse(d(t,"utf8"));return e.version!==1||typeof e.apiKey!="string"||!e.apiKey.startsWith("sk_sootsim_")?null:e.apiKey}catch{return null}}function T(t){if(!t.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let e=i();l(g(k(e)),{recursive:!0}),h(e,JSON.stringify({version:1,apiKey:t,savedAt:new Date().toISOString()},null,2)+`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-3HWWX5E3.js";import{l as s}from"./chunk-WC5LXGUR.js";import{chmodSync as c,existsSync as a,mkdirSync as l,readFileSync as d,rmSync as p,writeFileSync as h}from"node:fs";import{dirname as g,join as f,resolve as k}from"node:path";function i(){return f(s(),"credentials.json")}function _(){let t=i();if(!a(t))return null;try{let e=JSON.parse(d(t,"utf8"));return e.version!==1||typeof e.apiKey!="string"||!e.apiKey.startsWith("sk_sootsim_")?null:e.apiKey}catch{return null}}function T(t){if(!t.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let e=i();l(g(k(e)),{recursive:!0}),h(e,JSON.stringify({version:1,apiKey:t,savedAt:new Date().toISOString()},null,2)+`
3
3
  `);try{c(e,384)}catch{}}function K(){p(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function y(t){return!!(t&&t.length>=20&&t.length<=256&&m.some(e=>t.startsWith(e)))}function S(){let t=process.env.SOOT_INSTALLATION_TOKEN?.trim(),e=process.env.GITHUB_TOKEN?.trim(),r=t||e;if(!y(r))return null;let n=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!n)return null;let u=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:n,installationId:u||null,source:t?"soot-runner":"github-actions"}}function b(){let t=process.env.SOOTSIM_API_KEY?.trim();if(t&&t.startsWith("sk_sootsim_"))return{kind:"api-key",secret:t,source:"env"};let e=S();if(e)return e;let r=_();if(r)return{kind:"api-key",secret:r,source:"file"};let n=o();return n?.token?{kind:"session",token:n.token,origin:n.origin}:null}function E(t){return t.kind==="api-key"?`Bearer ${t.secret}`:`Bearer ${t.token}`}export{_ as a,T as b,K as c,b as d,E as e};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import{existsSync as C,mkdirSync as D,readFileSync as O,rmSync as s,writeFileSync as g}from"fs";import{tmpdir as P}from"os";import{dirname as R,join as A,resolve as x}from"path";import{execFileSync as a}from"child_process";import{readFileSync as I}from"fs";import{createRequire as S}from"module";var o=null;function u(r){o||(o=_());try{return o(r)}catch{return null}}function _(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return y();if(process.platform==="darwin"){let n=E();return n||T()}return()=>null}function y(){return r=>{try{let n=I(`/proc/${r}/stat`,"utf8"),t=n.lastIndexOf(")");if(t<0)return null;let i=n.slice(t+1).trim().split(/\s+/),e=Number(i[1]);return Number.isFinite(e)&&e>0?e:null}catch{return null}}}var N=3,d=216,b=16;function E(){if(!process.versions?.bun)return null;try{let r=S(import.meta.url),{dlopen:n,FFIType:t}=r("bun:ffi"),i=n("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[t.i32,t.i32,t.u64,t.ptr,t.i32],returns:t.i32}}),e=Buffer.alloc(d);return m=>{if(Number(i.symbols.proc_pidinfo(m,N,0n,e,d))<=0)return null;let p=e.readUInt32LE(b);return p>0?p:null}}catch{return null}}function T(){return r=>{try{let t=a("lsof",["-R","-p",String(r),"-d","cwd","-a"],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).split(`
3
3
  `)[1];if(!t)return null;let i=t.trim().split(/\s+/),e=Number(i[2]);return Number.isFinite(e)&&e>1?e:null}catch{return null}}}var c=1,f="SOOTSIM_CLI_CURRENT_SIM_PATH",v=["SOOTSIM_CLI_IDENTITY","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"];function F(r,n=20){let t=u(r);if(!t||t<=1)return null;for(let i=0;i<n;i++){let e=u(t);if(!e||e<=1)return t;t=e}return t}function k(){for(let n of v){let t=process.env[n];if(t&&t.trim())return{key:`${n}:${t.trim()}`,source:n,stable:!0}}let r=F(process.ppid);return r&&r>1?{key:`gppid-${r}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function L(){return k().key}function l(){if(process.env[f])return x(process.env[f]);let r=L();return A(P(),`sootsim-current-sim-${r}.json`)}function h(){let r=l();if(!C(r))return null;try{let n=JSON.parse(O(r,"utf8"));return n.version!==c||typeof n.simId!="string"||!n.simId.trim()||typeof n.updatedAt!="string"?(s(r,{force:!0}),null):{version:c,simId:n.simId.trim(),updatedAt:n.updatedAt}}catch{return s(r,{force:!0}),null}}function J(){return h()?.simId||null}function j(r){let n=r.trim();if(!n)return;let t=l();D(R(t),{recursive:!0}),g(t,JSON.stringify({version:c,simId:n,updatedAt:new Date().toISOString()},null,2)+`
4
4
  `)}function K(){s(l(),{force:!0})}export{k as a,L as b,J as c,j as d,K as e};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-CTIBRJOB.js";import"./chunk-G7YSDJ47.js";export{a as getCliVersion};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-P3WJGZTF.js";import{existsSync as x,readFileSync as j}from"fs";import{resolve as g}from"path";async function P(s){(s.includes("--help")||s.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-G7YSDJ47.js";import{existsSync as x,readFileSync as j}from"fs";import{resolve as g}from"path";async function P(s){(s.includes("--help")||s.includes("-h"))&&(console.log(`
3
3
  sootsim compat \u2014 check package compatibility
4
4
 
5
5
  usage:
@@ -20,7 +20,7 @@ examples:
20
20
  sootsim compat react-native-reanimated
21
21
  sootsim compat --json
22
22
  sootsim compat --brief
23
- `),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-CDNAUTDO.js"),a=g(n,"package.json");x(a)||(console.error(" no package.json found in",n),process.exit(1));let u=JSON.parse(j(a,"utf8")),r=o(u);if(c){console.log(JSON.stringify(r,null,2));return}if(r.packages.length===0){console.log(" no RN ecosystem packages detected");return}let T=Math.round(r.overallScore*100),v=r.packages.filter(i=>i.status==="full").length,$=r.packages.filter(i=>i.status==="partial"||i.status==="auto-stub").length,w=r.packages.filter(i=>i.status==="unsupported").length,p=[];v&&p.push(`${v} fully supported`),$&&p.push(`${$} partial`),w&&p.push(`${w} unsupported`),console.log(` ${p.join(", ")} \u2014 ${T}% compatible`);return}let{POLYFILL_REGISTRY:d}=await import("./web-CDNAUTDO.js");if(k){W(k,d);return}let b=g(n,"package.json");x(b)||(console.error(" no package.json found in",n),process.exit(1));let m=JSON.parse(j(b,"utf8")),S={...m.dependencies,...m.devDependencies},t={full:[],partial:[],autoStub:[],unsupported:[],justWorks:[],unknown:[]};for(let o of Object.keys(S)){let a=d[o];if(a){let u=a.stubType==="native"?"full":a.stubType==="works"?"not-relevant":a.stubType;if(a.stubType!=="native"&&a.versions?.length){let r=Math.max(...a.versions.map(y=>y.coverage||0));u=r>=.8?"full":r>=.3?"partial":"auto-stub"}switch(u){case"full":t.full.push(o);break;case"partial":t.partial.push(o);break;case"auto-stub":t.autoStub.push(o);break;case"unsupported":t.unsupported.push(o);break;case"not-relevant":t.justWorks.push(o);break;default:f(o)&&t.unknown.push(o)}}else f(o)&&t.unknown.push(o)}console.log(`
23
+ `),process.exit(0));let c=s.includes("--json"),e=s.includes("--brief"),l=s.indexOf("--app"),n=l!==-1&&s[l+1]?g(s[l+1]):process.cwd(),k=s.filter((o,a)=>!o.startsWith("-")&&(l===-1||a!==l+1))[0];if(c||e){let{scanDeps:o}=await import("./web-JGAPJJM5.js"),a=g(n,"package.json");x(a)||(console.error(" no package.json found in",n),process.exit(1));let u=JSON.parse(j(a,"utf8")),r=o(u);if(c){console.log(JSON.stringify(r,null,2));return}if(r.packages.length===0){console.log(" no RN ecosystem packages detected");return}let T=Math.round(r.overallScore*100),v=r.packages.filter(i=>i.status==="full").length,$=r.packages.filter(i=>i.status==="partial"||i.status==="auto-stub").length,w=r.packages.filter(i=>i.status==="unsupported").length,p=[];v&&p.push(`${v} fully supported`),$&&p.push(`${$} partial`),w&&p.push(`${w} unsupported`),console.log(` ${p.join(", ")} \u2014 ${T}% compatible`);return}let{POLYFILL_REGISTRY:d}=await import("./web-JGAPJJM5.js");if(k){W(k,d);return}let b=g(n,"package.json");x(b)||(console.error(" no package.json found in",n),process.exit(1));let m=JSON.parse(j(b,"utf8")),S={...m.dependencies,...m.devDependencies},t={full:[],partial:[],autoStub:[],unsupported:[],justWorks:[],unknown:[]};for(let o of Object.keys(S)){let a=d[o];if(a){let u=a.stubType==="native"?"full":a.stubType==="works"?"not-relevant":a.stubType;if(a.stubType!=="native"&&a.versions?.length){let r=Math.max(...a.versions.map(y=>y.coverage||0));u=r>=.8?"full":r>=.3?"partial":"auto-stub"}switch(u){case"full":t.full.push(o);break;case"partial":t.partial.push(o);break;case"auto-stub":t.autoStub.push(o);break;case"unsupported":t.unsupported.push(o);break;case"not-relevant":t.justWorks.push(o);break;default:f(o)&&t.unknown.push(o)}}else f(o)&&t.unknown.push(o)}console.log(`
24
24
  sootsim compatibility report
25
25
  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
26
26
 
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-P3WJGZTF.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-G7YSDJ47.js";import{existsSync as i,writeFileSync as n,readFileSync as c}from"fs";import{resolve as t}from"path";async function a(s){let e=s[0];switch((!e||s.includes("--help")||s.includes("-h"))&&(console.log(`
3
3
  sootsim config \u2014 manage sootsim configuration
4
4
 
5
5
  usage:
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r}from"./chunk-UJUJJDJH.js";import"./chunk-QDYFRHQK.js";import"./chunk-G6Y6PFGR.js";import"./chunk-UASODA4K.js";import"./chunk-HKLWUXFK.js";import"./chunk-SL4MHVAB.js";import"./chunk-34TWXW7Z.js";import"./chunk-OAATHYER.js";import"./chunk-LAZ7FFOW.js";import"./chunk-6EMLKJ4H.js";import"./chunk-H532JOZV.js";import"./chunk-YVKR7SWO.js";import"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";export{d as buildOpenUrl,c as buildShellUrl,p as closeSimsBulk,q as planBulkCloseTargets,h as playwrightHostPidForSim,f as printConnectedSims,a as resolveBundleTarget,b as resolveDefaultShellBaseUrl,o as runClaimCommand,r as runCloseCommand,n as runFocusCommand,k as runListCommand,l as runOpenCommand,m as runUseCommand,i as signalDriverLaunchConnected,e as summarizeSimUrl,j as terminatePlaywrightHostsForSims,g as waitForSimMatch};
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r}from"./chunk-2LR6NOP2.js";import"./chunk-27A45VIL.js";import"./chunk-5DR2FIO5.js";import"./chunk-YEAJZSES.js";import"./chunk-Q33MTWNZ.js";import"./chunk-K3SEMIKF.js";import"./chunk-RI4ITM2W.js";import"./chunk-GWXDYAFY.js";import"./chunk-KXOXMNFV.js";import"./chunk-GUEPTURI.js";import"./chunk-63G2GUFJ.js";import"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";export{d as buildOpenUrl,c as buildShellUrl,p as closeSimsBulk,q as planBulkCloseTargets,h as playwrightHostPidForSim,f as printConnectedSims,a as resolveBundleTarget,b as resolveDefaultShellBaseUrl,o as runClaimCommand,r as runCloseCommand,n as runFocusCommand,k as runListCommand,l as runOpenCommand,m as runUseCommand,i as signalDriverLaunchConnected,e as summarizeSimUrl,j as terminatePlaywrightHostsForSims,g as waitForSimMatch};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as I,e as N,i as S}from"./chunk-YVKR7SWO.js";import"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";import{createWriteStream as k,mkdirSync as v,writeFileSync as C}from"fs";import{dirname as T,resolve as w}from"path";import{Readable as F}from"stream";import{pipeline as y}from"stream/promises";import{createGzip as x}from"zlib";async function U(o,m){let n=Number(b(o,"--duration")??"5");if(!Number.isFinite(n)||n<=0)return console.error(" --duration must be a positive number (seconds)"),1;let a=Number(b(o,"--sample-interval")??"10");if(!Number.isFinite(a)||a<=0)return console.error(" --sample-interval must be a positive number (milliseconds)"),1;let t=Number(b(o,"--max-buffer")??"100000");if(!Number.isFinite(t)||t<=0)return console.error(" --max-buffer must be a positive number"),1;let p=b(o,"--output")??b(o,"-o"),l=w(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=l.endsWith(".gz"),h=I(o,{port:m.port,stripValueFlags:["--duration","--output","-o","--sample-interval","--max-buffer"]}),c=N({...h,commandTimeoutMs:Math.max(3e4,(n+20)*1e3)});try{let u=await S(c,"SootSim.bridges.workerCpuProfileStart",{sampleInterval:a,maxBufferSize:t});if(!u?.started)return u?.error?.includes("cpu-profile-unsupported")?(console.error(" cpu-profile is currently unsupported."),console.error(" the JS Self-Profiler API cannot profile a dedicated worker, and"),console.error(" sootsim runs the guest app in the tenant worker. a CDP-based"),console.error(" profiler is required \u2014 tracked as the F28 follow-up.")):(console.error(" could not start tenant-worker profiler."),console.error(" is sootsim running? (try `sootsim list`)")),1;m.verbose&&console.error(` started: sampleInterval=${u.sampleInterval}ms buffer=${u.maxBufferSize}`),console.log(` recording for ${n}s\u2026`),await new Promise(r=>setTimeout(r,n*1e3));let s=await S(c,"SootSim.bridges.workerCpuProfileStop");if(!s||s.error||!s.trace)return console.error(` profile capture failed: ${s?.error??"no trace returned"}`),1;let P=B(s.trace),e=JSON.stringify(P);v(T(l),{recursive:!0}),g?await y(F.from([e]),x(),k(l)):C(l,e);let i=(Buffer.byteLength(e)/1024/1024).toFixed(2);return console.log(` samples: ${P.samples.length} (${i} MB uncompressed)`),console.log(` saved: ${l}`),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}catch(u){let s=u?.message??String(u);return console.error(` profile failed: ${s}`),/could not connect|ECONNREFUSED/i.test(s)&&console.error(" is sootsim running? (try `sootsim list`)"),1}finally{c.close()}}function B(o){let m=o.frames??[],n=o.resources??[],a=o.stacks??[],t=o.samples??[],p=1,l=[{id:p,callFrame:{functionName:"(root)",scriptId:"0",url:"",lineNumber:-1,columnNumber:-1},hitCount:0,children:[]}];for(let e=0;e<a.length;e++){let i=a[e],r=m[i.frameId]??{name:"(unknown)"},f=r.resource!==void 0?n[r.resource]??"":"";l.push({id:e+2,callFrame:{functionName:r.name||"(anonymous)",scriptId:r.resource!==void 0?String(r.resource):"0",url:f,lineNumber:typeof r.line=="number"?r.line-1:-1,columnNumber:typeof r.column=="number"?r.column-1:-1},hitCount:0,children:[]})}for(let e=0;e<a.length;e++){let i=a[e],r=e+2,f=i.parentId!==void 0?i.parentId+2:p,d=l[f-1];d&&!d.children.includes(r)&&d.children.push(r)}let g=[],h=[],c=t.length>0?t[0].timestamp:0,u=c;for(let e=0;e<t.length;e++){let i=t[e],r=i.stackId!==void 0?i.stackId+2:p;g.push(r);let f=l[r-1];f&&f.hitCount++;let d=e===0?0:i.timestamp-u;h.push(Math.max(0,Math.round(d*1e3))),u=i.timestamp}let s=Math.round(c*1e3),P=t.length>0?Math.round(t[t.length-1].timestamp*1e3):s;return{nodes:l,startTime:s,endTime:P,samples:g,timeDeltas:h}}function b(o,m){let n=o.indexOf(m);if(!(n<0||n===o.length-1))return o[n+1]}export{U as runCpuProfile};
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as I,e as N,i as S}from"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";import{createWriteStream as k,mkdirSync as v,writeFileSync as C}from"fs";import{dirname as T,resolve as w}from"path";import{Readable as F}from"stream";import{pipeline as y}from"stream/promises";import{createGzip as x}from"zlib";async function U(o,m){let n=Number(b(o,"--duration")??"5");if(!Number.isFinite(n)||n<=0)return console.error(" --duration must be a positive number (seconds)"),1;let a=Number(b(o,"--sample-interval")??"10");if(!Number.isFinite(a)||a<=0)return console.error(" --sample-interval must be a positive number (milliseconds)"),1;let t=Number(b(o,"--max-buffer")??"100000");if(!Number.isFinite(t)||t<=0)return console.error(" --max-buffer must be a positive number"),1;let p=b(o,"--output")??b(o,"-o"),l=w(process.cwd(),p??"/tmp/sootsim.cpuprofile"),g=l.endsWith(".gz"),h=I(o,{port:m.port,stripValueFlags:["--duration","--output","-o","--sample-interval","--max-buffer"]}),c=N({...h,commandTimeoutMs:Math.max(3e4,(n+20)*1e3)});try{let u=await S(c,"SootSim.bridges.workerCpuProfileStart",{sampleInterval:a,maxBufferSize:t});if(!u?.started)return u?.error?.includes("cpu-profile-unsupported")?(console.error(" cpu-profile is currently unsupported."),console.error(" the JS Self-Profiler API cannot profile a dedicated worker, and"),console.error(" sootsim runs the guest app in the tenant worker. a CDP-based"),console.error(" profiler is required \u2014 tracked as the F28 follow-up.")):(console.error(" could not start tenant-worker profiler."),console.error(" is sootsim running? (try `sootsim list`)")),1;m.verbose&&console.error(` started: sampleInterval=${u.sampleInterval}ms buffer=${u.maxBufferSize}`),console.log(` recording for ${n}s\u2026`),await new Promise(r=>setTimeout(r,n*1e3));let s=await S(c,"SootSim.bridges.workerCpuProfileStop");if(!s||s.error||!s.trace)return console.error(` profile capture failed: ${s?.error??"no trace returned"}`),1;let P=B(s.trace),e=JSON.stringify(P);v(T(l),{recursive:!0}),g?await y(F.from([e]),x(),k(l)):C(l,e);let i=(Buffer.byteLength(e)/1024/1024).toFixed(2);return console.log(` samples: ${P.samples.length} (${i} MB uncompressed)`),console.log(` saved: ${l}`),console.log(" open in chrome devtools \u2192 Performance \u2192 Load profile to inspect."),0}catch(u){let s=u?.message??String(u);return console.error(` profile failed: ${s}`),/could not connect|ECONNREFUSED/i.test(s)&&console.error(" is sootsim running? (try `sootsim list`)"),1}finally{c.close()}}function B(o){let m=o.frames??[],n=o.resources??[],a=o.stacks??[],t=o.samples??[],p=1,l=[{id:p,callFrame:{functionName:"(root)",scriptId:"0",url:"",lineNumber:-1,columnNumber:-1},hitCount:0,children:[]}];for(let e=0;e<a.length;e++){let i=a[e],r=m[i.frameId]??{name:"(unknown)"},f=r.resource!==void 0?n[r.resource]??"":"";l.push({id:e+2,callFrame:{functionName:r.name||"(anonymous)",scriptId:r.resource!==void 0?String(r.resource):"0",url:f,lineNumber:typeof r.line=="number"?r.line-1:-1,columnNumber:typeof r.column=="number"?r.column-1:-1},hitCount:0,children:[]})}for(let e=0;e<a.length;e++){let i=a[e],r=e+2,f=i.parentId!==void 0?i.parentId+2:p,d=l[f-1];d&&!d.children.includes(r)&&d.children.push(r)}let g=[],h=[],c=t.length>0?t[0].timestamp:0,u=c;for(let e=0;e<t.length;e++){let i=t[e],r=i.stackId!==void 0?i.stackId+2:p;g.push(r);let f=l[r-1];f&&f.hitCount++;let d=e===0?0:i.timestamp-u;h.push(Math.max(0,Math.round(d*1e3))),u=i.timestamp}let s=Math.round(c*1e3),P=t.length>0?Math.round(t[t.length-1].timestamp*1e3):s;return{nodes:l,startTime:s,endTime:P,samples:g,timeDeltas:h}}function b(o,m){let n=o.indexOf(m);if(!(n<0||n===o.length-1))return o[n+1]}export{U as runCpuProfile};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as T}from"./chunk-LVLOAXDS.js";import"./chunk-FVQOPALM.js";import"./chunk-IZ3CWZNF.js";import"./chunk-H532JOZV.js";import"./chunk-SPWIBWDN.js";import"./chunk-K2KVNO7W.js";import{a as _,b as N}from"./chunk-ODLY2N63.js";import"./chunk-GYXN4445.js";import"./chunk-RA3I4BJI.js";import"./chunk-FWROUGUO.js";import{g as I,o as C,p as w,q as B}from"./chunk-ZGHJUI77.js";import{a as W}from"./chunk-P3WJGZTF.js";import{execFileSync as et,spawnSync as s}from"child_process";import{existsSync as a,mkdirSync as v,readFileSync as rt,rmSync as S,writeFileSync as U}from"fs";import{homedir as $}from"os";import{dirname as M,resolve as p}from"path";import{execFileSync as Y}from"child_process";import{chmodSync as K,mkdirSync as D,rmSync as X,writeFileSync as P}from"fs";import{dirname as L}from"path";var Q="dev.sootsim.daemon",O="SootSim Daemon",F="0.1.36";function R(t,e,r){let o=w(),n=B(),i=L(L(n)),f=L(n),u=`${i}/Resources`;X(o,{recursive:!0,force:!0}),D(C(),{recursive:!0}),D(f,{recursive:!0}),D(u,{recursive:!0}),P(`${i}/Info.plist`,z()),P(`${i}/PkgInfo`,"APPL????"),P(n,J(t,e,r)),K(n,493);try{Y("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(c){let g=c instanceof Error?c.message:String(c);console.warn(` warning: ad-hoc codesign of ${o} failed: ${g}
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as T}from"./chunk-JXMRUEWU.js";import"./chunk-5JZ6Z32G.js";import"./chunk-I56WNY6G.js";import"./chunk-63G2GUFJ.js";import"./chunk-FMZY67DH.js";import"./chunk-CTIBRJOB.js";import{a as _,b as N}from"./chunk-6U6RQ6NC.js";import"./chunk-3HWWX5E3.js";import"./chunk-WIMYX5KS.js";import"./chunk-UJ3GDA34.js";import{g as I,o as C,p as w,q as B}from"./chunk-WC5LXGUR.js";import{a as W}from"./chunk-G7YSDJ47.js";import{execFileSync as et,spawnSync as s}from"child_process";import{existsSync as a,mkdirSync as v,readFileSync as rt,rmSync as S,writeFileSync as U}from"fs";import{homedir as $}from"os";import{dirname as M,resolve as p}from"path";import{execFileSync as Y}from"child_process";import{chmodSync as K,mkdirSync as D,rmSync as X,writeFileSync as P}from"fs";import{dirname as L}from"path";var Q="dev.sootsim.daemon",O="SootSim Daemon",F="0.1.36";function R(t,e,r){let o=w(),n=B(),i=L(L(n)),f=L(n),u=`${i}/Resources`;X(o,{recursive:!0,force:!0}),D(C(),{recursive:!0}),D(f,{recursive:!0}),D(u,{recursive:!0}),P(`${i}/Info.plist`,z()),P(`${i}/PkgInfo`,"APPL????"),P(n,J(t,e,r)),K(n,493);try{Y("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(c){let g=c instanceof Error?c.message:String(c);console.warn(` warning: ad-hoc codesign of ${o} failed: ${g}
3
3
  the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:o,launcherPath:n}}function z(){return`<?xml version="1.0" encoding="UTF-8"?>
4
4
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
5
5
  <plist version="1.0">
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{e as f,l as T}from"./chunk-G6Y6PFGR.js";import{F as A,G as D,H as O,I as x,J as v}from"./chunk-UASODA4K.js";import{c as S,e as $,g as N}from"./chunk-YVKR7SWO.js";import"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{e as f,l as T}from"./chunk-5DR2FIO5.js";import{F as A,G as D,H as O,I as x,J as v}from"./chunk-YEAJZSES.js";import{c as S,e as $,g as N}from"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";var H=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],R="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function L(){console.log(`
3
3
  sootsim debug \u2014 drive __sootsimDebug from the terminal
4
4
 
5
5
  usage:
@@ -167,7 +167,7 @@ examples:
167
167
  } : null,
168
168
  samples,
169
169
  }
170
- })()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-XVHQ25HJ.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
170
+ })()`}async function c(i,l){return N(i,l)}async function Y(i,l){let g=S(i,{port:l.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),u=g.positional;(!u[0]||i.includes("--help")||i.includes("-h"))&&(L(),process.exit(0));let P=g.wsPort,_=g.simId,n=!i.includes("--json"),y=_?` --sim ${_}`:"",k=u[0],r=u.slice(1);if(new Set(["state","js","eval","perf","sample-color"]).has(k)){let{runInspect:e}=await import("./inspect-3FXRWDUZ.js");await e(["debug",...i],{port:l.port,verbose:l.verbose});return}let t=$(g);try{switch(k){case"enable":{let e=B(r[0]);e.length===0&&(console.error(` usage: sootsim debug enable <channel[,channel,...]>
171
171
  known: ${H.join(", ")}`),process.exit(1));let o=await v(t,"enable",e);console.log(a({active:o},n));break}case"disable":{let e=B(r[0]),o=await v(t,"disable",e);console.log(a({active:o},n));break}case"toggle":{let e=r[0];e||(console.error(" usage: sootsim debug toggle <channel>"),process.exit(1));let o=await c(t,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(a({[e]:o},n));break}case"status":{let e=await A(t);console.log(a(e,n));break}case"channels":{let e=await c(t,"window.__sootsimDebug.channels()");console.log(a(e,n));break}case"flags":{let e=await D(t);console.log(a(e,n));break}case"snapshot":{let e=r[0],o=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",s=await c(t,`(() => { const s = ${o}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(a(s,n));break}case"snapshots":{let e=await c(t,"window.__sootsimDebug.snapshots()");console.log(a(e,n));break}case"diff":{let e=r[0],o=r[1];(!e||!o)&&(console.error(" usage: sootsim debug diff <labelA> <labelB>"),process.exit(1));let s=`(() => {
172
172
  const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(o)});
173
173
  if (!d) return null;
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a}from"./chunk-Q33MTWNZ.js";import"./chunk-G7YSDJ47.js";export{a as APPS};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as S}from"./chunk-WCM7INZL.js";import"./chunk-2WOD3LBI.js";import"./chunk-OYRL6RAD.js";import"./chunk-6K2OMU5N.js";import"./chunk-7LR7PVW4.js";import"./chunk-5OJK5LYU.js";import"./chunk-JJQQMLVH.js";import"./chunk-UJUJJDJH.js";import"./chunk-QDYFRHQK.js";import"./chunk-G6Y6PFGR.js";import"./chunk-UASODA4K.js";import"./chunk-HKLWUXFK.js";import"./chunk-SL4MHVAB.js";import"./chunk-34TWXW7Z.js";import"./chunk-OAATHYER.js";import"./chunk-LAZ7FFOW.js";import"./chunk-6EMLKJ4H.js";import"./chunk-FVQOPALM.js";import"./chunk-H532JOZV.js";import"./chunk-ODLY2N63.js";import"./chunk-GYXN4445.js";import"./chunk-GOU7IGMA.js";import"./chunk-RA3I4BJI.js";import"./chunk-YVKR7SWO.js";import"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as S}from"./chunk-C6RVANMG.js";import"./chunk-SMNILGN7.js";import"./chunk-6TJBW53J.js";import"./chunk-K2VUO3X2.js";import"./chunk-PWXZFYQK.js";import"./chunk-YUSYVLWH.js";import"./chunk-M4E2KH4M.js";import"./chunk-2LR6NOP2.js";import"./chunk-27A45VIL.js";import"./chunk-5DR2FIO5.js";import"./chunk-YEAJZSES.js";import"./chunk-Q33MTWNZ.js";import"./chunk-K3SEMIKF.js";import"./chunk-RI4ITM2W.js";import"./chunk-GWXDYAFY.js";import"./chunk-KXOXMNFV.js";import"./chunk-GUEPTURI.js";import"./chunk-5JZ6Z32G.js";import"./chunk-63G2GUFJ.js";import"./chunk-6U6RQ6NC.js";import"./chunk-3HWWX5E3.js";import"./chunk-LP6PSZDR.js";import"./chunk-WIMYX5KS.js";import"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";import{spawn as D}from"child_process";import{existsSync as u,mkdirSync as _,writeFileSync as f,unlinkSync as I}from"fs";import{tmpdir as P}from"os";import{dirname as $,resolve as n,join as M}from"path";function E(){try{let e=import.meta.resolve("sootsim/detox");return $(e.startsWith("file://")?e.slice(7):e)}catch{return n(import.meta.dirname,"..","..","detox")}}var F=`
3
3
  sootsim detox \u2014 run detox-style tests against a sootsim shell
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-OYRL6RAD.js";import"./chunk-FVQOPALM.js";import"./chunk-GOU7IGMA.js";import{f as c,g as r,h as g}from"./chunk-RA3I4BJI.js";import{c as d,e as l,h as a}from"./chunk-YVKR7SWO.js";import"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";function h(){console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-6TJBW53J.js";import"./chunk-5JZ6Z32G.js";import"./chunk-LP6PSZDR.js";import{f as c,g as r,h as g}from"./chunk-WIMYX5KS.js";import{c as d,e as l,h as a}from"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";function h(){console.log(`
3
3
  sootsim device \u2014 inspect or change the live device preset for a sim
4
4
 
5
5
  usage:
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{c as E,e as R,h as b}from"./chunk-YVKR7SWO.js";import{b as v}from"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{c as E,e as R,h as b}from"./chunk-VQYMMPDN.js";import{b as v}from"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";function F(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(s=>typeof s=="string"?s:JSON.stringify(s)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
3
3
  sootsim diagnose \u2014 compact "what just went wrong?" report
4
4
 
5
5
  usage:
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-A7HWACJO.js";import{a,b,c,d,e,f,g,h,i}from"./chunk-K3SEMIKF.js";import"./chunk-RI4ITM2W.js";import"./chunk-GWXDYAFY.js";import"./chunk-KXOXMNFV.js";import"./chunk-GUEPTURI.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";export{e as ALL_DRIVERS,i as buildDriverListRows,a as chromiumDriver,b as electronDriver,f as getAllDrivers,g as getDriver,c as playwrightDriver,h as resolveDriver,d as systemDriver};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as g}from"./chunk-VB7Z7JWH.js";import"./chunk-5CPW2643.js";import{a as v,f as h}from"./chunk-UJUJJDJH.js";import"./chunk-QDYFRHQK.js";import"./chunk-G6Y6PFGR.js";import"./chunk-UASODA4K.js";import"./chunk-HKLWUXFK.js";import{b as f,g as u}from"./chunk-SL4MHVAB.js";import{a as p}from"./chunk-34TWXW7Z.js";import"./chunk-OAATHYER.js";import{c as m}from"./chunk-LAZ7FFOW.js";import"./chunk-6EMLKJ4H.js";import"./chunk-H532JOZV.js";import"./chunk-YVKR7SWO.js";import"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as g}from"./chunk-DPEKE6KI.js";import"./chunk-A7HWACJO.js";import{a as v,f as h}from"./chunk-2LR6NOP2.js";import"./chunk-27A45VIL.js";import"./chunk-5DR2FIO5.js";import"./chunk-YEAJZSES.js";import"./chunk-Q33MTWNZ.js";import{b as f,g as u}from"./chunk-K3SEMIKF.js";import{a as p}from"./chunk-RI4ITM2W.js";import"./chunk-GWXDYAFY.js";import{c as m}from"./chunk-KXOXMNFV.js";import"./chunk-GUEPTURI.js";import"./chunk-63G2GUFJ.js";import"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";function b(e){let r=e.indexOf("--port");if(r<0)return;let o=e[r+1],i=o?Number(o):Number.NaN;return(!Number.isInteger(i)||i<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),i}async function O(e,r){let o=b(e)??r.port;return o?h(String(o)):void 0}async function $(e,r){(e.includes("--help")||e.includes("-h"))&&(console.log(`
3
3
  sootsim electron \u2014 launch the desktop companion
4
4
 
5
5
  usage:
@@ -15,4 +15,4 @@ examples:
15
15
  sootsim electron
16
16
  sootsim electron --port 5173
17
17
  sootsim electron --profile qa
18
- `),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-2LYXUCKU.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
18
+ `),process.exit(0));let o=e.indexOf("--driver"),i=o>=0?e[o+1]:void 0,t=e.find((n,a)=>e[a-1]==="--profile"),d=e.includes("--ephemeral");t&&d&&(console.error(" sootsim electron: --profile cannot be combined with --ephemeral"),process.exit(1));let x=t?m(t).id:void 0,s=i||r.driver,l=f;if(s){let n=u(s);n||(console.error(` unknown driver "${s}" \u2014 run \`sootsim list --drivers\``),process.exit(1)),l=n}if(l.id==="electron"){let n=p();if(!n){if(v(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await g("run sootsim install-desktop now?",!0)){console.log();let{runInstallDesktop:I}=await import("./install-desktop-EORTVZKX.js");await I(["--yes"]),n=p()}n||process.exit(1)}console.log(` launching ${n.path}`)}let w=await O(e,r),c=await l.launch({url:w,device:r.device,profileId:x,ephemeralProfile:d});c.launched||(console.error(` ${c.message}`),process.exit(1)),console.log(` ${c.message}`)}export{O as resolveElectronLaunchUrl,$ as runElectron};
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as c,b as d,c as e,d as f}from"./chunk-C6RVANMG.js";import"./chunk-SMNILGN7.js";import"./chunk-6TJBW53J.js";import"./chunk-K2VUO3X2.js";import"./chunk-PWXZFYQK.js";import"./chunk-YUSYVLWH.js";import{d as a,e as b}from"./chunk-M4E2KH4M.js";import"./chunk-2LR6NOP2.js";import"./chunk-27A45VIL.js";import"./chunk-5DR2FIO5.js";import"./chunk-YEAJZSES.js";import"./chunk-Q33MTWNZ.js";import"./chunk-K3SEMIKF.js";import"./chunk-RI4ITM2W.js";import"./chunk-GWXDYAFY.js";import"./chunk-KXOXMNFV.js";import"./chunk-GUEPTURI.js";import"./chunk-5JZ6Z32G.js";import"./chunk-63G2GUFJ.js";import"./chunk-6U6RQ6NC.js";import"./chunk-3HWWX5E3.js";import"./chunk-LP6PSZDR.js";import"./chunk-WIMYX5KS.js";import"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";export{c as discoverSootsimUrl,e as hoistLeadingSimFlag,a as parseFlowFile,f as runFlow,d as runFlowPlayback,b as validateFlowFile};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as n,c as r,d as l}from"./chunk-RRPKIYG7.js";import"./chunk-YXZHBYID.js";import"./chunk-P3WJGZTF.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as n,c as r,d as l}from"./chunk-WB6M53YK.js";import"./chunk-ZF2JD3AH.js";import"./chunk-G7YSDJ47.js";function a(t){let s=t[0]??"list";if(s==="reset"){t[1]==="global"?(r(),console.log(" cleared global hint state")):(n(),console.log(" cleared hint state for this CLI identity"));return}if(s==="list"){let e=l();if(!e.length){console.log(" no hints registered");return}let i=Math.max(...e.map(o=>o.id.length));console.log(" registered hints:");for(let o of e){let c=typeof o.frequency=="string"?o.frequency:`cooldown ${o.frequency.cooldownMs}ms`;console.log(` ${o.id.padEnd(i)} ${c}`)}console.log(""),console.log(" env overrides:"),console.log(" SOOTSIM_HINTS=off suppress all hints"),console.log(" SOOTSIM_HINTS=always show every hint every time");return}console.error(` unknown subcommand: ${s}`),console.error(" usage:"),console.error(" sootsim hints list show registered hints"),console.error(" sootsim hints reset [global] clear shown-state"),process.exit(1)}export{a as runHints};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,D as activeRuntimeDir,j as activeRuntimeFile,r as cacheDir,H as claimDaemonLockfile,C as compareSemver,t as configFilePath,p as daemonAppBundlePath,o as daemonAppDir,q as daemonAppLauncherPath,s as daemonLockfilePath,k as electronDir,l as electronUserDataDir,m as electronVersionDir,y as ensureSootsimHome,F as isDaemonLockfileFresh,g as isSootsimDevCheckout,B as listInstalledRuntimes,n as profilesDir,z as readActiveRuntime,E as readDaemonLockfile,u as readSharedConfig,w as readTelemetryEnabled,I as removeDaemonLockfile,i as runtimeDir,h as runtimesDir,f as sootsimHomeDir,A as writeActiveRuntime,G as writeDaemonLockfile,v as writeSharedConfig,x as writeTelemetryEnabled};
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{A,B,C,D,E,F,G,H,I,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";export{b as ACTIVE_RUNTIME_FILE,d as CONFIG_FILE,e as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,a as SOOTSIM_HOME_ENV,D as activeRuntimeDir,j as activeRuntimeFile,r as cacheDir,H as claimDaemonLockfile,C as compareSemver,t as configFilePath,p as daemonAppBundlePath,o as daemonAppDir,q as daemonAppLauncherPath,s as daemonLockfilePath,k as electronDir,l as electronUserDataDir,m as electronVersionDir,y as ensureSootsimHome,F as isDaemonLockfileFresh,g as isSootsimDevCheckout,B as listInstalledRuntimes,n as profilesDir,z as readActiveRuntime,E as readDaemonLockfile,u as readSharedConfig,w as readTelemetryEnabled,I as removeDaemonLockfile,i as runtimeDir,h as runtimesDir,f as sootsimHomeDir,A as writeActiveRuntime,G as writeDaemonLockfile,v as writeSharedConfig,x as writeTelemetryEnabled};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as Q}from"./chunk-RRPKIYG7.js";import{a as pt,b as ft}from"./chunk-HPJIWPPC.js";import{a as He,h as ye,k as ee}from"./chunk-JJQQMLVH.js";import{b as gt,c as yt,i as ht}from"./chunk-UJUJJDJH.js";import"./chunk-QDYFRHQK.js";import{a as Z,b as j,c as J,d as ne,e as V,f as ge,g as de,h as dt,i as ut,j as _e,k as mt}from"./chunk-G6Y6PFGR.js";import{B as at,D as le,E as lt,K as ct,a as fe,b as Ue,c as Ke,d as ze,e as Ye,f as Ge,g as Xe,h as Me,i as Ie,n as Ne,o as Ve,p as Qe,q as Ze,r as et,s as tt,t as ot,u as st,v as nt,w as rt,x as it}from"./chunk-UASODA4K.js";import"./chunk-HKLWUXFK.js";import"./chunk-SL4MHVAB.js";import"./chunk-34TWXW7Z.js";import"./chunk-OAATHYER.js";import"./chunk-LAZ7FFOW.js";import"./chunk-6EMLKJ4H.js";import{a as Be}from"./chunk-6SLYUGPA.js";import{a as Se,c as ke}from"./chunk-IZ3CWZNF.js";import{a as De}from"./chunk-H532JOZV.js";import{c as Je,e as Le,f as qe,g as We,h as Te}from"./chunk-YVKR7SWO.js";import{b as je}from"./chunk-YXZHBYID.js";import"./chunk-FWROUGUO.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";import{existsSync as eo,mkdirSync as to,readFileSync as oo,rmSync as bt,writeFileSync as so}from"fs";import{tmpdir as no}from"os";import{dirname as ro,join as io,resolve as ao}from"path";var ue=1,lo="SOOTSIM_INSPECT_NOTICE_PATH",co=300*1e3,uo=15e3;function wt(){return ao(process.env[lo]||io(no(),"sootsim-inspect-notice-state.json"))}function mo(o,c){return Object.fromEntries(Object.entries(o).filter(([,i])=>typeof i?.signature=="string"&&Number.isFinite(i?.updatedAt)&&c-i.updatedAt<=co))}function po(o){let c=wt();if(!eo(c))return{version:ue,entries:{}};try{let i=JSON.parse(oo(c,"utf8"));return i.version!==ue||!i.entries||typeof i.entries!="object"?(bt(c,{force:!0}),{version:ue,entries:{}}):{version:ue,entries:mo(i.entries,o)}}catch{return bt(c,{force:!0}),{version:ue,entries:{}}}}function fo(o){let c=wt();to(ro(c),{recursive:!0}),so(c,JSON.stringify(o,null,2)+`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as Q}from"./chunk-WB6M53YK.js";import{a as pt,b as ft}from"./chunk-DHMFHEWO.js";import{a as He,h as ye,k as ee}from"./chunk-M4E2KH4M.js";import{b as gt,c as yt,i as ht}from"./chunk-2LR6NOP2.js";import"./chunk-27A45VIL.js";import{a as Z,b as j,c as J,d as ne,e as V,f as ge,g as de,h as dt,i as ut,j as _e,k as mt}from"./chunk-5DR2FIO5.js";import{B as at,D as le,E as lt,K as ct,a as fe,b as Ue,c as Ke,d as ze,e as Ye,f as Ge,g as Xe,h as Me,i as Ie,n as Ne,o as Ve,p as Qe,q as Ze,r as et,s as tt,t as ot,u as st,v as nt,w as rt,x as it}from"./chunk-YEAJZSES.js";import"./chunk-Q33MTWNZ.js";import"./chunk-K3SEMIKF.js";import"./chunk-RI4ITM2W.js";import"./chunk-GWXDYAFY.js";import"./chunk-KXOXMNFV.js";import"./chunk-GUEPTURI.js";import{a as Be}from"./chunk-CIHPCQIH.js";import{a as Se,c as ke}from"./chunk-I56WNY6G.js";import{a as De}from"./chunk-63G2GUFJ.js";import{c as Je,e as Le,f as qe,g as We,h as Te}from"./chunk-VQYMMPDN.js";import{b as je}from"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";import{existsSync as eo,mkdirSync as to,readFileSync as oo,rmSync as bt,writeFileSync as so}from"fs";import{tmpdir as no}from"os";import{dirname as ro,join as io,resolve as ao}from"path";var ue=1,lo="SOOTSIM_INSPECT_NOTICE_PATH",co=300*1e3,uo=15e3;function wt(){return ao(process.env[lo]||io(no(),"sootsim-inspect-notice-state.json"))}function mo(o,c){return Object.fromEntries(Object.entries(o).filter(([,i])=>typeof i?.signature=="string"&&Number.isFinite(i?.updatedAt)&&c-i.updatedAt<=co))}function po(o){let c=wt();if(!eo(c))return{version:ue,entries:{}};try{let i=JSON.parse(oo(c,"utf8"));return i.version!==ue||!i.entries||typeof i.entries!="object"?(bt(c,{force:!0}),{version:ue,entries:{}}):{version:ue,entries:mo(i.entries,o)}}catch{return bt(c,{force:!0}),{version:ue,entries:{}}}}function fo(o){let c=wt();to(ro(c),{recursive:!0}),so(c,JSON.stringify(o,null,2)+`
3
3
  `)}function go(o,c){let i=c.trim()||"default";return`${o}:${i}`}function Fe(o,c,i,l={}){let f=l.nowMs??Date.now(),a=l.cooldownMs??uo,g=po(f),h=go(o,c),M=g.entries[h];return M&&M.signature===i&&f-M.updatedAt<a?!1:(g.entries[h]={signature:i,updatedAt:f},fo(g),!0)}async function xt(o,c={args:[]}){let i=await Ue(o);if(j(c.args)){J(i);return}console.log(` nodes: ${i.nodes}`)}function Ae(o,c){let i=o.indexOf(c);return i>=0&&i+1<o.length?o[i+1]:null}async function $t(o){let{bridge:c,args:i,positional:l}=o,f=i.includes("--verbose")||i.includes("-v"),a=j(i),g=f&&!a,h=i.includes("--watch")||i.includes("-w"),M=1e3,k=i.includes("--compact"),w=i.includes("--no-xy"),S=i.includes("--no-clipped"),I=Ae(i,"--testid-like"),N=Ae(i,"--only"),O=Ae(i,"--subtree"),D=l[1],u=D?/[*?]/.test(D):!1,H=!u&&!N?D:void 0,B=N??(u?D:void 0),C=async()=>{await ge(c,{verbose:g});let Y=await Ye(c,{describe:!0,verbose:f,filter:H||"",testIdLike:I||void 0,onlyGlob:B||void 0,subtreeRoot:O||void 0,compact:k,hideXy:w}),$=Y?.tree,T=Y?.shell,q=Y?.keyboard;if(a){J({shell:T,tree:$??"",keyboard:q});return}if(T&&typeof T=="object"){let E=[T.state?`state=${T.state}`:null,T.activeApp?`app=${T.activeApp}`:null,T.showSwitcher?"switcher":null,T.switcherPhase&&T.switcherPhase!=="idle"?`phase=${T.switcherPhase}`:null].filter(Boolean);E.length>0&&console.log(` shell: ${E.join(" ")}`)}if(typeof $=="string"&&$.startsWith("__SUBTREE_NOT_FOUND__:")){let E=$.slice(22);console.log(` subtree root not found: ${E}`),Q("subtree-root-not-found",E);return}if(!$){let E=Y?.nodeCount??0;console.log(" no matching nodes found"),!(H||I||B||O)&&E<10&&Q("app-still-loading",E);return}let z=$,G=0;if(S&&typeof z=="string"){let E=z.split(`
4
4
  `),se=[];for(let pe of E){if(pe.includes("(clipped:")){G+=1;continue}se.push(pe)}z=se.join(`
5
5
  `)}console.log(z),G>0&&console.log(` ${G} clipped row(s) hidden (omit --no-clipped to see)`);let re=H||I||B||O;if((H||I||B)&&!h&&Q("describe-filter-context"),!re&&!h&&$.split(`
@@ -114,7 +114,7 @@ import{a as Q}from"./chunk-RRPKIYG7.js";import{a as pt,b as ft}from"./chunk-HPJI
114
114
  `);console.log(`${t??""}
115
115
 
116
116
  ${n}
117
- `),process.exit(0)}let I=f.wsPort,N=f.simId,O=f.simIdSource,D=f.commandTimeoutMs;if(g==="list"&&l.some(e=>e==="--drivers"||e==="-D")){let{buildDriverListRows:e}=await import("./drivers-YFPP36NV.js"),t=e();console.log(` available drivers (${t.length}):
117
+ `),process.exit(0)}let I=f.wsPort,N=f.simId,O=f.simIdSource,D=f.commandTimeoutMs;if(g==="list"&&l.some(e=>e==="--drivers"||e==="-D")){let{buildDriverListRows:e}=await import("./drivers-UYPTYLEX.js"),t=e();console.log(` available drivers (${t.length}):
118
118
  `);let n=Math.max(...t.map(s=>s.id.length),6),r=Math.max(...t.map(s=>s.kind.length),4);for(let s of t){let d=s.available?"\u2713":"\u2717",m=s.id.padEnd(n),y=s.kind.padEnd(r);console.log(` ${d} ${m} ${y} ${s.description}`),s.available&&s.detail?console.log(` ${s.detail}`):!s.available&&s.reason&&console.log(` unavailable: ${s.reason}`)}return}let u=Le(f),H=N||"default",B=new Set(["errors","warnings","requests","js","eval","reload","globals","perf","list","wait","sleep"]),C=200;function oe(e){let t=e.replace(/\s+/g," ").trim();if(!t)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(t)){let r=/<title[^>]*>([^<]+)<\/title>/i.exec(e)?.[1]?.trim(),s=/<body[^>]*>([\s\S]*?)<\//i.exec(e)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),d=r||s||"html error page";return`<html ${e.length}B> "${d}" (body elided \u2014 add --json for the full payload)`}return t.length<=C?t:`${t.slice(0,C)}\u2026 (+${t.length-C} more bytes)`}function Y(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){let t=he()?5e3:1500;try{let{settled:n,elapsed:r}=await ee({bridge:e,maxMs:t,pollMs:32,stablePolls:2});n||process.stderr.write(` \u26A0 auto-wait timed out after ${r??t}ms \u2014 next command may see mid-animation state. use \`sootsim do settle\` for a longer wait.
119
119
  `)}catch{}}function T(e){return!(!e||e.hit===!1||e.ok===!1||e.pointerTapHandled===!1&&!e.keyboardOpened&&!e.isTextInput)}function q(e,t){return{id:e.target?.id??e.match?.id??e.node?.id??null,testID:e.target?.testID??e.match?.testID??e.node?.testID??null,text:e.target?.text??e.target?.accessibilityLabel??e.match?.text??e.match?.accessibilityLabel??e.node?.text??t??null,type:e.target?.type??e.match?.type??e.node?.type??null}}async function z(e){let t=0,n=null,r=null;try{await ee({bridge:u,maxMs:he()?3e3:1200,pollMs:32,stablePolls:2})}catch{}let s=Date.now()+(he()?5e3:2500);for(;Date.now()<=s||t===0;){t++;let d=await e.resolve();if(n=d,d?.error==="bridge-not-ready"||d?.ambiguous||d?.nthOutOfRange)return{payload:d,result:null,attempts:t,failure:"special"};if(d&&typeof d.cx=="number"&&typeof d.cy=="number"){let y=await u.send({type:"tap",x:d.cx,y:d.cy,target:q(d,e.textFallback)});if(r=y,T(y))return{payload:d,result:y,attempts:t}}let m=s-Date.now();if(m<=0)break;try{await ee({bridge:u,maxMs:Math.min(m,700),pollMs:32,stablePolls:2})}catch{await Z(Math.min(120,m))}}return{payload:n,result:r,attempts:t,failure:n&&typeof n.cx=="number"?"missed":"not-found"}}function G(e,t){console.error(` tap failed: ${e} stayed visible but did not receive a hittable press after ${t.attempts} attempt${t.attempts===1?"":"s"}`),t.result&&console.error(` last result: ${JSON.stringify(t.result)}`)}async function re(){try{return await u.send({type:"evaluate",code:`(() => ({
120
120
  console: window.__sootsimConsole?.count?.() || null,
@@ -0,0 +1,2 @@
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as o}from"./chunk-HYHZ6RNF.js";import"./chunk-DPEKE6KI.js";import"./chunk-YAAFZCFV.js";import"./chunk-6U6RQ6NC.js";import"./chunk-3HWWX5E3.js";import"./chunk-VQYMMPDN.js";import"./chunk-ZF2JD3AH.js";import"./chunk-UJ3GDA34.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";async function t(n){console.error(" note: `sootsim install` is now `sootsim setup-repo`. forwarding\u2026\n"),await o(n)}export{t as runInstall};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as b}from"./chunk-VB7Z7JWH.js";import{a as x}from"./chunk-34TWXW7Z.js";import"./chunk-P3WJGZTF.js";import{spawn as k,spawnSync as u}from"child_process";import{chmodSync as S,createWriteStream as E,existsSync as w,mkdirSync as y,renameSync as T,rmSync as g,statSync as P}from"fs";import{tmpdir as D}from"os";import{dirname as M,join as f,resolve as v}from"path";var h="https://sootbean.com/api/electron-release";function A(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",n=`sootsim-latest-${o}.dmg`;return{platform:o,filename:n,url:`${h}/${n}`,install:_}}if(process.platform==="linux"){let o="sootsim-latest-linux-x64.AppImage";return{platform:"linux-x64",filename:o,url:`${h}/${o}`,install:L}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:C}}return null}async function O({url:r,dest:o,onProgress:n}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${r})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");y(M(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,n?.(c,a)}}finally{await new Promise((l,p)=>{i.end(e=>e?p(e):l())})}}function I(r,o){let n=(r/1048576).toFixed(1);if(!o)return` ${n} MB`;let s=Math.min(100,Math.round(r/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${n} / ${t} MB`}async function _(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let n=o.stdout.trim().split(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as b}from"./chunk-DPEKE6KI.js";import{a as x}from"./chunk-RI4ITM2W.js";import"./chunk-G7YSDJ47.js";import{spawn as k,spawnSync as u}from"child_process";import{chmodSync as S,createWriteStream as E,existsSync as w,mkdirSync as y,renameSync as T,rmSync as g,statSync as P}from"fs";import{tmpdir as D}from"os";import{dirname as M,join as f,resolve as v}from"path";var h="https://sootbean.com/api/electron-release";function A(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",n=`sootsim-latest-${o}.dmg`;return{platform:o,filename:n,url:`${h}/${n}`,install:_}}if(process.platform==="linux"){let o="sootsim-latest-linux-x64.AppImage";return{platform:"linux-x64",filename:o,url:`${h}/${o}`,install:L}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:C}}return null}async function O({url:r,dest:o,onProgress:n}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`download failed: ${s.status} ${s.statusText} (${r})`);let t=s.headers.get("content-length"),a=t?Number(t):null;if(!s.body)throw new Error("download failed: empty response body");y(M(o),{recursive:!0});let i=E(o),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,n?.(c,a)}}finally{await new Promise((l,p)=>{i.end(e=>e?p(e):l())})}}function I(r,o){let n=(r/1048576).toFixed(1);if(!o)return` ${n} MB`;let s=Math.min(100,Math.round(r/o*100)),t=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${n} / ${t} MB`}async function _(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let n=o.stdout.trim().split(`
3
3
  `),t=n[n.length-1].split(" ").pop()?.trim();if(!t||!w(t))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=f(t,"sootsim.app");if(!w(a))throw u("hdiutil",["detach","-force",t]),new Error(`sootsim.app not found inside ${t}`);let i="/Applications",d=v(process.env.HOME||"","Applications"),c=i;try{let m=f(i,`.sootsim-write-probe-${process.pid}`);u("touch",[m]),w(m)?g(m,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=u("cp",["-R",a,l]),e=u("hdiutil",["detach","-force",t]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return e.status!==0&&console.warn(` warning: failed to unmount ${t} (${e.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",l]),l}async function L(r){let o=v(process.env.HOME||"","Applications");y(o,{recursive:!0});let n=f(o,"sootsim.AppImage");return w(n)&&g(n,{force:!0}),T(r,n),S(n,493),n}async function C(r){return await new Promise((o,n)=>{let s=k("cmd",["/c","start",'""',"/wait",r],{stdio:"inherit"});s.once("error",n),s.once("exit",t=>{t===0?o():n(new Error(`installer exited with code ${t}`))})}),r}async function Y(r){(r.includes("--help")||r.includes("-h"))&&(console.log(`
4
4
  sootsim install-desktop \u2014 download and install the optional desktop GUI
5
5
 
@@ -20,4 +20,4 @@ examples:
20
20
  `),process.exit(0));let o=r.includes("--yes")||r.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,n=r.includes("--force"),s=x();if(s&&!n){console.log(` sootsim desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let t=A();if(t||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, win32-x64"),process.exit(1)),console.log(` platform: ${t.platform}`),console.log(` download: ${t.url}`),console.log(),!o){if(!await b("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(D(),`sootsim-install-${Date.now()}`),i=f(a,t.filename),d=0;process.stdout.write(` downloading ${t.filename}...
21
21
  `);try{await O({url:t.url,dest:i,onProgress:(e,m)=>{let $=Date.now();$-d<100&&e<(m??1/0)||(d=$,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${I(e,m)}`))}})}catch(e){g(a,{recursive:!0,force:!0}),console.error(`
22
22
  download failed: ${e instanceof Error?e.message:String(e)}`),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
23
- `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-FMUIUQIW.js");try{let e=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${e}`)}catch(e){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:e instanceof Error?e.message:String(e)}}),await p(),console.error(` install failed: ${e instanceof Error?e.message:String(e)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{Y as runInstallDesktop};
23
+ `);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-H2HZFBM3.js");try{let e=await t.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:t.platform,size_bytes:c}}),console.log(` installed: ${e}`)}catch(e){l({event:"cli_install_desktop_failed",properties:{platform:t.platform,error:e instanceof Error?e.message:String(e)}}),await p(),console.error(` install failed: ${e instanceof Error?e.message:String(e)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" sootsim electron launch the desktop app"),console.log(" sootsim open <target> open a demo or bundle in it")}export{Y as runInstallDesktop};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as l,b as d,c as k,d as y,e as g}from"./chunk-5OJK5LYU.js";import{d as c}from"./chunk-GYXN4445.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as l,b as d,c as k,d as y,e as g}from"./chunk-YUSYVLWH.js";import{d as c}from"./chunk-3HWWX5E3.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";async function a(){let s=await c();return s?.token||(process.stderr.write(" sootsim keys ... needs you to be signed in.\n run `sootsim login` first.\n"),process.exit(1)),{origin:s.origin,token:s.token}}function f(s){if(!s)return"never";try{return new Date(s).toLocaleString()}catch{return s}}async function h(s){let i=s[0];if(!i||i==="--help"||i==="-h"){u();return}if(i==="list"){let{origin:o,token:e}=await a(),n=await fetch(`${o.replace(/\/$/,"")}/api/sootsim/billing/keys`,{headers:{authorization:`Bearer ${e}`}});n.ok||(console.error(` keys list failed (${n.status})`),process.exit(1));let{keys:r}=await n.json();if(r.length===0){console.log(" no keys. create one with `sootsim keys create <label>`.");return}for(let t of r)console.log(` ${t.keyPrefix}\u2026 ${t.label.padEnd(24)} scopes=${t.scopes.join(",")} last=${f(t.lastUsedAt)} id=${t.id}`);return}if(i==="create"){let o=s[1]?.trim();o||(console.error(" usage: sootsim keys create <label>"),process.exit(1));let{origin:e,token:n}=await a(),r=await fetch(`${e.replace(/\/$/,"")}/api/sootsim/billing/keys`,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},body:JSON.stringify({label:o})});r.ok||(console.error(` keys create failed (${r.status}): ${await r.text()}`),process.exit(1));let t=await r.json();console.log(`
3
3
  created: ${t.record.label} (${t.record.keyPrefix}\u2026)`),console.log(` scopes: ${t.record.scopes.join(",")}`),console.log(`
4
4
  secret: ${t.secret}
5
5
  `),console.log(` copy this now \u2014 we can't show it again.
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import"./chunk-5CPW2643.js";import{b as m}from"./chunk-SL4MHVAB.js";import{a as u}from"./chunk-34TWXW7Z.js";import"./chunk-OAATHYER.js";import"./chunk-LAZ7FFOW.js";import"./chunk-6EMLKJ4H.js";import{D as c,E as r,F as l,y as s,z as a}from"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";import{spawn as p}from"child_process";import{existsSync as h}from"fs";async function I(n){if(n.includes("--help")||n.includes("-h")){console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import"./chunk-A7HWACJO.js";import{b as m}from"./chunk-K3SEMIKF.js";import{a as u}from"./chunk-RI4ITM2W.js";import"./chunk-GWXDYAFY.js";import"./chunk-KXOXMNFV.js";import"./chunk-GUEPTURI.js";import{D as c,E as r,F as l,y as s,z as a}from"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";import{spawn as p}from"child_process";import{existsSync as h}from"fs";async function I(n){if(n.includes("--help")||n.includes("-h")){console.log(`
3
3
  sootsim launch \u2014 one-shot: install runtime if needed, start daemon, open app
4
4
 
5
5
  usage:
@@ -13,4 +13,4 @@ options:
13
13
  examples:
14
14
  sootsim launch
15
15
  sootsim launch --version 1.2.3
16
- `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-H4NZF64R.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await t(["install",...o],{channel:n.channel})}async function d(){let n=r();if(l(n))return;console.log("sootsim: starting daemon");let e=w();p(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let t=Date.now()+8e3;for(;Date.now()<t;){let o=r();if(l(o))return;await g(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function x(){u()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await m.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function w(){let n=process.argv[1];return n&&h(n)?n:"sootsim"}function g(n){return new Promise(e=>setTimeout(e,n))}async function R(){s(),await d()}export{R as ensureDaemonRunning,I as runLaunch};
16
+ `);return}let e=n.includes("--no-runtime-install"),i=n.indexOf("--channel"),t=i>=0&&n[i+1]?n[i+1]:"stable",o=n.indexOf("--version"),f=o>=0&&n[o+1]?n[o+1]:void 0;s(),await v({skipAutoInstall:e,channel:t,explicitVersion:f}),await d(),await x()}async function v(n){let e=a(),i=c();if(e&&i)return;n.skipAutoInstall&&(console.error(" no sootsim runtime installed. run `sootsim runtime install` first, or drop --no-runtime-install."),process.exit(1)),console.log("sootsim: first run \u2014 installing runtime");let{runRuntime:t}=await import("./runtime-AK263273.js"),o=[];n.explicitVersion&&o.push(n.explicitVersion),n.channel!=="stable"&&o.push("--channel",n.channel),await t(["install",...o],{channel:n.channel})}async function d(){let n=r();if(l(n))return;console.log("sootsim: starting daemon");let e=w();p(e,["server","--quiet"],{detached:!0,stdio:"ignore",env:process.env}).unref();let t=Date.now()+8e3;for(;Date.now()<t;){let o=r();if(l(o))return;await g(150)}console.error(" daemon didn't become ready within 8s \u2014 check ~/.sootsim/ or run `sootsim server` in a terminal to see errors"),process.exit(1)}async function x(){u()||(console.error(" no sootsim desktop companion installed. run `sootsim install-desktop` to download electron + the shell."),process.exit(1));let e=await m.launch({});e.launched||(console.error(` ${e.message}`),process.exit(1)),console.log(` ${e.message}`)}function w(){let n=process.argv[1];return n&&h(n)?n:"sootsim"}function g(n){return new Promise(e=>setTimeout(e,n))}async function R(){s(),await d()}export{R as ensureDaemonRunning,I as runLaunch};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{b as f,d as m}from"./chunk-GYXN4445.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(t){if(t)return t;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${h}/api/auth/me`)).ok)return h}catch{}return I}function R(){console.log(`
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{b as f,d as m}from"./chunk-3HWWX5E3.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";import{exec as S}from"node:child_process";import{randomBytes as $}from"node:crypto";import _ from"node:http";var I=process.env.SOOTSIM_AUTH_ORIGIN||"https://sootbean.com",h="http://localhost:3000";async function x(t){if(t)return t;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${h}/api/auth/me`)).ok)return h}catch{}return I}function R(){console.log(`
3
3
  sootsim login \u2014 sign in so desktop uploads can attach to your account
4
4
 
5
5
  usage:
@@ -21,6 +21,6 @@ options:
21
21
  <p style="color:#ccc">${t}</p>
22
22
  </div>
23
23
  </body>
24
- </html>`}async function P(t){try{let o=await fetch(`${t.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(o.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!o.ok){let c=await o.text().catch(()=>"");return{ok:!1,error:`dev-login ${o.status}: ${c}`}}let e=await o.json();return e.token?{ok:!0,token:e.token,userId:e.user?.id,email:e.email}:{ok:!1,error:"dev-login response missing token"}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"dev-login fetch failed"}}}function A(t){try{let o=new URL(t).hostname;return o==="localhost"||o==="127.0.0.1"||o.endsWith(".local")}catch{return!1}}async function G(t){(t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let o=[...t],e=await x(T(o,"--origin"));if(A(e)){console.log(` detected local origin (${e}) \u2014 signing in as dev user`);let r=await P(e);if(r.ok){f({token:r.token,user:r.userId?{id:r.userId,email:r.email}:null,origin:e,source:"cli"});let s=await m(e),l=s?.user?.email||r.email||s?.user?.id||r.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-FMUIUQIW.js");n({event:"cli_login_succeeded",identity:{userId:r.userId??s?.user?.id??null},properties:{origin:e,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${r.error}); falling back to browser`)}let c=$(16).toString("hex"),i=await new Promise(r=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,O=a.searchParams.get("userId")||void 0,g=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),g){n.end(u(`sign-in failed: ${g}`)),r({ok:!1,error:g}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),r({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),r({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),r({ok:!0,token:k,email:b,userId:O}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),r({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){r({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${e.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",e),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
24
+ </html>`}async function P(t){try{let o=await fetch(`${t.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(o.status===403)return{ok:!1,error:"dev-login disabled (not in dev mode)"};if(!o.ok){let c=await o.text().catch(()=>"");return{ok:!1,error:`dev-login ${o.status}: ${c}`}}let e=await o.json();return e.token?{ok:!0,token:e.token,userId:e.user?.id,email:e.email}:{ok:!1,error:"dev-login response missing token"}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"dev-login fetch failed"}}}function A(t){try{let o=new URL(t).hostname;return o==="localhost"||o==="127.0.0.1"||o.endsWith(".local")}catch{return!1}}async function G(t){(t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let o=[...t],e=await x(T(o,"--origin"));if(A(e)){console.log(` detected local origin (${e}) \u2014 signing in as dev user`);let r=await P(e);if(r.ok){f({token:r.token,user:r.userId?{id:r.userId,email:r.email}:null,origin:e,source:"cli"});let s=await m(e),l=s?.user?.email||r.email||s?.user?.id||r.userId,{trackCliEvent:n,flushCliTelemetry:a}=await import("./telemetry-H2HZFBM3.js");n({event:"cli_login_succeeded",identity:{userId:r.userId??s?.user?.id??null},properties:{origin:e,mode:"dev"}}),await a(),console.log(` signed in${l?` as ${l}`:""} (dev)`);return}console.log(` dev-login not available (${r.error}); falling back to browser`)}let c=$(16).toString("hex"),i=await new Promise(r=>{let s=_.createServer((l,n)=>{try{let a=new URL(l.url||"/","http://127.0.0.1"),w=a.searchParams.get("state"),k=a.searchParams.get("token"),b=a.searchParams.get("email")||void 0,O=a.searchParams.get("userId")||void 0,g=a.searchParams.get("error");if(n.setHeader("content-type","text/html; charset=utf-8"),g){n.end(u(`sign-in failed: ${g}`)),r({ok:!1,error:g}),s.close();return}if(w!==c){n.end(u("state mismatch. close this tab and retry `sootsim login`.")),r({ok:!1,error:"state mismatch"}),s.close();return}if(!k){n.end(u("missing token. close this tab and retry `sootsim login`.")),r({ok:!1,error:"missing token"}),s.close();return}n.end(u("sign-in complete. you can return to the terminal.")),r({ok:!0,token:k,email:b,userId:O}),s.close()}catch(a){n.statusCode=500,n.end(u("sign-in callback failed. retry `sootsim login`.")),r({ok:!1,error:a instanceof Error?a.message:"callback failed"}),s.close()}});s.listen(0,"127.0.0.1",()=>{let l=s.address();if(!l||typeof l=="string"){r({ok:!1,error:"failed to bind callback server"}),s.close();return}let n=new URL(`${e.replace(/\/$/,"")}/auth/sootsim-cli`);n.searchParams.set("state",c),n.searchParams.set("port",String(l.port)),n.searchParams.set("sootbean",e),console.log(" opening browser for sootsim login..."),console.log(` waiting for callback on 127.0.0.1:${l.port}`),console.log(` if nothing opens, visit:
25
25
  ${n.toString()}
26
- `),L(n.toString())})});if(!i.ok){let{trackCliEvent:r,flushCliTelemetry:s}=await import("./telemetry-FMUIUQIW.js");r({event:"cli_login_failed",properties:{origin:e,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}f({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:e,source:"cli"});let d=await m(e),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-FMUIUQIW.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:e}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
26
+ `),L(n.toString())})});if(!i.ok){let{trackCliEvent:r,flushCliTelemetry:s}=await import("./telemetry-H2HZFBM3.js");r({event:"cli_login_failed",properties:{origin:e,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}f({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:e,source:"cli"});let d=await m(e),p=d?.user?.email||i.email||d?.user?.id||i.userId,{trackCliEvent:y,flushCliTelemetry:v}=await import("./telemetry-H2HZFBM3.js");y({event:"cli_login_succeeded",identity:{userId:i.userId??d?.user?.id??null},properties:{origin:e}}),await v(),console.log(` signed in${p?` as ${p}`:""}`)}export{G as runLogin};
@@ -1,2 +1,2 @@
1
- /*! sootsim v0.1.73 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- import{a as r,b as i}from"./chunk-ODLY2N63.js";import{a as t,c as o}from"./chunk-GYXN4445.js";import"./chunk-ZGHJUI77.js";import"./chunk-P3WJGZTF.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
1
+ /*! sootsim v0.1.74 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import{a as r,b as i}from"./chunk-6U6RQ6NC.js";import{a as t,c as o}from"./chunk-3HWWX5E3.js";import"./chunk-WC5LXGUR.js";import"./chunk-G7YSDJ47.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};