sootsim 0.1.302 → 0.1.304

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 (159) hide show
  1. package/dist-cli/bin.js +5 -5
  2. package/dist-cli/chunks/{agent-QM5DJK6B.js → agent-EK355OQM.js} +2 -2
  3. package/dist-cli/chunks/{agent-wrapper-HDOQKZ2C.js → agent-wrapper-LCJJWHZE.js} +2 -2
  4. package/dist-cli/chunks/app-fonts-LIPU2DLT.js +4 -0
  5. package/dist-cli/chunks/{assert-URPY7JOQ.js → assert-OASKCPBX.js} +2 -2
  6. package/dist-cli/chunks/{auth-LDIGTG4T.js → auth-XYYKD33F.js} +2 -2
  7. package/dist-cli/chunks/{beta-7X7SMIUJ.js → beta-TOL55XPM.js} +2 -2
  8. package/dist-cli/chunks/{camera-44FBN2AD.js → camera-PHKVEQHR.js} +2 -2
  9. package/dist-cli/chunks/{chunk-47FKMZKZ.js → chunk-2MEUZOSD.js} +1 -1
  10. package/dist-cli/chunks/{chunk-N53HDXGW.js → chunk-2RLFUM3C.js} +8 -8
  11. package/dist-cli/chunks/{chunk-YY54A626.js → chunk-3UUHIHA6.js} +2 -2
  12. package/dist-cli/chunks/{chunk-QNA5RNYZ.js → chunk-5NJTX5OP.js} +2 -2
  13. package/dist-cli/chunks/{chunk-YY27LKQF.js → chunk-76OLOD2G.js} +2 -2
  14. package/dist-cli/chunks/{chunk-UEFW7TPW.js → chunk-7RFXZXKH.js} +1 -1
  15. package/dist-cli/chunks/{chunk-2BQCOQBK.js → chunk-A4UYZTV7.js} +2 -2
  16. package/dist-cli/chunks/{chunk-T3UJXMFJ.js → chunk-ABHNOM2C.js} +1 -1
  17. package/dist-cli/chunks/{chunk-PDB5OX3V.js → chunk-AJYA6R3N.js} +2 -2
  18. package/dist-cli/chunks/{chunk-TWOBAP7S.js → chunk-BJOT2LL6.js} +2 -2
  19. package/dist-cli/chunks/{chunk-UNDGU5PA.js → chunk-BPRMA4IC.js} +2 -2
  20. package/dist-cli/chunks/{chunk-QN5DSQNG.js → chunk-CMYVGJBQ.js} +1 -1
  21. package/dist-cli/chunks/{chunk-ZORZTTQL.js → chunk-ENXLKDQ6.js} +3 -3
  22. package/dist-cli/chunks/{chunk-WQWYWERD.js → chunk-EXW6TH3O.js} +2 -2
  23. package/dist-cli/chunks/{chunk-QOS3GSOM.js → chunk-FNI75AD7.js} +1 -1
  24. package/dist-cli/chunks/{chunk-KNBZZC7R.js → chunk-G4R7CPCY.js} +2 -2
  25. package/dist-cli/chunks/{chunk-XLAZCK5H.js → chunk-GF3LDVWF.js} +2 -2
  26. package/dist-cli/chunks/{chunk-ZADSXYX7.js → chunk-GMILMS7P.js} +2 -2
  27. package/dist-cli/chunks/{chunk-IJKBAKAA.js → chunk-HFA5ZACE.js} +21 -10
  28. package/dist-cli/chunks/{chunk-XRRW4YFF.js → chunk-HFKQUS4I.js} +3 -3
  29. package/dist-cli/chunks/{chunk-SMBMOSXY.js → chunk-INBBOCU4.js} +2 -2
  30. package/dist-cli/chunks/chunk-ITDTSNN2.js +4 -0
  31. package/dist-cli/chunks/{chunk-ZQLQVJUB.js → chunk-IWRRIQDJ.js} +2 -2
  32. package/dist-cli/chunks/{chunk-7F57RUPB.js → chunk-JDKWIB6V.js} +1 -1
  33. package/dist-cli/chunks/{chunk-XKUUILJ2.js → chunk-LRXSLMX4.js} +1 -1
  34. package/dist-cli/chunks/{chunk-H7J7U34H.js → chunk-M3ETYVNL.js} +1 -1
  35. package/dist-cli/chunks/{chunk-2AD7UVSQ.js → chunk-MSYPDBFG.js} +2 -2
  36. package/dist-cli/chunks/{chunk-LLCCT4VC.js → chunk-NXYKNKNL.js} +2 -2
  37. package/dist-cli/chunks/{chunk-NFC3BJMX.js → chunk-OSH6526H.js} +1 -1
  38. package/dist-cli/chunks/{chunk-HFHHYL3K.js → chunk-QWQHSUZC.js} +2 -2
  39. package/dist-cli/chunks/chunk-RJWQ3VAD.js +14 -0
  40. package/dist-cli/chunks/{chunk-VEOPRCNX.js → chunk-RQJDIDJ3.js} +1 -1
  41. package/dist-cli/chunks/{chunk-FNJ2IEDC.js → chunk-RT7TUHH7.js} +2 -2
  42. package/dist-cli/chunks/{chunk-W6XC5TUY.js → chunk-RYQUO6LT.js} +1 -1
  43. package/dist-cli/chunks/{chunk-N7ATA44P.js → chunk-SN6ARNCL.js} +2 -2
  44. package/dist-cli/chunks/{chunk-BJDIJYWM.js → chunk-SVFN66PF.js} +2 -2
  45. package/dist-cli/chunks/{chunk-5CWTAN4D.js → chunk-UB3OWUVK.js} +1 -1
  46. package/dist-cli/chunks/{chunk-D4BPRTTD.js → chunk-V6JDDX4B.js} +2 -2
  47. package/dist-cli/chunks/{chunk-RZLCDDE2.js → chunk-VUR5QXVX.js} +2 -2
  48. package/dist-cli/chunks/{chunk-BVUQ2PVZ.js → chunk-W3CSYOSQ.js} +1 -1
  49. package/dist-cli/chunks/{chunk-7UIDSSWQ.js → chunk-WNDYTKLC.js} +1 -1
  50. package/dist-cli/chunks/{chunk-2ELPPBLQ.js → chunk-XCVSB47R.js} +2 -2
  51. package/dist-cli/chunks/{chunk-C36FJ7OB.js → chunk-XHYSASAX.js} +1 -1
  52. package/dist-cli/chunks/{chunk-HNYGEEPF.js → chunk-XXS4TCOO.js} +3 -3
  53. package/dist-cli/chunks/{chunk-OOP74SPV.js → chunk-Y5YM7XHU.js} +1 -1
  54. package/dist-cli/chunks/{chunk-UJ7P2CWC.js → chunk-YAV6BH3A.js} +2 -2
  55. package/dist-cli/chunks/{chunk-AHPEOPNQ.js → chunk-YXHO2OUL.js} +1 -1
  56. package/dist-cli/chunks/chunk-ZDRI2LUG.js +125 -0
  57. package/dist-cli/chunks/{chunk-REJQMXOG.js → chunk-ZONISYZ5.js} +1 -1
  58. package/dist-cli/chunks/{cleanup-QTLASIO7.js → cleanup-GCTEGJMP.js} +2 -2
  59. package/dist-cli/chunks/{cli-version-EUG2MGT7.js → cli-version-G72HUH4E.js} +2 -2
  60. package/dist-cli/chunks/{compat-DA2Z6HOU.js → compat-IC4JHGBH.js} +2 -2
  61. package/dist-cli/chunks/{config-U65JAS2W.js → config-C65MZFU3.js} +2 -2
  62. package/dist-cli/chunks/{control-ZCFRXISU.js → control-RWLYBKQR.js} +2 -2
  63. package/dist-cli/chunks/daemon-D77E5G6Z.js +4 -0
  64. package/dist-cli/chunks/{debug-OXP67EDF.js → debug-LEL32PDN.js} +3 -3
  65. package/dist-cli/chunks/{desktop-ZEQXNFI2.js → desktop-RDSISJH2.js} +3 -3
  66. package/dist-cli/chunks/{detox-M4JBLH5P.js → detox-SCCWUIKK.js} +2 -2
  67. package/dist-cli/chunks/{device-ISL5YP5C.js → device-MTDEKDUK.js} +2 -2
  68. package/dist-cli/chunks/{diagnose-H2TRXSVS.js → diagnose-UZJCKLPZ.js} +2 -2
  69. package/dist-cli/chunks/disk-cleanup-HLWRVTVW.js +4 -0
  70. package/dist-cli/chunks/drivers-Q7GMKTBM.js +4 -0
  71. package/dist-cli/chunks/{film-LKYPZOJD.js → film-YBE544PG.js} +3 -3
  72. package/dist-cli/chunks/flow-5VOVAVZN.js +4 -0
  73. package/dist-cli/chunks/help-2PESJ7V2.js +4 -0
  74. package/dist-cli/chunks/{hidden-runtime-alias-JMWSVMJD.js → hidden-runtime-alias-KJYCJLSR.js} +2 -2
  75. package/dist-cli/chunks/{home-paths-S66AEW3L.js → home-paths-NSHWNEGK.js} +2 -2
  76. package/dist-cli/chunks/inspect-OIA3Q5MD.js +4 -0
  77. package/dist-cli/chunks/install-desktop-7KLACQUW.js +4 -0
  78. package/dist-cli/chunks/{login-EJEEYZGB.js → login-AEVUU72R.js} +4 -4
  79. package/dist-cli/chunks/{logout-QCEW2MME.js → logout-72XHF6J2.js} +2 -2
  80. package/dist-cli/chunks/{maestro-4IKBKIUF.js → maestro-OXSKQJ6B.js} +3 -3
  81. package/dist-cli/chunks/{maestro-generate-WSYSKMND.js → maestro-generate-AKZFORVJ.js} +3 -3
  82. package/dist-cli/chunks/{mode-KQ5VDMPP.js → mode-U6KRG2PE.js} +2 -2
  83. package/dist-cli/chunks/{optional-demo-registry-MMHEMCBJ.js → optional-demo-registry-L3VIWBI2.js} +2 -2
  84. package/dist-cli/chunks/{perf-LGZDBRUM.js → perf-KF2BJZIN.js} +2 -2
  85. package/dist-cli/chunks/{permissions-DA4JXY2N.js → permissions-TRJG4QAI.js} +2 -2
  86. package/dist-cli/chunks/{record-TPU2TOEU.js → record-TICJYZOA.js} +3 -3
  87. package/dist-cli/chunks/{report-issue-PPUNSEEQ.js → report-issue-OQPLBQMJ.js} +2 -2
  88. package/dist-cli/chunks/runtime-HDMLWNXW.js +4 -0
  89. package/dist-cli/chunks/screenshot-command-XLERKHVW.js +159 -0
  90. package/dist-cli/chunks/{screenshots-capture-AG2TIYLG.js → screenshots-capture-B6OORSD4.js} +2 -2
  91. package/dist-cli/chunks/{serve-C3WLV2OX.js → serve-5M7MIPWF.js} +2 -2
  92. package/dist-cli/chunks/{setup-4KZKLDZV.js → setup-HJZDC4PK.js} +2 -2
  93. package/dist-cli/chunks/{skills-65XCNSNM.js → skills-RXHLMGGL.js} +2 -2
  94. package/dist-cli/chunks/{storage-ADWG4UT7.js → storage-MMPD2XBS.js} +2 -2
  95. package/dist-cli/chunks/store-APKY72ZY.js +4 -0
  96. package/dist-cli/chunks/telemetry-W3YRHE67.js +4 -0
  97. package/dist-cli/chunks/{timeline-BRHYLQTW.js → timeline-6PF5BZ37.js} +2 -2
  98. package/dist-cli/chunks/{upgrade-AEJNAP6O.js → upgrade-QSMIK3RC.js} +2 -2
  99. package/dist-cli/chunks/upload-HQEOYILQ.js +4 -0
  100. package/dist-cli/chunks/{version-HZWBK4KJ.js → version-WLTFXEDC.js} +2 -2
  101. package/dist-cli/chunks/{web-LCSSJCZ4.js → web-DI73LQ7N.js} +2 -2
  102. package/dist-cli/chunks/{what-happened-GWA24LHG.js → what-happened-4SAMGZWR.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 +17 -8
  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 +58 -3
  131. package/dist-lib/sdk.cjs +18 -6
  132. package/dist-lib/sdk.mjs +18 -6
  133. package/dist-lib/skills.cjs +26 -12
  134. package/dist-lib/vite.cjs +1 -1
  135. package/package.json +2 -2
  136. package/scripts/dev-server-scanner.ts +95 -9
  137. package/skills/sootsim-debug/SKILL.md +6 -0
  138. package/skills/sootsim-setup/SKILL.md +38 -0
  139. package/src/attached-projects.ts +2 -2
  140. package/src/host/bridge-host.ts +2 -2
  141. package/src/runtime-assets.ts +1 -1
  142. package/src/runtime-delivery.ts +1 -1
  143. package/src/vite-plugin.ts +1 -1
  144. package/dist-cli/chunks/app-fonts-VPJDIM5M.js +0 -4
  145. package/dist-cli/chunks/chunk-5TWYZNIF.js +0 -125
  146. package/dist-cli/chunks/chunk-GRMK3BZY.js +0 -4
  147. package/dist-cli/chunks/chunk-I4NP3TJR.js +0 -12
  148. package/dist-cli/chunks/daemon-S25HJFIG.js +0 -4
  149. package/dist-cli/chunks/disk-cleanup-DY6JAHH3.js +0 -4
  150. package/dist-cli/chunks/drivers-EE4LTPSZ.js +0 -4
  151. package/dist-cli/chunks/flow-WGICJ5KS.js +0 -4
  152. package/dist-cli/chunks/help-YQ63GAW6.js +0 -4
  153. package/dist-cli/chunks/inspect-VKVWW64M.js +0 -4
  154. package/dist-cli/chunks/install-desktop-CH27FTQI.js +0 -4
  155. package/dist-cli/chunks/runtime-7MZZR6SC.js +0 -4
  156. package/dist-cli/chunks/screenshot-command-2YSWGL4X.js +0 -156
  157. package/dist-cli/chunks/store-FEQIGIYH.js +0 -4
  158. package/dist-cli/chunks/telemetry-KBOJKIRS.js +0 -4
  159. package/dist-cli/chunks/upload-QKJRNNL3.js +0 -4
@@ -1,156 +0,0 @@
1
- /*! sootsim v0.1.302 | (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 re,b as ne,f as se}from"./chunk-HNYGEEPF.js";import"./chunk-ZADSXYX7.js";import{a as k}from"./chunk-5CWTAN4D.js";import{b as Q}from"./chunk-N53HDXGW.js";import{a as ee}from"./chunk-SMBMOSXY.js";import"./chunk-HFHHYL3K.js";import{a as te,b as oe}from"./chunk-WQWYWERD.js";import"./chunk-YY27LKQF.js";import"./chunk-I4NP3TJR.js";import"./chunk-XKUUILJ2.js";import"./chunk-LLCCT4VC.js";import{s as K}from"./chunk-IJKBAKAA.js";import"./chunk-BJDIJYWM.js";import"./chunk-7F57RUPB.js";import"./chunk-UNDGU5PA.js";import"./chunk-GRMK3BZY.js";import"./chunk-BVUQ2PVZ.js";import"./chunk-2ELPPBLQ.js";import"./chunk-H7J7U34H.js";import"./chunk-N7ATA44P.js";import"./chunk-VEOPRCNX.js";import{h as A,i as X,j as R,k as J,l as Z,m as M,n as P}from"./chunk-D4BPRTTD.js";import"./chunk-47FKMZKZ.js";import"./chunk-PDB5OX3V.js";import"./chunk-2AD7UVSQ.js";import"./chunk-QOS3GSOM.js";import"./chunk-2BQCOQBK.js";import"./chunk-RZLCDDE2.js";import"./chunk-KNBZZC7R.js";import{b as F,e as x,f as j,g as I,h as L,i as U,j as E}from"./chunk-FNJ2IEDC.js";import"./chunk-T3UJXMFJ.js";import"./chunk-AHPEOPNQ.js";import"./chunk-5TWYZNIF.js";import"./chunk-UEFW7TPW.js";import"./chunk-C36FJ7OB.js";import{mkdirSync as le,writeFileSync as ie}from"fs";import{dirname as ce,resolve as ue}from"path";async function de(e,t){let o=Ie(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=Le(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=Te(o),l=ze(o);if(r||s)return a&&(console.error(" --with-frame is not supported with --gallery / --themes"),process.exit(1)),ae(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=me(o),d=await Re(o);if(await Ae(c.wsPort)){try{await Be(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 ae(o,t)}async function Ae(e){let t=X(e,{commandTimeoutMs:1e3});try{return await t.listSims(),!0}catch{return!1}finally{t.close()}}async function Re(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 Be(e,t,o,i,r,s){let n=R({...e,commandTimeoutMs:45e3});try{if((await J(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,C=await K(n,f);if(!C.ready)throw new Error(`app not ready to capture after ${Math.round(C.elapsedMs/1e3)}s`+(C.loadingText?` (still showing "${C.loadingText}")`:"")+"; 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:Q(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=ue(process.cwd(),t||"/tmp/sootsim-inspect.png");le(ce(p),{recursive:!0});let y=Buffer.from(w,"base64");if(i){let f=await Oe(n);if(!f)throw new Error("could not read current device model from the target sim");let C=await re(y,f);ie(p,C),console.log(` frame: ${f}`)}else ie(p,y);console.log(` saved: ${p}`)}finally{n.close()}}async function Oe(e){let t=await M(e,"SootSim.bridges.settings.get")??{deviceModel:null},o=typeof t.deviceModel=="string"?t.deviceModel:null;return!o||!(o in F)?null:o}function Te(e){let t=!1;for(let o of e)o==="--with-frame"&&(t=!0),o==="--no-frame"&&(t=!1);return t}function ze(e){if(e.includes("--shell-only"))return"shell";if(e.includes("--no-shell"))return"tenant"}var _e=new Set(["--help","-h","--verbose","-v","--with-frame","--no-frame","--no-shell","--shell-only","--allow-loading","--gallery","--themes"]),pe=new Set(["--output","--area","--id","--text","--url","--port","--timeout","--sim"]),je={"--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 Ie(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 Le(e){let t=[];for(let o=0;o<e.length;o++){let i=e[o];if(i.startsWith("-")){if(pe.has(i)){o++;continue}_e.has(i)||t.push({flag:i,suggestion:je[i]})}}return t}function me(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("-")){pe.has(i)&&o++;continue}return i}}async function ae(e,t){let o=me(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 k(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=ue(process.cwd(),o);le(ce(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 Qe,writeFileSync as Ce}from"fs";import{tmpdir as eo}from"os";import T from"path";import{mkdirSync as fe,readFileSync as Ue,writeFileSync as ge}from"fs";import H from"path";function he(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 He(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=He(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 Ye(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 Ge(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 we(...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!==x.color?e:{...e,color:t.glow}}function We(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:${we("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:${we("translateX(-50%)",G(c))}`,`filter:${W(u)}`,"z-index:2"].join(";")}}}function qe({canvas:e,compose:t,slide:o,imageDataUrl:i}){let r=o.background??t.background,s=We(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>
40
- <html>
41
- <head>
42
- <meta charset="utf-8" />
43
- <style>
44
- html, body {
45
- margin: 0;
46
- width: ${e.width}px;
47
- height: ${e.height}px;
48
- overflow: hidden;
49
- background: transparent;
50
- }
51
- body {
52
- font-family: "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
53
- }
54
- #canvas {
55
- position: relative;
56
- width: ${e.width}px;
57
- height: ${e.height}px;
58
- overflow: hidden;
59
- background: ${Ye(r)};
60
- color: ${t.text.color};
61
- isolation: isolate;
62
- }
63
- #glow {
64
- position: absolute;
65
- inset: 0;
66
- background: ${Ge(r)};
67
- pointer-events: none;
68
- }
69
- #copy {
70
- ${s.copyStyle};
71
- }
72
- #device {
73
- ${a};
74
- }
75
- #device img {
76
- display: block;
77
- width: 100%;
78
- height: auto;
79
- }
80
- </style>
81
- </head>
82
- <body>
83
- <div id="canvas">
84
- <div id="glow"></div>
85
- ${n?`<div id="copy">${u}${l}${c}</div>`:""}
86
- <div id="device"><img src="${i}" alt="" /></div>
87
- </div>
88
- </body>
89
- </html>`}async function ye(e,t,o){let i=[],r=o??await(async()=>{let{chromium:n}=await import("playwright");return k(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,${Ue(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(qe({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);fe(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}});ge(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()}fe(e.outDir,{recursive:!0});let s=H.join(e.outDir,"manifest.json");return ge(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 be(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 Se(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 Ve}from"fs";import $ 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 xe(e,t){return typeof e=="boolean"?e:t}function v(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Pe(e,t){return typeof e!="string"||e.trim().length===0?t:Object.prototype.hasOwnProperty.call(F,e)?e:null}function $e(e,t){if(typeof e=="string"){let r=E(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=v(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:v(e.direction,t.direction??180),glow:S(e.glow)??t.glow,stops:i.length>0?i:t.stops?.map(r=>({...r}))??[]}}function Ke(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 Xe(e){switch(e){case"editorial-left":case"minimal-bottom":case"none":case"bold-top":return e;default:return"bold-top"}}function Je(e){switch(e){case"plan":case"flow":case"auto":return e;default:return"auto"}}function ke(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 $.isAbsolute(t)?t:$.resolve(e,t)}function Ze(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=he(n||s);return{id:n||a,assetKey:a,screenshot:s,headline:b(r.headline),subheadline:b(r.subheadline),eyebrow:b(r.eyebrow),pose:ke(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?$e(r.theme??r.background,t):void 0}})}function ve(e){let t=$.resolve(e),o=$.dirname(t),i=ee.parse(Ve(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=Pe(r.device,null),c=N(o,b(s.out,$.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=Je(s.pathMode),w=$e(n.background??"cyan",E("cyan")),p={show:xe(n.frame&&g(n.frame)?n.frame.show:void 0,!0),style:Pe(n.frame&&g(n.frame)?n.frame.style:null,null)||l||j,pose:ke(n.frame&&g(n.frame)?n.frame.pose:void 0)||"straight",scale:v(n.frame&&g(n.frame)?n.frame.scale:void 0,1),offsetY:v(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,x.color),blur:v(n.frame&&g(n.frame)&&g(n.frame.shadow)?n.frame.shadow.blur:void 0,x.blur),spread:v(n.frame&&g(n.frame)&&g(n.frame.shadow)?n.frame.shadow.spread:void 0,x.spread),opacity:v(n.frame&&g(n.frame)&&g(n.frame.shadow)?n.frame.shadow.opacity:void 0,x.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):$.join(c,"raw"),framedDir:$.join(c,"framed"),mode:m,pathMode:h,simId:S(s.sim),openInNewSim:xe(s.new,!1)},compose:{outDir:N(o,b(n.out,$.join(".sootsim","screenshots","exports"))),locale:b(n.locale,"en"),canvases:Ke(n.canvases),frame:p,background:w,text:{preset:Xe(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:Ze(n.slides,w)}}}function et(e){return e.capture.pathMode==="plan"||e.capture.pathMode==="flow"?e.capture.pathMode:e.capture.fromDir?"flow":"plan"}function tt(e,t){if(!e.capture.flowPath)throw new Error("capture flow path is required to build flow args");let o=[e.capture.flowPath],i=et(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 ot(e){return T.join(e.capture.outDir,"manifest.json")}async function rt(e,t){if(!e.capture.flowPath)return;V(e.capture.rawDir,{recursive:!0});let o=tt(e,t),i=await se(o);if(i!==0)throw new Error(`flow capture failed with exit code ${i}`)}async function nt(e,t){let o=new Map;V(e.capture.framedDir,{recursive:!0});let i=t??await(async()=>{let{chromium:r}=await import("playwright");return k(s=>r.launch(s),{headless:!0})})();try{let r=await ne(i);try{for(let s of e.compose.slides){let n=z(e,s.screenshot),a=Qe(n),l=await r.compose(a,e.compose.frame.style),c=T.join(e.capture.framedDir,`${s.assetKey}.png`);Ce(c,l),o.set(s.id,c)}}finally{await r.close()}}finally{!t&&typeof i.close=="function"&&await i.close()}return o}function st(e,t,o){let i=[],r=[];V(e.capture.outDir,{recursive:!0});let s=ot(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 Ce(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 it(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 Me(e,t={}){let o=ve(e);t.orgDeckFrames&&t.orgDeckFrames.length>0&&Se(o,t.orgDeckFrames);let i=t.deviceModel??o.deviceModel;t.composeOnly||await rt(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 k(l=>a.launch(l),{headless:!0})})():null;try{let a=r?await nt(o,n??void 0):new Map,l=st(o,a,i);if(t.captureOnly)return{plan:o,capture:l,compose:null};let c=it(o,a),u=await ye(o.compose,c,n??void 0);return{plan:o,capture:l,compose:u}}finally{n&&typeof n.close=="function"&&await n.close()}}async function De(e,t={}){if(e.includes("--help")||e.includes("-h"))return console.log(`
90
- sootsim screenshot appstore \u2014 capture and compose app-store screenshot sets
91
-
92
- usage:
93
- sootsim screenshot appstore --plan <plan.yaml> [options]
94
-
95
- options:
96
- --plan <path> screenshot plan yaml
97
- --sim <id> reuse a live sim for capture
98
- --app <target> override plan app target (port, url, or shell url)
99
- --device <model> override plan capture device for this run
100
- --org <slug> overlay copy/colors from a team's org screenshot deck
101
- --repo <name> repo for --org (both required to pull the org deck)
102
- --api-origin <url> contrast origin to fetch the deck from (default: the
103
- signed-in session origin, else https://contrast.dev)
104
- --capture-only stop after raw/framed intermediates
105
- --compose-only skip flow capture, reuse existing raw screenshots
106
-
107
- examples:
108
- sootsim screenshot appstore --plan app-store.yaml
109
- sootsim screenshot appstore --plan app-store.yaml --sim a9
110
- sootsim screenshot appstore --plan app-store.yaml --org acme --repo mobile
111
- `),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=te();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 be({org:c,repo:u,origin:y,authHeader:oe(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 Me(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 at,writeFileSync as lt}from"node:fs";import{dirname as ct,isAbsolute as ut,join as Ne,resolve as dt}from"node:path";var pt=`
112
- sootsim screenshot slides \u2014 compose App Store screenshots in the live sim
113
-
114
- usage:
115
- sootsim screenshot slides list slides (alias: slides list)
116
- sootsim screenshot slides set <n> [fields] patch a slide's copy/colors
117
- sootsim screenshot slides add append a blank slide (focuses it)
118
- sootsim screenshot slides remove <n> delete a slide
119
- sootsim screenshot slides move <n> <position> reorder a slide
120
- sootsim screenshot slides focus <n> open a slide (device flips into it)
121
- sootsim screenshot slides overview back to the gallery
122
- sootsim screenshot slides capture [<n>] capture the live frame into a slide
123
- sootsim screenshot slides export [<n>] [--out <dir>]
124
- write composed App-Store PNG(s)
125
-
126
- set fields:
127
- --title <text> headline
128
- --subtitle <text> subheadline
129
- --bg-top <color> gradient top (white gray slate black cyan blue
130
- --bg-bottom <color> gradient bottom teal green lime gold orange coral
131
- --title-color <color> copy color override, or "auto" red berry magenta
132
- --title-size <s> sm | md | lg | none gray-light
133
- --underlay <s> black | white | none gray-dark \u2026)
134
- --shadow <s> light | medium | strong | none
135
-
136
- notes:
137
- slides are addressed by 1-based index. screenshot mode is auto-enabled.
138
- capture shoots whatever the sim currently shows \u2014 navigate the app first
139
- (sootsim do tap-id \u2026), then capture.
140
-
141
- examples:
142
- sootsim screenshot slides set 1 --title "The ultimate MMA community." --bg-top cyan --bg-bottom black
143
- sootsim screenshot slides capture 1
144
- sootsim screenshot slides export --out ./exports
145
- `,mt={"--title":"title","--subtitle":"subtitle","--bg-top":"bgTop","--bg-bottom":"bgBottom","--title-color":"titleColor","--title-size":"titleSize","--underlay":"titleUnderlay","--shadow":"titleShadow","--out":"out"};function ht(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=mt[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 ft(e){if(!e)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:e}async function gt(e){if(!await Z(e,`(async () => {
146
- if (window.SootSim?.bridges?.settings?.get?.()?.screenshotMode) return true
147
- window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
148
- detail: { type: 'fire-action', id: 'toggle-screenshot-mode' },
149
- }))
150
- const deadline = Date.now() + 2000
151
- while (Date.now() < deadline) {
152
- if (window.SootSim?.bridges?.settings?.get?.()?.screenshotMode) return true
153
- await new Promise((r) => setTimeout(r, 40))
154
- }
155
- return false
156
- })()`,{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 wt(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 yt(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(pt);return}let{rest:o,values:i,json:r}=ht(e),s=A(o,{port:t.port,commandTimeoutMs:45e3}),n=s.positional[0]??"list",a=ft(s.positional[1]),l=Number(s.positional[2]),c=R(s),u=d=>{r?console.log(JSON.stringify(d,null,2)):wt(d)};try{switch(await gt(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 P(c,"SootSim.bridges.screenshotControl.setSlide",a,d));break}case"add":{u(await P(c,"SootSim.bridges.screenshotControl.addSlide"));break}case"remove":{if(a==null)throw new Error("usage: sootsim screenshot slides remove <n>");u(await P(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 P(c,"SootSim.bridges.screenshotControl.moveSlide",a,l));break}case"focus":{if(a==null)throw new Error("usage: sootsim screenshot slides focus <n>");u(await P(c,"SootSim.bridges.screenshotControl.focusSlide",a));break}case"overview":{u(await P(c,"SootSim.bridges.screenshotControl.overview"));break}case"capture":{let d=await P(c,"SootSim.bridges.screenshotControl.capture",...a!=null?[a]:[]);u(d);break}case"export":{let d=i.out?ut(i.out)?i.out:dt(process.cwd(),i.out):Ne(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=Ne(d,y.name);at(ct(f),{recursive:!0}),lt(f,yt(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 bt=new Set(["--sim","--port","-p","--output","-o","--out","--plan","--app","--device","--org","--repo","--api-origin","--branch","--platform","--slides","--shell-origin","--timeout"]),St=new Set(["capture","slides","appstore"]);function Ee(e){for(let t=0;t<e.length;t++){let o=e[t];if(o.startsWith("-")){bt.has(o)&&t++;continue}return St.has(o)?{name:o,index:t}:null}return null}function _(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function xt(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 xo(e,t){let o=Ee(e);if(!o||o.name==="capture"){await de(o?_(e,o.index):e,t);return}if(o.name==="slides"){await Fe(_(e,o.index),t);return}let i=_(e,o.index),r=Ee(i);if(r?.name==="capture")try{let{runScreenshotsCapture:s}=await import("./screenshots-capture-AG2TIYLG.js");return await s(xt(_(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 De(i,t)}export{xo as runScreenshotCommand};
@@ -1,4 +0,0 @@
1
- /*! sootsim v0.1.302 | (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-2ELPPBLQ.js";import"./chunk-FNJ2IEDC.js";import"./chunk-C36FJ7OB.js";export{a as settingsStore};
@@ -1,4 +0,0 @@
1
- /*! sootsim v0.1.302 | (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-PDB5OX3V.js";import"./chunk-2AD7UVSQ.js";import"./chunk-UEFW7TPW.js";import"./chunk-C36FJ7OB.js";export{b as flushCliTelemetry,a as trackCliEvent};
@@ -1,4 +0,0 @@
1
- /*! sootsim v0.1.302 | (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-HFHHYL3K.js";import"./chunk-WQWYWERD.js";import"./chunk-UNDGU5PA.js";import"./chunk-GRMK3BZY.js";import"./chunk-BVUQ2PVZ.js";import"./chunk-VEOPRCNX.js";import"./chunk-D4BPRTTD.js";import"./chunk-PDB5OX3V.js";import"./chunk-2AD7UVSQ.js";import"./chunk-T3UJXMFJ.js";import"./chunk-AHPEOPNQ.js";import"./chunk-UEFW7TPW.js";import"./chunk-C36FJ7OB.js";export{a as resolveDefaultUploadOrigin,b as resolvePublicPreviewOrigin,c as runUpload};