sootsim 0.1.301 → 0.1.303

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 (156) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-DWXNDXDJ.js → agent-NKFJH2RJ.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-DTPQFEMR.js → agent-wrapper-WEA3TGWF.js} +2 -2
  4. package/dist-cli/chunks/{app-fonts-MKW6UNBO.js → app-fonts-L5JXOKIF.js} +2 -2
  5. package/dist-cli/chunks/{assert-GN4KR5TI.js → assert-ZG65AUNK.js} +2 -2
  6. package/dist-cli/chunks/{auth-HLOV4GZN.js → auth-RMFBZQIW.js} +2 -2
  7. package/dist-cli/chunks/{beta-DP7K4JVJ.js → beta-RR6TCDCJ.js} +2 -2
  8. package/dist-cli/chunks/{camera-SH6FT7ZA.js → camera-JWOAFE6U.js} +2 -2
  9. package/dist-cli/chunks/{chunk-4PKUB2QX.js → chunk-2LMSJNAH.js} +2 -2
  10. package/dist-cli/chunks/{chunk-WKSX2VHB.js → chunk-3I647BPF.js} +1 -1
  11. package/dist-cli/chunks/{chunk-HEPIUAFX.js → chunk-3YYCMGOR.js} +3 -3
  12. package/dist-cli/chunks/{chunk-SOBEJUH4.js → chunk-4F7VUXKY.js} +2 -2
  13. package/dist-cli/chunks/{chunk-KYGB26L4.js → chunk-5NHCBHYZ.js} +2 -2
  14. package/dist-cli/chunks/{chunk-4MNKKMYG.js → chunk-657GXEAT.js} +2 -2
  15. package/dist-cli/chunks/{chunk-VXRYV6G6.js → chunk-6Q5PHS4F.js} +1 -1
  16. package/dist-cli/chunks/{chunk-M33LQWC2.js → chunk-APBN2B6C.js} +1 -1
  17. package/dist-cli/chunks/{chunk-NWM62KI3.js → chunk-ATRV3MGB.js} +2 -2
  18. package/dist-cli/chunks/{chunk-KEFBMDYK.js → chunk-AWE4ZKR3.js} +1 -1
  19. package/dist-cli/chunks/{chunk-MKQNHDDF.js → chunk-AXDVKOGM.js} +2 -2
  20. package/dist-cli/chunks/{chunk-V2SZPQJF.js → chunk-BDZ7GDAA.js} +1 -1
  21. package/dist-cli/chunks/{chunk-IRNRCBRW.js → chunk-BQLQCPXE.js} +1 -1
  22. package/dist-cli/chunks/{chunk-FVNWUEK2.js → chunk-BYCMWKNX.js} +3 -3
  23. package/dist-cli/chunks/{chunk-STF4UH5I.js → chunk-CQEK4J75.js} +2 -2
  24. package/dist-cli/chunks/{chunk-7RU45W2O.js → chunk-CVRPU5KX.js} +1 -1
  25. package/dist-cli/chunks/{chunk-QNQP3WYV.js → chunk-DTQ4XGJP.js} +3 -3
  26. package/dist-cli/chunks/chunk-E3POCZJT.js +4 -0
  27. package/dist-cli/chunks/{chunk-4FCN3KOD.js → chunk-FLLDNYUC.js} +2 -2
  28. package/dist-cli/chunks/{chunk-Q4ZLYMUP.js → chunk-FQZQKJZ5.js} +1 -1
  29. package/dist-cli/chunks/{chunk-YTUW6DGN.js → chunk-G4B2PTUA.js} +2 -2
  30. package/dist-cli/chunks/{chunk-RW75MMQZ.js → chunk-GVC4ZNVM.js} +2 -2
  31. package/dist-cli/chunks/{chunk-YXRD4B4X.js → chunk-H3U7LAZG.js} +2 -2
  32. package/dist-cli/chunks/{chunk-4OZG2LQA.js → chunk-HKWQLGKK.js} +8 -8
  33. package/dist-cli/chunks/{chunk-7LULF3D2.js → chunk-JZZIA5BR.js} +21 -10
  34. package/dist-cli/chunks/{chunk-OVEH5OOR.js → chunk-LIK6FJNR.js} +1 -1
  35. package/dist-cli/chunks/{chunk-UK7X4OX3.js → chunk-LK63GSPB.js} +1 -1
  36. package/dist-cli/chunks/{chunk-J22XZAGG.js → chunk-M4SIQQDE.js} +2 -2
  37. package/dist-cli/chunks/{chunk-YIBVYNHV.js → chunk-MLHEWBGL.js} +1 -1
  38. package/dist-cli/chunks/{chunk-NEKVW4FE.js → chunk-MLX2UIH7.js} +2 -2
  39. package/dist-cli/chunks/{chunk-WE74HC52.js → chunk-NRPNLTJI.js} +2 -2
  40. package/dist-cli/chunks/{chunk-LE6JWEXU.js → chunk-OSCWNNYR.js} +1 -1
  41. package/dist-cli/chunks/{chunk-DNH4ZWVK.js → chunk-QR4A5JV3.js} +2 -2
  42. package/dist-cli/chunks/{chunk-JDQ5AJJ4.js → chunk-SSGGUPY7.js} +2 -2
  43. package/dist-cli/chunks/{chunk-MFLCDFRS.js → chunk-TDM4IQS3.js} +2 -2
  44. package/dist-cli/chunks/{chunk-TABUERS3.js → chunk-TFWWL3HI.js} +1 -1
  45. package/dist-cli/chunks/{chunk-MPDBF324.js → chunk-TL6D2L7C.js} +2 -2
  46. package/dist-cli/chunks/{chunk-EODC7ZE7.js → chunk-U7GJF4CQ.js} +2 -2
  47. package/dist-cli/chunks/{chunk-RCH5EVVP.js → chunk-UJIGVLKD.js} +1 -1
  48. package/dist-cli/chunks/{chunk-Y4EES4A2.js → chunk-VGNEIUJ7.js} +2 -2
  49. package/dist-cli/chunks/{chunk-P2HUPEXS.js → chunk-VLLTUTO5.js} +2 -2
  50. package/dist-cli/chunks/{chunk-BGY7U4IH.js → chunk-WI5GVQ6M.js} +2 -2
  51. package/dist-cli/chunks/{chunk-SDBIR5ON.js → chunk-XAHT6BRW.js} +1 -1
  52. package/dist-cli/chunks/{chunk-YOLPZLST.js → chunk-XE2DUF5Z.js} +1 -1
  53. package/dist-cli/chunks/{chunk-6MFFAN7Q.js → chunk-YOV3CQIH.js} +1 -1
  54. package/dist-cli/chunks/{chunk-PPD77GEP.js → chunk-YPZDXYHV.js} +2 -2
  55. package/dist-cli/chunks/{chunk-3XC55LRK.js → chunk-YWAV3FQJ.js} +2 -2
  56. package/dist-cli/chunks/chunk-ZED5FLNC.js +125 -0
  57. package/dist-cli/chunks/{chunk-77CFHIGG.js → chunk-ZJ6EL5FU.js} +1 -1
  58. package/dist-cli/chunks/{cleanup-DIDGDPIX.js → cleanup-MTGLBGPQ.js} +2 -2
  59. package/dist-cli/chunks/{cli-version-K3UX3EWQ.js → cli-version-KF6SJ5QC.js} +2 -2
  60. package/dist-cli/chunks/{compat-CU5BZOTA.js → compat-NIROXTXH.js} +2 -2
  61. package/dist-cli/chunks/{config-ZDPMF7NT.js → config-GVI5ADMM.js} +2 -2
  62. package/dist-cli/chunks/{control-PKNXORO3.js → control-RLM3WBEH.js} +2 -2
  63. package/dist-cli/chunks/daemon-O2R2GEWR.js +4 -0
  64. package/dist-cli/chunks/{debug-FRVAHAUX.js → debug-QLQ6VFDL.js} +3 -3
  65. package/dist-cli/chunks/{desktop-RM4LA63P.js → desktop-4KAE6XGD.js} +3 -3
  66. package/dist-cli/chunks/{detox-XXPJIQFG.js → detox-XW4L3NAA.js} +2 -2
  67. package/dist-cli/chunks/{device-5CWUNYYM.js → device-IMVFXWBB.js} +2 -2
  68. package/dist-cli/chunks/{diagnose-7WHQUJOH.js → diagnose-JTFFK6SX.js} +2 -2
  69. package/dist-cli/chunks/disk-cleanup-3HBGT6XT.js +4 -0
  70. package/dist-cli/chunks/drivers-BHLLX7OX.js +4 -0
  71. package/dist-cli/chunks/{film-EEAFWERR.js → film-BTQI2ZPO.js} +3 -3
  72. package/dist-cli/chunks/flow-C7PWEH4C.js +4 -0
  73. package/dist-cli/chunks/help-LOC2M6FR.js +4 -0
  74. package/dist-cli/chunks/{hidden-runtime-alias-GEDAK5VD.js → hidden-runtime-alias-5Y3QDZ2L.js} +2 -2
  75. package/dist-cli/chunks/{home-paths-PE4236U4.js → home-paths-K2P3TAAX.js} +2 -2
  76. package/dist-cli/chunks/inspect-JH64MAHP.js +4 -0
  77. package/dist-cli/chunks/install-desktop-C6KE3OM5.js +4 -0
  78. package/dist-cli/chunks/{login-NBG6XEI2.js → login-DIHEERZB.js} +4 -4
  79. package/dist-cli/chunks/{logout-TLDRLFXP.js → logout-HXABB5BG.js} +2 -2
  80. package/dist-cli/chunks/{maestro-DHRICU2K.js → maestro-LF67TXN2.js} +3 -3
  81. package/dist-cli/chunks/{maestro-generate-QZAGYXXJ.js → maestro-generate-XU7IAT4W.js} +3 -3
  82. package/dist-cli/chunks/{mode-XOMKPZZG.js → mode-GJRNBJWL.js} +2 -2
  83. package/dist-cli/chunks/{optional-demo-registry-L66RRINW.js → optional-demo-registry-SXOSQMWZ.js} +2 -2
  84. package/dist-cli/chunks/{perf-GSKQKH3W.js → perf-IZY2XMUE.js} +2 -2
  85. package/dist-cli/chunks/{permissions-D4XQ4HBT.js → permissions-RLZXUFQU.js} +2 -2
  86. package/dist-cli/chunks/{record-QTA3IWSU.js → record-OBWLYFSP.js} +3 -3
  87. package/dist-cli/chunks/{report-issue-BVPBXZEM.js → report-issue-DU7TRHJK.js} +2 -2
  88. package/dist-cli/chunks/runtime-E7SIB4P3.js +4 -0
  89. package/dist-cli/chunks/screenshot-command-5IF4BSJ4.js +159 -0
  90. package/dist-cli/chunks/{screenshots-capture-NUVPCCYY.js → screenshots-capture-OFYWMTVR.js} +2 -2
  91. package/dist-cli/chunks/{serve-FR5M2RRQ.js → serve-DUES2MUY.js} +2 -2
  92. package/dist-cli/chunks/{setup-O4WMVQVP.js → setup-7JBMUE6Q.js} +2 -2
  93. package/dist-cli/chunks/{skills-RUYLHJED.js → skills-J5HVAM75.js} +2 -2
  94. package/dist-cli/chunks/{storage-OCCDGKMN.js → storage-EPTR6RW5.js} +2 -2
  95. package/dist-cli/chunks/store-W3YDQEZQ.js +4 -0
  96. package/dist-cli/chunks/telemetry-WXVIVQ4Y.js +4 -0
  97. package/dist-cli/chunks/{timeline-QWPHBXJ2.js → timeline-QR2474MZ.js} +2 -2
  98. package/dist-cli/chunks/{upgrade-WUQAUREZ.js → upgrade-MQL27HMQ.js} +2 -2
  99. package/dist-cli/chunks/upload-6IA2EKEH.js +4 -0
  100. package/dist-cli/chunks/{version-TCSZK3WH.js → version-ILGJD7EH.js} +2 -2
  101. package/dist-cli/chunks/{web-7P7SQTFS.js → web-NEPM3SZU.js} +2 -2
  102. package/dist-cli/chunks/{what-happened-KIUBAPFB.js → what-happened-KGOUXBW4.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 +18 -6
  132. package/dist-lib/sdk.mjs +18 -6
  133. package/dist-lib/skills.cjs +6 -2
  134. package/dist-lib/vite.cjs +1 -1
  135. package/package.json +2 -2
  136. package/skills/sootsim-debug/SKILL.md +6 -0
  137. package/skills/sootsim-setup/SKILL.md +26 -0
  138. package/src/attached-projects.ts +2 -2
  139. package/src/host/bridge-host.ts +2 -2
  140. package/src/runtime-assets.ts +1 -1
  141. package/src/runtime-delivery.ts +1 -1
  142. package/src/vite-plugin.ts +1 -1
  143. package/dist-cli/chunks/chunk-EKNSKDBI.js +0 -125
  144. package/dist-cli/chunks/chunk-NR2G2PSN.js +0 -4
  145. package/dist-cli/chunks/daemon-OXELSM3C.js +0 -4
  146. package/dist-cli/chunks/disk-cleanup-EGAZA7DS.js +0 -4
  147. package/dist-cli/chunks/drivers-JEAO6IWD.js +0 -4
  148. package/dist-cli/chunks/flow-DMSEJ526.js +0 -4
  149. package/dist-cli/chunks/help-BTYQFHMT.js +0 -4
  150. package/dist-cli/chunks/inspect-RKOCZZ2A.js +0 -4
  151. package/dist-cli/chunks/install-desktop-25G42KWB.js +0 -4
  152. package/dist-cli/chunks/runtime-UQY75DPC.js +0 -4
  153. package/dist-cli/chunks/screenshot-command-YWDQBPE6.js +0 -156
  154. package/dist-cli/chunks/store-56RG4ZWJ.js +0 -4
  155. package/dist-cli/chunks/telemetry-YSUNFE7N.js +0 -4
  156. package/dist-cli/chunks/upload-D5BXJTXK.js +0 -4
@@ -0,0 +1,159 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a as ne,b as se,f as ie}from"./chunk-DTQ4XGJP.js";import"./chunk-QR4A5JV3.js";import{a as v}from"./chunk-ZJ6EL5FU.js";import{b as ee}from"./chunk-HKWQLGKK.js";import{a as te}from"./chunk-CQEK4J75.js";import"./chunk-VLLTUTO5.js";import{a as oe,b as re}from"./chunk-G4B2PTUA.js";import"./chunk-GVC4ZNVM.js";import"./chunk-YWAV3FQJ.js";import"./chunk-MLHEWBGL.js";import"./chunk-ATRV3MGB.js";import{r as K,s as X}from"./chunk-JZZIA5BR.js";import"./chunk-SSGGUPY7.js";import"./chunk-3I647BPF.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-TL6D2L7C.js";import"./chunk-UJIGVLKD.js";import"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import{h as A,i as J,j as R,k as Z,l as Q,m as M,n as $}from"./chunk-5NHCBHYZ.js";import"./chunk-AWE4ZKR3.js";import"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import"./chunk-APBN2B6C.js";import"./chunk-NRPNLTJI.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import{b as E,e as P,f as j,g as I,h as L,i as U,j as F}from"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{mkdirSync as ce,writeFileSync as ae}from"fs";import{dirname as ue,resolve as de}from"path";async function pe(e,t){let o=Le(e);(o.includes("--help")||o.includes("-h"))&&(console.log(`
5
+ sootsim screenshot \u2014 capture the canvas as a PNG
6
+
7
+ usage:
8
+ sootsim screenshot [output] [options]
9
+ sootsim screenshot [options] --output <path>
10
+
11
+ options:
12
+ --output <path> output file path (default: /tmp/sootsim-inspect.png)
13
+ first positional arg works too: \`screenshot /tmp/x.png\`
14
+ --with-frame wrap the captured screen in a tight device frame
15
+ --no-frame capture the raw screen bitmap (default)
16
+ --no-shell tenant-only capture (no status bar, keyboard, toasts,
17
+ notification center, or other shell overlays). use for
18
+ clean app screenshots when a shell surface is in the way.
19
+ --shell-only capture only the shell chrome, no tenant content
20
+ --allow-loading capture after caller-owned readiness checks even when
21
+ visible app copy matches a generic loading phrase
22
+ --area x,y,w,h crop to a logical sootsim rect
23
+ --id <testID> crop to a node's bounding box
24
+ --text <text> crop to a node found by text content
25
+ --gallery crawl and capture multiple screens as HTML gallery
26
+ --themes capture light and dark variants
27
+
28
+ examples:
29
+ sootsim screenshot
30
+ sootsim screenshot --no-shell --output app.png
31
+ sootsim screenshot --with-frame --output framed.png
32
+ sootsim screenshot --area 0,200,393,400 --output hero.png
33
+ sootsim screenshot --id loginButton --output button.png
34
+ `),process.exit(0));let i=Ue(o);if(i.length>0){for(let{flag:h,suggestion:w}of i)console.error(w?` unknown flag: ${h} (did you mean ${w}?)`:` unknown flag: ${h}`);console.error(" run `sootsim screenshot --help` for the list of supported flags"),process.exit(1)}let r=o.includes("--gallery"),s=o.includes("--themes"),n=o.includes("--allow-loading"),a=ze(o),l=_e(o);if(r||s)return a&&(console.error(" --with-frame is not supported with --gallery / --themes"),process.exit(1)),le(o,t);a&&o.some(h=>h==="--area"||h==="--id"||h==="--text")&&(console.error(" --with-frame only supports full-screen capture for now"),console.error(" remove --area / --id / --text, or capture raw and compose later"),process.exit(1));let c=A(o,{port:t.port,stripBooleanFlags:["--with-frame","--no-frame","--no-shell","--shell-only","--allow-loading"],stripValueFlags:["--output","--area","--id","--text"]}),u=he(o),d=await Be(o);if(await Re(c.wsPort)){try{await Oe(c,u,d,a,l,n)}catch(h){console.error(` screenshot failed: ${h instanceof Error?h.message:String(h)}`),process.exit(1)}return}a&&(console.error(" --with-frame requires a running sootsim bridge"),console.error(" open the app in a live sim first, then rerun the command"),process.exit(1)),d&&(console.error(" --area / --id / --text require a running sootsim bridge"),console.error(" start one with `sootsim serve`, `sootsim desktop`, or your project dev server"),process.exit(1)),await le(o,t)}async function Re(e){let t=J(e,{commandTimeoutMs:1e3});try{return await t.listSims(),!0}catch{return!1}finally{t.close()}}async function Be(e){let t=e.find((r,s)=>e[s-1]==="--area");if(t){let r=t.split(",").map(c=>Number(c.trim()));if(r.length!==4||r.some(c=>!Number.isFinite(c)))throw new Error(`--area expects x,y,w,h (got "${t}")`);let[s,n,a,l]=r;return{x:s,y:n,w:a,h:l}}let o=e.find((r,s)=>e[s-1]==="--id"),i=e.find((r,s)=>e[s-1]==="--text");return o||i?{__matcher:{id:o,text:i}}:null}async function Oe(e,t,o,i,r,s){let n=R({...e,commandTimeoutMs:45e3});try{if((await Z(n)).hidden&&process.stderr.write(` \u26A0 screenshot will capture the LAST PAINTED canvas \u2014 likely stale.
35
+ navigation/\`shell\` commands sent before this screenshot may not
36
+ have repainted yet. focus the tab manually or \`sootsim --sim <id>\`
37
+ to target a visible sim before capturing.
38
+
39
+ `),!s){let f=Number(process.env.CONTRAST_SCREENSHOT_READY_MAX_MS)||9e4,x=await X(n,f);if(!x.ready&&x.externalError)process.stderr.write(` \u26A0 capturing an ERROR screen. the app failed to load: ${x.externalError}
40
+ this is failure evidence, not app content. never use it as a baseline.
41
+
42
+ `);else if(!x.ready)throw new Error(`app not ready to capture after ${Math.round(x.elapsedMs/1e3)}s (${K(x)}); refusing to capture the boot/loading card. retry once the app paints.`)}let l=o,c=o?.__matcher;if(c){let f=await n.send({type:"evaluate",code:ee(c)});if(!f)throw new Error(c.id?`no node with id "${c.id}"`:`no node matching text "${c.text}"`);l=f}let u=l?{x:l.x,y:l.y,w:l.w,h:l.h}:void 0,d={type:"screenshot"};r&&(d.layers=r),u&&(d.crop=u);let m=await n.send(d);if(typeof m!="string"||m.length<="data:image/png;base64,".length)throw new Error("screenshot capture returned no image data \u2014 the sim is connected but not painting; check `sootsim get errors`");let w=m.replace(/^data:image\/png;base64,/,"");u&&console.log(` area: x=${u.x} y=${u.y} w=${u.w} h=${u.h}`),r&&console.log(` layers: ${r}`);let p=de(process.cwd(),t||"/tmp/sootsim-inspect.png");ce(ue(p),{recursive:!0});let y=Buffer.from(w,"base64");if(i){let f=await Te(n);if(!f)throw new Error("could not read current device model from the target sim");let x=await ne(y,f);ae(p,x),console.log(` frame: ${f}`)}else ae(p,y);console.log(` saved: ${p}`)}finally{n.close()}}async function Te(e){let t=await M(e,"SootSim.bridges.settings.get")??{deviceModel:null},o=typeof t.deviceModel=="string"?t.deviceModel:null;return!o||!(o in E)?null:o}function ze(e){let t=!1;for(let o of e)o==="--with-frame"&&(t=!0),o==="--no-frame"&&(t=!1);return t}function _e(e){if(e.includes("--shell-only"))return"shell";if(e.includes("--no-shell"))return"tenant"}var je=new Set(["--help","-h","--verbose","-v","--with-frame","--no-frame","--no-shell","--shell-only","--allow-loading","--gallery","--themes"]),me=new Set(["--output","--area","--id","--text","--url","--port","--timeout","--sim"]),Ie={"--rect":"--area","--crop":"--area","--region":"--area","--bounds":"--area","--box":"--area","--xywh":"--area","--out":"--output","-o":"--output","--file":"--output","--path":"--output","--testid":"--id","--test-id":"--id","--test_id":"--id"};function Le(e){let t=[],o={"-o":"--output","--out":"--output","--file":"--output","--path":"--output","--testid":"--id","--test-id":"--id","--test_id":"--id","--rect":"--area","--crop":"--area","--region":"--area","--bounds":"--area","--box":"--area","--xywh":"--area"};for(let i of e){let r=o[i];t.push(r??i)}return t}function Ue(e){let t=[];for(let o=0;o<e.length;o++){let i=e[o];if(i.startsWith("-")){if(me.has(i)){o++;continue}je.has(i)||t.push({flag:i,suggestion:Ie[i]})}}return t}function he(e){let t=e.find((o,i)=>e[i-1]==="--output");if(t)return t;for(let o=0;o<e.length;o++){let i=e[o];if(i.startsWith("-")){me.has(i)&&o++;continue}return i}}async function le(e,t){let o=he(e)||"sootsim-screenshot.png",i=e.includes("--gallery"),r=e.find((a,l)=>e[l-1]==="--url")||`http://localhost:${t.port||5173}`,{chromium:s}=await import("playwright"),n=await v(a=>s.launch(a),{headless:!0});try{if(i)console.log(" capturing gallery..."),console.log(" (gallery mode not yet implemented)");else{let a=await n.newPage({viewport:{width:500,height:900}});await a.goto(r,{waitUntil:"networkidle"}),await a.waitForTimeout(2e3);let l=de(process.cwd(),o);ce(ue(l),{recursive:!0}),await a.screenshot({path:l}),console.log(` saved: ${l}`),await a.close()}}catch(a){console.error(` screenshot failed: ${a.message}`),process.exitCode=1}finally{await n.close()}}import{mkdirSync as V,readFileSync as et,writeFileSync as Me}from"fs";import{tmpdir as to}from"os";import T from"path";import{mkdirSync as ge,readFileSync as He,writeFileSync as we}from"fs";import H from"path";function fe(e){return e.replace(/\\/g,"/").replace(/\.png$/i,"").trim().split("/").filter(Boolean).join("--").replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"slide"}function Y(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function Ye(e){let t=e.trim();return/^#[0-9a-f]{3}$/i.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function B(e,t){let o=Ye(e),i=Math.max(0,Math.min(1,t)),r=o.match(/^#([0-9a-f]{6})$/i);if(r){let s=r[1],n=Number.parseInt(s.slice(0,2),16),a=Number.parseInt(s.slice(2,4),16),l=Number.parseInt(s.slice(4,6),16);return`rgba(${n}, ${a}, ${l}, ${i})`}return o.startsWith("rgb(")?o.replace(/^rgb\((.+)\)$/i,`rgba($1, ${i})`):o}function Ge(e){if(e.type==="solid")return e.color||"#000000";let t=e.direction??180,o=e.stops?.map(i=>`${i.color} ${i.offset}%`).join(", ")||"#000000 0%, #111111 100%";return`linear-gradient(${t}deg, ${o})`}function We(e){let t=e.glow;return t?`radial-gradient(circle at 50% 24%, ${B(t,.46)} 0%, ${B(t,.2)} 24%, rgba(0,0,0,0) 62%)`:"none"}function G(e){switch(e){case"tilted-left":return"perspective(2400px) rotateY(10deg) rotateZ(-2deg)";case"tilted-right":return"perspective(2400px) rotateY(-10deg) rotateZ(2deg)";case"cut-bottom":return"translateY(10%) scale(1.08)";case"cut-top":return"translateY(-16%) scale(1.08)";case"straight":default:return"none"}}function ye(...e){let t=e.map(o=>o.trim()).filter(o=>o.length>0&&o!=="none");return t.length>0?t.join(" "):"none"}function W(e){let t=B(e.color,e.opacity),o=B(e.color,e.opacity*.52);return`drop-shadow(0 34px ${e.spread}px ${o}) drop-shadow(0 0 ${e.blur}px ${t})`}function q(e,t){return!t.glow||e.color&&e.color!==P.color?e:{...e,color:t.glow}}function qe(e,t){if(e==="editorial-left"){let r=Math.round(t.height*.056),s=Math.round(t.height*.022);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.12)}px`,`left:${Math.round(t.width*.085)}px`,`width:${Math.round(t.width*.42)}px`,"text-align:left","z-index:3"].join(";"),titleStyle:`font-size:${r}px;line-height:0.92;`,subStyle:`font-size:${s}px;line-height:1.36;max-width:${Math.round(t.width*.36)}px;`,eyebrowStyle:"align-items:flex-start;",deviceStyle:(n,a,l)=>{let c=Math.round(t.width*.68*(a.scale??n.scale)),u=Math.round(t.height*(.03+n.offsetY+(a.offsetY??0))),d=a.pose||n.pose||"tilted-right",m=q(n.shadow,l);return["position:absolute",`top:${Math.round(t.height*.18)+u}px`,`left:${Math.round(t.width*.56)}px`,`width:${c}px`,"transform-origin:center center",`transform:${G(d)}`,`filter:${W(m)}`,"z-index:2"].join(";")}}}if(e==="minimal-bottom"){let r=Math.round(t.height*.041),s=Math.round(t.height*.019);return{copyStyle:["position:absolute",`left:${Math.round(t.width*.12)}px`,`right:${Math.round(t.width*.12)}px`,`bottom:${Math.round(t.height*.085)}px`,"text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${r}px;line-height:0.96;`,subStyle:`font-size:${s}px;line-height:1.34;max-width:${Math.round(t.width*.56)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(n,a,l)=>{let c=Math.round(t.width*.84*(a.scale??n.scale)),u=Math.round(t.height*(n.offsetY+(a.offsetY??0))),d=a.pose||n.pose,m=q(n.shadow,l);return["position:absolute",`top:${Math.round(t.height*.075)+u}px`,"left:50%",`width:${c}px`,"transform-origin:center center",`transform:${ye("translateX(-50%)",G(d))}`,`filter:${W(m)}`,"z-index:2"].join(";")}}}let o=Math.round(t.height*.04),i=Math.round(t.height*.019);return{copyStyle:["position:absolute",`top:${Math.round(t.height*.084)}px`,"left:50%",`width:${Math.round(t.width*.88)}px`,"transform:translateX(-50%)","text-align:center","z-index:3"].join(";"),titleStyle:`font-size:${o}px;line-height:0.92;`,subStyle:`font-size:${i}px;line-height:1.34;max-width:${Math.round(t.width*.6)}px;margin:0 auto;`,eyebrowStyle:"align-items:center;",deviceStyle:(r,s,n)=>{let a=Math.round(t.width*.64*(s.scale??r.scale)),l=Math.round(t.height*(r.offsetY+(s.offsetY??0))),c=s.pose||r.pose,u=q(r.shadow,n);return["position:absolute",`top:${Math.round(t.height*.28)+l}px`,"left:50%",`width:${a}px`,"transform-origin:center top",`transform:${ye("translateX(-50%)",G(c))}`,`filter:${W(u)}`,"z-index:2"].join(";")}}}function Ve({canvas:e,compose:t,slide:o,imageDataUrl:i}){let r=o.background??t.background,s=qe(t.text.preset,e),n=t.text.preset!=="none"&&!!(o.eyebrow||o.headline||o.subheadline),a=s.deviceStyle(t.frame,o,r),l=o.headline?`<div style="font-weight:780;white-space:pre-line;text-wrap:balance;${s.titleStyle}">${Y(o.headline)}</div>`:"",c=o.subheadline?`<div style="margin-top:${Math.round(e.height*.018)}px;color:${t.text.subColor};white-space:pre-line;text-wrap:balance;${s.subStyle}">${Y(o.subheadline)}</div>`:"",u=o.eyebrow?`<div style="display:flex;${s.eyebrowStyle}margin-bottom:${Math.round(e.height*.016)}px;"><div style="font-size:${Math.round(e.height*.014)}px;font-weight:700;letter-spacing:0.18em;text-transform:uppercase;color:${t.text.eyebrowColor};">${Y(o.eyebrow)}</div></div>`:"";return`<!doctype html>
43
+ <html>
44
+ <head>
45
+ <meta charset="utf-8" />
46
+ <style>
47
+ html, body {
48
+ margin: 0;
49
+ width: ${e.width}px;
50
+ height: ${e.height}px;
51
+ overflow: hidden;
52
+ background: transparent;
53
+ }
54
+ body {
55
+ font-family: "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
56
+ }
57
+ #canvas {
58
+ position: relative;
59
+ width: ${e.width}px;
60
+ height: ${e.height}px;
61
+ overflow: hidden;
62
+ background: ${Ge(r)};
63
+ color: ${t.text.color};
64
+ isolation: isolate;
65
+ }
66
+ #glow {
67
+ position: absolute;
68
+ inset: 0;
69
+ background: ${We(r)};
70
+ pointer-events: none;
71
+ }
72
+ #copy {
73
+ ${s.copyStyle};
74
+ }
75
+ #device {
76
+ ${a};
77
+ }
78
+ #device img {
79
+ display: block;
80
+ width: 100%;
81
+ height: auto;
82
+ }
83
+ </style>
84
+ </head>
85
+ <body>
86
+ <div id="canvas">
87
+ <div id="glow"></div>
88
+ ${n?`<div id="copy">${u}${l}${c}</div>`:""}
89
+ <div id="device"><img src="${i}" alt="" /></div>
90
+ </div>
91
+ </body>
92
+ </html>`}async function be(e,t,o){let i=[],r=o??await(async()=>{let{chromium:n}=await import("playwright");return v(a=>n.launch(a),{headless:!0})})();try{let n=await r.newContext({viewport:{width:1280,height:720}});try{for(let a of t){let c=`data:image/png;base64,${He(a.imagePath).toString("base64")}`;for(let u of e.canvases){let d=await n.newPage();try{await d.setViewportSize({width:u.width,height:u.height}),await d.setContent(Ve({canvas:u,compose:e,slide:a.slide,imageDataUrl:c}),{waitUntil:"load"}),await d.waitForTimeout(20);let m=H.join(e.outDir,u.name,e.locale);ge(m,{recursive:!0});let h=H.join(m,`${a.slide.assetKey}.png`),w=await d.screenshot({type:"png",clip:{x:0,y:0,width:u.width,height:u.height}});we(h,w),i.push({slideId:a.slide.id,canvas:u.name,locale:e.locale,outputPath:h,sourcePath:a.imagePath})}finally{await d.close()}}}}finally{await n.close()}}finally{!o&&typeof r.close=="function"&&await r.close()}ge(e.outDir,{recursive:!0});let s=H.join(e.outDir,"manifest.json");return we(s,JSON.stringify({generatedAt:new Date().toISOString(),locale:e.locale,outputs:i},null,2)),{manifestPath:s,outputs:i.map(n=>n.outputPath),entries:i}}function D(e){return typeof e=="string"&&e.length>0?e:void 0}async function Se(e){let o=`${e.origin.replace(/\/$/,"")}/api/sootsim/screenshot-decks?org=${encodeURIComponent(e.org)}&repo=${encodeURIComponent(e.repo)}`,i=await fetch(o,{headers:{Authorization:e.authHeader}});if(!i.ok){let a=await i.text().catch(()=>"");throw new Error(`org deck fetch failed (${i.status} ${i.statusText}) for ${e.org}/${e.repo}${a?` \u2014 ${a.slice(0,200)}`:""}`)}let s=(await i.json()).decks?.[0];if(!s||!s.config||typeof s.config!="object")return null;let n=s.config.frames;return Array.isArray(n)?n.map(a=>{let l=a??{};return{title:D(l.title),subtitle:D(l.subtitle),bgTop:D(l.bgTop),bgBottom:D(l.bgBottom),titleColor:D(l.titleColor)}}):null}function xe(e,t){e.compose.slides.forEach((o,i)=>{let r=t[i];if(r&&(r.title!=null&&(o.headline=r.title),r.subtitle!=null&&(o.subheadline=r.subtitle),r.bgTop&&r.bgBottom)){let s={type:"gradient",direction:180,stops:[{offset:0,color:I(r.bgTop)},{offset:1,color:I(r.bgBottom)}]};o.background=s}})}import{readFileSync as Ke}from"fs";import k from"path";function g(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function O(e,t){if(!g(e))throw new Error(`${t} must be an object`);return e}function b(e,t=""){return typeof e=="string"?e:t}function S(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}function Pe(e,t){return typeof e=="boolean"?e:t}function C(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function $e(e,t){return typeof e!="string"||e.trim().length===0?t:Object.prototype.hasOwnProperty.call(E,e)?e:null}function ke(e,t){if(typeof e=="string"){let r=F(e);if(!r)throw new Error(`unknown background preset: ${e}`);return r}if(!g(e))return U(t);let o=e.type==="solid"||e.type==="gradient"?e.type:t.type;if(o==="solid")return{type:o,color:b(e.color,t.color??"#000000"),glow:S(e.glow)??t.glow};let i=Array.isArray(e.stops)?e.stops.map(r=>{if(!g(r))return null;let s=C(r.offset,Number.NaN),n=S(r.color);return!Number.isFinite(s)||!n?null:{offset:s,color:n}}).filter(r=>!!r):t.stops?.map(r=>({...r}))??[];return{type:o,direction:C(e.direction,t.direction??180),glow:S(e.glow)??t.glow,stops:i.length>0?i:t.stops?.map(r=>({...r}))??[]}}function Xe(e){let o=(Array.isArray(e)?e:["iphone-6-9"]).map(i=>{if(typeof i!="string")throw new Error("compose.canvases entries must be strings");let r=L(i);if(!r)throw new Error(`unknown canvas preset: ${i}`);return r});if(o.length===0)throw new Error("compose.canvases must include at least one preset");return o}function Je(e){switch(e){case"editorial-left":case"minimal-bottom":case"none":case"bold-top":return e;default:return"bold-top"}}function Ze(e){switch(e){case"plan":case"flow":case"auto":return e;default:return"auto"}}function ve(e){switch(e){case"straight":case"tilted-left":case"tilted-right":case"cut-bottom":case"cut-top":return e;default:return}}function N(e,t){return k.isAbsolute(t)?t:k.resolve(e,t)}function Qe(e,t){if(!Array.isArray(e)||e.length===0)throw new Error("compose.slides must be a non-empty array");return e.map((o,i)=>{let r=O(o,`compose.slides[${i}]`),s=S(r.screenshot);if(!s)throw new Error(`compose.slides[${i}].screenshot is required`);let n=S(r.id),a=fe(n||s);return{id:n||a,assetKey:a,screenshot:s,headline:b(r.headline),subheadline:b(r.subheadline),eyebrow:b(r.eyebrow),pose:ve(r.pose),scale:typeof r.scale=="number"&&Number.isFinite(r.scale)?r.scale:void 0,offsetY:typeof r.offsetY=="number"&&Number.isFinite(r.offsetY)?r.offsetY:void 0,background:r.theme||r.background?ke(r.theme??r.background,t):void 0}})}function Ce(e){let t=k.resolve(e),o=k.dirname(t),i=te.parse(Ke(t,"utf8")),r=O(i,"screenshots plan"),s=O(r.capture??{},"capture"),n=O(r.compose??{},"compose"),a=typeof r.app=="number"?String(r.app):S(r.app),l=$e(r.device,null),c=N(o,b(s.out,k.join(".sootsim","screenshots","capture"))),u=S(s.from),d=S(s.flow);if(!u&&!d)throw new Error("capture.flow or capture.from is required");let m=s.mode==="raw"||s.mode==="framed"||s.mode==="raw+framed"?s.mode:"raw+framed",h=Ze(s.pathMode),w=ke(n.background??"cyan",F("cyan")),p={show:Pe(n.frame&&g(n.frame)?n.frame.show:void 0,!0),style:$e(n.frame&&g(n.frame)?n.frame.style:null,null)||l||j,pose:ve(n.frame&&g(n.frame)?n.frame.pose:void 0)||"straight",scale:C(n.frame&&g(n.frame)?n.frame.scale:void 0,1),offsetY:C(n.frame&&g(n.frame)?n.frame.offsetY:void 0,0),shadow:{color:b(n.frame&&g(n.frame)&&g(n.frame.shadow)?n.frame.shadow.color:void 0,P.color),blur:C(n.frame&&g(n.frame)&&g(n.frame.shadow)?n.frame.shadow.blur:void 0,P.blur),spread:C(n.frame&&g(n.frame)&&g(n.frame.shadow)?n.frame.shadow.spread:void 0,P.spread),opacity:C(n.frame&&g(n.frame)&&g(n.frame.shadow)?n.frame.shadow.opacity:void 0,P.opacity)}};return{planPath:t,planDir:o,appTarget:a,deviceModel:l,capture:{flowPath:d?N(o,d):null,fromDir:u?N(o,u):null,outDir:c,rawDir:u?N(o,u):k.join(c,"raw"),framedDir:k.join(c,"framed"),mode:m,pathMode:h,simId:S(s.sim),openInNewSim:Pe(s.new,!1)},compose:{outDir:N(o,b(n.out,k.join(".sootsim","screenshots","exports"))),locale:b(n.locale,"en"),canvases:Xe(n.canvases),frame:p,background:w,text:{preset:Je(n.text&&g(n.text)?n.text.preset:void 0),color:b(n.text&&g(n.text)?n.text.color:void 0,"#ffffff"),subColor:b(n.text&&g(n.text)?n.text.subColor:void 0,"rgba(232,240,247,0.86)"),eyebrowColor:b(n.text&&g(n.text)?n.text.eyebrowColor:void 0,"rgba(229,242,255,0.72)")},slides:Qe(n.slides,w)}}}function tt(e){return e.capture.pathMode==="plan"||e.capture.pathMode==="flow"?e.capture.pathMode:e.capture.fromDir?"flow":"plan"}function ot(e,t){if(!e.capture.flowPath)throw new Error("capture flow path is required to build flow args");let o=[e.capture.flowPath],i=tt(e);o.push("--screenshots",e.capture.rawDir),i==="flow"&&o.push("--screenshot-paths","flow");let r=t.appTarget??e.appTarget,s=t.deviceModel??e.deviceModel,n=t.simId??e.capture.simId;return r&&o.push("--url",r),s&&o.push("--device",s),n&&o.push("--sim",n),e.capture.openInNewSim&&o.push("--new"),o}function z(e,t){return T.isAbsolute(t)?t:T.join(e.capture.rawDir,t)}function rt(e){return T.join(e.capture.outDir,"manifest.json")}async function nt(e,t){if(!e.capture.flowPath)return;V(e.capture.rawDir,{recursive:!0});let o=ot(e,t),i=await ie(o);if(i!==0)throw new Error(`flow capture failed with exit code ${i}`)}async function st(e,t){let o=new Map;V(e.capture.framedDir,{recursive:!0});let i=t??await(async()=>{let{chromium:r}=await import("playwright");return v(s=>r.launch(s),{headless:!0})})();try{let r=await se(i);try{for(let s of e.compose.slides){let n=z(e,s.screenshot),a=et(n),l=await r.compose(a,e.compose.frame.style),c=T.join(e.capture.framedDir,`${s.assetKey}.png`);Me(c,l),o.set(s.id,c)}}finally{await r.close()}}finally{!t&&typeof i.close=="function"&&await i.close()}return o}function it(e,t,o){let i=[],r=[];V(e.capture.outDir,{recursive:!0});let s=rt(e),n=e.compose.slides.map(a=>{let l=z(e,a.screenshot),c=t.get(a.id)??null;return i.push(l),c&&r.push(c),{id:a.id,screenshot:a.screenshot,rawPath:l,framedPath:c}});return Me(s,JSON.stringify({generatedAt:new Date().toISOString(),deviceModel:o,mode:e.capture.mode,rawDir:e.capture.rawDir,framedDir:e.capture.framedDir,slides:n},null,2)),{manifestPath:s,rawDir:e.capture.rawDir,framedDir:e.capture.framedDir,rawFiles:i,framedFiles:r}}function at(e,t){return e.compose.slides.map(o=>({slide:o,imagePath:e.compose.frame.show===!0?t.get(o.id)??z(e,o.screenshot):z(e,o.screenshot)}))}async function De(e,t={}){let o=Ce(e);t.orgDeckFrames&&t.orgDeckFrames.length>0&&xe(o,t.orgDeckFrames);let i=t.deviceModel??o.deviceModel;t.composeOnly||await nt(o,t);let r=o.capture.mode!=="raw"||!t.captureOnly&&o.compose.frame.show===!0,n=r||!t.captureOnly?await(async()=>{let{chromium:a}=await import("playwright");return v(l=>a.launch(l),{headless:!0})})():null;try{let a=r?await st(o,n??void 0):new Map,l=it(o,a,i);if(t.captureOnly)return{plan:o,capture:l,compose:null};let c=at(o,a),u=await be(o.compose,c,n??void 0);return{plan:o,capture:l,compose:u}}finally{n&&typeof n.close=="function"&&await n.close()}}async function Ne(e,t={}){if(e.includes("--help")||e.includes("-h"))return console.log(`
93
+ sootsim screenshot appstore \u2014 capture and compose app-store screenshot sets
94
+
95
+ usage:
96
+ sootsim screenshot appstore --plan <plan.yaml> [options]
97
+
98
+ options:
99
+ --plan <path> screenshot plan yaml
100
+ --sim <id> reuse a live sim for capture
101
+ --app <target> override plan app target (port, url, or shell url)
102
+ --device <model> override plan capture device for this run
103
+ --org <slug> overlay copy/colors from a team's org screenshot deck
104
+ --repo <name> repo for --org (both required to pull the org deck)
105
+ --api-origin <url> contrast origin to fetch the deck from (default: the
106
+ signed-in session origin, else https://contrast.dev)
107
+ --capture-only stop after raw/framed intermediates
108
+ --compose-only skip flow capture, reuse existing raw screenshots
109
+
110
+ examples:
111
+ sootsim screenshot appstore --plan app-store.yaml
112
+ sootsim screenshot appstore --plan app-store.yaml --sim a9
113
+ sootsim screenshot appstore --plan app-store.yaml --org acme --repo mobile
114
+ `),0;let o=p=>e.find((y,f)=>e[f-1]===p),i=new Set(["--plan","--sim","--app","--device","--org","--repo","--api-origin"]),r=e.filter((p,y)=>{if(p.startsWith("-"))return!1;let f=e[y-1];return!f||!i.has(f)}),s=o("--plan")||r[0];if(!s)return console.error(" error: screenshots plan path is required (`--plan <path>`)."),1;let n=o("--sim")?.trim()||null,a=o("--app")?.trim()||null,l=o("--device")?.trim()||null,c=o("--org")?.trim()||null,u=o("--repo")?.trim()||null,d=o("--api-origin")?.trim()||null,m=e.includes("--capture-only"),h=e.includes("--compose-only"),w=null;if(c||u){if(!c||!u)return console.error(" error: --org and --repo must be passed together."),1;let p=oe();if(!p)return console.error(" error: --org/--repo needs auth \u2014 run `sootsim login` or set SOOTSIM_API_KEY."),1;let y=d||(p.kind==="session"?p.origin:"https://contrast.dev");try{w=await Se({org:c,repo:u,origin:y,authHeader:re(p)})}catch(f){return console.error(` ${f.message}`),1}!w||w.length===0?console.log(` note: no org deck for ${c}/${u} \u2014 composing with the plan's copy/colors.`):console.log(` org deck: ${w.length} slide(s) from ${c}/${u}`)}try{let p=await De(s,{simId:n,appTarget:a,deviceModel:l,captureOnly:m,composeOnly:h,orgDeckFrames:w});return console.log(` capture manifest: ${p.capture.manifestPath}`),p.compose?(console.log(` compose manifest: ${p.compose.manifestPath}`),console.log(` exports: ${p.compose.outputs.length}`)):console.log(" compose skipped"),0}catch(p){return console.error(` screenshots failed: ${p.message}`),1}}import{mkdirSync as lt,writeFileSync as ct}from"node:fs";import{dirname as ut,isAbsolute as dt,join as Ee,resolve as pt}from"node:path";var mt=`
115
+ sootsim screenshot slides \u2014 compose App Store screenshots in the live sim
116
+
117
+ usage:
118
+ sootsim screenshot slides list slides (alias: slides list)
119
+ sootsim screenshot slides set <n> [fields] patch a slide's copy/colors
120
+ sootsim screenshot slides add append a blank slide (focuses it)
121
+ sootsim screenshot slides remove <n> delete a slide
122
+ sootsim screenshot slides move <n> <position> reorder a slide
123
+ sootsim screenshot slides focus <n> open a slide (device flips into it)
124
+ sootsim screenshot slides overview back to the gallery
125
+ sootsim screenshot slides capture [<n>] capture the live frame into a slide
126
+ sootsim screenshot slides export [<n>] [--out <dir>]
127
+ write composed App-Store PNG(s)
128
+
129
+ set fields:
130
+ --title <text> headline
131
+ --subtitle <text> subheadline
132
+ --bg-top <color> gradient top (white gray slate black cyan blue
133
+ --bg-bottom <color> gradient bottom teal green lime gold orange coral
134
+ --title-color <color> copy color override, or "auto" red berry magenta
135
+ --title-size <s> sm | md | lg | none gray-light
136
+ --underlay <s> black | white | none gray-dark \u2026)
137
+ --shadow <s> light | medium | strong | none
138
+
139
+ notes:
140
+ slides are addressed by 1-based index. screenshot mode is auto-enabled.
141
+ capture shoots whatever the sim currently shows \u2014 navigate the app first
142
+ (sootsim do tap-id \u2026), then capture.
143
+
144
+ examples:
145
+ sootsim screenshot slides set 1 --title "The ultimate MMA community." --bg-top cyan --bg-bottom black
146
+ sootsim screenshot slides capture 1
147
+ sootsim screenshot slides export --out ./exports
148
+ `,ht={"--title":"title","--subtitle":"subtitle","--bg-top":"bgTop","--bg-bottom":"bgBottom","--title-color":"titleColor","--title-size":"titleSize","--underlay":"titleUnderlay","--shadow":"titleShadow","--out":"out"};function ft(e){let t=[],o={},i=!1;for(let r=0;r<e.length;r+=1){let s=e[r];if(s==="--json"){i=!0;continue}let n=s.indexOf("="),a=n>0?s.slice(0,n):s,l=ht[a];if(l){n>0?o[l]=s.slice(n+1):(o[l]=e[r+1]??"",r+=1);continue}t.push(s)}return{rest:t,values:o,json:i}}function gt(e){if(!e)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:e}async function wt(e){if(!await Q(e,`(async () => {
149
+ if (window.SootSim?.bridges?.settings?.get?.()?.screenshotMode) return true
150
+ window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
151
+ detail: { type: 'fire-action', id: 'toggle-screenshot-mode' },
152
+ }))
153
+ const deadline = Date.now() + 2000
154
+ while (Date.now() < deadline) {
155
+ if (window.SootSim?.bridges?.settings?.get?.()?.screenshotMode) return true
156
+ await new Promise((r) => setTimeout(r, 40))
157
+ }
158
+ return false
159
+ })()`,{acquireLock:!0}))throw new Error("could not enable screenshot mode \u2014 is this a browser sim with the screenshot plugin? (electron has no screenshot mode)")}function yt(e){console.log(` ${e.projectName} \u2014 canvas ${e.canvas} (${e.exportSize.width}\xD7${e.exportSize.height}), device ${e.deviceModel}`);for(let t of e.slides){let o=[t.focused?"focused":t.active?"active":null,t.captured?`captured${t.captureMode==="3d"?" 3d":""}`:"no capture"].filter(Boolean).join(", "),i=t.title?`"${t.title}"`:"(no title)",r=[`bg ${t.bgTop}\u2192${t.bgBottom}`,t.titleColor?`color ${t.titleColor}`:null,t.titleSize?`size ${t.titleSize}`:null,t.titleUnderlay?`underlay ${t.titleUnderlay}`:null,t.titleShadow?`shadow ${t.titleShadow}`:null].filter(Boolean).join(", ");console.log(` ${t.index}. ${i} \u2014 ${r} [${o}]`),t.subtitle&&console.log(` ${t.subtitle}`)}}function bt(e){let t=e.match(/^data:[^;]+;base64,(.+)$/);if(!t)throw new Error("export returned an unexpected payload");return Buffer.from(t[1],"base64")}async function Fe(e,t){if(e.includes("--help")||e.includes("-h")){console.log(mt);return}let{rest:o,values:i,json:r}=ft(e),s=A(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=gt(s.positional[1]),l=Number(s.positional[2]),c=R(s),u=d=>{r?console.log(JSON.stringify(d,null,2)):yt(d)};try{switch(await wt(c),n){case"list":{u(await M(c,"SootSim.bridges.screenshotControl.getState"));break}case"set":{if(a==null)throw new Error("usage: sootsim screenshot slides set <n> --title \u2026 (see --help)");let d={};for(let m of["title","subtitle","bgTop","bgBottom","titleColor","titleSize","titleUnderlay","titleShadow"])i[m]!=null&&(d[m]=i[m]);if(Object.keys(d).length===0)throw new Error("nothing to set \u2014 pass at least one field (see --help)");u(await $(c,"SootSim.bridges.screenshotControl.setSlide",a,d));break}case"add":{u(await $(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");u(await $(c,"SootSim.bridges.screenshotControl.removeSlide",a));break}case"move":{if(a==null||!Number.isInteger(l)||l<1)throw new Error("usage: sootsim screenshot slides move <n> <position>");u(await $(c,"SootSim.bridges.screenshotControl.moveSlide",a,l));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");u(await $(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await $(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let d=await $(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(d);break}case"export":{let d=i.out?dt(i.out)?i.out:pt(process.cwd(),i.out):Ee(process.cwd(),"screenshots"),m=await M(c,"SootSim.bridges.screenshotControl.getState"),h=a!=null?m.slides.filter(p=>p.index===a||p.id===a):m.slides.filter(p=>p.captured);if(h.length===0)throw new Error(a!=null?`no slide ${a}`:"no captured slides to export \u2014 capture first");let w=[];for(let p of h){let y=await M(c,"SootSim.bridges.screenshotControl.exportSlide",p.index),f=Ee(d,y.name);lt(ut(f),{recursive:!0}),ct(f,bt(y.dataUrl)),w.push(f),console.log(` saved: ${f} (${y.width}\xD7${y.height})`)}r&&console.log(JSON.stringify({written:w},null,2));break}default:throw new Error(`unknown subcommand "${n}" \u2014 see sootsim screenshot slides --help`)}}finally{c.close()}}var St=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout"]),xt=new Set(["capture","slides","appstore"]);function Ae(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){St.has(o)&&t++;continue}return xt.has(o)?{name:o,index:t}:null}return null}function _(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Pt(e){let t=[];for(let o=0;o<e.length;o++){if(e[o]==="--sim"){o++;continue}t.push(e[o])}return t}async function Po(e,t){let o=Ae(e);if(!o||o.name==="capture"){await pe(o?_(e,o.index):e,t);return}if(o.name==="slides"){await Fe(_(e,o.index),t);return}let i=_(e,o.index),r=Ae(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-OFYWMTVR.js");return await s(Pt(_(i,r.index)))}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ERR_MODULE_NOT_FOUND")return console.error("screenshot appstore capture is repo-only tooling \u2014 it needs the sootsim workspace (playwright is not shipped with the published CLI)."),1;throw s}return Ne(i,t)}export{Po as runScreenshotCommand};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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 M}from"./chunk-77CFHIGG.js";import{a as x}from"./chunk-YTUW6DGN.js";import"./chunk-4FCN3KOD.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import{execSync as T}from"node:child_process";import{mkdirSync as D,mkdtempSync as O,rmSync as E,writeFileSync as j}from"node:fs";import{tmpdir as G}from"node:os";import{dirname as q,isAbsolute as B,join as U,resolve as L}from"node:path";import{chromium as W}from"playwright-core";var z=`
4
+ import{b as M}from"./chunk-ZJ6EL5FU.js";import{a as x}from"./chunk-G4B2PTUA.js";import"./chunk-FLLDNYUC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{execSync as T}from"node:child_process";import{mkdirSync as D,mkdtempSync as O,rmSync as E,writeFileSync as j}from"node:fs";import{tmpdir as G}from"node:os";import{dirname as q,isAbsolute as B,join as U,resolve as L}from"node:path";import{chromium as W}from"playwright-core";var z=`
5
5
  sootsim screenshot appstore capture \u2014 headlessly capture + upload App Store slides
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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 ge,c as J,d as Se,e as K,f as ye,h as ve,i as E,j as be,k as we,l as Ae,m as ke,q as Te,t as k,u as Ce,v as Ie,w as Ee,x as Pe}from"./chunk-MKQNHDDF.js";import"./chunk-OVEH5OOR.js";import{e as fe}from"./chunk-P2HUPEXS.js";import"./chunk-YTUW6DGN.js";import{g as _,h as ue,i as pe,k as L,l as me}from"./chunk-3XC55LRK.js";import"./chunk-NEKVW4FE.js";import"./chunk-NR2G2PSN.js";import{d as he}from"./chunk-TABUERS3.js";import"./chunk-RCH5EVVP.js";import"./chunk-SDBIR5ON.js";import"./chunk-KYGB26L4.js";import{a as F,b as G,c as oe,d as ae}from"./chunk-BGY7U4IH.js";import"./chunk-4FCN3KOD.js";import{f as x}from"./chunk-WE74HC52.js";import{b as de,c as le}from"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import{E as Y,G as O,H as j,I as Z,J as Q,K as ee,M as te,P as ie,Q as re,R as ne,S as $,T as se,g as q,h as z,y as W,z as X}from"./chunk-UK7X4OX3.js";import{a as ce}from"./chunk-V2SZPQJF.js";import"./chunk-IRNRCBRW.js";import{spawn as gt}from"child_process";import C from"fs";import{createServer as St}from"http";import w from"path";import{WebSocket as g,WebSocketServer as yt}from"ws";import Oe from"node:fs";import B from"node:path";import{spawn as Je}from"node:child_process";function Ke(o){return typeof o.text=="string"?o.text.trim():""}function Ve(o){let e=o?.trim();return e||"tm"}async function Re(o){let e=o.sessionId.trim();if(!G(e))throw new Error(`invalid Team Machine session id: ${e||"<empty>"}`);let t=Ke(o.prompt);if(!t)throw new Error("prompt text is empty");let i=Ve(o.command),s=o.timeoutMs??15e3;await new Promise((n,c)=>{let r=Je(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),a="",l=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}c(new Error(`tm send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",d=>{a.length<4e3&&(a+=String(d))}),r.on("error",d=>{clearTimeout(l),c(d)}),r.on("exit",(d,p)=>{if(clearTimeout(l),d===0){n();return}let u=a.trim();c(new Error(u||`tm send exited with ${p?`signal ${p}`:`code ${d??"unknown"}`}`))})})}var M=1,Ge=25;function qe(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var D=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;pendingSessionStates=new Map;pendingSessionPatches=new Map;sessionStatusPersistTimer=null;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await ke()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
4
+ import{b as ge,c as J,d as Se,e as K,f as ye,h as ve,i as E,j as be,k as we,l as Ae,m as ke,q as Te,t as k,u as Ce,v as Ie,w as Ee,x as Pe}from"./chunk-AXDVKOGM.js";import"./chunk-LIK6FJNR.js";import{e as fe}from"./chunk-VLLTUTO5.js";import"./chunk-G4B2PTUA.js";import{g as _,h as ue,i as pe,k as L,l as me}from"./chunk-YWAV3FQJ.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import{d as he}from"./chunk-TFWWL3HI.js";import"./chunk-UJIGVLKD.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import{a as F,b as G,c as oe,d as ae}from"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import{f as x}from"./chunk-NRPNLTJI.js";import{b as de,c as le}from"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import{E as Y,G as O,H as j,I as Z,J as Q,K as ee,M as te,P as ie,Q as re,R as ne,S as $,T as se,g as q,h as z,y as W,z as X}from"./chunk-LK63GSPB.js";import{a as ce}from"./chunk-BDZ7GDAA.js";import"./chunk-BQLQCPXE.js";import{spawn as gt}from"child_process";import C from"fs";import{createServer as St}from"http";import w from"path";import{WebSocket as g,WebSocketServer as yt}from"ws";import Oe from"node:fs";import B from"node:path";import{spawn as Je}from"node:child_process";function Ke(o){return typeof o.text=="string"?o.text.trim():""}function Ve(o){let e=o?.trim();return e||"tm"}async function Re(o){let e=o.sessionId.trim();if(!G(e))throw new Error(`invalid Team Machine session id: ${e||"<empty>"}`);let t=Ke(o.prompt);if(!t)throw new Error("prompt text is empty");let i=Ve(o.command),s=o.timeoutMs??15e3;await new Promise((n,c)=>{let r=Je(i,["send",e,t],{stdio:["ignore","ignore","pipe"],env:process.env}),a="",l=setTimeout(()=>{try{r.kill("SIGTERM")}catch{}c(new Error(`tm send timed out after ${Math.round(s/1e3)}s`))},s);r.stderr?.setEncoding("utf8"),r.stderr?.on("data",d=>{a.length<4e3&&(a+=String(d))}),r.on("error",d=>{clearTimeout(l),c(d)}),r.on("exit",(d,p)=>{if(clearTimeout(l),d===0){n();return}let u=a.trim();c(new Error(u||`tm send exited with ${p?`signal ${p}`:`code ${d??"unknown"}`}`))})})}var M=1,Ge=25;function qe(){return[Number(process.env.VITE_PORT_WEB||process.env.PORT||3e3),Number(process.env.VITE_PORT_ZERO||7849),Number(process.env.VITE_PORT_R2||9500)].filter(o=>Number.isFinite(o)&&o>0)}var D=class{subscriptions=new Map;sessionsBySocket=new Map;allSockets=new Set;pendingPromptEchoes=new Map;pendingTurns=new Map;pendingSessionStates=new Map;pendingSessionPatches=new Map;sessionStatusPersistTimer=null;opts;constructor(e={}){this.opts=e}registerSocket(e){this.allSockets.add(e)}unregisterSocket(e){let t=this.sessionsBySocket.get(e);if(t){for(let i of t)this.decrementSubscription(i);this.sessionsBySocket.delete(e)}this.allSockets.delete(e)}async handleMessage(e,t){let i=t?.type;if(typeof i!="string"||!i.startsWith("agent:"))return!1;let s=t.id;try{let n=await this.dispatch(e,i,t);this.respond(e,s,n)}catch(n){n instanceof k?this.respondError(e,s,n.message,n.code):this.respondError(e,s,n instanceof Error?n.message:String(n))}return!0}async seedOnBoot(){try{await ke()}catch(e){process.stderr.write(`[sootsim-agent] seedFromDemoAppRegistry failed: ${e instanceof Error?e.message:String(e)}
5
5
  `)}}close(){this.sessionStatusPersistTimer&&(clearTimeout(this.sessionStatusPersistTimer),this.sessionStatusPersistTimer=null),this.flushSessionStatuses();for(let e of this.subscriptions.values())try{e.unsubscribe()}catch{}this.subscriptions.clear(),this.sessionsBySocket.clear(),this.allSockets.clear()}async dispatch(e,t,i){switch(t){case"agent:list-projects":return K();case"agent:upsert-project":return J(i.input??{});case"agent:delete-project":return ve(String(i.projectId)),{ok:!0};case"agent:auto-attach-for-url":return this.autoAttachForUrl(i.input??{});case"agent:list-sessions":return be(i.projectId?String(i.projectId):void 0);case"agent:start-session":return this.doStartSession(i.input??{});case"agent:send-claimed-prompt":return this.sendClaimedPrompt(i);case"agent:send-prompt":{let n=String(i.sessionId),c=E(n);if(!c)throw new k("NO_SESSION",`no session: ${n}`);let r=this.normalizePromptEnvelope(i);return await Ie(n,r),this.notePromptAccepted(n,r,c.status==="working")}case"agent:end-session":this.dropSessionFanout(String(i.sessionId)),await Ee(String(i.sessionId));let s=E(String(i.sessionId));return s&&this.broadcastSessionStatus(s),{ok:!0};case"agent:get-transcript":return this.getTranscript(String(i.sessionId));case"agent:get-paths":return this.getPaths();case"agent:subscribe-events":return this.subscribeSocket(e,String(i.sessionId));case"agent:unsubscribe-events":return this.unsubscribeSocket(e,String(i.sessionId));default:throw new k("UNKNOWN_AGENT_MSG",`unknown agent message: ${t}`)}}async sendClaimedPrompt(e){let t=typeof e.simId=="string"?e.simId.trim():"";if(!t)throw new k("NO_SIM","agent:send-claimed-prompt requires simId");let i=this.opts.resolveCliLease?.(t)??null;if(!i||i.kind!=="cli"||i.expiresAt<=Date.now())throw new k("NO_CLAIM",`sim ${t} has no active CLI claim`);let s=F(i.cliIdentityKey);if(!s)throw new k("UNSUPPORTED_CLAIM",`sim ${t} is claimed by a CLI identity that is not promptable`);return await Re({sessionId:s,prompt:this.normalizePromptEnvelope(e)}),{ok:!0,routed:"team-machine",sessionId:s}}async doStartSession(e){if(!Se(e.projectId))throw new k("NO_PROJECT",`no project: ${e.projectId}`);let i=await Ce(e);return this.broadcastSessionStatus(i.session),i}async autoAttachForUrl(e){let t=e.bundleUrl??"",i=(()=>{try{return new URL(t).port||null}catch{return null}})();if(!i)return{project:null};let s=this.opts.getExcludePorts?.()??qe(),c=(await _({excludePorts:s})).find(d=>String(d.port)===i);if(!c||!c.cwd)return{project:null};let r=K().find(d=>d.cwd===c.cwd)??null,a=Array.from(new Set([...r?.knownBundleUrls??[],c.bundleUrl,t]));return{project:J({cwd:c.cwd,name:c.projectName??B.basename(c.cwd),preferredProvider:e.provider??r?.preferredProvider,sourceRoots:r?.sourceRoots??[c.cwd],knownBundleUrls:a,framework:r?.framework??ze(c.framework),bundleId:c.bundleId??r?.bundleId})}}getTranscript(e){let t=Te(e);return Oe.existsSync(t)?Oe.readFileSync(t,"utf8"):{error:"transcript not found",code:"NO_TRANSCRIPT"}}getPaths(){let e=ge();return{userDataDir:e,storeFile:B.join(e,"attached-projects.json"),sessionsDir:B.join(e,"sessions"),transcriptsDir:B.join(e,"transcripts")}}subscribeSocket(e,t){let i=this.sessionsBySocket.get(e);if(i||(i=new Set,this.sessionsBySocket.set(e,i)),i.has(t))return{ok:!0,refCount:this.subscriptions.get(t)?.refCount??1};i.add(t);let s=this.subscriptions.get(t);if(s)return s.refCount++,{ok:!0,refCount:s.refCount};let n=Pe(t,c=>{let r=this.coalescePromptEcho(t,c);if(r&&(this.applySessionEvent(t,r),this.fanOutEvent(t,r)),c.type==="turn-completed"){let a=E(t);if(a)try{ye(a.projectId,{usd:c.costUsd,ts:c.ts})}catch(l){process.stderr.write(`[sootsim-agent] recordTurnTelemetry failed: ${l instanceof Error?l.message:String(l)}
6
6
  `)}}});return this.subscriptions.set(t,{unsubscribe:n,refCount:1}),{ok:!0,refCount:1}}unsubscribeSocket(e,t){let i=this.sessionsBySocket.get(e);return!i||!i.has(t)?{ok:!0,refCount:0}:(i.delete(t),this.decrementSubscription(t))}decrementSubscription(e){let t=this.subscriptions.get(e);if(!t)return{ok:!0,refCount:0};if(t.refCount--,t.refCount<=0){try{t.unsubscribe()}catch{}return this.subscriptions.delete(e),{ok:!0,refCount:0}}return{ok:!0,refCount:t.refCount}}dropSessionFanout(e){let t=this.subscriptions.get(e);if(t){try{t.unsubscribe()}catch{}this.subscriptions.delete(e)}for(let i of this.sessionsBySocket.values())i.delete(e);this.clearPromptTracking(e)}normalizePromptEnvelope(e){if(e?.prompt&&typeof e.prompt=="object"){let t=e.prompt;return{text:String(t.text??""),...typeof t.displayText=="string"?{displayText:t.displayText}:{},...typeof t.inspectSummary=="string"?{inspectSummary:t.inspectSummary}:{},...typeof t.inspectTrace=="string"?{inspectTrace:t.inspectTrace}:{}}}return{text:String(e?.text??""),...typeof e?.displayText=="string"?{displayText:e.displayText}:{},...typeof e?.inspectSummary=="string"?{inspectSummary:e.inspectSummary}:{},...typeof e?.inspectTrace=="string"?{inspectTrace:e.inspectTrace}:{}}}notePromptAccepted(e,t,i){let s=Date.now(),n=this.pendingPromptEchoes.get(e)??[];n.push({sentAt:s}),this.pendingPromptEchoes.set(e,n);let c=Math.max(this.pendingTurns.get(e)??0,i?1:0)+1;this.pendingTurns.set(e,c);let r=t.displayText??t.text;return this.patchSession(e,{lastPrompt:r,status:"working",needsAttention:!1}),this.fanOutEvent(e,{type:"prompt-received",text:r,...t.inspectSummary?{inspectSummary:t.inspectSummary}:{},...t.inspectTrace?{inspectTrace:t.inspectTrace}:{},ts:s}),{ok:!0,queued:c>1,pendingTurns:c,queueDepth:Math.max(0,c-1)}}applySessionEvent(e,t){switch(t.type){case"prompt-received":case"turn-started":this.patchSession(e,{status:"working",needsAttention:!1});return;case"turn-completed":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"idle",needsAttention:!1,lastTurnFiles:t.filesTouched,currentlyEditing:void 0});return}case"approval-needed":this.patchSession(e,{status:"needs-attention",needsAttention:!0});return;case"error":{let i=this.consumeSettledTurn(e);this.patchSession(e,{status:i>0?"working":"needs-attention",needsAttention:i<=0,currentlyEditing:void 0});return}case"exited":this.clearPromptTracking(e),this.patchSession(e,{status:"ended",needsAttention:!1,wrapperPid:void 0,currentlyEditing:void 0});return;case"ready":case"turn-reasoning":case"turn-message":case"turn-plan":case"tool-call":case"file-edited":case"file-diff-delta":return}}patchSession(e,t){let i=this.pendingSessionStates.get(e)??E(e);if(!i)return;let s=we(i,t);this.pendingSessionStates.set(e,s),this.pendingSessionPatches.set(e,{...this.pendingSessionPatches.get(e),...t}),this.broadcastSessionStatus(s),!this.sessionStatusPersistTimer&&(this.sessionStatusPersistTimer=setTimeout(()=>{this.sessionStatusPersistTimer=null,this.flushSessionStatuses()},Ge))}flushSessionStatuses(){if(this.pendingSessionPatches.size===0)return;let e=this.pendingSessionStates,t=this.pendingSessionPatches;this.pendingSessionStates=new Map,this.pendingSessionPatches=new Map;try{Ae([...t].map(([i,s])=>({id:i,patch:s})))}catch(i){for(let[s,n]of e)this.pendingSessionStates.has(s)||this.pendingSessionStates.set(s,n);for(let[s,n]of t)this.pendingSessionPatches.set(s,{...n,...this.pendingSessionPatches.get(s)});process.stderr.write(`[sootsim-agent] session status persistence failed: ${i instanceof Error?i.message:String(i)}
7
7
  `)}}coalescePromptEcho(e,t){if(t.type!=="prompt-received")return t;let i=this.pendingPromptEchoes.get(e);if(!i||i.length===0)return t;for(;i.length>0&&Date.now()-i[0].sentAt>15e3;)i.shift();return i.length===0?(this.pendingPromptEchoes.delete(e),t):(i.shift(),i.length===0?this.pendingPromptEchoes.delete(e):this.pendingPromptEchoes.set(e,i),null)}consumeSettledTurn(e){let t=Math.max(0,(this.pendingTurns.get(e)??1)-1);return t>0?this.pendingTurns.set(e,t):this.pendingTurns.delete(e),t}clearPromptTracking(e){this.pendingPromptEchoes.delete(e),this.pendingTurns.delete(e)}fanOutEvent(e,t){let i=JSON.stringify({type:"agent:event",sessionId:e,event:t});for(let[s,n]of this.sessionsBySocket)if(n.has(e)&&s.readyState===M)try{s.send(i)}catch{}}broadcastSessionStatus(e){let t=JSON.stringify({type:"agent:session-status",session:e});for(let i of this.allSockets)if(i.readyState===M)try{i.send(t)}catch{}}respond(e,t,i){if(e.readyState===M)try{e.send(JSON.stringify({id:t,result:i}))}catch{}}respondError(e,t,i,s){if(e.readyState===M)try{e.send(JSON.stringify({id:t,error:i,...s?{code:s}:{}}))}catch{}}};function ze(o){return o==="expo"?"expo":o==="one"||o==="vxrn"?"one":"unknown"}import _e from"http";import Le from"https";import{finished as Ze,pipeline as Qe}from"stream/promises";var V="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36",Xe=[{hostSuffix:"uniswap.org",headers:{origin:"https://app.uniswap.org",referer:"https://app.uniswap.org/"},suppressBrowserUserAgent:!0}];function Ye(o){let e=o.toLowerCase();for(let t of Xe)if(e===t.hostSuffix||e.endsWith(`.${t.hostSuffix}`))return t}function xe(o){let e=Ye(o.hostname);return{"accept-encoding":"identity",...e?.suppressBrowserUserAgent?{}:{"user-agent":V},...e?.headers}}var et=new Set(["host","origin","referer","user-agent","accept-encoding","cookie","connection","keep-alive","transfer-encoding","upgrade","content-length","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","sec-ch-ua","sec-ch-ua-mobile","sec-ch-ua-platform"]),tt={"access-control-allow-origin":"*","access-control-allow-methods":"GET,POST,PUT,DELETE,PATCH,OPTIONS","access-control-allow-headers":"*","access-control-expose-headers":"*","access-control-max-age":"3600"},it=new Set(["host","origin","referer","sec-fetch-site","sec-fetch-mode","sec-fetch-dest"]);function Be(o){return o.protocol!=="https:"?{}:ue(o.hostname)?{rejectUnauthorized:!1}:{}}function P(o){for(let[e,t]of Object.entries(tt))o.setHeader(e,t)}function rt(o,e){let t=[],i=e;i?.code&&t.push(i.code),i?.message&&t.push(i.message),i?.cause?.code&&t.push(i.cause.code),i?.cause?.message&&t.push(i.cause.message);let n=[...new Set(t.filter(Boolean))].join(" | ")||String(e);return o.includes("stored-in-.env.local")?`${n} | upstream url still contains placeholder env values`:n}function nt(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(et.has(i.toLowerCase())||(t[i]=Array.isArray(s)?s.join(", "):s));return Object.assign(t,e?xe(e):{"user-agent":V}),t}function st(o,e){let t={};for(let[i,s]of Object.entries(o))s&&(it.has(i.toLowerCase())||(t[i]=s));return t.host=e.host,t.origin=e.origin,t.referer=`${e.origin}/`,t}function Me(o){return o?.startsWith("/__fetch-proxy?")||o?.startsWith("/__proxy?")||!1}function De(o){return o?!!(o.startsWith("/__app-api?")||o.startsWith("/__app-api/")):!1}async function Ne(o,e){if(o.method==="OPTIONS"){P(e),e.writeHead(204),e.end();return}let i=new URLSearchParams((o.url||"").split("?")[1]||"").get("url");if(!i){P(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("missing url param");return}let s;try{s=new URL(i)}catch{P(e),e.writeHead(400,{"Content-Type":"text/plain"}),e.end("invalid url param");return}let n;if(o.method!=="GET"&&o.method!=="HEAD"){let a=[];for await(let l of o)a.push(Buffer.isBuffer(l)?l:Buffer.from(l));a.length>0&&(n=Buffer.concat(a))}let c=o.method||"GET",r=async(a,l,d,p)=>{let u=a.protocol==="https:"?Le:_e,h=nt(o.headers,a);a.origin!==s.origin&&(delete h.authorization,delete h["proxy-authorization"]),l==="GET"||l==="HEAD"?(delete h["content-length"],delete h["content-type"]):d&&(h["content-length"]=String(d.byteLength));let m=await new Promise((b,v)=>{let y=u.request({hostname:a.hostname,port:a.port||(a.protocol==="https:"?443:80),path:a.pathname+a.search,method:l,headers:h,...Be(a)},b),R=()=>y.destroy(new Error("fetch proxy client disconnected"));o.once("aborted",R),y.once("close",()=>o.off("aborted",R)),y.once("error",v),d===void 0?y.end():y.end(d)}),f=m.statusCode??502,S=m.headers.location;if(S&&(f===301||f===302||f===303||f===307||f===308)){if(p>=10)throw m.destroy(),new Error("too many redirects");let b=(f===301||f===302)&&l==="POST"||f===303&&l!=="GET"&&l!=="HEAD",v=new URL(S,a);m.resume(),await Ze(m),await r(v,b?"GET":l,b?void 0:d,p+1);return}for(let[b,v]of Object.entries(m.headers)){let y=b.toLowerCase();v===void 0||y==="set-cookie"||y==="connection"||y==="keep-alive"||y==="proxy-authenticate"||y==="proxy-authorization"||y==="te"||y==="trailer"||y==="transfer-encoding"||y==="upgrade"||y.startsWith("access-control-")||e.setHeader(b,v)}P(e);let A=m.headers["set-cookie"]??[];A.length>0&&e.setHeader("x-sootsim-set-cookie",(Array.isArray(A)?A:[A]).join(", ")),e.statusCode=f,await Qe(m,e)};try{await r(s,c,n,0)}catch(a){if(e.headersSent){e.destroy(a instanceof Error?a:new Error(String(a)));return}P(e),e.writeHead(502,{"Content-Type":"text/plain"}),e.end(`fetch proxy error: ${rt(s.href,a)}`)}}function He(o,e){let t=o.url||"",i="",s="";if(t.startsWith("/__app-api?")){let l=new URL(t,"http://sootsim.local");i=l.searchParams.get("path")||"",s=l.searchParams.get("origin")?.trim()||""}else if(t.startsWith("/__app-api/"))i=t.slice(10);else return!1;if(!s)return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: missing origin query param"),!0;if(o.method==="OPTIONS")return e.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin||"*","Access-Control-Allow-Methods":"GET,POST,PUT,PATCH,DELETE,OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]||"*","Access-Control-Allow-Credentials":"true","Access-Control-Max-Age":"86400"}),e.end(),!0;let n;try{n=new URL(i,s)}catch{return e.writeHead(400,{"Content-Type":"text/plain"}),e.end("app-api: invalid origin or path"),!0}let c=n.protocol==="https:"?Le:_e,r=st(o.headers,n),a=c.request({hostname:n.hostname,port:n.port||(n.protocol==="https:"?443:80),path:n.pathname+n.search,method:o.method,headers:r,...Be(n)},l=>{let d=Object.keys(l.headers).filter(p=>{let u=p.toLowerCase();return!u.startsWith("access-control-")&&u!=="set-cookie"}).join(", ");e.writeHead(l.statusCode??502,{...l.headers,"access-control-allow-origin":o.headers.origin||"*","access-control-allow-credentials":"true","access-control-expose-headers":d}),l.pipe(e)});return a.on("error",l=>{e.statusCode=502,e.end(`app proxy error: ${l.message}`)}),o.pipe(a),!0}import{WebSocket as T,WebSocketServer as ot}from"ws";var at="/__websocket-proxy",ct=new Set(["host","connection","upgrade","transfer-encoding","content-length","sec-websocket-accept","sec-websocket-extensions","sec-websocket-key","sec-websocket-protocol","sec-websocket-version"]);function I(o,e,t){try{o.write(`HTTP/1.1 ${e} ${t}\r
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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 l}from"./chunk-7RU45W2O.js";import{d as V,f as q,g as J,i as N,j as F}from"./chunk-VXRYV6G6.js";import{b as k,c as L}from"./chunk-PPD77GEP.js";import{c as w}from"./chunk-BGY7U4IH.js";import"./chunk-4FCN3KOD.js";import{f as m}from"./chunk-WE74HC52.js";import"./chunk-YXRD4B4X.js";import"./chunk-MFLCDFRS.js";import"./chunk-J22XZAGG.js";import"./chunk-SOBEJUH4.js";import"./chunk-4MNKKMYG.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-EKNSKDBI.js";import{A as v,B as E,H as R,K as C,M as I,l as b}from"./chunk-UK7X4OX3.js";import{a as T}from"./chunk-V2SZPQJF.js";import"./chunk-Q4ZLYMUP.js";import"./chunk-IRNRCBRW.js";import P from"node:fs";import U from"node:os";import $ from"node:path";import{spawn as ne}from"node:child_process";import u from"node:fs";import s from"node:path";function B(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"package.json")))return n;let o=s.dirname(n);if(o===n)return null;n=o}}function j(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"bun.lock"))||u.existsSync(s.join(n,"bun.lockb")))return"bun";if(u.existsSync(s.join(n,"pnpm-lock.yaml")))return"pnpm";if(u.existsSync(s.join(n,"package-lock.json")))return"npm";let o=s.dirname(n);if(o===n)return"npm";n=o}}function Y(e){let n=s.resolve(e.appDir),o=oe(s.join(n,"package.json")),t=o.scripts?.sootsim;if(t&&t!=="sootsim open")throw new Error(`package.json already defines scripts.sootsim as ${JSON.stringify(t)}; resolve that conflict before setup`);let r=j(n),i=[];return o.devDependencies?.sootsim!==e.cliVersion&&i.push(te(r,e.cliVersion)),t!=="sootsim open"&&i.push(se(r)),{appDir:n,packageManager:r,operations:i}}async function H(e,n){for(let o of e.operations)n.dryRun||await ie(o,e.appDir,n.json)}function O(e){return e.operations.map(n=>`${n.command} ${n.args.map(re).join(" ")}`)}function oe(e){let n;try{n=JSON.parse(u.readFileSync(e,"utf8"))}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`could not read ${e}: ${i}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${e} must contain a JSON object`);let o=W(Reflect.get(n,"scripts")),t=W(Reflect.get(n,"devDependencies"));return{...o?{scripts:o}:{},...t?{devDependencies:t}:{}}}function W(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=Object.entries(e).filter(o=>typeof o[1]=="string");return Object.fromEntries(n)}function te(e,n){let o=`sootsim@${n}`;switch(e){case"bun":return{command:"bun",args:["add","--dev","--exact",o],description:`install ${o} as an exact dev dependency`};case"pnpm":return{command:"pnpm",args:["add","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`};case"npm":return{command:"npm",args:["install","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`}}}function re(e){return/^[a-zA-Z0-9_./@=-]+$/.test(e)?e:JSON.stringify(e)}function ie(e,n,o){return new Promise((t,r)=>{let i=ne(e.command,e.args,{cwd:n,stdio:o?["ignore",2,"inherit"]:"inherit"});i.once("error",r),i.once("exit",c=>{c===0?t():r(new Error(`${e.command} exited with code ${c??"unknown"}`))})})}function se(e){return{command:e,args:e==="bun"?["pm","pkg","set","scripts.sootsim=sootsim open"]:["pkg","set","scripts.sootsim=sootsim open"],description:"add the `sootsim` package script"}}async function We(e){if(e.includes("--help")||e.includes("-h")){je();return}let n=pe(e),o="decisions";try{let t=B(n.appDir),r=k(),i=v(),c=await ue(n,r),Q=await le(n,t),y=await Z(n,"productAnalytics",i.productAnalytics,i.configured),g=await Z(n,"crashReports",i.crashReports,i.configured),X=await m.fetchManifest(),d=m.resolveVersion(X,{channel:"stable"}).version,D=T();if(D==="0.0.0")throw new Error("could not resolve the installed SootSim CLI version");let a=null;Q&&t&&(a=Y({appDir:t,cliVersion:D})),Se(n),he(n,r,c,d),be(n,t,a),ve(n,y,g),o="runtime";let A=!1;if(!n.dryRun){let _=R();A=(await m.install({version:d,channel:"stable",setActive:!0,protectVersions:_?[_]:[]})).installed}o="repository",a&&await H(a,{dryRun:n.dryRun,json:n.json}),o="service";let S=r.installed;c&&!r.installed&&!n.dryRun&&(await L({port:7668,force:!1}),S=!0),o="privacy",n.dryRun||E({productAnalytics:y,crashReports:g}),o="compatibility";let p=t?fe(t):null,h=await de(n,p);h&&p&&t&&!n.dryRun&&await me(t,p),Re(n,p,h);let M={runtimeVersion:d,serviceInstalled:S,repositoryPrepared:a!==null,compatibilityShared:h&&!n.dryRun},ee=ge(d);n.json?console.log(JSON.stringify({...M,runtimeInstalled:n.dryRun?!1:A,dryRun:n.dryRun,cache:ee,repositoryOperations:a?O(a):[]},null,2)):we(a);let f=p?q(p):null;return w({event:"cli_setup_completed",properties:{service_installed:S,repository_prepared:a!==null,product_analytics:y,crash_reports:g,compat_supported:f?.supported??0,compat_partial:f?.partial??0,compat_unsupported:f?.unsupported??0,compat_not_yet_verified:f?.notYetVerified??0,from_welcome:n.fromWelcome,ci:n.ci,dry_run:n.dryRun}}),M}catch(t){let r=ke(t);throw w({event:"cli_setup_failed",properties:{stage:o,message:r}}),t}}function ce(){let e=k(),n=C(),o=R();return{daemonSupported:e.supported,daemonInstalled:e.installed,daemonRunning:!!(n&&I(n)),runtimeInstalled:!!(o&&P.existsSync(b(o))),privacyConfigured:v().configured}}function Be(e=ce()){return!e.runtimeInstalled||!e.privacyConfigured}function pe(e){let n=e.indexOf("--app"),o=n>=0?e[n+1]:void 0;if(n>=0&&(!o||o.startsWith("-")))throw new Error("--app requires a directory");let t=z(e,"--service","--no-service"),r=z(e,"--repo","--no-repo");return{appDir:$.resolve(o??process.cwd()),ci:e.includes("--ci"),dryRun:e.includes("--dry-run"),fromWelcome:e.includes("--from-welcome"),json:e.includes("--json"),yes:e.includes("--yes")||e.includes("-y"),service:t,repository:r,productAnalytics:G(e,"--analytics"),crashReports:G(e,"--crash-reports"),shareCompatibility:e.includes("--share-compat")}}function z(e,n,o){if(e.includes(n)&&e.includes(o))throw new Error(`${n} and ${o} cannot be used together`);if(e.includes(n))return!0;if(e.includes(o))return!1}function G(e,n){let o=e.find(i=>i.startsWith(`${n}=`)),t=e.indexOf(n),r=o?.slice(n.length+1)??(t>=0?e[t+1]:void 0);if(r!==void 0){if(r==="on"||r==="yes"||r==="true")return!0;if(r==="off"||r==="no"||r==="false")return!1;throw new Error(`${n} must be on or off`)}}async function ue(e,n){if(e.ci){if(e.service===!0)throw new Error("--ci cannot install a machine service");return!1}return n.supported?n.installed&&e.service===void 0?!0:e.service!==void 0?e.service:e.yes?!0:(x(e,"--service or --no-service"),l("Install the background service and shared managed runtime?",!0)):!1}async function le(e,n){if(!n){if(e.repository===!0)throw new Error("--repo requires a package.json");return!1}return e.repository!==void 0?e.repository:e.yes?!0:(x(e,"--repo or --no-repo"),l(`Prepare ${n} for reproducible SootSim runs?`,!0))}async function Z(e,n,o,t){let r=n==="productAnalytics"?e.productAnalytics:e.crashReports;return r!==void 0?r:t?o:e.yes?!0:(x(e,n==="productAnalytics"?"--analytics on|off":"--crash-reports on|off"),l(n==="productAnalytics"?"Share bounded product analytics?":"Send bounded crash reports?",!0))}async function de(e,n){return n?e.shareCompatibility?!0:e.yes||!process.stdin.isTTY?!1:l("Share dependency names, requested versions, framework, and this compatibility result?",!1):!1}function x(e,n){if(!(process.stdin.isTTY&&!e.ci))throw new Error(`non-interactive setup requires ${n}, or --yes to accept defaults`)}function fe(e){let n=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!n||typeof n!="object")throw new Error("package.json must contain an object");return V(n)}async function me(e,n){let o=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!o||typeof o!="object")throw new Error("package.json must be an object");let t=await fetch("https://contrast.dev/api/scan",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ye(o,n)),signal:AbortSignal.timeout(1e4)});if(!t.ok)throw new Error(`compatibility sharing failed with HTTP ${t.status}`)}function ye(e,n){return{dependencies:K(Reflect.get(e,"dependencies")),devDependencies:K(Reflect.get(e,"devDependencies")),framework:n.framework,result:{framework:n.framework,rnVersion:n.rnVersion,packages:n.packages.slice(0,200)},source:"desktop",shared:!0}}function K(e){if(!e||typeof e!="object")return{};let n={};for(let[o,t]of Object.entries(e).slice(0,200))typeof t=="string"&&(n[o.slice(0,160)]=t.slice(0,80));return n}function ge(e){let n=U.platform(),o=U.arch();return{path:b(e),key:`sootsim-runtime-${n}-${o}-${e}`,inputs:{platform:n,arch:o,runtimeVersion:e}}}function Se(e){e.json||console.log(`
4
+ import{a as l}from"./chunk-CVRPU5KX.js";import{d as V,f as q,g as J,i as N,j as F}from"./chunk-6Q5PHS4F.js";import{b as k,c as L}from"./chunk-YPZDXYHV.js";import{c as w}from"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import{f as m}from"./chunk-NRPNLTJI.js";import"./chunk-H3U7LAZG.js";import"./chunk-TDM4IQS3.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import{A as v,B as E,H as R,K as C,M as I,l as b}from"./chunk-LK63GSPB.js";import{a as T}from"./chunk-BDZ7GDAA.js";import"./chunk-FQZQKJZ5.js";import"./chunk-BQLQCPXE.js";import P from"node:fs";import U from"node:os";import $ from"node:path";import{spawn as ne}from"node:child_process";import u from"node:fs";import s from"node:path";function B(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"package.json")))return n;let o=s.dirname(n);if(o===n)return null;n=o}}function j(e){let n=s.resolve(e);for(;;){if(u.existsSync(s.join(n,"bun.lock"))||u.existsSync(s.join(n,"bun.lockb")))return"bun";if(u.existsSync(s.join(n,"pnpm-lock.yaml")))return"pnpm";if(u.existsSync(s.join(n,"package-lock.json")))return"npm";let o=s.dirname(n);if(o===n)return"npm";n=o}}function Y(e){let n=s.resolve(e.appDir),o=oe(s.join(n,"package.json")),t=o.scripts?.sootsim;if(t&&t!=="sootsim open")throw new Error(`package.json already defines scripts.sootsim as ${JSON.stringify(t)}; resolve that conflict before setup`);let r=j(n),i=[];return o.devDependencies?.sootsim!==e.cliVersion&&i.push(te(r,e.cliVersion)),t!=="sootsim open"&&i.push(se(r)),{appDir:n,packageManager:r,operations:i}}async function H(e,n){for(let o of e.operations)n.dryRun||await ie(o,e.appDir,n.json)}function O(e){return e.operations.map(n=>`${n.command} ${n.args.map(re).join(" ")}`)}function oe(e){let n;try{n=JSON.parse(u.readFileSync(e,"utf8"))}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`could not read ${e}: ${i}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${e} must contain a JSON object`);let o=W(Reflect.get(n,"scripts")),t=W(Reflect.get(n,"devDependencies"));return{...o?{scripts:o}:{},...t?{devDependencies:t}:{}}}function W(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=Object.entries(e).filter(o=>typeof o[1]=="string");return Object.fromEntries(n)}function te(e,n){let o=`sootsim@${n}`;switch(e){case"bun":return{command:"bun",args:["add","--dev","--exact",o],description:`install ${o} as an exact dev dependency`};case"pnpm":return{command:"pnpm",args:["add","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`};case"npm":return{command:"npm",args:["install","--save-dev","--save-exact",o],description:`install ${o} as an exact dev dependency`}}}function re(e){return/^[a-zA-Z0-9_./@=-]+$/.test(e)?e:JSON.stringify(e)}function ie(e,n,o){return new Promise((t,r)=>{let i=ne(e.command,e.args,{cwd:n,stdio:o?["ignore",2,"inherit"]:"inherit"});i.once("error",r),i.once("exit",c=>{c===0?t():r(new Error(`${e.command} exited with code ${c??"unknown"}`))})})}function se(e){return{command:e,args:e==="bun"?["pm","pkg","set","scripts.sootsim=sootsim open"]:["pkg","set","scripts.sootsim=sootsim open"],description:"add the `sootsim` package script"}}async function We(e){if(e.includes("--help")||e.includes("-h")){je();return}let n=pe(e),o="decisions";try{let t=B(n.appDir),r=k(),i=v(),c=await ue(n,r),Q=await le(n,t),y=await Z(n,"productAnalytics",i.productAnalytics,i.configured),g=await Z(n,"crashReports",i.crashReports,i.configured),X=await m.fetchManifest(),d=m.resolveVersion(X,{channel:"stable"}).version,D=T();if(D==="0.0.0")throw new Error("could not resolve the installed SootSim CLI version");let a=null;Q&&t&&(a=Y({appDir:t,cliVersion:D})),Se(n),he(n,r,c,d),be(n,t,a),ve(n,y,g),o="runtime";let A=!1;if(!n.dryRun){let _=R();A=(await m.install({version:d,channel:"stable",setActive:!0,protectVersions:_?[_]:[]})).installed}o="repository",a&&await H(a,{dryRun:n.dryRun,json:n.json}),o="service";let S=r.installed;c&&!r.installed&&!n.dryRun&&(await L({port:7668,force:!1}),S=!0),o="privacy",n.dryRun||E({productAnalytics:y,crashReports:g}),o="compatibility";let p=t?fe(t):null,h=await de(n,p);h&&p&&t&&!n.dryRun&&await me(t,p),Re(n,p,h);let M={runtimeVersion:d,serviceInstalled:S,repositoryPrepared:a!==null,compatibilityShared:h&&!n.dryRun},ee=ge(d);n.json?console.log(JSON.stringify({...M,runtimeInstalled:n.dryRun?!1:A,dryRun:n.dryRun,cache:ee,repositoryOperations:a?O(a):[]},null,2)):we(a);let f=p?q(p):null;return w({event:"cli_setup_completed",properties:{service_installed:S,repository_prepared:a!==null,product_analytics:y,crash_reports:g,compat_supported:f?.supported??0,compat_partial:f?.partial??0,compat_unsupported:f?.unsupported??0,compat_not_yet_verified:f?.notYetVerified??0,from_welcome:n.fromWelcome,ci:n.ci,dry_run:n.dryRun}}),M}catch(t){let r=ke(t);throw w({event:"cli_setup_failed",properties:{stage:o,message:r}}),t}}function ce(){let e=k(),n=C(),o=R();return{daemonSupported:e.supported,daemonInstalled:e.installed,daemonRunning:!!(n&&I(n)),runtimeInstalled:!!(o&&P.existsSync(b(o))),privacyConfigured:v().configured}}function Be(e=ce()){return!e.runtimeInstalled||!e.privacyConfigured}function pe(e){let n=e.indexOf("--app"),o=n>=0?e[n+1]:void 0;if(n>=0&&(!o||o.startsWith("-")))throw new Error("--app requires a directory");let t=z(e,"--service","--no-service"),r=z(e,"--repo","--no-repo");return{appDir:$.resolve(o??process.cwd()),ci:e.includes("--ci"),dryRun:e.includes("--dry-run"),fromWelcome:e.includes("--from-welcome"),json:e.includes("--json"),yes:e.includes("--yes")||e.includes("-y"),service:t,repository:r,productAnalytics:G(e,"--analytics"),crashReports:G(e,"--crash-reports"),shareCompatibility:e.includes("--share-compat")}}function z(e,n,o){if(e.includes(n)&&e.includes(o))throw new Error(`${n} and ${o} cannot be used together`);if(e.includes(n))return!0;if(e.includes(o))return!1}function G(e,n){let o=e.find(i=>i.startsWith(`${n}=`)),t=e.indexOf(n),r=o?.slice(n.length+1)??(t>=0?e[t+1]:void 0);if(r!==void 0){if(r==="on"||r==="yes"||r==="true")return!0;if(r==="off"||r==="no"||r==="false")return!1;throw new Error(`${n} must be on or off`)}}async function ue(e,n){if(e.ci){if(e.service===!0)throw new Error("--ci cannot install a machine service");return!1}return n.supported?n.installed&&e.service===void 0?!0:e.service!==void 0?e.service:e.yes?!0:(x(e,"--service or --no-service"),l("Install the background service and shared managed runtime?",!0)):!1}async function le(e,n){if(!n){if(e.repository===!0)throw new Error("--repo requires a package.json");return!1}return e.repository!==void 0?e.repository:e.yes?!0:(x(e,"--repo or --no-repo"),l(`Prepare ${n} for reproducible SootSim runs?`,!0))}async function Z(e,n,o,t){let r=n==="productAnalytics"?e.productAnalytics:e.crashReports;return r!==void 0?r:t?o:e.yes?!0:(x(e,n==="productAnalytics"?"--analytics on|off":"--crash-reports on|off"),l(n==="productAnalytics"?"Share bounded product analytics?":"Send bounded crash reports?",!0))}async function de(e,n){return n?e.shareCompatibility?!0:e.yes||!process.stdin.isTTY?!1:l("Share dependency names, requested versions, framework, and this compatibility result?",!1):!1}function x(e,n){if(!(process.stdin.isTTY&&!e.ci))throw new Error(`non-interactive setup requires ${n}, or --yes to accept defaults`)}function fe(e){let n=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!n||typeof n!="object")throw new Error("package.json must contain an object");return V(n)}async function me(e,n){let o=JSON.parse(P.readFileSync($.join(e,"package.json"),"utf8"));if(!o||typeof o!="object")throw new Error("package.json must be an object");let t=await fetch("https://contrast.dev/api/scan",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ye(o,n)),signal:AbortSignal.timeout(1e4)});if(!t.ok)throw new Error(`compatibility sharing failed with HTTP ${t.status}`)}function ye(e,n){return{dependencies:K(Reflect.get(e,"dependencies")),devDependencies:K(Reflect.get(e,"devDependencies")),framework:n.framework,result:{framework:n.framework,rnVersion:n.rnVersion,packages:n.packages.slice(0,200)},source:"desktop",shared:!0}}function K(e){if(!e||typeof e!="object")return{};let n={};for(let[o,t]of Object.entries(e).slice(0,200))typeof t=="string"&&(n[o.slice(0,160)]=t.slice(0,80));return n}function ge(e){let n=U.platform(),o=U.arch();return{path:b(e),key:`sootsim-runtime-${n}-${o}-${e}`,inputs:{platform:n,arch:o,runtimeVersion:e}}}function Se(e){e.json||console.log(`
5
5
  ${e.fromWelcome?"welcome to sootsim":"sootsim setup"}`)}function he(e,n,o,t){e.json||(console.log(`
6
6
  1. machine`),console.log(` stable runtime: ${t}`),console.log(` background service: ${n.supported?o?"install":"skip":"unsupported on this platform"}`))}function be(e,n,o){if(!e.json){if(console.log(`
7
7
  2. repository`),!n){console.log(" no package.json found; repository preparation skipped");return}if(!o){console.log(` skipped for ${n}`);return}console.log(` package manager: ${j(n)}`);for(let t of O(o))console.log(` ${e.dryRun?"would run":"run"}: ${t}`)}}function ve(e,n,o){e.json||(console.log(`
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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"./chunk-IRNRCBRW.js";import*as i from"fs";import*as I from"os";import*as a from"path";import{fileURLToPath as h}from"url";function $(){try{let t=h(import.meta.resolve("sootsim/package.json"));return a.join(a.dirname(t),"skills")}catch{let t=a.dirname(h(import.meta.url));return a.resolve(t,"../../skills")}}var d=$(),w=new Set(["all","codex","claude"]);function S(){console.log(`sootsim skill
4
+ import"./chunk-BQLQCPXE.js";import*as i from"fs";import*as I from"os";import*as a from"path";import{fileURLToPath as h}from"url";function $(){try{let t=h(import.meta.resolve("sootsim/package.json"));return a.join(a.dirname(t),"skills")}catch{let t=a.dirname(h(import.meta.url));return a.resolve(t,"../../skills")}}var d=$(),w=new Set(["all","codex","claude"]);function S(){console.log(`sootsim skill
5
5
 
6
6
  install and inspect bundled SootSim agent skills.
7
7
 
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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{k as f}from"./chunk-4OZG2LQA.js";import"./chunk-STF4UH5I.js";import"./chunk-RW75MMQZ.js";import"./chunk-3XC55LRK.js";import"./chunk-YIBVYNHV.js";import"./chunk-NWM62KI3.js";import"./chunk-7LULF3D2.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-JDQ5AJJ4.js";import"./chunk-WKSX2VHB.js";import"./chunk-NEKVW4FE.js";import"./chunk-NR2G2PSN.js";import"./chunk-TABUERS3.js";import"./chunk-MPDBF324.js";import"./chunk-RCH5EVVP.js";import"./chunk-4PKUB2QX.js";import"./chunk-SDBIR5ON.js";import"./chunk-KYGB26L4.js";import"./chunk-KEFBMDYK.js";import"./chunk-M33LQWC2.js";import"./chunk-WE74HC52.js";import"./chunk-J22XZAGG.js";import"./chunk-SOBEJUH4.js";import"./chunk-4MNKKMYG.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-EKNSKDBI.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";function p(){console.log(`
4
+ import{k as f}from"./chunk-HKWQLGKK.js";import"./chunk-CQEK4J75.js";import"./chunk-GVC4ZNVM.js";import"./chunk-YWAV3FQJ.js";import"./chunk-MLHEWBGL.js";import"./chunk-ATRV3MGB.js";import"./chunk-JZZIA5BR.js";import{a as t,b as n,c as l,d as c,e as a}from"./chunk-SSGGUPY7.js";import"./chunk-3I647BPF.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-TL6D2L7C.js";import"./chunk-UJIGVLKD.js";import"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import"./chunk-AWE4ZKR3.js";import"./chunk-APBN2B6C.js";import"./chunk-NRPNLTJI.js";import"./chunk-M4SIQQDE.js";import"./chunk-4F7VUXKY.js";import"./chunk-657GXEAT.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-ZED5FLNC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";function p(){console.log(`
5
5
  sootsim storage profile \u2014 manage isolated storage profiles
6
6
 
7
7
  usage:
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{a}from"./chunk-TL6D2L7C.js";import"./chunk-657GXEAT.js";import"./chunk-BQLQCPXE.js";export{a as settingsStore};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{c as a,d as b}from"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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 m,j as d,m as s}from"./chunk-KYGB26L4.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";import{writeFileSync as g}from"fs";function u(){console.log(`
4
+ import{h as m,j as d,m as s}from"./chunk-5NHCBHYZ.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";import{writeFileSync as g}from"fs";function u(){console.log(`
5
5
  sootsim timeline \u2014 control the semantic event timeline
6
6
 
7
7
  usage:
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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 h,b as v,c as $}from"./chunk-HEPIUAFX.js";import{b as p}from"./chunk-4PKUB2QX.js";import"./chunk-SDBIR5ON.js";import"./chunk-KYGB26L4.js";import{b as g}from"./chunk-WE74HC52.js";import"./chunk-6MFFAN7Q.js";import"./chunk-YOLPZLST.js";import{H as a,g as m,h as u,l as d}from"./chunk-UK7X4OX3.js";import{a as f}from"./chunk-V2SZPQJF.js";import"./chunk-IRNRCBRW.js";import{spawn as y}from"node:child_process";import k from"node:fs";import R from"node:os";import r from"node:path";var b="https://registry.npmjs.org/sootsim/latest";async function W(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
4
+ import{a as h,b as v,c as $}from"./chunk-3YYCMGOR.js";import{b as p}from"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import{b as g}from"./chunk-NRPNLTJI.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import{H as a,g as m,h as u,l as d}from"./chunk-LK63GSPB.js";import{a as f}from"./chunk-BDZ7GDAA.js";import"./chunk-BQLQCPXE.js";import{spawn as y}from"node:child_process";import k from"node:fs";import R from"node:os";import r from"node:path";var b="https://registry.npmjs.org/sootsim/latest";async function W(o){let n=o.indexOf("--channel"),t=n>=0&&o[n+1]?o[n+1]:void 0;console.log(`sootsim upgrade
5
5
  `),console.log("runtime:");let e=a(),{config:l}=await p(),s=l?.runtimeVersion,c=s?k.existsSync(r.join(d(s),"index.html")):!1;s&&console.log(` project config: v${s}`);let i=(s&&c?null:await $(["install",...s?[s,"--set-active=false"]:[],...t?["--channel",t]:[]],{}))?.version??s??a();i&&console.log(s?c?` result: v${i} already installed for this project`:` result: not installed \u2192 v${i} for this project`:e&&e!==i?` result: v${e} \u2192 v${i}`:e?` result: v${i} already current`:` result: not installed \u2192 v${i}`);let x=i?await h(i):null;console.log(`
6
6
  cli:`),await j(),i&&console.log(`
7
7
  ${v(i,x)}`)}function w(){if(u())return{kind:"dev"};let o=process.argv[1]??"";try{o=k.realpathSync(o)}catch{}let n=r.sep;if(o.includes(`${n}_npx${n}`)||o.includes(`${n}.bunx${n}`))return{kind:"npx"};if(o.includes(`${n}.bun${n}`))return{kind:"global",command:"bun",args:["add","-g","sootsim@latest"]};if(o.includes(`${n}pnpm${n}`))return{kind:"global",command:"pnpm",args:["add","-g","sootsim@latest"]};let t=r.join(m(),"cli");if(o.startsWith(`${t}${n}`))return{kind:"global",command:"npm",args:["i","-g","--prefix",t,"sootsim@latest"]};let e=r.resolve(process.env.SOOTSIM_CLI_PREFIX||r.join(R.homedir(),".local"));return o.startsWith(`${e}${n}`)?{kind:"global",command:"npm",args:["i","-g","--prefix",e,"sootsim@latest"]}:{kind:"global",command:"npm",args:["i","-g","sootsim@latest"]}}async function j(){let o=f(),n=await C();if(!n){console.log(` v${o} \u2014 couldn't reach the npm registry, skipped`);return}if(g(n,o)<=0){console.log(` v${o} (latest)`);return}let t=w();if(console.log(` v${o} \u2192 v${n}`),t.kind==="dev"){console.log(" running from the Contrast dev checkout \u2014 pull instead of upgrading");return}if(t.kind==="npx"){console.log(" running from the npx cache \u2014 get the latest with:"),console.log(" npx sootsim@latest");return}let e=`${t.command} ${t.args.join(" ")}`;console.log(` updating global install (${e})\u2026`),await S(t.command,t.args)?console.log(` updated to v${n}`):(console.log(" update failed \u2014 run it yourself:"),console.log(` ${e}`))}function S(o,n){return new Promise(t=>{let e=y(o,n,{stdio:"inherit"});e.on("error",()=>t(!1)),e.on("exit",l=>t(l===0))})}async function C(){try{let o=await fetch(b,{headers:{accept:"application/json"},signal:AbortSignal.timeout(8e3)});if(!o.ok)return null;let n=await o.json();return typeof n.version=="string"&&n.version?n.version:null}catch{return null}}export{W as runUpgrade};
@@ -0,0 +1,4 @@
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ import { createRequire as __sootsimCreateRequire } from 'node:module'
3
+ var require = __sootsimCreateRequire(import.meta.url)
4
+ import{e as a,f as b,g as c}from"./chunk-VLLTUTO5.js";import"./chunk-G4B2PTUA.js";import"./chunk-MLX2UIH7.js";import"./chunk-E3POCZJT.js";import"./chunk-TFWWL3HI.js";import"./chunk-XAHT6BRW.js";import"./chunk-5NHCBHYZ.js";import"./chunk-WI5GVQ6M.js";import"./chunk-FLLDNYUC.js";import"./chunk-YOV3CQIH.js";import"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};
@@ -1,6 +1,6 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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}from"./chunk-4PKUB2QX.js";import"./chunk-SDBIR5ON.js";import{d as r,f as e}from"./chunk-WE74HC52.js";import{a as m}from"./chunk-MFLCDFRS.js";import{l as s}from"./chunk-UK7X4OX3.js";import{a as l}from"./chunk-V2SZPQJF.js";import"./chunk-IRNRCBRW.js";import g from"node:fs";import d from"node:path";async function V($){let{IS_BETA:c,BETA_LABEL:u}=await import("./beta-DP7K4JVJ.js"),f=c?` \xB7 ${u}`:"";console.log(`sootsim v${l()}${f}`);let o=m(),i=e.resolveChannel();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${i}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `sootsim runtime install`"):console.log(`${o.primary} \xB7 ${i}`);let{config:n}=await a();if(n?.runtimeVersion){let p=g.existsSync(d.join(s(n.runtimeVersion),"index.html"));console.log(`project runtime v${n.runtimeVersion} \xB7 configured \xB7 ${p?"installed":"installs on open"}`)}let t=await e.checkUpToDate({channel:i});t.outdated&&t.latest&&console.log(`
4
+ import{b as a}from"./chunk-2LMSJNAH.js";import"./chunk-XAHT6BRW.js";import{d as r,f as e}from"./chunk-NRPNLTJI.js";import{a as m}from"./chunk-TDM4IQS3.js";import{l as s}from"./chunk-LK63GSPB.js";import{a as l}from"./chunk-BDZ7GDAA.js";import"./chunk-BQLQCPXE.js";import g from"node:fs";import d from"node:path";async function V($){let{IS_BETA:c,BETA_LABEL:u}=await import("./beta-RR6TCDCJ.js"),f=c?` \xB7 ${u}`:"";console.log(`sootsim v${l()}${f}`);let o=m(),i=e.resolveChannel();o.isDevBridge?(console.log(o.primary),o.installedRuntime&&console.log(`${o.installedRuntime} \xB7 ${i}`)):o.primary==="runtime not installed"?console.log("runtime not installed \u2014 run `sootsim runtime install`"):console.log(`${o.primary} \xB7 ${i}`);let{config:n}=await a();if(n?.runtimeVersion){let p=g.existsSync(d.join(s(n.runtimeVersion),"index.html"));console.log(`project runtime v${n.runtimeVersion} \xB7 configured \xB7 ${p?"installed":"installs on open"}`)}let t=await e.checkUpToDate({channel:i});t.outdated&&t.latest&&console.log(`
5
5
  \u2191 default runtime v${t.latest} available; run \`sootsim upgrade\``),console.log(`
6
6
  what's new: ${r}`)}export{V as runVersion};
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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,b,c,d,e,f,g,h,i,j}from"./chunk-VXRYV6G6.js";import"./chunk-IRNRCBRW.js";export{b as COMPAT_CATEGORIES,j as COMPAT_RESULT_CAVEAT,c as POLYFILL_REGISTRY,a as UNSUPPORTABLE,f as countScanResults,i as formatDetailedScanLines,h as formatPackageStatus,g as formatScanCounts,d as scanDeps,e as scanDepsWithData};
4
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-6Q5PHS4F.js";import"./chunk-BQLQCPXE.js";export{b as COMPAT_CATEGORIES,j as COMPAT_RESULT_CAVEAT,c as POLYFILL_REGISTRY,a as UNSUPPORTABLE,f as countScanResults,i as formatDetailedScanLines,h as formatPackageStatus,g as formatScanCounts,d as scanDeps,e as scanDepsWithData};
@@ -1,7 +1,7 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (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{D as N,E as F,G as y,R as T,S as b,T as S}from"./chunk-7LULF3D2.js";import{h as A,j as _}from"./chunk-KYGB26L4.js";import"./chunk-6MFFAN7Q.js";import{c as k}from"./chunk-YOLPZLST.js";import"./chunk-UK7X4OX3.js";import"./chunk-IRNRCBRW.js";function O(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--since"&&e+1<n.length){t.push(e,e+1);let s=n[e+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let r=Number(l[1]),u=l[2]??"ms",v=u==="s"?r*1e3:u==="m"?r*6e4:r;return{since:Date.now()-v,consumed:t}}let i=Number(s);if(Number.isFinite(i)&&i>1e12)return{since:i,consumed:t}}return{consumed:t}}function B(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--kinds"&&e+1<n.length)return t.push(e,e+1),{kinds:n[e+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:t};return{consumed:t}}function D(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--limit"&&e+1<n.length){t.push(e,e+1);let s=Number(n[e+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:t}}return{consumed:t}}function x(n){let t=[],e={label:"initial state",events:[],startedAt:n[0]?.t??null};t.push(e);for(let s of n)if(e.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,i=l?.phase;if(!i||i==="enter"||i==="appear"||i==="active"){let r=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;t.length===1&&e.events.length===1?e.label=`${s.kind}: ${r}`:(e={label:`${s.kind}: ${r}`,events:[],startedAt:s.t},t.push(e))}}return t}async function J(n,t){let e=A(n,{port:t.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
4
+ import{D as N,E as F,G as y,R as T,S as b,T as S}from"./chunk-JZZIA5BR.js";import{h as A,j as _}from"./chunk-5NHCBHYZ.js";import"./chunk-YOV3CQIH.js";import{c as k}from"./chunk-XE2DUF5Z.js";import"./chunk-LK63GSPB.js";import"./chunk-BQLQCPXE.js";function O(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--since"&&e+1<n.length){t.push(e,e+1);let s=n[e+1].trim(),l=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(s);if(l){let r=Number(l[1]),u=l[2]??"ms",v=u==="s"?r*1e3:u==="m"?r*6e4:r;return{since:Date.now()-v,consumed:t}}let i=Number(s);if(Number.isFinite(i)&&i>1e12)return{since:i,consumed:t}}return{consumed:t}}function B(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--kinds"&&e+1<n.length)return t.push(e,e+1),{kinds:n[e+1].split(",").map(s=>s.trim()).filter(Boolean),consumed:t};return{consumed:t}}function D(n){let t=[];for(let e=0;e<n.length;e++)if(n[e]==="--limit"&&e+1<n.length){t.push(e,e+1);let s=Number(n[e+1]);if(Number.isFinite(s)&&s>0)return{limit:s,consumed:t}}return{consumed:t}}function x(n){let t=[],e={label:"initial state",events:[],startedAt:n[0]?.t??null};t.push(e);for(let s of n)if(e.events.push(s),s.kind==="screen"||s.kind==="route"){let l=s.data,i=l?.phase;if(!i||i==="enter"||i==="appear"||i==="active"){let r=l?.name||l?.activeName||l?.path||l?.pathname||s.kind;t.length===1&&e.events.length===1?e.label=`${s.kind}: ${r}`:(e={label:`${s.kind}: ${r}`,events:[],startedAt:s.t},t.push(e))}}return t}async function J(n,t){let e=A(n,{port:t.port,stripBooleanFlags:["--summary","--all","--json","--no-advance","--help","-h","--flow","--noisy"],stripValueFlags:["--since","--kinds","--limit"]});(n.includes("--help")||n.includes("-h"))&&(console.log(`
5
5
  sootsim what-happened \u2014 show recent events from the semantic timeline
6
6
 
7
7
  usage:
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! sootsim v0.1.301 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! sootsim v0.1.303 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;