sootsim 0.1.299 → 0.1.301

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 (149) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-3UVOB3T3.js → agent-DWXNDXDJ.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-XVOWC72E.js → agent-wrapper-DTPQFEMR.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-C222PFAQ.js → app-fonts-MKW6UNBO.js} +2 -2
  5. package/dist-cli/chunks/{assert-2MHAZDEL.js → assert-GN4KR5TI.js} +2 -2
  6. package/dist-cli/chunks/{auth-7DTOEHC2.js → auth-HLOV4GZN.js} +2 -2
  7. package/dist-cli/chunks/{beta-WOHZHXPE.js → beta-DP7K4JVJ.js} +2 -2
  8. package/dist-cli/chunks/{camera-XCUE5ZNM.js → camera-SH6FT7ZA.js} +2 -2
  9. package/dist-cli/chunks/{chunk-FLTBPGAQ.js → chunk-3XC55LRK.js} +2 -2
  10. package/dist-cli/chunks/{chunk-XMOYKSSM.js → chunk-4FCN3KOD.js} +2 -2
  11. package/dist-cli/chunks/{chunk-2FTQEDJC.js → chunk-4MNKKMYG.js} +2 -2
  12. package/dist-cli/chunks/{chunk-ZEXLS32P.js → chunk-4OZG2LQA.js} +3 -3
  13. package/dist-cli/chunks/{chunk-WCAT3UC4.js → chunk-4PKUB2QX.js} +2 -2
  14. package/dist-cli/chunks/{chunk-VR4ZUUA4.js → chunk-6MFFAN7Q.js} +1 -1
  15. package/dist-cli/chunks/{chunk-ONQYJYUM.js → chunk-77CFHIGG.js} +1 -1
  16. package/dist-cli/chunks/{chunk-6RH6PEO3.js → chunk-7LULF3D2.js} +1 -1
  17. package/dist-cli/chunks/{chunk-E2XMG2HC.js → chunk-7RU45W2O.js} +1 -1
  18. package/dist-cli/chunks/{chunk-ITSHLH5U.js → chunk-BGY7U4IH.js} +2 -2
  19. package/dist-cli/chunks/{chunk-MKIABOQK.js → chunk-DNH4ZWVK.js} +2 -2
  20. package/dist-cli/chunks/{chunk-L7GNKY3A.js → chunk-EKNSKDBI.js} +1 -1
  21. package/dist-cli/chunks/{chunk-PHBVCGV3.js → chunk-EODC7ZE7.js} +2 -2
  22. package/dist-cli/chunks/{chunk-WMLVFFXE.js → chunk-FVNWUEK2.js} +3 -3
  23. package/dist-cli/chunks/{chunk-JXHCBXUD.js → chunk-HEPIUAFX.js} +3 -3
  24. package/dist-cli/chunks/{chunk-FMQ772D7.js → chunk-IRNRCBRW.js} +1 -1
  25. package/dist-cli/chunks/{chunk-I4NK5VBB.js → chunk-J22XZAGG.js} +2 -2
  26. package/dist-cli/chunks/{chunk-DGWM3X4S.js → chunk-JDQ5AJJ4.js} +2 -2
  27. package/dist-cli/chunks/{chunk-23JBOG4P.js → chunk-KEFBMDYK.js} +1 -1
  28. package/dist-cli/chunks/{chunk-YEE3MKPH.js → chunk-KYGB26L4.js} +2 -2
  29. package/dist-cli/chunks/{chunk-Q34734UC.js → chunk-LE6JWEXU.js} +1 -1
  30. package/dist-cli/chunks/{chunk-QMDKE3C6.js → chunk-M33LQWC2.js} +1 -1
  31. package/dist-cli/chunks/{chunk-5GRQIA5R.js → chunk-MFLCDFRS.js} +2 -2
  32. package/dist-cli/chunks/{chunk-ZRDU2ENE.js → chunk-MKQNHDDF.js} +2 -2
  33. package/dist-cli/chunks/{chunk-QPPG5YZS.js → chunk-MPDBF324.js} +2 -2
  34. package/dist-cli/chunks/{chunk-ALOQJP4C.js → chunk-NEKVW4FE.js} +2 -2
  35. package/dist-cli/chunks/{chunk-MTOADQY2.js → chunk-NR2G2PSN.js} +2 -2
  36. package/dist-cli/chunks/{chunk-L3FA7WE5.js → chunk-NWM62KI3.js} +2 -2
  37. package/dist-cli/chunks/{chunk-KJQJ5VPA.js → chunk-OVEH5OOR.js} +1 -1
  38. package/dist-cli/chunks/{chunk-RWXJ6OS4.js → chunk-P2HUPEXS.js} +2 -2
  39. package/dist-cli/chunks/{chunk-LEHK72DK.js → chunk-PPD77GEP.js} +2 -2
  40. package/dist-cli/chunks/{chunk-MSYFSZKB.js → chunk-Q4ZLYMUP.js} +1 -1
  41. package/dist-cli/chunks/{chunk-WM4RNTPN.js → chunk-QNQP3WYV.js} +3 -3
  42. package/dist-cli/chunks/{chunk-UNFMIX7B.js → chunk-RCH5EVVP.js} +1 -1
  43. package/dist-cli/chunks/{chunk-444BQYY3.js → chunk-RW75MMQZ.js} +2 -2
  44. package/dist-cli/chunks/chunk-SDBIR5ON.js +4 -0
  45. package/dist-cli/chunks/{chunk-5VX2Y3ZB.js → chunk-SOBEJUH4.js} +2 -2
  46. package/dist-cli/chunks/{chunk-LFWATDB3.js → chunk-STF4UH5I.js} +2 -2
  47. package/dist-cli/chunks/{chunk-EJC4A2ZH.js → chunk-TABUERS3.js} +1 -1
  48. package/dist-cli/chunks/{chunk-DUGY7KHN.js → chunk-UK7X4OX3.js} +1 -1
  49. package/dist-cli/chunks/{chunk-G377NNEV.js → chunk-V2SZPQJF.js} +1 -1
  50. package/dist-cli/chunks/chunk-VXRYV6G6.js +4 -0
  51. package/dist-cli/chunks/{chunk-37ACY2R3.js → chunk-WE74HC52.js} +2 -2
  52. package/dist-cli/chunks/{chunk-CBRE6JLP.js → chunk-WKSX2VHB.js} +1 -1
  53. package/dist-cli/chunks/{chunk-B6TCNXJO.js → chunk-Y4EES4A2.js} +2 -2
  54. package/dist-cli/chunks/{chunk-HM42NCGX.js → chunk-YIBVYNHV.js} +1 -1
  55. package/dist-cli/chunks/{chunk-F57XAX5N.js → chunk-YOLPZLST.js} +1 -1
  56. package/dist-cli/chunks/{chunk-W3H6FBWV.js → chunk-YTUW6DGN.js} +2 -2
  57. package/dist-cli/chunks/{chunk-4TYUHNHI.js → chunk-YXRD4B4X.js} +2 -2
  58. package/dist-cli/chunks/{cleanup-O6SD44HN.js → cleanup-DIDGDPIX.js} +2 -2
  59. package/dist-cli/chunks/{cli-version-PIYRRI52.js → cli-version-K3UX3EWQ.js} +2 -2
  60. package/dist-cli/chunks/{compat-AWJLEWTH.js → compat-CU5BZOTA.js} +2 -2
  61. package/dist-cli/chunks/{config-6PLYOSBK.js → config-ZDPMF7NT.js} +2 -2
  62. package/dist-cli/chunks/{control-K4QMNPXN.js → control-PKNXORO3.js} +2 -2
  63. package/dist-cli/chunks/daemon-OXELSM3C.js +4 -0
  64. package/dist-cli/chunks/{debug-YCJCLH35.js → debug-FRVAHAUX.js} +3 -3
  65. package/dist-cli/chunks/{desktop-NRUWYSTV.js → desktop-RM4LA63P.js} +3 -3
  66. package/dist-cli/chunks/{detox-XTERPTZN.js → detox-XXPJIQFG.js} +2 -2
  67. package/dist-cli/chunks/{device-G4KJITB6.js → device-5CWUNYYM.js} +2 -2
  68. package/dist-cli/chunks/{diagnose-CKZOV5PL.js → diagnose-7WHQUJOH.js} +2 -2
  69. package/dist-cli/chunks/disk-cleanup-EGAZA7DS.js +4 -0
  70. package/dist-cli/chunks/drivers-JEAO6IWD.js +4 -0
  71. package/dist-cli/chunks/{film-4T3QY3VT.js → film-EEAFWERR.js} +3 -3
  72. package/dist-cli/chunks/flow-DMSEJ526.js +4 -0
  73. package/dist-cli/chunks/help-BTYQFHMT.js +4 -0
  74. package/dist-cli/chunks/{hidden-runtime-alias-S2PPAYI3.js → hidden-runtime-alias-GEDAK5VD.js} +2 -2
  75. package/dist-cli/chunks/{home-paths-MUZXK2LA.js → home-paths-PE4236U4.js} +2 -2
  76. package/dist-cli/chunks/inspect-RKOCZZ2A.js +4 -0
  77. package/dist-cli/chunks/install-desktop-25G42KWB.js +4 -0
  78. package/dist-cli/chunks/{login-RH2KRRBQ.js → login-NBG6XEI2.js} +4 -4
  79. package/dist-cli/chunks/{logout-GIEQBBFN.js → logout-TLDRLFXP.js} +2 -2
  80. package/dist-cli/chunks/{maestro-JEAOFJLT.js → maestro-DHRICU2K.js} +3 -3
  81. package/dist-cli/chunks/{maestro-generate-GAYZAFOV.js → maestro-generate-QZAGYXXJ.js} +3 -3
  82. package/dist-cli/chunks/{mode-V2OWWT7B.js → mode-XOMKPZZG.js} +2 -2
  83. package/dist-cli/chunks/{optional-demo-registry-CZSJJFLR.js → optional-demo-registry-L66RRINW.js} +2 -2
  84. package/dist-cli/chunks/{perf-SNBPEVZL.js → perf-GSKQKH3W.js} +2 -2
  85. package/dist-cli/chunks/{permissions-MKMHM34X.js → permissions-D4XQ4HBT.js} +2 -2
  86. package/dist-cli/chunks/{record-55URP7AI.js → record-QTA3IWSU.js} +3 -3
  87. package/dist-cli/chunks/{report-issue-I4JZBUDD.js → report-issue-BVPBXZEM.js} +2 -2
  88. package/dist-cli/chunks/runtime-UQY75DPC.js +4 -0
  89. package/dist-cli/chunks/{screenshot-command-YGBR4Y2V.js → screenshot-command-YWDQBPE6.js} +3 -3
  90. package/dist-cli/chunks/{screenshots-capture-S5CP6OWZ.js → screenshots-capture-NUVPCCYY.js} +2 -2
  91. package/dist-cli/chunks/{serve-45NQNA7C.js → serve-FR5M2RRQ.js} +2 -2
  92. package/dist-cli/chunks/{setup-HKTRNWH6.js → setup-O4WMVQVP.js} +2 -2
  93. package/dist-cli/chunks/{skills-HUDGHVRT.js → skills-RUYLHJED.js} +2 -2
  94. package/dist-cli/chunks/{storage-HOYYA2PS.js → storage-OCCDGKMN.js} +2 -2
  95. package/dist-cli/chunks/store-56RG4ZWJ.js +4 -0
  96. package/dist-cli/chunks/telemetry-YSUNFE7N.js +4 -0
  97. package/dist-cli/chunks/{timeline-2S3FS3AA.js → timeline-QWPHBXJ2.js} +2 -2
  98. package/dist-cli/chunks/{upgrade-KZSYVT3E.js → upgrade-WUQAUREZ.js} +2 -2
  99. package/dist-cli/chunks/upload-D5BXJTXK.js +4 -0
  100. package/dist-cli/chunks/{version-BWNEYFPL.js → version-TCSZK3WH.js} +2 -2
  101. package/dist-cli/chunks/{web-DXSNL2J6.js → web-7P7SQTFS.js} +2 -2
  102. package/dist-cli/chunks/{what-happened-VT4FO7XN.js → what-happened-KIUBAPFB.js} +2 -2
  103. package/dist-lib/agent-daemon-client.cjs +1 -1
  104. package/dist-lib/agent-events.cjs +1 -1
  105. package/dist-lib/agent-identity.cjs +1 -1
  106. package/dist-lib/agent-sessions.cjs +1 -1
  107. package/dist-lib/attached-projects.cjs +1 -1
  108. package/dist-lib/auth/shared-session.cjs +1 -1
  109. package/dist-lib/backend-origin.cjs +1 -1
  110. package/dist-lib/beta.cjs +1 -1
  111. package/dist-lib/beta.mjs +1 -1
  112. package/dist-lib/bridge-constants.cjs +1 -1
  113. package/dist-lib/cli-constants.cjs +1 -1
  114. package/dist-lib/config.cjs +1 -1
  115. package/dist-lib/detox/index.cjs +1 -1
  116. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  117. package/dist-lib/home-paths.cjs +1 -1
  118. package/dist-lib/host/bridge-host.cjs +1 -1
  119. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  120. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  121. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  122. package/dist-lib/host/websocket-proxy.cjs +1 -1
  123. package/dist-lib/index.cjs +1 -1
  124. package/dist-lib/jump-to-source-babel.cjs +1 -1
  125. package/dist-lib/menu.cjs +1 -1
  126. package/dist-lib/menu.mjs +1 -1
  127. package/dist-lib/metro.cjs +1 -1
  128. package/dist-lib/profiles.cjs +1 -1
  129. package/dist-lib/render-mode.cjs +1 -1
  130. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  131. package/dist-lib/sdk.cjs +1 -1
  132. package/dist-lib/sdk.mjs +1 -1
  133. package/dist-lib/skills.cjs +304 -299
  134. package/dist-lib/vite.cjs +1 -1
  135. package/package.json +1 -1
  136. package/src/vite-plugin.ts +29 -9
  137. package/dist-cli/chunks/chunk-HVQA443X.js +0 -4
  138. package/dist-cli/chunks/chunk-IGKB2HLF.js +0 -4
  139. package/dist-cli/chunks/daemon-HG6LHW3O.js +0 -4
  140. package/dist-cli/chunks/disk-cleanup-LX6FRBNM.js +0 -4
  141. package/dist-cli/chunks/drivers-X6XG4AX4.js +0 -4
  142. package/dist-cli/chunks/flow-EQPPW77J.js +0 -4
  143. package/dist-cli/chunks/help-IRKWFF27.js +0 -4
  144. package/dist-cli/chunks/inspect-VGNST6ZA.js +0 -4
  145. package/dist-cli/chunks/install-desktop-5H7A5R3Z.js +0 -4
  146. package/dist-cli/chunks/runtime-XHMSVSWG.js +0 -4
  147. package/dist-cli/chunks/store-7QB3V42F.js +0 -4
  148. package/dist-cli/chunks/telemetry-HYW35ACO.js +0 -4
  149. package/dist-cli/chunks/upload-P3CQI4RQ.js +0 -4
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as m,b as T}from"./chunk-CBRE6JLP.js";import{a as w,b as A,c as C}from"./chunk-EJC4A2ZH.js";import{a as I}from"./chunk-QMDKE3C6.js";import{a as _,d as E}from"./chunk-F57XAX5N.js";import{G as O,o as x,q as f}from"./chunk-DUGY7KHN.js";import h from"fs";import v from"path";var c="default",j="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),j)}function H(e){return`sootsim-profile-${s(e)}`}function z(e){return v.join(x(),"Partitions",H(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function M(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:M(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:M([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
4
+ import{a as m,b as T}from"./chunk-WKSX2VHB.js";import{a as w,b as A,c as C}from"./chunk-TABUERS3.js";import{a as I}from"./chunk-M33LQWC2.js";import{a as _,d as E}from"./chunk-YOLPZLST.js";import{G as O,o as x,q as f}from"./chunk-UK7X4OX3.js";import h from"fs";import v from"path";var c="default",j="profiles.json",a=1;function s(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function g(){return v.join(f(),j)}function H(e){return`sootsim-profile-${s(e)}`}function z(e){return v.join(x(),"Partitions",H(e))}function y(e){return v.join(f(),"playwright",s(e))}function b(){try{let e=JSON.parse(h.readFileSync(g(),"utf8"));if(!e||e.version!==a)return{version:a,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:s(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:a,profiles:r}}catch{return{version:a,profiles:[]}}}function M(e){return[...e].sort((r,t)=>r.id===c?-1:t.id===c?1:r.id.localeCompare(t.id))}function P(e){if(e.profiles.some(t=>t.id===c))return{...e,profiles:M(e.profiles)};let r=new Date().toISOString();return{version:a,profiles:M([{id:c,createdAt:r,updatedAt:r},...e.profiles])}}function S(e){O();let r=P(e),t=`${g()}.tmp`;return h.writeFileSync(t,`${JSON.stringify(r,null,2)}
5
5
  `,"utf8"),h.renameSync(t,g()),r}function K(){return S(b()).profiles}function Y(e){let r=s(e);return K().find(t=>t.id===r)??null}function L(e=c){let r=s(e),t=Y(r);return t||V(r)}function V(e){let r=s(e),t=P(b());if(t.profiles.some(i=>i.id===r))throw new Error(`profile already exists: ${r}`);let o=new Date().toISOString(),n={id:r,createdAt:o,updatedAt:o};return S({version:a,profiles:[...t.profiles,n]}),n}function ge(e){let r=s(e);if(r===c)throw new Error("the default profile cannot be deleted; clear it instead");let t=P(b()),o=t.profiles.find(n=>n.id===r);if(!o)throw new Error(`profile not found: ${r}`);return S({version:a,profiles:t.profiles.filter(n=>n.id!==r)}),J(r),o}function J(e){let r=s(e);for(let t of[z(r),y(r)])try{h.rmSync(t,{recursive:!0,force:!0})}catch{}}function X(){let e=w();return e?{available:!0,reason:null,detail:e}:{available:!1,reason:"no chromium-family browser found (chrome, chromium, edge, brave, arc)"}}async function Z(e){if(e.headless)return{launched:!1,message:"the chromium driver launches a visible browser window and cannot run headless \u2014 a headless `chrome --headless=new` process exits immediately and the sim never connects. for headless automation use `--driver playwright`."};let r=w();if(!r)return{launched:!1,message:"chromium not found \u2014 install chrome or run `sootsim list --drivers`"};if(!e.url)return{launched:!1,message:"chromium driver requires a target url"};if(e.profileId||e.ephemeralProfile)return{launched:!1,message:"profiles require electron or playwright; browser tabs use your current Chrome profile"};try{let t=await C(e.url,{detached:e.detached??!0});return{launched:!0,message:`chromium launched \u2192 ${e.url}`,pid:t.pid,target:t.target??r,attachUrl:e.url}}catch(t){return{launched:!1,message:`chromium spawn failed: ${t instanceof Error?t.message:String(t)}`}}}var R={id:"chromium",name:"chromium",description:"system chrome / chromium / edge \u2014 visible window (headless: use playwright)",kind:"browser",availability:X,launch:Z};function Q(){let e=m();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"sootsim desktop app not installed (run `sootsim desktop install`)"}}async function ee(e){let r=m();if(!r)return{launched:!1,message:"sootsim desktop app not installed"};try{let t=await T(e.url,r,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile,ownerPid:e.ownerPid});return t.launched?{launched:!0,message:e.url?`electron launched via ${t.via} \u2192 ${e.url}`:`electron launched via ${t.via}`,target:t.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(t){return{launched:!1,message:`electron launch failed: ${t instanceof Error?t.message:String(t)}`}}}var W={id:"electron",name:"electron",description:"sootsim desktop companion app (native window, menu bar)",kind:"native",availability:Q,launch:ee};import{spawn as re}from"child_process";import{closeSync as te,mkdtempSync as oe,openSync as ie,readFileSync as ne}from"fs";import{createRequire as se}from"module";import{tmpdir as N}from"os";import{join as $}from"path";var ae=`
6
6
  const modulePath = process.env.SOOTSIM_PW_MODULE;
7
7
  const url = process.env.SOOTSIM_PW_URL;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  var p={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},m=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),d=new Set(["do","get","wait","shell","debug"]),b=new Set(["detox","maestro","record","film","storage","permissions","perf","screenshot","mode","inspect","debug","timeline","what-happened","shell","assert","device","open","list","use","claim","close","compat","report-issue","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","update","version","skill","config","cleanup","app-fonts","agent-wrapper","agent",...m]);function u(c){let r=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<r.length;){let o=r[s];if(o==="--"){e.commandArgs.push(...r.slice(s+1));break}let i=Object.entries(p).find(([a,t])=>a===o||t.short===o);if(i){let[a,t]=i,l=a.replace(/^--/,"");if(t.type==="boolean")e.globalFlags[l]=!0,s++;else{let n=r[s+1];if(n===void 0||n.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(t.type==="number"){let g=Number(n);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${n}"`),s+=2;continue}e.globalFlags[l]=g}else e.globalFlags[l]=n;s+=2}continue}if(!e.command&&!o.startsWith("-")){let a=o.indexOf("-");if(a>0){let t=o.slice(0,a),l=o.slice(a+1);if(d.has(t)&&l.length>0){e.command=t;let n=r.slice(s+1);e.commandArgs=[l,...n[0]==="--"?n.slice(1):n];break}}if(b.has(o)){e.command=o;let t=r.slice(s+1);e.commandArgs=t[0]==="--"?t.slice(1):t;break}e.commandArgs=r.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{m as a,u as b};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{b as A,e as T,g as E}from"./chunk-F57XAX5N.js";import{K as S,L as I,M as B,N as P,g as F}from"./chunk-DUGY7KHN.js";var b="http://localhost:5173/";import{WebSocket as $}from"ws";var W=null;function M(){let i=F();if(W?.homeDir===i)return W.world;let r=_();return W={homeDir:i,world:r},r}function _(){let i=I();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=S();return r&&B(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function U(i){let r=I();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=S();return e&&B(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function Q(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=I();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=S();return d&&B(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return M().bridgePort}function z(i,r){let e=U(i),d=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${d} :${i} (${t?`shell ${t}, `:""}${l})
4
+ import{b as A,e as T,g as E}from"./chunk-YOLPZLST.js";import{K as S,L as I,M as B,N as P,g as F}from"./chunk-UK7X4OX3.js";var b="http://localhost:5173/";import{WebSocket as $}from"ws";var W=null;function M(){let i=F();if(W?.homeDir===i)return W.world;let r=_();return W={homeDir:i,world:r},r}function _(){let i=I();if(i&&P(i))return{source:"dev-bridge",bridgePort:i.bridgePort,shellBaseUrl:i.shellPort?`http://localhost:${i.shellPort}/`:b};let r=S();return r&&B(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:b}:{source:"default",bridgePort:7668,shellBaseUrl:b}}function U(i){let r=I();if(r&&P(r)&&r.bridgePort===i)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:b};let e=S();return e&&B(e)&&e.bridgePort===i?{source:"daemon",shellBaseUrl:e.runtimePort>0?`http://localhost:${e.runtimePort}/`:b}:null}function Q(i){let r;try{let l=new URL(i);r=l.port?Number(l.port):l.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let e=I();if(e&&P(e)&&(e.shellPort===r||e.runtimePort===r||e.bridgePort===r))return e.bridgePort;let d=S();return d&&B(d)&&(d.runtimePort===r||d.bridgePort===r)?d.bridgePort:null}function D(){return M().bridgePort}function z(i,r){let e=U(i),d=e?.source==="dev-bridge"?"dev bridge":e?.source==="daemon"?"daemon bridge":"bridge",l=e?`${e.source}.json`:"no lockfile",t=r??e?.shellBaseUrl;process.stderr.write(` \u2192 ${d} :${i} (${t?`shell ${t}, `:""}${l})
5
5
  `)}var C=class extends Error{lock;constructor(r,e){super(r),this.name="BridgeSimLockedError",this.lock=e}};function N(i){return i==="flag"?"via --sim":i==="saved"?"saved via `sootsim use`":"primary fallback \u2014 no sim pinned"}function X(i,r={}){let e=new Set,d=r.port??D(),l=r.commandTimeoutMs??15e3,t,u="none",v=new Set(r.stripBooleanFlags??[]),y=new Set(r.stripValueFlags??[]);for(let n=0;n<i.length;n++){let a=i[n];if(a==="--port"||a==="-p"){e.add(n),n+1<i.length&&(e.add(n+1),d=Number(i[n+1])),n++;continue}if(a.startsWith("--port=")){e.add(n),d=Number(a.slice(7));continue}if(a==="--timeout"){e.add(n),n+1<i.length&&(e.add(n+1),l=Number(i[n+1])),n++;continue}if(a==="--sim"||a==="--session"||a==="--tab"){e.add(n),n+1<i.length&&(e.add(n+1),t=i[n+1]?.trim()||void 0,u="flag"),n++;continue}let s=a.startsWith("--sim=")?a.slice(6):a.startsWith("--session=")?a.slice(10):a.startsWith("--tab=")?a.slice(6):void 0;if(s!==void 0){e.add(n),t=s.trim()||void 0,u="flag";continue}if(v.has(a)){e.add(n);continue}y.has(a)&&(e.add(n),n+1<i.length&&e.add(n+1),n++)}if(!t){let n=T();n&&(t=n.trim()||void 0,u="saved")}return{positional:i.filter((n,a)=>!e.has(a)),wsPort:d,simId:t,simIdSource:u,commandTimeoutMs:l}}function R(i,r={}){let e=1,d=r.commandTimeoutMs??15e3,l=new Map,t=new $(`ws://localhost:${i}`),u=A(),v=new Promise((s,o)=>{t.on("open",()=>{try{t.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:r.cliLabel}))}catch{}s()}),t.on("error",c=>{let m=c.message?`: ${c.message}`:"";o(new Error(`could not connect to ws://localhost:${i}${m}`))})}),y=!1,n=!1;function a(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=N(o?r.simIdSource:"none");process.stderr.write(` \u2192 ${c} (${m})
6
6
  `)}return t.on("message",s=>{let o;try{o=JSON.parse(s.toString())}catch{return}if(o.id===0)return;let c=l.get(o.id);c&&(l.delete(o.id),o._otherCliCount>0&&!y&&(y=!0,process.stderr.write(`
7
7
  \u26A0 ${o._otherCliCount} other CLI identity/identities are driving this sim
@@ -1,3 +1,3 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  var a=["Cache","Code Cache","DawnCache","DawnGraphiteCache","DawnWebGPUCache","GPUCache","GrShaderCache","ShaderCache"],r=new Set(a);function s(e){return r.has(e)}export{a,s as b};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{H as t,L as n,N as l,j as r}from"./chunk-DUGY7KHN.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
4
+ import{H as t,L as n,N as l,j as r}from"./chunk-UK7X4OX3.js";function m(){let e=t(),i=r()?n():null;return i&&l(i)?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{m as a};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as R}from"./chunk-KJQJ5VPA.js";import{o as T}from"./chunk-DUGY7KHN.js";import{a as D}from"./chunk-FMQ772D7.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import f from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||T()}function y(){return _()}function B(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=B(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=B();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function U(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ye(e){let t=h.resolve(e.cwd),r=U(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function Se(){return S().attachedProjects}var Q=336*60*60*1e3;function we(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-Q,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function ve(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function Ae(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function V(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=V(t.agentSessions[c],s,r))}})}function v(e,t){z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-CZSJJFLR.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=U(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as Z,spawnSync as ee}from"node:child_process";import{randomUUID as te}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import re from"node:readline";function b(e){return u.join(y(),"sessions",e)}function W(e){return u.join(b(e),"prompt.in")}function J(e){return u.join(b(e),"events.out")}function ne(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function se(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=oe();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function oe(){try{let e=ie();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ie(){try{let r=D.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=ce();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ce(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ae(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!de(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function de(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=ee("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Re(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ae(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?te():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=W(s.id),d=J(s.id),a=ne(s.id);L(c),L(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=se(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=Z(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});x.unref();let E=e.readyTimeoutMs??6e3,j=await ue(d,p=>p.type==="ready"||p.type==="error",E);if(!j||j.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function Ne(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
4
+ import{a as R}from"./chunk-OVEH5OOR.js";import{o as T}from"./chunk-UK7X4OX3.js";import{a as D}from"./chunk-IRNRCBRW.js";function Y(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function I(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return Y(r)?r:null}catch{return null}}import{randomBytes as G,createHash as q}from"node:crypto";import f from"node:fs";import h from"node:path";var N=null;function _(){if(N)return N;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||T()}function y(){return _()}function B(){return h.join(_(),"attached-projects.json")}function $(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=B(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return $();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return $()}}function X(e){let t=B();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),X(t),t}function U(e){return q("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function K(){return`s_${G(10).toString("hex")}`}function ye(e){let t=h.resolve(e.cwd),r=U(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function F(e){return S().attachedProjects.find(t=>t.id===e)??null}function Se(){return S().attachedProjects}var Q=336*60*60*1e3;function we(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-Q,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function ve(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function Ae(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function M(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??K(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function C(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function V(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=V(t.agentSessions[c],s,r))}})}function v(e,t){z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-L66RRINW.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=U(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as Z,spawnSync as ee}from"node:child_process";import{randomUUID as te}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import re from"node:readline";function b(e){return u.join(y(),"sessions",e)}function W(e){return u.join(b(e),"prompt.in")}function J(e){return u.join(b(e),"events.out")}function ne(e){return u.join(y(),"transcripts",`${e}.log`)}function O(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function se(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=oe();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("sootsim CLI not found. set SOOTSIM_BIN to the path of the sootsim binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function oe(){try{let e=ie();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[sootsim] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ie(){try{let r=D.resolve("sootsim/package.json");return u.dirname(r)}catch{}let e=ce();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name==="sootsim")return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ce(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function ae(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!de(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function de(e){try{return process.kill(e,0),!0}catch{return!1}}function L(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=ee("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function Re(e){let t=F(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return ae(t.id,r,async()=>{let n=C(t.id).find(p=>p.provider===r&&p.status!=="ended"&&O(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`sootsim agent end <sessionId>\`.`);let o=r==="claude"?te():void 0,s=M({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=W(s.id),d=J(s.id),a=ne(s.id);L(c),L(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:H}=se(),P=[...H,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&P.push("--codex-bin",e.codexBin),e.claudeBin&&P.push("--claude-bin",e.claudeBin),e.freshThread&&P.push("--fresh-thread"),o&&P.push("--claude-session-uuid",o);let x=Z(A,P,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});x.unref();let E=e.readyTimeoutMs??6e3,j=await ue(d,p=>p.type==="ready"||p.type==="error",E);if(!j||j.type==="error"){if(x.pid)try{process.kill(x.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${E}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:x.pid,status:"idle"}),{session:k(s.id),wrapperPid:x.pid}})}async function Ne(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!O(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=W(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=R(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
5
5
  `)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function $e(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(O(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=b(e),n=y();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function _e(e,t){let r=J(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,m.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=re.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let a=I(d);a&&t(a)});let c=!1;return()=>{if(!c){c=!0;try{i.writeSync(n,`
6
6
  `)}catch{}try{s.close()}catch{}try{o.destroy()}catch{}}}}async function ue(e,t,r){let n=i.openSync(e,m.O_RDWR|m.O_NONBLOCK),o=Buffer.alloc(8192),s="",c=Date.now()+r;try{for(;Date.now()<c;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(a){if(a.code!=="EAGAIN")throw a;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let a;for(;(a=s.indexOf(`
7
7
  `))>=0;){let g=s.slice(0,a);s=s.slice(a+1);let A=I(g);if(A&&t(A))return A}}else await new Promise(a=>setTimeout(a,30))}return null}finally{i.closeSync(n)}}export{I as a,y as b,ye as c,F as d,Se as e,we as f,ve as g,Ae as h,k as i,C as j,V as k,z as l,Pe as m,b as n,W as o,J as p,ne as q,O as r,se as s,l as t,Re as u,Ne as v,$e as w,_e as x};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as P,k as m,l as S,m as R,n as _,o as v}from"./chunk-2FTQEDJC.js";var k="sootsim:settings",d=["productAnalytics","crashReports","colorScheme","reduceMotion","boldText","fontSize","largerAccessibilitySizes","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","showFrame","showMenuBar","showRail","solidWindow","ambientGlow","agentProvider"];function p(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function l(e){let t={};for(let n of d){if(!(n in e))continue;let o=e[n],i=S[n];i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||(t[n]=o)}return t}function K(e){let t={};for(let n of d)t[n]=e[n];return t}function M(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(k);return e?l(JSON.parse(e)):{}}catch{return{}}}function T(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(k,JSON.stringify(e))}catch{}}function x(){let t=p()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:l(t)}function A(e){let t=p();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:e})}catch{}}async function L(e){let t=p();return t?.writeSharedConfig?(await t.writeSharedConfig({settings:e}),!0):!1}function b(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function O(){let e=b()?.settings;return!e||typeof e!="object"?{}:l(e)}function B(e){if(!b())return;let t={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}async function F(e){if(!b()||typeof fetch>"u")return!1;let t=await fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:e}),keepalive:!0});if(!t.ok)throw new Error(`shared settings reset failed with HTTP ${t.status}`);return await t.text(),!0}function D(){let e=M(),t=O(),n=x();return{...e,...t,...n}}function V(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),A(n),B(n)}async function I(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),!await L(n)&&await F(n)}function j(e){if(typeof window>"u")return()=>{};let t=r=>{if(!(r.key!==k||r.newValue==null))try{e(l(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",t);let n=p(),o;n?.onSharedConfigChanged&&(o=n.onSharedConfigChanged(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))}));let a=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))});return()=>{window.removeEventListener("storage",t),o?.(),a?.()}}var N=_(),q=v(),y=D(),c=new Set,g={};for(let e of d)N[e]!==void 0&&(c.add(e),y[e]!==void 0&&(g[e]=y[e]),delete y[e]);var s={...q,...y},w=[],u=null;function h(){for(let e of w)e()}function E(){h(),V(s,g)}function C(e,t){let n=S[e];return n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]===t?!1:(s={...s,[e]:t},e==="deviceModel"&&(u=null),!0)}j(e=>{let t={...s},n=!1;for(let[o,i]of Object.entries(e)){let a=o;if(c.has(a)){g[a]=i;continue}t[a]!==i&&(t[a]=i,n=!0)}n&&(s=t,u=null,h())});var z={get(e){return s[e]},set(e,t){C(e,t)&&E()},setRuntime(e,t){c.has(e)||(c.add(e),d.includes(e)&&(g[e]=s[e])),C(e,t)&&h()},isRuntimeControlled(e){return c.has(e)},getAll(){return s},apply(e){let t=!1,n={...s};for(let[o,i]of Object.entries(e)){if(i===void 0)continue;let a=o,r=S[a];r&&(r.validate&&!r.validate(i)||r.options&&!r.options.includes(i)||n[a]!==i&&(n[a]=i,t=!0))}t&&(s=n,u=null,E())},applyRuntime(e){let t=!1;for(let n of Object.keys(e)){let o=e[n];o!==void 0&&(c.has(n)||(c.add(n),d.includes(n)&&(g[n]=s[n])),C(n,o)&&(t=!0))}t&&h()},reset(){s=v(),u=null,E()},async resetDeviceContent(){let e=m.filter(n=>!c.has(n)).map(n=>[n,R[n]]),t=e.some(([n,o])=>s[n]!==o);s={...s,...Object.fromEntries(e)};for(let n of m)c.has(n)&&(g[n]=R[n]);t&&h(),await I(s,g)},subscribe(e){return w.push(e),()=>{w=w.filter(t=>t!==e)}},getDeviceSpec(){return u||(u=P(s.deviceModel)),u},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{z as a};
4
+ import{c as P,k as m,l as S,m as R,n as _,o as v}from"./chunk-4MNKKMYG.js";var k="sootsim:settings",d=["productAnalytics","crashReports","colorScheme","reduceMotion","boldText","fontSize","largerAccessibilitySizes","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","showFrame","showMenuBar","showRail","solidWindow","ambientGlow","agentProvider"];function p(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function l(e){let t={};for(let n of d){if(!(n in e))continue;let o=e[n],i=S[n];i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||(t[n]=o)}return t}function K(e){let t={};for(let n of d)t[n]=e[n];return t}function M(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(k);return e?l(JSON.parse(e)):{}}catch{return{}}}function T(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(k,JSON.stringify(e))}catch{}}function x(){let t=p()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:l(t)}function A(e){let t=p();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:e})}catch{}}async function L(e){let t=p();return t?.writeSharedConfig?(await t.writeSharedConfig({settings:e}),!0):!1}function b(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function O(){let e=b()?.settings;return!e||typeof e!="object"?{}:l(e)}function B(e){if(!b())return;let t={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}async function F(e){if(!b()||typeof fetch>"u")return!1;let t=await fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:e}),keepalive:!0});if(!t.ok)throw new Error(`shared settings reset failed with HTTP ${t.status}`);return await t.text(),!0}function D(){let e=M(),t=O(),n=x();return{...e,...t,...n}}function V(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),A(n),B(n)}async function I(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),!await L(n)&&await F(n)}function j(e){if(typeof window>"u")return()=>{};let t=r=>{if(!(r.key!==k||r.newValue==null))try{e(l(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",t);let n=p(),o;n?.onSharedConfigChanged&&(o=n.onSharedConfigChanged(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))}));let a=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))});return()=>{window.removeEventListener("storage",t),o?.(),a?.()}}var N=_(),q=v(),y=D(),c=new Set,g={};for(let e of d)N[e]!==void 0&&(c.add(e),y[e]!==void 0&&(g[e]=y[e]),delete y[e]);var s={...q,...y},w=[],u=null;function h(){for(let e of w)e()}function E(){h(),V(s,g)}function C(e,t){let n=S[e];return n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]===t?!1:(s={...s,[e]:t},e==="deviceModel"&&(u=null),!0)}j(e=>{let t={...s},n=!1;for(let[o,i]of Object.entries(e)){let a=o;if(c.has(a)){g[a]=i;continue}t[a]!==i&&(t[a]=i,n=!0)}n&&(s=t,u=null,h())});var z={get(e){return s[e]},set(e,t){C(e,t)&&E()},setRuntime(e,t){c.has(e)||(c.add(e),d.includes(e)&&(g[e]=s[e])),C(e,t)&&h()},isRuntimeControlled(e){return c.has(e)},getAll(){return s},apply(e){let t=!1,n={...s};for(let[o,i]of Object.entries(e)){if(i===void 0)continue;let a=o,r=S[a];r&&(r.validate&&!r.validate(i)||r.options&&!r.options.includes(i)||n[a]!==i&&(n[a]=i,t=!0))}t&&(s=n,u=null,E())},applyRuntime(e){let t=!1;for(let n of Object.keys(e)){let o=e[n];o!==void 0&&(c.has(n)||(c.add(n),d.includes(n)&&(g[n]=s[n])),C(n,o)&&(t=!0))}t&&h()},reset(){s=v(),u=null,E()},async resetDeviceContent(){let e=m.filter(n=>!c.has(n)).map(n=>[n,R[n]]),t=e.some(([n,o])=>s[n]!==o);s={...s,...Object.fromEntries(e)};for(let n of m)c.has(n)&&(g[n]=R[n]);t&&h(),await I(s,g)},subscribe(e){return w.push(e),()=>{w=w.filter(t=>t!==e)}},getDeviceSpec(){return u||(u=P(s.deviceModel)),u},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{z as a};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as k}from"./chunk-HVQA443X.js";import{createHash as j}from"node:crypto";import D from"node:fs";import{createRequire as L}from"node:module";import x from"node:path";var P=/(^|\/)expo-splash-screen$/,A=/(^|\/)react-native-bootsplash$/;function w(n,e){let r=e.replace(/\/+$/,""),s=n.replace(/^\.\//,"").replace(/^\/+/,"");if(s)return`${r}/assets/${s}`}function d(n,e,r){return r?r(n):w(n,e)}function y(n){if(n==="cover")return"cover";if(n==="contain"||n==="native")return"contain"}function p(n){return typeof n=="string"&&n.length>0?n:void 0}function m(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function R(n,e,r){if(!n||typeof n!="object")return null;let s=n,o={source:"expo-splash-screen",backgroundColor:p(s.backgroundColor)??"#ffffff"},i=p(s.image);i&&(o.imageUrl=d(i,e,r));let t=m(s.imageWidth);t!=null&&(o.imageWidthPx=t);let l=y(s.resizeMode);l&&(o.resizeMode=l);let a=s.dark;if(a&&typeof a=="object"){let u=a,g=p(u.backgroundColor),f=p(u.image);(g||f)&&(o.dark={},g&&(o.dark.backgroundColor=g),f&&(o.dark.imageUrl=d(f,e,r)))}return o}function U(n,e,r,s){let c=n[e],o=c&&typeof c=="object"?c.splash:void 0,i=n.splash,t=o&&typeof o=="object"?o:i;if(!t||typeof t!="object")return null;let a={source:"expo-legacy",backgroundColor:p(t.backgroundColor)??"#ffffff",imageWidthPx:m(t.imageWidth)??200,resizeMode:y(t.resizeMode)??"contain"},u=p(t.image);u&&(a.imageUrl=d(u,r,s));let g=t.dark;if(g&&typeof g=="object"){let f=g,h=p(f.backgroundColor),S=p(f.image);(h||S)&&(a.dark={},h&&(a.dark.backgroundColor=h),S&&(a.dark.imageUrl=d(S,r,s)))}return a}function v(n,e,r){if(!n||typeof n!="object")return null;let s=n,c=p(s.logo);if(!c)return null;let o={source:"react-native-bootsplash",backgroundColor:p(s.background)??"#fff",imageUrl:d(c,e,r),imageWidthPx:m(s.logoWidth)??100,resizeMode:"contain"},i=p(s.darkBackground),t=p(s.darkLogo);return(i||t)&&(o.dark={},i&&(o.dark.backgroundColor=i),t&&(o.dark.imageUrl=d(t,e,r))),o}function C(n,e,r,s={}){if(!n||typeof n!="object")return null;let c=n,o=c.plugins,i=null,t=null;if(Array.isArray(o))for(let l of o){let a=Array.isArray(l)?l[0]:l;if(typeof a!="string")continue;let u=Array.isArray(l)?l[1]??{}:{};!i&&P.test(a)?i=R(u,r,s.resolveAssetUrl):!t&&A.test(a)&&(t=v(u,r,s.resolveAssetUrl))}return t||i||U(c,e,r,s.resolveAssetUrl)}var b=L(import.meta.url);function E(n){try{let e=new URL(n),r=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return e.origin}catch{}return null}function I(n){try{return D.statSync(x.join(n,"package.json")).isFile()}catch{return!1}}function G(n){let e=E(n.bundleUrl);if(!e)return null;let r=n.repoDir||process.env.CONTRAST_REPO_DIR,s=r?x.resolve(r):process.cwd();if(!r&&!I(s))return null;let o=k(s,{trustStart:n.exactProjectDir})?.appDir??null;if(!o)return null;let i=(n.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),t=null;try{let a=b.resolve("@expo/config",{paths:[o,s]}),u=b(a);typeof u.getConfig=="function"&&(t=u.getConfig)}catch{}if(!t)return null;let l;try{let a=t(o,{skipSDKVersionRequirement:!0});a?.exp&&typeof a.exp=="object"&&(l=a.exp)}catch{}return!l||typeof l!="object"?null:C(l,i==="android"?"android":"ios",e)}function q(n){return encodeURIComponent(JSON.stringify(n))}function z(n){if(!n)return null;try{let e=JSON.parse(decodeURIComponent(n));if(!e||typeof e!="object")return null;let r=e;return r.source!=="expo-splash-screen"&&r.source!=="expo-legacy"&&r.source!=="react-native-bootsplash"||typeof r.backgroundColor!="string"?null:e}catch{return null}}function M(n){let e=new Set;return n.imageUrl&&e.add(n.imageUrl),n.dark?.imageUrl&&e.add(n.dark.imageUrl),[...e]}function F(n){let e=(n.split("?")[0].split(".").pop()||"").toLowerCase();return e==="png"?"image/png":e==="jpg"||e==="jpeg"?"image/jpeg":e==="webp"?"image/webp":e==="gif"?"image/gif":e==="svg"?"image/svg+xml":"application/octet-stream"}async function H(n,e){let r=z(n);if(!r)return[];let s=[],c=new Set;for(let o of M(r)){let i=j("sha256").update(o).digest("hex");if(!c.has(i)){c.add(i);try{let t=await fetch(o);if(!t.ok){e?.onError?.(o,new Error(`${t.status} ${t.statusText}`));continue}let l=new Uint8Array(await t.arrayBuffer());s.push({url:o,urlhash:i,contentType:F(o),bytes:l}),e?.onStaged?.({url:o,byteLength:l.byteLength})}catch(t){e?.onError?.(o,t)}}}return s}export{G as a,q as b,H as c};
4
+ import{a as k}from"./chunk-SDBIR5ON.js";import{createHash as j}from"node:crypto";import D from"node:fs";import{createRequire as L}from"node:module";import x from"node:path";var P=/(^|\/)expo-splash-screen$/,A=/(^|\/)react-native-bootsplash$/;function w(n,e){let r=e.replace(/\/+$/,""),s=n.replace(/^\.\//,"").replace(/^\/+/,"");if(s)return`${r}/assets/${s}`}function d(n,e,r){return r?r(n):w(n,e)}function y(n){if(n==="cover")return"cover";if(n==="contain"||n==="native")return"contain"}function p(n){return typeof n=="string"&&n.length>0?n:void 0}function m(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function R(n,e,r){if(!n||typeof n!="object")return null;let s=n,o={source:"expo-splash-screen",backgroundColor:p(s.backgroundColor)??"#ffffff"},i=p(s.image);i&&(o.imageUrl=d(i,e,r));let t=m(s.imageWidth);t!=null&&(o.imageWidthPx=t);let l=y(s.resizeMode);l&&(o.resizeMode=l);let a=s.dark;if(a&&typeof a=="object"){let u=a,g=p(u.backgroundColor),f=p(u.image);(g||f)&&(o.dark={},g&&(o.dark.backgroundColor=g),f&&(o.dark.imageUrl=d(f,e,r)))}return o}function U(n,e,r,s){let c=n[e],o=c&&typeof c=="object"?c.splash:void 0,i=n.splash,t=o&&typeof o=="object"?o:i;if(!t||typeof t!="object")return null;let a={source:"expo-legacy",backgroundColor:p(t.backgroundColor)??"#ffffff",imageWidthPx:m(t.imageWidth)??200,resizeMode:y(t.resizeMode)??"contain"},u=p(t.image);u&&(a.imageUrl=d(u,r,s));let g=t.dark;if(g&&typeof g=="object"){let f=g,h=p(f.backgroundColor),S=p(f.image);(h||S)&&(a.dark={},h&&(a.dark.backgroundColor=h),S&&(a.dark.imageUrl=d(S,r,s)))}return a}function v(n,e,r){if(!n||typeof n!="object")return null;let s=n,c=p(s.logo);if(!c)return null;let o={source:"react-native-bootsplash",backgroundColor:p(s.background)??"#fff",imageUrl:d(c,e,r),imageWidthPx:m(s.logoWidth)??100,resizeMode:"contain"},i=p(s.darkBackground),t=p(s.darkLogo);return(i||t)&&(o.dark={},i&&(o.dark.backgroundColor=i),t&&(o.dark.imageUrl=d(t,e,r))),o}function C(n,e,r,s={}){if(!n||typeof n!="object")return null;let c=n,o=c.plugins,i=null,t=null;if(Array.isArray(o))for(let l of o){let a=Array.isArray(l)?l[0]:l;if(typeof a!="string")continue;let u=Array.isArray(l)?l[1]??{}:{};!i&&P.test(a)?i=R(u,r,s.resolveAssetUrl):!t&&A.test(a)&&(t=v(u,r,s.resolveAssetUrl))}return t||i||U(c,e,r,s.resolveAssetUrl)}var b=L(import.meta.url);function E(n){try{let e=new URL(n),r=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return e.origin}catch{}return null}function I(n){try{return D.statSync(x.join(n,"package.json")).isFile()}catch{return!1}}function G(n){let e=E(n.bundleUrl);if(!e)return null;let r=n.repoDir||process.env.CONTRAST_REPO_DIR,s=r?x.resolve(r):process.cwd();if(!r&&!I(s))return null;let o=k(s,{trustStart:n.exactProjectDir})?.appDir??null;if(!o)return null;let i=(n.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),t=null;try{let a=b.resolve("@expo/config",{paths:[o,s]}),u=b(a);typeof u.getConfig=="function"&&(t=u.getConfig)}catch{}if(!t)return null;let l;try{let a=t(o,{skipSDKVersionRequirement:!0});a?.exp&&typeof a.exp=="object"&&(l=a.exp)}catch{}return!l||typeof l!="object"?null:C(l,i==="android"?"android":"ios",e)}function q(n){return encodeURIComponent(JSON.stringify(n))}function z(n){if(!n)return null;try{let e=JSON.parse(decodeURIComponent(n));if(!e||typeof e!="object")return null;let r=e;return r.source!=="expo-splash-screen"&&r.source!=="expo-legacy"&&r.source!=="react-native-bootsplash"||typeof r.backgroundColor!="string"?null:e}catch{return null}}function M(n){let e=new Set;return n.imageUrl&&e.add(n.imageUrl),n.dark?.imageUrl&&e.add(n.dark.imageUrl),[...e]}function F(n){let e=(n.split("?")[0].split(".").pop()||"").toLowerCase();return e==="png"?"image/png":e==="jpg"||e==="jpeg"?"image/jpeg":e==="webp"?"image/webp":e==="gif"?"image/gif":e==="svg"?"image/svg+xml":"application/octet-stream"}async function H(n,e){let r=z(n);if(!r)return[];let s=[],c=new Set;for(let o of M(r)){let i=j("sha256").update(o).digest("hex");if(!c.has(i)){c.add(i);try{let t=await fetch(o);if(!t.ok){e?.onError?.(o,new Error(`${t.status} ${t.statusText}`));continue}let l=new Uint8Array(await t.arrayBuffer());s.push({url:o,urlhash:i,contentType:F(o),bytes:l}),e?.onStaged?.({url:o,byteLength:l.byteLength})}catch(t){e?.onError?.(o,t)}}}return s}export{G as a,q as b,H as c};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as S}from"./chunk-HVQA443X.js";import{createHash as W}from"node:crypto";import A from"node:fs";import{createRequire as O}from"node:module";import c from"node:path";var C=/\.(ttf|otf|woff|woff2)$/i;function _(t,n,e){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&e.push(i);let r=t[n];if(!r||typeof r!="object")return;let s=r.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){e.push(i);continue}if(!i||typeof i!="object")continue;let a=i.fontDefinitions;if(Array.isArray(a))for(let y of a){if(!y||typeof y!="object")continue;let d=y.path;typeof d=="string"&&e.push(d)}}}function D(t,n){if(!Array.isArray(t))return[];let e=[];for(let o of t){let r=Array.isArray(o)?o[0]:o;if(typeof r!="string"||!/(^|\/)expo-font$/.test(r))continue;let s=Array.isArray(o)?o[1]??{}:{};_(s,n,e)}return e}function N(t){return t.slice(t.lastIndexOf("/")+1).replace(C,"")}function $(t,n){let e=n.replace(/\/+$/,""),o=new Set,r=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),C.test(i)&&r.push({family:N(i),url:`${e}/assets/${i}`}))}return r}var T=O(import.meta.url);function E(t){try{let n=new URL(t),e=n.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(e==="localhost"||e.endsWith(".localhost")||e==="0.0.0.0"||e==="::1"||/^127(?:\.\d{1,3}){3}$/.test(e))return n.origin}catch{}return null}function q(t){try{return A.statSync(c.join(t,"package.json")).isFile()}catch{return!1}}function Q(t){let n=E(t.bundleUrl);if(!n)return[];let e=t.repoDir||process.env.CONTRAST_REPO_DIR,o=e?c.resolve(e):process.cwd();if(!e&&!q(o))return[];let r=S(o,{trustStart:t.exactProjectDir}),s=r?.appDir??null;if(!s)return[];let i=(t.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),a=null;if(e||r)try{let p=T.resolve("@expo/config",{paths:[s,o]}),u=T(p);typeof u.getConfig=="function"&&(a=u.getConfig)}catch{}let y=[];if(a)try{let p=a(s,{skipSDKVersionRequirement:!0});if(p?.exp&&typeof p.exp=="object"){let u=p.exp.plugins;Array.isArray(u)&&(y=u)}}catch{}let d=D(y,i==="android"?"android":"ios").slice(0,256),I=Date.now(),P=0,j=(p,u)=>{let h=[{dir:p,depth:0}],l=0;for(;l<h.length&&P<64&&d.length<256&&Date.now()-I<50;){let f=h[l++];if(!f)continue;P++;let m;try{m=A.readdirSync(f.dir,{withFileTypes:!0})}catch{continue}for(let g of m){if(g.isSymbolicLink())continue;let x=c.join(f.dir,g.name);if(g.isDirectory()){f.depth<4&&h.length<64&&!g.name.startsWith(".")&&h.push({dir:x,depth:f.depth+1});continue}if(!g.isFile()||!/\.(ttf|otf|woff|woff2)$/i.test(g.name))continue;let w=c.relative(p,x).split(c.sep).join("/");if(d.push(c.posix.join(u,w)),d.length>=256)break}}};try{let p=JSON.parse(A.readFileSync(c.join(s,"package.json"),"utf8")),u=new Set;for(let l of["dependencies","devDependencies","optionalDependencies"]){let f=Reflect.get(p,l);if(!(!f||typeof f!="object"))for(let m of Object.keys(f))u.add(m)}let h=[...u].filter(l=>l==="react-native-vector-icons"||l.startsWith("@react-native-vector-icons/"));if(h.length>0){let l=Reflect.get(p,"reactNativeVectorIcons"),f=l&&typeof l=="object"?Reflect.get(l,"fontDir"):null,m=typeof f=="string"?f:"rnvi-fonts",g=c.resolve(s,m),x=c.relative(s,g);!x.startsWith("..")&&!c.isAbsolute(x)&&j(g,x.split(c.sep).join("/"));let w=O(c.join(s,"package.json"));for(let F of h)try{let v=w.resolve(F),L=F.split("/").join(c.sep),b=`${c.sep}node_modules${c.sep}${L}${c.sep}`,R=v.lastIndexOf(b);if(R===-1)continue;let U=v.slice(0,R+b.length-1),k=F==="react-native-vector-icons"?"Fonts":"fonts";j(c.join(U,k),c.posix.join("node_modules",F,k))}catch{}}}catch{}return $(d,n)}async function Y(t,n){let e=E(t);if(!e)return null;let o=new AbortController,r=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${e}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let a=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof a=="string"&&a.length>0?a:null}catch{return null}finally{clearTimeout(r)}}function Z(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function M(t){let n=[];for(let e of t.split(",")){let o=e.trim();if(!o)continue;let r=o.indexOf("::"),s=r===-1?o:o.slice(0,r);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function G(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function tt(t,n){let e=[],o=new Set;for(let r of M(t)){let s=W("sha256").update(r).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(r);if(!i.ok){n?.onError?.(r,new Error(`${i.status} ${i.statusText}`));continue}let a=new Uint8Array(await i.arrayBuffer());e.push({url:r,urlhash:s,contentType:G(r),bytes:a}),n?.onStaged?.({url:r,byteLength:a.byteLength})}catch(i){n?.onError?.(r,i)}}}return e}export{Q as a,Y as b,Z as c,tt as d};
4
+ import{a as S}from"./chunk-SDBIR5ON.js";import{createHash as W}from"node:crypto";import A from"node:fs";import{createRequire as O}from"node:module";import c from"node:path";var C=/\.(ttf|otf|woff|woff2)$/i;function _(t,n,e){if(!t||typeof t!="object")return;let o=t.fonts;if(Array.isArray(o))for(let i of o)typeof i=="string"&&e.push(i);let r=t[n];if(!r||typeof r!="object")return;let s=r.fonts;if(Array.isArray(s))for(let i of s){if(typeof i=="string"){e.push(i);continue}if(!i||typeof i!="object")continue;let a=i.fontDefinitions;if(Array.isArray(a))for(let y of a){if(!y||typeof y!="object")continue;let d=y.path;typeof d=="string"&&e.push(d)}}}function D(t,n){if(!Array.isArray(t))return[];let e=[];for(let o of t){let r=Array.isArray(o)?o[0]:o;if(typeof r!="string"||!/(^|\/)expo-font$/.test(r))continue;let s=Array.isArray(o)?o[1]??{}:{};_(s,n,e)}return e}function N(t){return t.slice(t.lastIndexOf("/")+1).replace(C,"")}function $(t,n){let e=n.replace(/\/+$/,""),o=new Set,r=[];for(let s of t){let i=s.replace(/^\.\//,"").replace(/^\/+/,"");!i||o.has(i)||(o.add(i),C.test(i)&&r.push({family:N(i),url:`${e}/assets/${i}`}))}return r}var T=O(import.meta.url);function E(t){try{let n=new URL(t),e=n.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(e==="localhost"||e.endsWith(".localhost")||e==="0.0.0.0"||e==="::1"||/^127(?:\.\d{1,3}){3}$/.test(e))return n.origin}catch{}return null}function q(t){try{return A.statSync(c.join(t,"package.json")).isFile()}catch{return!1}}function Q(t){let n=E(t.bundleUrl);if(!n)return[];let e=t.repoDir||process.env.CONTRAST_REPO_DIR,o=e?c.resolve(e):process.cwd();if(!e&&!q(o))return[];let r=S(o,{trustStart:t.exactProjectDir}),s=r?.appDir??null;if(!s)return[];let i=(t.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),a=null;if(e||r)try{let p=T.resolve("@expo/config",{paths:[s,o]}),u=T(p);typeof u.getConfig=="function"&&(a=u.getConfig)}catch{}let y=[];if(a)try{let p=a(s,{skipSDKVersionRequirement:!0});if(p?.exp&&typeof p.exp=="object"){let u=p.exp.plugins;Array.isArray(u)&&(y=u)}}catch{}let d=D(y,i==="android"?"android":"ios").slice(0,256),I=Date.now(),P=0,j=(p,u)=>{let h=[{dir:p,depth:0}],l=0;for(;l<h.length&&P<64&&d.length<256&&Date.now()-I<50;){let f=h[l++];if(!f)continue;P++;let m;try{m=A.readdirSync(f.dir,{withFileTypes:!0})}catch{continue}for(let g of m){if(g.isSymbolicLink())continue;let x=c.join(f.dir,g.name);if(g.isDirectory()){f.depth<4&&h.length<64&&!g.name.startsWith(".")&&h.push({dir:x,depth:f.depth+1});continue}if(!g.isFile()||!/\.(ttf|otf|woff|woff2)$/i.test(g.name))continue;let w=c.relative(p,x).split(c.sep).join("/");if(d.push(c.posix.join(u,w)),d.length>=256)break}}};try{let p=JSON.parse(A.readFileSync(c.join(s,"package.json"),"utf8")),u=new Set;for(let l of["dependencies","devDependencies","optionalDependencies"]){let f=Reflect.get(p,l);if(!(!f||typeof f!="object"))for(let m of Object.keys(f))u.add(m)}let h=[...u].filter(l=>l==="react-native-vector-icons"||l.startsWith("@react-native-vector-icons/"));if(h.length>0){let l=Reflect.get(p,"reactNativeVectorIcons"),f=l&&typeof l=="object"?Reflect.get(l,"fontDir"):null,m=typeof f=="string"?f:"rnvi-fonts",g=c.resolve(s,m),x=c.relative(s,g);!x.startsWith("..")&&!c.isAbsolute(x)&&j(g,x.split(c.sep).join("/"));let w=O(c.join(s,"package.json"));for(let F of h)try{let v=w.resolve(F),L=F.split("/").join(c.sep),b=`${c.sep}node_modules${c.sep}${L}${c.sep}`,R=v.lastIndexOf(b);if(R===-1)continue;let U=v.slice(0,R+b.length-1),k=F==="react-native-vector-icons"?"Fonts":"fonts";j(c.join(U,k),c.posix.join("node_modules",F,k))}catch{}}}catch{}return $(d,n)}async function Y(t,n){let e=E(t);if(!e)return null;let o=new AbortController,r=setTimeout(()=>o.abort(),n?.timeoutMs??1500);try{let s=await fetch(`${e}/`,{headers:{"expo-platform":"ios",Accept:"application/json"},signal:o.signal});if(!s.ok)return null;let a=(await s.json())?.extra?.expoClient?._internal?.projectRoot;return typeof a=="string"&&a.length>0?a:null}catch{return null}finally{clearTimeout(r)}}function Z(t){return t.map(n=>`${encodeURIComponent(n.url)}::${encodeURIComponent(n.family)}`).join(",")}function M(t){let n=[];for(let e of t.split(",")){let o=e.trim();if(!o)continue;let r=o.indexOf("::"),s=r===-1?o:o.slice(0,r);try{n.push(decodeURIComponent(s))}catch{n.push(s)}}return n.filter(Boolean)}function G(t){let n=(t.split("?")[0].split(".").pop()||"").toLowerCase();return n==="ttf"?"font/ttf":n==="otf"?"font/otf":n==="woff"?"font/woff":n==="woff2"?"font/woff2":"application/octet-stream"}async function tt(t,n){let e=[],o=new Set;for(let r of M(t)){let s=W("sha256").update(r).digest("hex");if(!o.has(s)){o.add(s);try{let i=await fetch(r);if(!i.ok){n?.onError?.(r,new Error(`${i.status} ${i.statusText}`));continue}let a=new Uint8Array(await i.arrayBuffer());e.push({url:r,urlhash:s,contentType:G(r),bytes:a}),n?.onStaged?.({url:r,byteLength:a.byteLength})}catch(i){n?.onError?.(r,i)}}}return e}export{Q as a,Y as b,Z as c,tt as d};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{I as F,m as B,n as A,p as h,u as E,w as P}from"./chunk-6RH6PEO3.js";import{i as y,m as N,n as I}from"./chunk-YEE3MKPH.js";var k={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function z(e){return e.includes("--json")}function K(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
4
+ import{I as F,m as B,n as A,p as h,u as E,w as P}from"./chunk-7LULF3D2.js";import{i as y,m as N,n as I}from"./chunk-KYGB26L4.js";var k={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function z(e){return e.includes("--json")}function K(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
5
5
  `)}function Q(e){process.stderr.write(`${e}
6
6
  `)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function O(e,t,...r){return N(e,`__sootsimTest.${t}`,...r)}async function j(e,t,...r){return I(e,`SootSim.bridges.mainShell.${t}`,...r)}async function X(e,t={}){try{let r=await O(e,"waitForScreenTransitions",k);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function Z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await j(e,t,...n)}catch(o){if(!F(o)||Date.now()>=s)throw o;await w(50)}}async function ee(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let i=0;i<s;i++){let u=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function te(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let i=y(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await i.send({type:"evaluate",code:"1"}),i}catch{i.close()}await w(o)}return null}async function ne(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,i=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,liveFrameActive:!1,liveFrameChannels:0,liveFramePublishes:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let a=await e.send({type:"evaluate",code:B}),g=Date.now()-o,f=Number(a?.nodes)||0,$=Number(a?.targets)||0,C=a?.liveFrameActive===!0,W=Number(a?.liveFrameChannels)||0,q=Number(a?.liveFramePublishes)||0,x=Number(a?.errors)||0,T=a?.flag===!0,p=a?.externalReady,M=typeof a?.loadingText=="string"?a.loadingText.trim():"",D=typeof a?.externalStatus=="string"?a.externalStatus.trim():"",R=typeof a?.externalError=="string"?a.externalError.trim():"",v=typeof a?.externalError=="string"&&R.length>0;if(c=p,d=v,f!==i&&(i=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,liveFrameActive:C,liveFrameChannels:W,liveFramePublishes:q,flag:a?.flag,loadingText:M,externalReady:typeof p=="boolean"?p:null,externalStatus:D,externalError:R,errors:x},T&&p!==!1&&!v&&!M&&h({liveFrameActive:C,nodes:f,targets:$})&&g-u>=A)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!T)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&h(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function H(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function L(e,t={}){let r=await e.send({type:"evaluate",code:P});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
7
7
  console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await E(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  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,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as K,b as V,c as Ne}from"./chunk-W3H6FBWV.js";import{c as Fe}from"./chunk-ALOQJP4C.js";import{d as $e}from"./chunk-MTOADQY2.js";import{d as Oe}from"./chunk-EJC4A2ZH.js";import{h as _e,j as Pe,l as B}from"./chunk-YEE3MKPH.js";import{c as Ue,d as E}from"./chunk-ITSHLH5U.js";import{a as Ae}from"./chunk-XMOYKSSM.js";import{createHash as St}from"crypto";import{readFileSync as M}from"fs";import je from"path";import{gzipSync as ge,gunzipSync as vt}from"zlib";function Ce(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ut,constants as ct}from"node:zlib";var dt=9;function Le(e){return ut(e,{params:{[ct.BROTLI_PARAM_QUALITY]:dt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function pt(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await pt(l),o++,r?.(o,i)}}))}function ft(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function gt(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function ze(e){let t=gt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=ft(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let m=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:m.signal})}finally{m.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function ht(e){return e!==null&&typeof e=="object"?e:null}function De(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=ht(e);return t?t.schemaVersion===1&&De(t.t)!==void 0&&De(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function yt(e,t){let r=[];for(let s of e.split(`
4
+ import{a as K,b as V,c as Ne}from"./chunk-YTUW6DGN.js";import{c as Fe}from"./chunk-NEKVW4FE.js";import{d as $e}from"./chunk-NR2G2PSN.js";import{d as Oe}from"./chunk-TABUERS3.js";import{h as _e,j as Pe,l as B}from"./chunk-KYGB26L4.js";import{c as Ue,d as E}from"./chunk-BGY7U4IH.js";import{a as Ae}from"./chunk-4FCN3KOD.js";import{createHash as St}from"crypto";import{readFileSync as M}from"fs";import je from"path";import{gzipSync as ge,gunzipSync as vt}from"zlib";function Ce(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ut,constants as ct}from"node:zlib";var dt=9;function Le(e){return ut(e,{params:{[ct.BROTLI_PARAM_QUALITY]:dt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function pt(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await pt(l),o++,r?.(o,i)}}))}function ft(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function gt(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function ze(e){let t=gt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=ft(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let m=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:m.signal})}finally{m.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function ht(e){return e!==null&&typeof e=="object"?e:null}function De(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=ht(e);return t?t.schemaVersion===1&&De(t.t)!==void 0&&De(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function yt(e,t){let r=[];for(let s of e.split(`
5
5
  `)){let o=s.trim();if(o)try{let i=JSON.parse(o);t(i)&&r.push(i)}catch{}}return r}function He(e){return yt(e,de)}import{execSync as bt}from"child_process";function me(e){try{return bt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function pe(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function wt(){let e=me("git remote get-url origin");if(!e)return null;let t=e.match(/github\.com[/:]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i);return t?{owner:t[1],repo:t[2]}:null}function fe(){let e=process.env.GITHUB_ACTIONS==="true",t=process.env.CONTRAST_BRANCH?.trim()||null,r=process.env.CONTRAST_SHA?.trim()||null,s=process.env.CONTRAST_PR_TITLE?.trim()||null,o=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim(),[i,l]=o.includes("/")?o.split("/",2):[null,null];if(e){let h=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//)?.[1];return{owner:i,repo:l,branch:t||process.env.GITHUB_HEAD_REF?.trim()||process.env.GITHUB_REF_NAME?.trim()||null,commitSha:r||process.env.GITHUB_SHA?.trim()||null,githubUsername:process.env.GITHUB_ACTOR?.trim()||null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER)??pe(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let m=t??me("git rev-parse --abbrev-ref HEAD"),c=i?null:wt();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:m==="HEAD"?null:m,commitSha:r??me("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Yt(e){if(e.length===0)return{stepCount:null,failedStepIndex:null};let t=e.find(r=>r.status==="failure");return{stepCount:e.length,failedStepIndex:t?t.stepIndex:null}}function Qt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Xt(e){let t=e.auth??K();if(!t)return null;let r=fe(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:V(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let m=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${m?`: ${m.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Rt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}function xt(e){let t=JSON.parse(M(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),m=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof m!="string"||!m)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=M(m);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var Ve=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",We=process.env.SOOTSIM_PREVIEW_ORIGIN||"https://sootsim.com",ye="https://contrast.localhost:3000",kt=2e3;async function Et(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${ye}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(kt)});if(t.ok||t.status===204||t.status===405)return ye}catch{}return Ve}function N(e){return e.replace(/\/$/,"")}function Bt(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function It(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function At(e,t){return t?N(t):process.env.SOOTSIM_PREVIEW_ORIGIN?N(process.env.SOOTSIM_PREVIEW_ORIGIN):Bt(e)?N(e):It(e)?N(We):N(e)}function Ut(){console.log(`
6
6
  sootsim record upload \u2014 publish the current recorded bundle as a /preview/<id> link
7
7
 
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{c as j,d as H}from"./chunk-ITSHLH5U.js";import{c as Y}from"./chunk-4TYUHNHI.js";import{K as F,M,g as R,j as E,r as O,s as x,t as U}from"./chunk-DUGY7KHN.js";import{a as V}from"./chunk-G377NNEV.js";import{execFileSync as Z,spawnSync as c}from"child_process";import{existsSync as n,mkdirSync as L,readFileSync as le,realpathSync as ue,rmSync as h,writeFileSync as K}from"fs";import{homedir as v}from"os";import{basename as pe,dirname as C,resolve as u,sep as X}from"path";import{execFileSync as re}from"child_process";import{chmodSync as oe,mkdirSync as A,rmSync as se,writeFileSync as I}from"fs";import{dirname as T}from"path";var ne="dev.sootsim.daemon",G="SootSim Daemon",q="0.1.36";function W(e,t,r){let s=x(),o=U(),a=T(T(o)),l=T(o),p=`${a}/Resources`;se(s,{recursive:!0,force:!0}),A(O(),{recursive:!0}),A(l,{recursive:!0}),A(p,{recursive:!0}),I(`${a}/Info.plist`,ie()),I(`${a}/PkgInfo`,"APPL????"),I(o,ae(e,t,r)),oe(o,493);try{re("codesign",["--force","--sign","-","--deep",s],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${s} failed: ${f}
4
+ import{c as j,d as H}from"./chunk-BGY7U4IH.js";import{c as Y}from"./chunk-YXRD4B4X.js";import{K as F,M,g as R,j as E,r as O,s as x,t as U}from"./chunk-UK7X4OX3.js";import{a as V}from"./chunk-V2SZPQJF.js";import{execFileSync as Z,spawnSync as c}from"child_process";import{existsSync as n,mkdirSync as L,readFileSync as le,realpathSync as ue,rmSync as h,writeFileSync as K}from"fs";import{homedir as v}from"os";import{basename as pe,dirname as C,resolve as u,sep as X}from"path";import{execFileSync as re}from"child_process";import{chmodSync as oe,mkdirSync as A,rmSync as se,writeFileSync as I}from"fs";import{dirname as T}from"path";var ne="dev.sootsim.daemon",G="SootSim Daemon",q="0.1.36";function W(e,t,r){let s=x(),o=U(),a=T(T(o)),l=T(o),p=`${a}/Resources`;se(s,{recursive:!0,force:!0}),A(O(),{recursive:!0}),A(l,{recursive:!0}),A(p,{recursive:!0}),I(`${a}/Info.plist`,ie()),I(`${a}/PkgInfo`,"APPL????"),I(o,ae(e,t,r)),oe(o,493);try{re("codesign",["--force","--sign","-","--deep",s],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${s} failed: ${f}
5
5
  the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:s,launcherPath:o}}function ie(){return`<?xml version="1.0" encoding="UTF-8"?>
6
6
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
7
7
  <plist version="1.0">
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  var o=!0,e="public beta",t=e,n="we send anonymous error and dependency data while you use it";export{o as a,e as b,t as c,n as d};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as at}from"./chunk-MKIABOQK.js";import{a as ot}from"./chunk-ONQYJYUM.js";import{a as pe,c as ge,d as we,e as ze,f as ye,g as be,h as Ye,i as Se,j as it}from"./chunk-ZEXLS32P.js";import{a as qe}from"./chunk-LFWATDB3.js";import{e as st}from"./chunk-RWXJ6OS4.js";import{i as et,q as tt,s as rt,w as nt}from"./chunk-444BQYY3.js";import{g as Xe}from"./chunk-FLTBPGAQ.js";import{h as Ge,m as Ke}from"./chunk-L3FA7WE5.js";import{J as he,m as He,n as Ue,o as We,p as je,q as Ve}from"./chunk-6RH6PEO3.js";import{a as Qe}from"./chunk-CBRE6JLP.js";import{a as Ze}from"./chunk-UNFMIX7B.js";import{h as fe,i as me,j as Je}from"./chunk-YEE3MKPH.js";import{c as De,d as ce}from"./chunk-ITSHLH5U.js";import{a as Be,b as Le,c as Ne}from"./chunk-2FTQEDJC.js";import{e as ue,f as Ce}from"./chunk-F57XAX5N.js";import*as $ from"fs";import{createHash as qt,randomUUID as zt}from"node:crypto";import{tmpdir as z}from"os";import*as w from"path";import*as v from"fs";import*as S from"path";var Pt="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",dt=1;function At(i){let e=Ne(i),t=e.scale,r=e.statusBarHeight>0&&!e.dynamicIsland&&e.homeIndicatorHeight===0&&e.cornerRadius===0,n=e.width,o=e.height,a=Be(e),s=r?e.width+58:a.frameWidth,l=r?e.height+111+111:a.frameHeight,p=9.5,u=dt,g=s+p*2,b=l+dt*2,m=p+(r?29:a.screenLeft),k=r?111:a.screenTop,P=r?52:a.frameRadius,H=[{side:e.hardwareButtons.lock.side,top:e.hardwareButtons.lock.top,height:e.hardwareButtons.lock.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.ringToggle.side,top:e.hardwareButtons.ringToggle.top,height:e.hardwareButtons.ringToggle.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.volumeUp.side,top:e.hardwareButtons.volumeUp.top,height:e.hardwareButtons.volumeUp.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.volumeDown.side,top:e.hardwareButtons.volumeDown.top,height:e.hardwareButtons.volumeDown.height,width:e.hardwareButtons.width}];return{model:i,renderScale:t,outerWidth:Math.round(g*t),outerHeight:Math.round(b*t),logicalOuterWidth:g,logicalOuterHeight:b,logicalFrameWidth:s,logicalFrameHeight:l,logicalFrameLeft:p,logicalFrameTop:u,logicalScreenWidth:n,logicalScreenHeight:o,logicalScreenLeft:m,logicalScreenTop:k,logicalScreenRadius:r?0:a.screenRadius,logicalFrameRadius:P,frameBackground:r?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:r?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:r?null:Pt,buttons:H,legacyHomeButton:r?{top:111+e.height+47/2,left:e.width/2-64/2+29,size:64,ring:1.5}:null,showHomeIndicator:e.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:e.homeIndicatorHeight}}function Mt(i){let e=i.side==="right",t=e?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
4
+ import{a as at}from"./chunk-DNH4ZWVK.js";import{a as ot}from"./chunk-77CFHIGG.js";import{a as pe,c as ge,d as we,e as ze,f as ye,g as be,h as Ye,i as Se,j as it}from"./chunk-4OZG2LQA.js";import{a as qe}from"./chunk-STF4UH5I.js";import{e as st}from"./chunk-P2HUPEXS.js";import{i as et,q as tt,s as rt,w as nt}from"./chunk-RW75MMQZ.js";import{g as Xe}from"./chunk-3XC55LRK.js";import{h as Ge,m as Ke}from"./chunk-NWM62KI3.js";import{J as he,m as He,n as Ue,o as We,p as je,q as Ve}from"./chunk-7LULF3D2.js";import{a as Qe}from"./chunk-WKSX2VHB.js";import{a as Ze}from"./chunk-RCH5EVVP.js";import{h as fe,i as me,j as Je}from"./chunk-KYGB26L4.js";import{c as De,d as ce}from"./chunk-BGY7U4IH.js";import{a as Be,b as Le,c as Ne}from"./chunk-4MNKKMYG.js";import{e as ue,f as Ce}from"./chunk-YOLPZLST.js";import*as $ from"fs";import{createHash as qt,randomUUID as zt}from"node:crypto";import{tmpdir as z}from"os";import*as w from"path";import*as v from"fs";import*as S from"path";var Pt="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",dt=1;function At(i){let e=Ne(i),t=e.scale,r=e.statusBarHeight>0&&!e.dynamicIsland&&e.homeIndicatorHeight===0&&e.cornerRadius===0,n=e.width,o=e.height,a=Be(e),s=r?e.width+58:a.frameWidth,l=r?e.height+111+111:a.frameHeight,p=9.5,u=dt,g=s+p*2,b=l+dt*2,m=p+(r?29:a.screenLeft),k=r?111:a.screenTop,P=r?52:a.frameRadius,H=[{side:e.hardwareButtons.lock.side,top:e.hardwareButtons.lock.top,height:e.hardwareButtons.lock.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.ringToggle.side,top:e.hardwareButtons.ringToggle.top,height:e.hardwareButtons.ringToggle.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.volumeUp.side,top:e.hardwareButtons.volumeUp.top,height:e.hardwareButtons.volumeUp.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.volumeDown.side,top:e.hardwareButtons.volumeDown.top,height:e.hardwareButtons.volumeDown.height,width:e.hardwareButtons.width}];return{model:i,renderScale:t,outerWidth:Math.round(g*t),outerHeight:Math.round(b*t),logicalOuterWidth:g,logicalOuterHeight:b,logicalFrameWidth:s,logicalFrameHeight:l,logicalFrameLeft:p,logicalFrameTop:u,logicalScreenWidth:n,logicalScreenHeight:o,logicalScreenLeft:m,logicalScreenTop:k,logicalScreenRadius:r?0:a.screenRadius,logicalFrameRadius:P,frameBackground:r?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:r?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:r?null:Pt,buttons:H,legacyHomeButton:r?{top:111+e.height+47/2,left:e.width/2-64/2+29,size:64,ring:1.5}:null,showHomeIndicator:e.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:e.homeIndicatorHeight}}function Mt(i){let e=i.side==="right",t=e?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
5
5
  <div
6
6
  aria-hidden="true"
7
7
  style="
@@ -561,7 +561,7 @@ flow extension:
561
561
  })()`}),console.log(` captured ${O.length} partial replay events`)}catch(d){console.warn(` event recorder stop failed: ${d?.message||String(d)}`)}console.error(`
562
562
  x failed: ${h.message}
563
563
  `),_&&(console.log(" partial profile:"),ft(_)),I&&console.log(` partial video: ${I}`);try{let d=c.lastFailedStep,y=d?`step-${String(d.index+1).padStart(2,"0")}-${d.kind}`:"unstaged",F=w.join(s,y);await c.captureFailureBundle(F,{error:h,stepIndex:d?.index,stepKind:d?.kind,stepTarget:d?.target}),de=F,console.log(` failure bundle: ${F}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(d){try{let y=w.join(s,"error.png");await c.captureScreenshot(y),console.log(` error screenshot: ${y}`)}catch{}console.log(` (failure bundle capture failed: ${d instanceof Error?d.message:String(d)})`)}await Ke(E,{errorsCommand:`sootsim get errors 5${c.simId?` --sim ${c.simId}`:""}`,warningsCommand:`sootsim get warnings 5${c.simId?` --sim ${c.simId}`:""}`,requestsCommand:`sootsim get requests 5${c.simId?` --sim ${c.simId}`:""}`}),V=1}if(await c.liveStatus?.end(V===0?"passed":"failed"),m&&(V===0||I||O))try{let h=await Qt(O??[]),d=["--origin",k,"--events",h];P&&d.push("--public-origin",P),I&&d.push("--video",I),j&&d.push("--screenshot",j),I&&L&&Number.isFinite(L)&&(d.push("--video-duration-ms",String(Math.round(L))),d.push("--recorded-duration-ms",String(Math.round(L))));let y=c.getLastRecordingStartedAtMs();y&&Number.isFinite(y)&&d.push("--recording-started-at-ms",String(Math.round(y))),x.wsPort&&d.push("--port",String(x.wsPort)),c.simId&&d.push("--sim",c.simId),H&&d.push("--open"),$e&&d.push("--owner",$e),ke&&d.push("--repo",ke),d.push("--run-scope",gt),U&&d.push("--billing-kind",U),console.log(`
564
- preparing preview upload\u2026`);let F=c.getFlowTraceSteps();F.length>0&&d.push("--timeline-events",await er(F));let J=await tr(F,y);J&&d.push("--snapshot-manifest",J),de&&d.push("--failure-bundle",de);let D=c.getLastRecordingFrameStats();D&&d.push("--trace-frame-stats",await rr(D));let{runUpload:It}=await import("./upload-P3CQI4RQ.js");Ie=await It(d,{})}catch(h){console.error(` preview upload failed: ${h?.message||h}`),V=1}return Fe=c.getFlowTraceSteps(),E.close(),ae?(c.simId&&le.add(c.simId),await Xt(x.wsPort,x.commandTimeoutMs,[...le])):c.simId&&c.simId!==Z&&Ce(c.simId),await ce(),V}async function Xt(i,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let n=me(i,{commandTimeoutMs:e});try{let o=await n.listSims(),a=r.filter(l=>o.some(p=>p.id===l&&p.readyState==="open"));if(a.length===0)return;let s=await nt(n,i,e,a);await tt(o,a),s.closed.length>0&&console.log(` closed flow sim(s): ${s.closed.join(", ")}`),s.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${s.remaining.join(", ")}`)}catch(o){console.warn(` warn: failed to close flow sim(s): ${o instanceof Error?o.message:String(o)}`)}finally{n.close()}}async function Qt(i){let{gzipSync:e}=await import("zlib"),t=i.map(o=>JSON.stringify(o)).join(`
564
+ preparing preview upload\u2026`);let F=c.getFlowTraceSteps();F.length>0&&d.push("--timeline-events",await er(F));let J=await tr(F,y);J&&d.push("--snapshot-manifest",J),de&&d.push("--failure-bundle",de);let D=c.getLastRecordingFrameStats();D&&d.push("--trace-frame-stats",await rr(D));let{runUpload:It}=await import("./upload-D5BXJTXK.js");Ie=await It(d,{})}catch(h){console.error(` preview upload failed: ${h?.message||h}`),V=1}return Fe=c.getFlowTraceSteps(),E.close(),ae?(c.simId&&le.add(c.simId),await Xt(x.wsPort,x.commandTimeoutMs,[...le])):c.simId&&c.simId!==Z&&Ce(c.simId),await ce(),V}async function Xt(i,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let n=me(i,{commandTimeoutMs:e});try{let o=await n.listSims(),a=r.filter(l=>o.some(p=>p.id===l&&p.readyState==="open"));if(a.length===0)return;let s=await nt(n,i,e,a);await tt(o,a),s.closed.length>0&&console.log(` closed flow sim(s): ${s.closed.join(", ")}`),s.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${s.remaining.join(", ")}`)}catch(o){console.warn(` warn: failed to close flow sim(s): ${o instanceof Error?o.message:String(o)}`)}finally{n.close()}}async function Qt(i){let{gzipSync:e}=await import("zlib"),t=i.map(o=>JSON.stringify(o)).join(`
565
565
  `)+(i.length?`
566
566
  `:""),r=e(Buffer.from(t,"utf8")),n=w.join(z(),`sootsim-events-${Date.now()}.jsonl.gz`);return $.writeFileSync(n,r),console.log(` events: ${i.length} written to ${n} (${r.length} bytes gz)`),n}async function er(i){let{gzipSync:e}=await import("zlib"),t=i.map((a,s)=>({schemaVersion:1,t:a.endedAtMs,seq:1e6+s,context:"host",kind:"flow-step",id:`flow-step-${a.stepIndex}`,data:{stepIndex:a.stepIndex,stepNumber:a.stepIndex+1,stepName:a.stepName,...a.targetLabel?{targetLabel:a.targetLabel}:{},status:a.status,durationMs:a.durationMs,startedAtMs:a.startedAtMs,endedAtMs:a.endedAtMs,...a.error?{error:a.error}:{}}})),r=t.map(a=>JSON.stringify(a)).join(`
567
567
  `)+`
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
4
  var e="./demo-app-registry.ts",o=null;async function p(){if(o)return o;try{let r=await import(e);o=Array.isArray(r.APPS)?r.APPS:[]}catch{o=[]}return o}function n(){return o??[]}function i(r){let t=o;return o=r,{restore:()=>{o=t}}}export{p as a,n as b,i as c};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{a as Ne,b as q,c as de,d as ue,e as Fe,f as je,h as x,i as We,j as Ke}from"./chunk-FLTBPGAQ.js";import{m as O}from"./chunk-L3FA7WE5.js";import{m as _e,p as Oe}from"./chunk-6RH6PEO3.js";import{b as He,l as he}from"./chunk-DGWM3X4S.js";import{a as B,b as pe}from"./chunk-CBRE6JLP.js";import{a as Ge,b as Je}from"./chunk-ALOQJP4C.js";import{a as qe,b as z,c as ze}from"./chunk-MTOADQY2.js";import{d as fe}from"./chunk-EJC4A2ZH.js";import{a as Ve}from"./chunk-WCAT3UC4.js";import{a as me}from"./chunk-HVQA443X.js";import{b as Be,c as De,d as ce,f as Ae,g as Le,h as M,i as v,j as E}from"./chunk-YEE3MKPH.js";import{f as Ee}from"./chunk-37ACY2R3.js";import{b as le,d as Ue}from"./chunk-2FTQEDJC.js";import{d as Te,e as T,f as b,g as _}from"./chunk-F57XAX5N.js";import{H as Re,K as ae,M as V,O as Me,l as ie}from"./chunk-DUGY7KHN.js";import{spawn as ot,spawnSync as nt}from"node:child_process";import U from"node:fs";import Ct from"node:os";import C from"node:path";import{WebSocket as Rt}from"ws";function Qe(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function vt(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Ze(e,o,t){return`${e}//${o}:${t}`}function St(e){if(typeof window>"u")return!1;try{let o=new URL(e);return x(o.hostname)&&x(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Ye(e,o){let t={...o,cache:o?.cache??"no-store"};return St(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function $t(e){return e==="https:"?443:80}function xt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function Pt(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:ue(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Xe(e,o){let t=e.replace(/\/+$/,"");try{if(x(new URL(t).hostname)){let n=await Pt(o);if(n)return n}}catch{}try{let n=await Ye(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:ue(i||`${t}${de}`),port:o,framework:vt(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ye(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:o,framework:"metro"}}catch{}return null}async function kt(e){return Xe(Ze("http:","localhost",e),e)}async function et(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await kt(a);if(l)return l;throw Qe(`localhost:${a}`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):$t(r),i=Ze(r,n.hostname,s);if(xt(n)){let a=await Xe(i,s);if(a)return a;throw Qe(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function Po(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function tt(e){let o=B();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function It(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function ko(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){It(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var Mt=12e4,rt=100,Et=5e3,st=1e4,Ut={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(o=>setTimeout(o,e))}function it(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function Tt(){let e=it("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??it("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Mt;return{timeoutMs:e,hostTimeoutMs:e+Et,intervalMs:rt,attempts:Math.max(1,Math.ceil(e/rt))}}function _t(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function Ot(e,o){return e.includes("--headless")?!0:e.includes("--headed")?!1:o==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function Q(e){return e.trim()}var dt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Bt(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return dt.test(o)||o.startsWith("/")?o:`/${o}`}function Dt(e){return e!==null&&typeof e=="object"}function At(e){let o=e.trim();return o?o.startsWith("/")?!0:dt.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function Lt(e){if(await G(e,250))return e;let o=ae();if(o&&V(o)&&await G(o.bridgePort,500))return o.bridgePort;if(o&&V(o))throw new Error(`sootsim bridge lockfile is fresh (port ${o.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await Nt();let t=Ft(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+st;for(;Date.now()<r;){let s=ae();if(s&&V(s)&&await G(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await G(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(st/1e3)}s`)}async function Nt(){let e=Re();if(e&&U.existsSync(ie(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-XHMSVSWG.js");await o(["install"],{})}function Ft(e){let o=process.argv[1];return o&&U.existsSync(o)?ot(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):ot("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function G(e,o){return new Promise(t=>{let n=new Rt(`ws://127.0.0.1:${e}`,{handshakeTimeout:o}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}t(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),o)})}function be(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function jt(e){try{let o=new URL(e,"http://sootsim.local");if(o.origin!=="http://sootsim.local")return!1;let t=o.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ht(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=Y(n.pathname),s=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return n.pathname=`${r}${s}`,n.search=t.search,n.hash=t.hash,n.toString()}function Wt(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function en(e){let o=Q(e);return(await ve(o)).bundleUrl}function Kt(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!x(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function ve(e){let o=Q(e),t=/^\d+$/.test(o)?Number(o):Kt(o);if(t&&t>0){let n=await je(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return et(o)}function Y(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Vt(e,o){let t=Q(e),n=new URL(o),r=Y(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function ut(e){let o=Q(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function qt(e,o,t={}){let n=t.resolvedBundle??await ve(e),r=new URL(o),s=Y(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=t.hot===void 0?n.bundleUrl:Fe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function zt(e){return e.startsWith("~/")?C.join(Ct.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function Gt(e){let o={},t={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=zt(s.slice(i+1).trim());U.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}async function Jt(e){if(e){let o=await z(e.bundleUrl);if(o)return me(o,{trustStart:!0})}return me(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Qt(e){if(U.existsSync(C.join(ie(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let o=await Ee.install({version:e,setActive:!1,protectVersions:Me()});console.error(` installed engine runtime ${o.version}`)}function Yt(e,o){if(!o)return e;let t=new URL(e);if(!x(t.hostname))throw new Error(`runtimeVersion ${o} requires a local SootSim host; got ${t.origin}`);return t.hostname=Ke(o),t.toString()}function mt(){return Be().shellBaseUrl}async function Zt(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=qe({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});if(s.length===0)return e;let i=await Xt(s);return i.length===0?e:(t.searchParams.set("appFonts",ze(i)),t.toString())}catch{return e}}async function Xt(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function eo(e,o,t={}){if(!e)return new URL(o).toString();if(be(e))return new URL(e).toString();if(jt(e))return Ht(e,o);let n=Ut[e.toLowerCase()];if(n){let r=new URL(o),s=Y(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return ut(e)?qt(e,o,t):Vt(e,o)}async function to(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=Ge({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});return!s||s.imageUrl&&!await oo(s.imageUrl)?e:(t.searchParams.set("appSplash",Je(s)),t.toString())}catch{return e}}async function oo(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function J(e,o=mt(),t={}){let n=await eo(e,o,t),r=await to(await Zt(n,t.project),t.project);if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function at(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return o}}async function no(e,o,t,n={}){let r=new URL(await J(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function ro(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function so(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function io(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function tn(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
4
+ import{a as Ne,b as q,c as de,d as ue,e as Fe,f as je,h as x,i as We,j as Ke}from"./chunk-3XC55LRK.js";import{m as O}from"./chunk-NWM62KI3.js";import{m as _e,p as Oe}from"./chunk-7LULF3D2.js";import{b as He,l as he}from"./chunk-JDQ5AJJ4.js";import{a as B,b as pe}from"./chunk-WKSX2VHB.js";import{a as Ge,b as Je}from"./chunk-NEKVW4FE.js";import{a as qe,b as z,c as ze}from"./chunk-NR2G2PSN.js";import{d as fe}from"./chunk-TABUERS3.js";import{a as Ve}from"./chunk-4PKUB2QX.js";import{a as me}from"./chunk-SDBIR5ON.js";import{b as Be,c as De,d as ce,f as Ae,g as Le,h as M,i as v,j as E}from"./chunk-KYGB26L4.js";import{f as Ee}from"./chunk-WE74HC52.js";import{b as le,d as Ue}from"./chunk-4MNKKMYG.js";import{d as Te,e as T,f as b,g as _}from"./chunk-YOLPZLST.js";import{H as Re,K as ae,M as V,O as Me,l as ie}from"./chunk-UK7X4OX3.js";import{spawn as ot,spawnSync as nt}from"node:child_process";import U from"node:fs";import Ct from"node:os";import C from"node:path";import{WebSocket as Rt}from"ws";function Qe(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function vt(e,o){return e?.includes("/one/metro-entry.bundle")?"one":typeof o=="string"&&o?"expo":"unknown"}function Ze(e,o,t){return`${e}//${o}:${t}`}function St(e){if(typeof window>"u")return!1;try{let o=new URL(e);return x(o.hostname)&&x(window.location.hostname)&&o.origin!==window.location.origin}catch{return!1}}async function Ye(e,o){let t={...o,cache:o?.cache??"no-store"};return St(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function $t(e){return e==="https:"?443:80}function xt(e){let o=e.pathname||"/";return(o==="/"||o==="")&&!e.search&&!e.hash}async function Pt(e){try{let o=await fetch("/__server-scan",{cache:"no-store"});if(!o.ok||!(o.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await o.json();if(!Array.isArray(t))return null;let n=t.find(r=>!!r&&typeof r=="object"&&r.port===e&&typeof r.bundleUrl=="string");return n?{bundleUrl:ue(n.bundleUrl),port:e,framework:typeof n.framework=="string"?n.framework:"unknown",projectName:typeof n.projectName=="string"?n.projectName:void 0}:null}catch{return null}}async function Xe(e,o){let t=e.replace(/\/+$/,"");try{if(x(new URL(t).hostname)){let n=await Pt(o);if(n)return n}}catch{}try{let n=await Ye(`${t}/`,{headers:{"expo-platform":"ios"}});if(n.ok){let r=await n.json(),s=r?.extra?.expoClient||r?.extra||{},i=typeof r?.launchAsset?.url=="string"?r.launchAsset.url:void 0;if(i||s.name)return{bundleUrl:ue(i||`${t}${de}`),port:o,framework:vt(i,s.sdkVersion),projectName:s.name}}}catch{}try{let n=await Ye(`${t}/status`);if(n.ok&&(await n.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:o,framework:"metro"}}catch{}return null}async function kt(e){return Xe(Ze("http:","localhost",e),e)}async function et(e){let o=e.trim();if(/^\d+$/.test(o)){let a=parseInt(o,10),l=await kt(a);if(l)return l;throw Qe(`localhost:${a}`)}let t=o.startsWith("http")?o:`http://${o}`,n;try{n=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let r=n.protocol||"http:",s=n.port?parseInt(n.port,10):$t(r),i=Ze(r,n.hostname,s);if(xt(n)){let a=await Xe(i,s);if(a)return a;throw Qe(i)}return{bundleUrl:n.toString(),port:s,framework:"unknown"}}function Po(){console.error(" no sootsim desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" sootsim desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" sootsim setup"),console.error("")}function tt(e){let o=B();if(console.log(` note: no sootsim bridge detected on port ${e}`),o){console.log(" launch the installed companion with:"),console.log(" sootsim desktop");return}console.log(""),console.log(" run `sootsim setup` to install the background daemon,"),console.log(" or run `sootsim serve` in another shell for a foreground bridge.")}function It(e){console.error(""),console.error(` no sim is connected to the sootsim bridge on port ${e}.`),console.error(""),console.error(" start your app dev server, then open it in sootsim:"),console.error(" npx expo start --localhost --port 8081"),console.error(" sootsim open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" sootsim describe")}async function ko(e,o,t){let n=[];try{n=await e.listSims()}catch{}if(console.error(""),n.length===0){It(o);return}console.error(` no sim with id "${t}" is connected to the bridge on port ${o}.`),console.error(""),console.error(" connected sims:");for(let r of n){let s=[r.isPrimary?"primary":null,r.readyState,r.userVisible===!1?"hidden":r.userVisible===!0?"visible":null,r.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${r.id} (${s})`)}console.error(""),console.error(" pass a valid --sim id, or run `sootsim list` to see all sessions.")}var Mt=12e4,rt=100,Et=5e3,st=1e4,Ut={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function $(e){return new Promise(o=>setTimeout(o,e))}function it(e){let o=process.env[e]?.trim();if(!o)return null;let t=Number(o);return Number.isInteger(t)&&t>0?t:null}function Tt(){let e=it("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??it("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Mt;return{timeoutMs:e,hostTimeoutMs:e+Et,intervalMs:rt,attempts:Math.max(1,Math.ceil(e/rt))}}function _t(e){return e==="chromium"||e==="electron"||e==="playwright"||e==="system"}function Ot(e,o){return e.includes("--headless")?!0:e.includes("--headed")?!1:o==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function Q(e){return e.trim()}var dt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Bt(e){let o=e.trim();if(!o)throw new Error("expected <url-or-route>");return dt.test(o)||o.startsWith("/")?o:`/${o}`}function Dt(e){return e!==null&&typeof e=="object"}function At(e){let o=e.trim();return o?o.startsWith("/")?!0:dt.test(o)?!/^https?:\/\//i.test(o):!1:!1}async function Lt(e){if(await G(e,250))return e;let o=ae();if(o&&V(o)&&await G(o.bridgePort,500))return o.bridgePort;if(o&&V(o))throw new Error(`sootsim bridge lockfile is fresh (port ${o.bridgePort}) but the bridge is not reachable. run \`sootsim daemon restart\` or \`sootsim daemon uninstall\`.`);await Nt();let t=Ft(["serve","--quiet","--port",String(e)]),n=null;t.once("exit",(s,i)=>{n=String(s??i??"unknown")}),t.unref();let r=Date.now()+st;for(;Date.now()<r;){let s=ae();if(s&&V(s)&&await G(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await G(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(n)throw new Error(`sootsim bridge exited before becoming ready (exit ${n})`);await $(150)}throw new Error(`sootsim bridge did not start within ${Math.round(st/1e3)}s`)}async function Nt(){let e=Re();if(e&&U.existsSync(ie(e)))return;console.error(" installing sootsim engine runtime...");let{runRuntime:o}=await import("./runtime-UQY75DPC.js");await o(["install"],{})}function Ft(e){let o=process.argv[1];return o&&U.existsSync(o)?ot(process.execPath,[o,...e],{detached:!0,stdio:"ignore",env:process.env}):ot("sootsim",e,{detached:!0,stdio:"ignore",env:process.env})}function G(e,o){return new Promise(t=>{let n=new Rt(`ws://127.0.0.1:${e}`,{handshakeTimeout:o}),r=!1,s=i=>{if(!r){r=!0;try{n.close()}catch{}t(i)}};n.once("open",()=>s(!0)),n.once("error",()=>s(!1)),setTimeout(()=>s(!1),o)})}function be(e){try{let o=new URL(e),t=o.pathname.replace(/\/+$/,"")||"/";return o.searchParams.has("open")||o.searchParams.has("port")||o.searchParams.has("bundle")||o.searchParams.has("demo")||o.pathname.includes("/sootsim/index.html")||t==="/sootsim"||o.pathname==="/__soot"||o.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function jt(e){try{let o=new URL(e,"http://sootsim.local");if(o.origin!=="http://sootsim.local")return!1;let t=o.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ht(e,o){let t=new URL(e,"http://sootsim.local"),n=new URL(o),r=Y(n.pathname),s=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return n.pathname=`${r}${s}`,n.search=t.search,n.hash=t.hash,n.toString()}function Wt(e){try{let o=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(o)||/^\/build\/.+/.test(o)}catch{return!1}}async function en(e){let o=Q(e);return(await ve(o)).bundleUrl}function Kt(e){try{let o=new URL(e.startsWith("http")?e:`http://${e}`),t=o.pathname||"/";if(t!=="/"&&t!==""||o.search||o.hash||!x(o.hostname))return null;let n=o.port?Number(o.port):o.protocol==="https:"?443:80;return Number.isFinite(n)&&n>0?n:null}catch{return null}}async function ve(e){let o=Q(e),t=/^\d+$/.test(o)?Number(o):Kt(o);if(t&&t>0){let n=await je(t);if(n)return{bundleUrl:n.bundleUrl,port:n.port,framework:n.framework,projectName:n.projectName}}return et(o)}function Y(e){let o=e.replace(/\/+$/,"")||"/";return o==="/__soot"||o.startsWith("/__soot/")?"/__soot":""}function Vt(e,o){let t=Q(e),n=new URL(o),r=Y(n.pathname);return n.pathname=`${r}/rn`,n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),/^\d+$/.test(t)?n.pathname=`${r}/rn/${t}`:(n.pathname=`${r}/rn`,n.searchParams.set("open",t)),n.toString()}function ut(e){let o=Q(e);return/^\d+$/.test(o)||/^https?:\/\//i.test(o)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(o)}async function qt(e,o,t={}){let n=t.resolvedBundle??await ve(e),r=new URL(o),s=Y(r.pathname);r.pathname=`${s}/rn`,r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("demo"),r.searchParams.delete("app");let i=t.hot===void 0?n.bundleUrl:Fe(n.bundleUrl,t.hot);return r.searchParams.set("bundle",i),r.toString()}function zt(e){return e.startsWith("~/")?C.join(Ct.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function Gt(e){let o={},t={};for(let r=0;r<e.length;r++){if(e[r]==="--replace"){let s=e[r+1];s||(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let i=s.indexOf("=");(i<=0||i===s.length-1)&&(console.error(" sootsim open: --replace expects <module>=<file>"),process.exit(1));let a=s.slice(0,i).trim(),l=zt(s.slice(i+1).trim());U.existsSync(l)||(console.error(` sootsim open: replacement file not found: ${l}`),process.exit(1)),o[a]={file:l},r++;continue}if(e[r]==="--remap"){let s=e[r+1],i=s?s.indexOf("="):-1;(!s||i<=0||i===s.length-1)&&(console.error(" sootsim open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[s.slice(0,i).trim()]=s.slice(i+1).trim(),r++;continue}}let n={};return Object.keys(o).length>0&&(n.modules=o),Object.keys(t).length>0&&(n.network={remap:t}),n.modules||n.network?n:void 0}async function Jt(e){if(e){let o=await z(e.bundleUrl);if(o)return me(o,{trustStart:!0})}return me(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Qt(e){if(U.existsSync(C.join(ie(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let o=await Ee.install({version:e,setActive:!1,protectVersions:Me()});console.error(` installed engine runtime ${o.version}`)}function Yt(e,o){if(!o)return e;let t=new URL(e);if(!x(t.hostname))throw new Error(`runtimeVersion ${o} requires a local SootSim host; got ${t.origin}`);return t.hostname=Ke(o),t.toString()}function mt(){return Be().shellBaseUrl}async function Zt(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=qe({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});if(s.length===0)return e;let i=await Xt(s);return i.length===0?e:(t.searchParams.set("appFonts",ze(i)),t.toString())}catch{return e}}async function Xt(e){let o=await Promise.all(e.map(async n=>{let r=new AbortController,s=setTimeout(()=>r.abort(),1500);try{let i=await fetch(n.url,{method:"HEAD",signal:r.signal});return i.status>=200&&i.status<400?n:null}catch{return null}finally{clearTimeout(s)}})),t=[];for(let n of o)n!==null&&t.push(n);return t}async function eo(e,o,t={}){if(!e)return new URL(o).toString();if(be(e))return new URL(e).toString();if(jt(e))return Ht(e,o);let n=Ut[e.toLowerCase()];if(n){let r=new URL(o),s=Y(r.pathname);return r.pathname=`${s}${n}`,r.toString()}return ut(e)?qt(e,o,t):Vt(e,o)}async function to(e,o){try{let t=new URL(e),n=t.searchParams.get("bundle")||"";if(!n)return e;let r=o?.appDir??await z(n)??void 0,s=Ge({bundleUrl:n,repoDir:r,exactProjectDir:!!o||!!r});return!s||s.imageUrl&&!await oo(s.imageUrl)?e:(t.searchParams.set("appSplash",Je(s)),t.toString())}catch{return e}}async function oo(e){let o=new AbortController,t=setTimeout(()=>o.abort(),1500);try{let n=await fetch(e,{method:"HEAD",signal:o.signal});return n.status>=200&&n.status<400}catch{return!1}finally{clearTimeout(t)}}async function J(e,o=mt(),t={}){let n=await eo(e,o,t),r=await to(await Zt(n,t.project),t.project);if(!t.device)return r;let s=new URL(r);return s.searchParams.set("device",t.device),s.toString()}function at(e,o){let t=e?.url||e?.origin||o;try{let n=new URL(t);return n.searchParams.delete("bundle"),n.searchParams.delete("demo"),n.searchParams.delete("app"),n.searchParams.delete("open"),n.searchParams.delete("port"),n.searchParams.delete("inspectOpen"),n.searchParams.delete("appFonts"),n.searchParams.delete("appSplash"),n.toString()}catch{return o}}async function no(e,o,t,n={}){let r=new URL(await J(e,o,n));return r.searchParams.set("inspectOpen",t),r.toString()}async function ro(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500,i=n.minNodeCount??10;for(let a=0;a<r;a++){let l=v(e,{commandTimeoutMs:o,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>i)return{bridge:l,count:d}}catch{}l.close(),await $(s)}return null}function so(e){if(!e)return null;try{let o=new URL(e);if(o.searchParams.has("bundle")){let t=o.searchParams.get("bundle")||"";try{let n=new URL(t),r=n.pathname.length>36?`...${n.pathname.slice(-36)}`:n.pathname;return`bundle ${n.host}${r}`}catch{return"bundle"}}return o.searchParams.has("port")?`connect :${o.searchParams.get("port")||""}`:o.searchParams.has("open")?`connect ${o.searchParams.get("open")||""}`:o.searchParams.has("demo")?`demo ${o.searchParams.get("demo")||"default"}`:o.pathname.includes("/sootsim/index.html")||o.pathname==="/sootsim/"||o.pathname==="/sootsim"?"embedded sootsim":null}catch{return null}}function io(e){let o=e.indexOf(":");if(o<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,o),n=e.slice(o+1),r=n.length>12?`${n.slice(0,8)}\u2026`:n;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${r}`:`${t} ${r}`}function tn(e,o){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
5
5
  `);for(let t of e){let n=t.lockedBy&&t.lockExpiresAt?`locked by ${io(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",r=[t.isPrimary?"primary":"",t.id===o?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",n].filter(Boolean);console.log(` ${t.id}${r.length?` [${r.join(", ")}]`:""}`);let s=so(t.url);if(s)console.log(` loaded: ${s}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let i=ao(t);i&&console.log(` engine: ${i}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${lt(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${lt(Date.now()-t.lastActiveAt)}`)}}function ao(e){let o=e.url||e.origin||"";if(!o)return null;try{let t=new URL(o).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"Contrast app embedded (:3000)":We()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function lt(e){let o=Math.max(0,Math.round(e/1e3));return o<60?`${o}s ago`:o<3600?`${Math.round(o/60)}m ago`:o<86400?`${Math.round(o/3600)}h ago`:`${Math.round(o/86400)}d ago`}async function ge(e,o,t,n={}){let r=n.attempts??30,s=n.intervalMs??500;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let d=(await a.listSims()).find(t);if(d)return d}catch{}finally{a.close()}await $(s)}return null}async function lo(e,o,t,n,r={}){let s=r.attempts??30,i=r.intervalMs??500,a=!!n&&Number.isInteger(n)&&n>1,l=()=>a&&n!==void 0&&!ye(n);for(let d=0;d<s;d++){if(l())return{kind:"host-exit"};let p=v(e,{commandTimeoutMs:o});try{let w=(await p.listSims()).find(t);if(w)return l()?{kind:"host-exit"}:{kind:"match",sim:w}}catch{}finally{p.close()}if(l())return{kind:"host-exit"};await $(i)}return{kind:"timeout"}}async function co(e,o,t,n={}){let r=n.attempts??20,s=n.intervalMs??250;for(let i=0;i<r;i++){let a=v(e,{commandTimeoutMs:o});try{let d=(await a.listSims()).find(p=>p.id===t);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await $(s)}return!1}function uo(e){let o=e.meta;if(!o||o.sootsimHostDriver!=="playwright")return null;let t=Number(o.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function mo(e){if(!e.connectAckFile)return!1;try{return U.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
6
6
  `,{flag:"w"}),!0}catch{return!1}}function ct(e){if(e.diagnosticLogPath)try{let o=U.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!o){console.error(` ${C.basename(e.diagnosticLogPath)} was empty`);return}let t=o.length>4e3?`\u2026
7
7
  ${o.slice(-4e3)}`:o;console.error(` ${C.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(o){let t=o instanceof Error?o.message:String(o);console.error(` failed to read ${C.basename(e.diagnosticLogPath)}: ${t}`)}}function ye(e){try{return process.kill(e,0),!0}catch(o){return o?.code==="EPERM"}}async function po(e,o=2500){let t=Date.now()+o;for(;Date.now()<t;){if(!ye(e))return!0;await $(100)}return!ye(e)}function fo(e){let o=nt("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=nt("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(o.status!==0||t.status!==0)return!1;let n=(o.stdout||"").trimEnd(),r=(t.stdout||"").trimEnd();return(r.startsWith(n)?r.slice(n.length):r).includes("SOOTSIM_PW_URL=")}async function we(e,o){let t=new Set(o),n=new Set;for(let r of e){if(!t.has(r.id))continue;let s=uo(r);s&&n.add(s)}for(let r of n){if(!fo(r)){console.log(` skipped pid ${r}: not a sootsim playwright host (stale sim record)`);continue}try{process.kill(r,"SIGTERM")}catch{}if(await po(r)){console.log(` closed playwright host process ${r}`);continue}try{process.kill(r,"SIGKILL"),console.log(` force-closed playwright host process ${r}`)}catch{}}}function Z(e,o){if(o){let r=o.trim(),s=e.find(i=>i.id===r);if(!s)throw new Error(`no sim connected with id ${r}`);return s}let t=e.find(r=>r.isPrimary&&r.readyState==="open");if(t)return t;let n=e.find(r=>r.readyState==="open");if(n)return n;throw new Error("no sim connected")}function D(e,o,t){console.log(` ${t==="current sim"?"loaded":"opened"}: ${e} [${t}]`),console.log(` current sim: ${o.id}`),console.log(JSON.stringify({simId:o.id,url:o.url},null,2))}async function A(e,o,t){if(t.includes("--no-describe"))return;let n=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await ho(e,o,{stableMs:150,maxMs:400});let r=v(e,{commandTimeoutMs:3e3,simId:o,cliLabel:"open --describe",simIdSource:"flag"});try{let s=null;try{s=await r.send({type:"evaluate",code:_e})}catch{}if(s&&!(s.flag===!0&&!s.loadingText&&Oe(s))){let p=s.loadingText?`still showing "${s.loadingText}"`:s.flag!==!0?"guest ready event has not fired":s.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${p} (nodes: ${s.nodes}, targets: ${s.targets})`),console.log(" before interacting, run: sootsim wait ready --max-ms 120000")}let a=`(async () => {
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import g from"node:fs";import f from"node:path";var D=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"],_=["sootsim.config.ts","sootsim.config.js","sootsim.config.mjs","sootsim.config.cjs"],S=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","fixtures","fixture","examples","example"]),d=256,y=4;function A(s,r){for(let t of r){let n=f.join(s,t);try{if(g.statSync(n).isFile())return n}catch{}}return null}function m(s){return A(s,D)}function h(s){return A(s,_)}function k(s){try{let r=JSON.parse(g.readFileSync(f.join(s,"package.json"),"utf8"));if(!r||typeof r!="object")return[];let t=Reflect.get(r,"workspaces");if(Array.isArray(t))return t.filter(c=>typeof c=="string");if(!t||typeof t!="object")return[];let n=Reflect.get(t,"packages");return Array.isArray(n)?n.filter(c=>typeof c=="string"):[]}catch{return[]}}function b(s){let r=new Set,t=0,n=!0;for(let c of k(s)){if(t>=d){n=!1;break}if(!c||f.isAbsolute(c))continue;let a=c.split(/[\\/]+/).filter(Boolean);if(a.length===0||a.length>y||a.some(o=>o===".."||o==="**"))continue;let i=[s];for(let o of a){let e=[];for(let l of i){if(t>=d){n=!1;break}if(t++,o==="*"){let p;try{p=g.readdirSync(l,{withFileTypes:!0})}catch{continue}for(let u of p)!u.isDirectory()||u.isSymbolicLink()||u.name.startsWith(".")||S.has(u.name)||e.push(f.join(l,u.name))}else if(!o.includes("*")){let p=f.join(l,o);try{let u=g.lstatSync(p);u.isDirectory()&&!u.isSymbolicLink()&&e.push(p)}catch{}}}i=e,i.length>d&&(i.length=d,n=!1)}for(let o of i)r.add(o)}return{directories:[...r],complete:n}}function j(s){let r=[{dir:s,depth:0}],t=[],n=0,c=0,a=!0;for(;c<r.length&&n<d;){let i=r[c++];if(!i)break;if(n++,i.depth>0&&m(i.dir)&&(t.push(i.dir),t.length>1))return{directories:t,complete:!0};if(i.depth>=y)continue;let o;try{o=g.readdirSync(i.dir,{withFileTypes:!0})}catch{continue}for(let e of o)if(!(!e.isDirectory()||e.isSymbolicLink())&&!(e.name.startsWith(".")||S.has(e.name))){if(r.length>=d){a=!1;break}r.push({dir:f.join(i.dir,e.name),depth:i.depth+1})}}return{directories:t,complete:a&&c===r.length}}function w(s,r={}){let t=f.resolve(s),n=h(t);if(m(t)||r.trustStart&&g.existsSync(t)){let e=n;if(!e&&r.trustStart){let l=f.dirname(t);for(let p=0;p<y&&l!==f.dirname(l)&&(e=h(l),!e);p++)l=f.dirname(l)}return{appDir:t,configPath:e}}let c=b(t),a=c.directories.filter(e=>m(e));if(a.length>1||!c.complete)return null;if(a.length===1){let e=a[0];return{appDir:e,configPath:n??h(e)}}let i=j(t),o=i.directories;if(o.length>1||!i.complete)return null;if(o.length===1){let e=o[0];return{appDir:e,configPath:n??h(e)}}return n?{appDir:t,configPath:n}:null}export{w as a};
@@ -1,5 +1,5 @@
1
- /*! sootsim v0.1.299 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  import { createRequire as __sootsimCreateRequire } from 'node:module'
3
3
  var require = __sootsimCreateRequire(import.meta.url)
4
- import{l as n}from"./chunk-2FTQEDJC.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
4
+ import{l as n}from"./chunk-4MNKKMYG.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
5
5
  `)}export{g as a};