sera-code 0.1.3 → 0.1.4

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 (332) hide show
  1. package/README.md +9 -1
  2. package/bin/sera.mjs +31 -0
  3. package/dist/bundle/chunks/{chunk-OXMPCU7P.js → chunk-DFRGGJWV.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-KO3Z5BTR.js → chunk-EMXTNOOJ.js} +5 -5
  5. package/dist/bundle/chunks/{chunk-KXU77PUU.js → chunk-ET2ARYK4.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-ZNCN2NGY.js → chunk-G5BGS7HZ.js} +2 -2
  7. package/dist/bundle/chunks/{chunk-HODJBMOY.js → chunk-GSGPISRE.js} +3 -4
  8. package/dist/bundle/chunks/{chunk-46WGNYIE.js → chunk-NMUS7OCP.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-HQBQWHLD.js → chunk-RCQXVPCE.js} +1 -1
  10. package/dist/bundle/chunks/{cli-MML2DU4A.js → cli-NOCFT7AL.js} +1 -1
  11. package/dist/bundle/chunks/{execute-HXDNZ26B.js → execute-S2O3RL6V.js} +1 -1
  12. package/dist/bundle/chunks/github-copilot.js +1 -1
  13. package/dist/bundle/chunks/{runtime-JAH75CB5.js → runtime-BRT7AUXY.js} +1 -1
  14. package/dist/bundle/chunks/{virtual-modules-OE2CSJ4W.js → virtual-modules-QR2XYBMY.js} +1 -1
  15. package/dist/bundle/cli-runtime.js +1 -1
  16. package/dist/bundle/index.js +1 -1
  17. package/dist/bundle/rpc-entry.js +1 -1
  18. package/lib/postinstall.js +16 -0
  19. package/lib/update.js +85 -0
  20. package/lib/win-setup.js +96 -0
  21. package/package.json +4 -1
  22. package/sera-core/skills/ambalaj-tasarim/NOTICE +1 -0
  23. package/sera-core/skills/ambalaj-tasarim/SKILL.md +34 -0
  24. package/sera-core/skills/ambalaj-tasarim/dieline.mjs +17 -0
  25. package/sera-core/skills/ambalaj-tasarim/sera-pack.js +535 -0
  26. package/sera-core/skills/animasyonlu-site/NOTICE +1 -0
  27. package/sera-core/skills/animasyonlu-site/SKILL.md +26 -0
  28. package/sera-core/skills/animasyonlu-site/sera-motion.js +310 -0
  29. package/sera-core/skills/animate/LICENSE +21 -0
  30. package/sera-core/skills/animate/NOTICE +2 -0
  31. package/sera-core/skills/animate/RECIPES.md +324 -0
  32. package/sera-core/skills/animate/SKILL.md +209 -0
  33. package/sera-core/skills/astryx-ui/SKILL.md +37 -0
  34. package/sera-core/skills/awwwards/LICENSE +21 -0
  35. package/sera-core/skills/awwwards/NOTICE +5 -0
  36. package/sera-core/skills/awwwards/SKILL.md +357 -0
  37. package/sera-core/skills/awwwards/references/anatomy.md +103 -0
  38. package/sera-core/skills/awwwards/references/art-direction.md +114 -0
  39. package/sera-core/skills/awwwards/references/astro.md +235 -0
  40. package/sera-core/skills/awwwards/references/concepts.md +110 -0
  41. package/sera-core/skills/awwwards/references/content.md +88 -0
  42. package/sera-core/skills/awwwards/references/engine.md +751 -0
  43. package/sera-core/skills/awwwards/references/layout.md +81 -0
  44. package/sera-core/skills/awwwards/references/motion.md +463 -0
  45. package/sera-core/skills/awwwards/references/nextjs.md +386 -0
  46. package/sera-core/skills/awwwards/references/patterns.md +123 -0
  47. package/sera-core/skills/awwwards/references/quality-bar.md +151 -0
  48. package/sera-core/skills/awwwards/references/quality.md +91 -0
  49. package/sera-core/skills/awwwards/references/ship.md +36 -0
  50. package/sera-core/skills/awwwards/references/typography.md +135 -0
  51. package/sera-core/skills/awwwards/references/webgl.md +430 -0
  52. package/sera-core/skills/awwwards/scripts/audit.mjs +243 -0
  53. package/sera-core/skills/awwwards/scripts/browser.mjs +54 -0
  54. package/sera-core/skills/awwwards/scripts/font.mjs +87 -0
  55. package/sera-core/skills/awwwards/scripts/og.mjs +20 -0
  56. package/sera-core/skills/awwwards/scripts/photos.mjs +65 -0
  57. package/sera-core/skills/awwwards/scripts/serve.mjs +48 -0
  58. package/sera-core/skills/awwwards/scripts/shoot.mjs +675 -0
  59. package/sera-core/skills/beceri-yaz/SKILL.md +39 -0
  60. package/sera-core/skills/brag-slim/LICENSE +21 -0
  61. package/sera-core/skills/brag-slim/NOTICE +2 -0
  62. package/sera-core/skills/brag-slim/SKILL.md +108 -0
  63. package/sera-core/skills/brainstorming/LICENSE +21 -0
  64. package/sera-core/skills/brainstorming/NOTICE +5 -0
  65. package/sera-core/skills/brainstorming/SKILL.md +298 -0
  66. package/sera-core/skills/brainstorming/builder-check-prompt.md +23 -0
  67. package/sera-core/skills/copywriting/LICENSE +21 -0
  68. package/sera-core/skills/copywriting/NOTICE +5 -0
  69. package/sera-core/skills/copywriting/SKILL.md +343 -0
  70. package/sera-core/skills/copywriting/references/ai-tells.md +309 -0
  71. package/sera-core/skills/copywriting/references/copy-frameworks.md +432 -0
  72. package/sera-core/skills/copywriting/references/natural-transitions.md +256 -0
  73. package/sera-core/skills/cro/LICENSE +21 -0
  74. package/sera-core/skills/cro/NOTICE +5 -0
  75. package/sera-core/skills/cro/SKILL.md +198 -0
  76. package/sera-core/skills/cro/references/experiments.md +248 -0
  77. package/sera-core/skills/cro/references/form.md +422 -0
  78. package/sera-core/skills/derin-arastirma/referanslar/arastirma-yontem.md +11 -0
  79. package/sera-core/skills/emil-design-eng/LICENSE +21 -0
  80. package/sera-core/skills/emil-design-eng/NOTICE +2 -0
  81. package/sera-core/skills/emil-design-eng/SKILL.md +684 -0
  82. package/sera-core/skills/frontend-design/LICENSE.txt +177 -0
  83. package/sera-core/skills/frontend-design/NOTICE +2 -0
  84. package/sera-core/skills/frontend-design/SKILL.md +71 -0
  85. package/sera-core/skills/gorsel-denetim/SKILL.md +30 -0
  86. package/sera-core/skills/hallmark/LICENSE +21 -0
  87. package/sera-core/skills/hallmark/NOTICE +5 -0
  88. package/sera-core/skills/hallmark/SKILL.md +154 -0
  89. package/sera-core/skills/hallmark/references/anatomy.md +71 -0
  90. package/sera-core/skills/hallmark/references/brand-truth.md +40 -0
  91. package/sera-core/skills/hallmark/references/comp.md +104 -0
  92. package/sera-core/skills/hallmark/references/craft.md +116 -0
  93. package/sera-core/skills/hallmark/references/dark-mode.md +49 -0
  94. package/sera-core/skills/hallmark/references/data-viz.md +48 -0
  95. package/sera-core/skills/hallmark/references/design-md.md +53 -0
  96. package/sera-core/skills/hallmark/references/direction.md +52 -0
  97. package/sera-core/skills/hallmark/references/export-formats.md +80 -0
  98. package/sera-core/skills/hallmark/references/flow.md +131 -0
  99. package/sera-core/skills/hallmark/references/fonts.md +58 -0
  100. package/sera-core/skills/hallmark/references/gates.md +243 -0
  101. package/sera-core/skills/hallmark/references/genres/atmospheric.md +24 -0
  102. package/sera-core/skills/hallmark/references/genres/editorial.md +24 -0
  103. package/sera-core/skills/hallmark/references/genres/modern-minimal.md +24 -0
  104. package/sera-core/skills/hallmark/references/genres/playful.md +24 -0
  105. package/sera-core/skills/hallmark/references/imagery.md +99 -0
  106. package/sera-core/skills/hallmark/references/interaction-and-states.md +89 -0
  107. package/sera-core/skills/hallmark/references/layout.md +104 -0
  108. package/sera-core/skills/hallmark/references/macrostructures/01-bento-grid.md +21 -0
  109. package/sera-core/skills/hallmark/references/macrostructures/02-long-document.md +35 -0
  110. package/sera-core/skills/hallmark/references/macrostructures/03-marquee-hero.md +21 -0
  111. package/sera-core/skills/hallmark/references/macrostructures/04-stat-led.md +21 -0
  112. package/sera-core/skills/hallmark/references/macrostructures/05-workbench.md +21 -0
  113. package/sera-core/skills/hallmark/references/macrostructures/06-conversational-faq.md +28 -0
  114. package/sera-core/skills/hallmark/references/macrostructures/07-manifesto.md +28 -0
  115. package/sera-core/skills/hallmark/references/macrostructures/08-photographic.md +21 -0
  116. package/sera-core/skills/hallmark/references/macrostructures/09-quote-led.md +21 -0
  117. package/sera-core/skills/hallmark/references/macrostructures/10-specimen.md +21 -0
  118. package/sera-core/skills/hallmark/references/macrostructures/11-catalogue.md +21 -0
  119. package/sera-core/skills/hallmark/references/macrostructures/12-letter.md +21 -0
  120. package/sera-core/skills/hallmark/references/macrostructures/13-index-first.md +21 -0
  121. package/sera-core/skills/hallmark/references/macrostructures/14-narrative-workflow.md +21 -0
  122. package/sera-core/skills/hallmark/references/macrostructures/15-split-studio.md +21 -0
  123. package/sera-core/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -0
  124. package/sera-core/skills/hallmark/references/macrostructures/17-type-specimen.md +19 -0
  125. package/sera-core/skills/hallmark/references/macrostructures/18-portfolio-grid.md +21 -0
  126. package/sera-core/skills/hallmark/references/macrostructures/19-map-diagram.md +21 -0
  127. package/sera-core/skills/hallmark/references/macrostructures/20-ecosystem-index.md +19 -0
  128. package/sera-core/skills/hallmark/references/macrostructures/21-component-playground.md +21 -0
  129. package/sera-core/skills/hallmark/references/macrostructures.md +119 -0
  130. package/sera-core/skills/hallmark/references/microinteractions.md +80 -0
  131. package/sera-core/skills/hallmark/references/patterns.md +202 -0
  132. package/sera-core/skills/hallmark/references/redesign.md +88 -0
  133. package/sera-core/skills/hallmark/references/responsive.md +46 -0
  134. package/sera-core/skills/hallmark/references/review-finish.md +19 -0
  135. package/sera-core/skills/hallmark/references/review-hero.md +20 -0
  136. package/sera-core/skills/hallmark/references/scroll-choreography.md +110 -0
  137. package/sera-core/skills/hallmark/references/texture.md +90 -0
  138. package/sera-core/skills/hallmark/references/themes/README.md +58 -0
  139. package/sera-core/skills/hallmark/references/themes/almanac.md +103 -0
  140. package/sera-core/skills/hallmark/references/themes/arcade.md +102 -0
  141. package/sera-core/skills/hallmark/references/themes/atelier.md +98 -0
  142. package/sera-core/skills/hallmark/references/themes/bloom.md +102 -0
  143. package/sera-core/skills/hallmark/references/themes/blueprint.md +103 -0
  144. package/sera-core/skills/hallmark/references/themes/broadside.md +108 -0
  145. package/sera-core/skills/hallmark/references/themes/brutal.md +95 -0
  146. package/sera-core/skills/hallmark/references/themes/carnival.md +104 -0
  147. package/sera-core/skills/hallmark/references/themes/cobalt.md +101 -0
  148. package/sera-core/skills/hallmark/references/themes/console.md +99 -0
  149. package/sera-core/skills/hallmark/references/themes/coral.md +102 -0
  150. package/sera-core/skills/hallmark/references/themes/darkroom.md +99 -0
  151. package/sera-core/skills/hallmark/references/themes/dose.md +98 -0
  152. package/sera-core/skills/hallmark/references/themes/dusk.md +105 -0
  153. package/sera-core/skills/hallmark/references/themes/editorial.md +97 -0
  154. package/sera-core/skills/hallmark/references/themes/formwork.md +107 -0
  155. package/sera-core/skills/hallmark/references/themes/furrow.md +98 -0
  156. package/sera-core/skills/hallmark/references/themes/garden.md +97 -0
  157. package/sera-core/skills/hallmark/references/themes/grid.md +101 -0
  158. package/sera-core/skills/hallmark/references/themes/halftone.md +106 -0
  159. package/sera-core/skills/hallmark/references/themes/hedgerow.md +104 -0
  160. package/sera-core/skills/hallmark/references/themes/hum.md +99 -0
  161. package/sera-core/skills/hallmark/references/themes/ink.md +106 -0
  162. package/sera-core/skills/hallmark/references/themes/kiln.md +108 -0
  163. package/sera-core/skills/hallmark/references/themes/loom.md +106 -0
  164. package/sera-core/skills/hallmark/references/themes/lumen.md +103 -0
  165. package/sera-core/skills/hallmark/references/themes/manifesto.md +101 -0
  166. package/sera-core/skills/hallmark/references/themes/midnight.md +97 -0
  167. package/sera-core/skills/hallmark/references/themes/newsprint.md +102 -0
  168. package/sera-core/skills/hallmark/references/themes/overprint.md +101 -0
  169. package/sera-core/skills/hallmark/references/themes/pasteup.md +100 -0
  170. package/sera-core/skills/hallmark/references/themes/piste.md +99 -0
  171. package/sera-core/skills/hallmark/references/themes/refract.md +101 -0
  172. package/sera-core/skills/hallmark/references/themes/ribbon.md +106 -0
  173. package/sera-core/skills/hallmark/references/themes/rim.md +96 -0
  174. package/sera-core/skills/hallmark/references/themes/riso.md +98 -0
  175. package/sera-core/skills/hallmark/references/themes/solstice.md +104 -0
  176. package/sera-core/skills/hallmark/references/themes/specimen.md +100 -0
  177. package/sera-core/skills/hallmark/references/themes/spore.md +104 -0
  178. package/sera-core/skills/hallmark/references/themes/sport.md +101 -0
  179. package/sera-core/skills/hallmark/references/themes/squeeze.md +99 -0
  180. package/sera-core/skills/hallmark/references/themes/sticker.md +106 -0
  181. package/sera-core/skills/hallmark/references/themes/studio.md +99 -0
  182. package/sera-core/skills/hallmark/references/themes/terminal.md +96 -0
  183. package/sera-core/skills/hallmark/references/themes/terrazzo.md +106 -0
  184. package/sera-core/skills/hallmark/references/themes/ultraviolet.md +106 -0
  185. package/sera-core/skills/hallmark/references/themes/vantage.md +99 -0
  186. package/sera-core/skills/hallmark/references/themes/vellum.md +105 -0
  187. package/sera-core/skills/hallmark/references/themes/wayfind.md +105 -0
  188. package/sera-core/skills/hallmark/references/themes/werkstatt.md +105 -0
  189. package/sera-core/skills/hallmark/scripts/capture.mjs +132 -0
  190. package/sera-core/skills/hallmark/scripts/refcheck.mjs +405 -0
  191. package/sera-core/skills/hallmark/scripts/sloplint-render.mjs +1283 -0
  192. package/sera-core/skills/hallmark/scripts/sloplint.mjs +4426 -0
  193. package/sera-core/skills/hallmark/scripts/theme.mjs +660 -0
  194. package/sera-core/skills/kurum-ici-iletisim/SKILL.md +40 -0
  195. package/sera-core/skills/launch/LICENSE +21 -0
  196. package/sera-core/skills/launch/NOTICE +5 -0
  197. package/sera-core/skills/launch/SKILL.md +385 -0
  198. package/sera-core/skills/launch/references/shipped-changes.md +84 -0
  199. package/sera-core/skills/launch/references/site-launch-qa.md +57 -0
  200. package/sera-core/skills/marka-kimligi/SKILL.md +30 -0
  201. package/sera-core/skills/mcp-yaz/SKILL.md +41 -0
  202. package/sera-core/skills/mobil-arayuz/SKILL.md +12 -0
  203. package/sera-core/skills/mvp-scoping/LICENSE +21 -0
  204. package/sera-core/skills/mvp-scoping/NOTICE +5 -0
  205. package/sera-core/skills/mvp-scoping/SKILL.md +95 -0
  206. package/sera-core/skills/ortak-yazarlik/SKILL.md +32 -0
  207. package/sera-core/skills/oyun-turleri/SKILL.md +176 -0
  208. package/sera-core/skills/paralel-sadelestirme/SKILL.md +33 -0
  209. package/sera-core/skills/phaser-core/LICENSE +201 -0
  210. package/sera-core/skills/phaser-core/NOTICE +5 -0
  211. package/sera-core/skills/phaser-core/NOTICE-UPSTREAM +15 -0
  212. package/sera-core/skills/phaser-core/SKILL.md +245 -0
  213. package/sera-core/skills/phaser-core/references/scene-flow.md +177 -0
  214. package/sera-core/skills/pitch-deck/LICENSE +21 -0
  215. package/sera-core/skills/pitch-deck/NOTICE +5 -0
  216. package/sera-core/skills/pitch-deck/SKILL.md +103 -0
  217. package/sera-core/skills/sera-3d-oyun/NOTICE +1 -0
  218. package/sera-core/skills/sera-3d-oyun/SKILL.md +12 -0
  219. package/sera-core/skills/sera-3d-oyun/sera-3d.js +3697 -0
  220. package/sera-core/skills/sera-diyagram/SKILL.md +43 -0
  221. package/sera-core/skills/sera-ofis-dosya/SKILL.md +3 -0
  222. package/sera-core/skills/sera-ofis-dosya/referanslar/ofis-ileri.md +46 -0
  223. package/sera-core/skills/sera-ui-site/NOTICE +1 -0
  224. package/sera-core/skills/sera-ui-site/SKILL.md +10 -0
  225. package/sera-core/skills/sera-ui-site/sera-ui.js +83 -0
  226. package/sera-core/skills/sera-veri-gorsel/SKILL.md +3 -0
  227. package/sera-core/skills/sera-veri-gorsel/referanslar/palet-dogrula.mjs +80 -0
  228. package/sera-core/skills/sistem-tarama/SKILL.md +49 -0
  229. package/sera-core/skills/sistem-tarama/referanslar/komutlar.md +78 -0
  230. package/sera-core/skills/tasarim-stilleri/SKILL.md +113 -0
  231. package/sera-core/skills/teardown/LICENSE +22 -0
  232. package/sera-core/skills/teardown/NOTICE +3 -0
  233. package/sera-core/skills/teardown/SKILL.md +144 -0
  234. package/sera-core/skills/teardown/package-lock.json +545 -0
  235. package/sera-core/skills/teardown/package.json +18 -0
  236. package/sera-core/skills/teardown/paths.mjs +30 -0
  237. package/sera-core/skills/teardown/run_sfx.py +10 -0
  238. package/sera-core/skills/teardown/sfx/__init__.py +10 -0
  239. package/sera-core/skills/teardown/sfx/__main__.py +64 -0
  240. package/sera-core/skills/teardown/sfx/dsp.py +453 -0
  241. package/sera-core/skills/teardown/sfx/loudness.py +72 -0
  242. package/sera-core/skills/teardown/sfx/mix.py +111 -0
  243. package/sera-core/skills/teardown/sfx/samples/SOURCES.md +23 -0
  244. package/sera-core/skills/teardown/sfx/samples/fs-258269-mouth-pop.ogg +0 -0
  245. package/sera-core/skills/teardown/sfx/samples/fs-323432-typing.ogg +0 -0
  246. package/sera-core/skills/teardown/sfx/samples/fs-329533-room-tone-in-an-apartment-livi.ogg +0 -0
  247. package/sera-core/skills/teardown/sfx/samples/fs-329569-roomtone-bedroom-yew.ogg +0 -0
  248. package/sera-core/skills/teardown/sfx/samples/fs-339521-vhs-rewind-forward-and-eject.ogg +0 -0
  249. package/sera-core/skills/teardown/sfx/samples/fs-349504-triangle-open-04.ogg +0 -0
  250. package/sera-core/skills/teardown/sfx/samples/fs-416777-digital-typing-wav.ogg +0 -0
  251. package/sera-core/skills/teardown/sfx/samples/fs-426767-apartment-room-tone-wav.ogg +0 -0
  252. package/sera-core/skills/teardown/sfx/samples/fs-447909-keyboard-typing.ogg +0 -0
  253. package/sera-core/skills/teardown/sfx/samples/fs-447910-plop.ogg +0 -0
  254. package/sera-core/skills/teardown/sfx/samples/fs-79388-keyboard-typing-wav.ogg +0 -0
  255. package/sera-core/skills/teardown/sfx/samples/fs-824189-pop-in-sfx.ogg +0 -0
  256. package/sera-core/skills/teardown/sfx/score_kit.py +206 -0
  257. package/sera-core/skills/teardown/sfx/synth.py +294 -0
  258. package/sera-core/skills/teardown/sheet.mjs +127 -0
  259. package/sera-core/skills/teardown/sims/beats.py +212 -0
  260. package/sera-core/skills/teardown/sims/build.mjs +141 -0
  261. package/sera-core/skills/teardown/sims/capture.mjs +211 -0
  262. package/sera-core/skills/teardown/sims/cessna-film/main.js +4 -0
  263. package/sera-core/skills/teardown/sims/cessna-film/timeline.json +1 -0
  264. package/sera-core/skills/teardown/sims/cessna-live/main.js +5 -0
  265. package/sera-core/skills/teardown/sims/cessna-shared/console.js +288 -0
  266. package/sera-core/skills/teardown/sims/cessna-shared/film.js +254 -0
  267. package/sera-core/skills/teardown/sims/cessna-shared/flight.js +53 -0
  268. package/sera-core/skills/teardown/sims/cessna-shared/gear.js +364 -0
  269. package/sera-core/skills/teardown/sims/cessna-shared/live.js +351 -0
  270. package/sera-core/skills/teardown/sims/cessna-shared/score.py +41 -0
  271. package/sera-core/skills/teardown/sims/cessna-shared/stage.js +248 -0
  272. package/sera-core/skills/teardown/sims/kit/director.js +300 -0
  273. package/sera-core/skills/teardown/sims/kit/hud.js +194 -0
  274. package/sera-core/skills/teardown/sims/kit/runtime.js +168 -0
  275. package/sera-core/skills/teardown/sims/kit/stage3d.js +114 -0
  276. package/sera-core/skills/teardown/sims/kit/style.css +137 -0
  277. package/sera-core/skills/teardown/sims/kit/util.js +79 -0
  278. package/sera-core/skills/teardown/sims/kit/warm.js +66 -0
  279. package/sera-core/skills/teardown/sims/strandbeest-film/main.js +4 -0
  280. package/sera-core/skills/teardown/sims/strandbeest-film/timeline.json +1 -0
  281. package/sera-core/skills/teardown/sims/strandbeest-live/main.js +5 -0
  282. package/sera-core/skills/teardown/sims/strandbeest-shared/beast.js +419 -0
  283. package/sera-core/skills/teardown/sims/strandbeest-shared/console.js +375 -0
  284. package/sera-core/skills/teardown/sims/strandbeest-shared/film.js +352 -0
  285. package/sera-core/skills/teardown/sims/strandbeest-shared/jansen.js +67 -0
  286. package/sera-core/skills/teardown/sims/strandbeest-shared/live.js +420 -0
  287. package/sera-core/skills/teardown/sims/strandbeest-shared/score.py +85 -0
  288. package/sera-core/skills/teardown/sims/strandbeest-shared/stage.js +463 -0
  289. package/sera-core/skills/teardown/sims/v8-film/main.js +4 -0
  290. package/sera-core/skills/teardown/sims/v8-film/timeline.json +1 -0
  291. package/sera-core/skills/teardown/sims/v8-live/main.js +5 -0
  292. package/sera-core/skills/teardown/sims/v8-shared/console.js +339 -0
  293. package/sera-core/skills/teardown/sims/v8-shared/engine.js +624 -0
  294. package/sera-core/skills/teardown/sims/v8-shared/film.js +239 -0
  295. package/sera-core/skills/teardown/sims/v8-shared/kin.js +86 -0
  296. package/sera-core/skills/teardown/sims/v8-shared/live.js +374 -0
  297. package/sera-core/skills/teardown/sims/v8-shared/score.py +60 -0
  298. package/sera-core/skills/teardown/sims/v8-shared/stage.js +173 -0
  299. package/sera-core/skills/teardown/wave.mjs +67 -0
  300. package/sera-core/skills/toplu-degisiklik/SKILL.md +39 -0
  301. package/sera-core/skills/ui-ux-pro-max/LICENSE +21 -0
  302. package/sera-core/skills/ui-ux-pro-max/NOTICE +5 -0
  303. package/sera-core/skills/ui-ux-pro-max/SKILL.md +13 -0
  304. package/sera-core/skills/ui-ux-pro-max/references/pro-rules.md +117 -0
  305. package/sera-core/skills/ui-ux-pro-max/references/quick-reference.md +266 -0
  306. package/sera-core/skills/unslop/LICENSE.md +410 -0
  307. package/sera-core/skills/unslop/SKILL.md +217 -0
  308. package/sera-core/skills/unslop/references/effects.md +113 -0
  309. package/sera-core/skills/unslop/references/refs/unslop-dashboard-after.webp +0 -0
  310. package/sera-core/skills/unslop/references/refs/unslop-hero-after.webp +0 -0
  311. package/sera-core/skills/unslop/references/refs.md +16 -0
  312. package/sera-core/skills/unslop/references/rtl.md +72 -0
  313. package/sera-core/skills/unslop/references/signs.md +125 -0
  314. package/sera-core/skills/unslop/references/tokens.md +137 -0
  315. package/sera-core/skills/unslop/references/visuals.md +84 -0
  316. package/sera-core/skills/unslop/scripts/snapshot.mjs +197 -0
  317. package/sera-core/skills/uretken-sanat/SKILL.md +42 -0
  318. package/sera-core/skills/verification-before-completion/LICENSE +21 -0
  319. package/sera-core/skills/verification-before-completion/NOTICE +5 -0
  320. package/sera-core/skills/verification-before-completion/SKILL.md +120 -0
  321. package/sera-core/skills/web-yayin-listesi/SKILL.md +3 -0
  322. package/sera-core/src/app-master.ts +2 -2
  323. package/sera-core/src/app-verify.ts +33 -0
  324. package/sera-core/src/extension.ts +16 -2
  325. package/sera-core/src/generated/build-rules.ts +81 -17
  326. package/sera-core/src/generated/quality-probe.ts +2 -0
  327. package/sera-core/src/generated/zero-knowledge.ts +36 -9
  328. package/sera-core/src/image-tool.ts +12 -2
  329. package/sera-core/src/link-data-tools.ts +411 -0
  330. package/sera-core/src/skills.ts +54 -18
  331. package/sera-core/src/video-tool.ts +51 -0
  332. package/sera-core/src/zk.ts +7 -3
@@ -0,0 +1,675 @@
1
+ #!/usr/bin/env node
2
+ // Generated from jury/scripts/shoot.mjs by tests/_gen/build.py; edit there, not here.
3
+ // Visual QA: screenshots a running site the way a visitor experiences it (any framework).
4
+ // node shoot.mjs <url> [--out .shots] [--steps 6] [--nav] [--crawl] [--max 8] [--tabs 12] [--hovers 8] [--no-throttle]
5
+ // Per page: desktop frames (the first screen once it is still, then scroll steps), mobile frames
6
+ // on a throttled mid-range phone (4x CPU, slow 4G), reduced-motion frames, keyboard-focus frames,
7
+ // rest/hover pairs per pointer target, page-transition frames (--nav clicks an internal link), plus
8
+ // report.json with console errors, failed requests, LCP/CLS, FPS, layout metrics, axe-core
9
+ // violations, the tab order, how each hover target reacts, whether anything moves at rest, and
10
+ // when the first screen stopped changing (an intro without a #loader is waited out, up to a cap).
11
+ // The hover pass adds about 3 s per target; --hovers 0 skips the targets (idle check still runs).
12
+ // --crawl shoots one page of every type plus the 404 into <out>/<page>/ and writes summary.json.
13
+ // Read every PNG it writes.
14
+ import crypto from 'node:crypto';
15
+ import fs from 'node:fs';
16
+ import path from 'node:path';
17
+ import { createRequire } from 'node:module';
18
+ import { launch } from './browser.mjs';
19
+
20
+ const args = process.argv.slice(2);
21
+ const valued = ['--out', '--steps', '--max', '--tabs', '--hovers'];
22
+ const url = args.find((a, i) => !a.startsWith('--') && !valued.includes(args[i - 1]));
23
+ if (!url) { console.error('usage: node shoot.mjs <url> [--out dir] [--steps n] [--nav] [--crawl] [--max n] [--tabs n] [--hovers n] [--no-throttle]'); process.exit(1); }
24
+ const opt = (k, d) => { const i = args.indexOf(`--${k}`); return i > -1 ? args[i + 1] : d; };
25
+ const outRoot = path.resolve(opt('out', '.shots'));
26
+ const steps = parseInt(opt('steps', '6'), 10);
27
+ const tabs = parseInt(opt('tabs', '12'), 10);
28
+ const hovers = parseInt(opt('hovers', '8'), 10);
29
+ const nav = args.includes('--nav');
30
+ const crawl = args.includes('--crawl');
31
+ const throttle = !args.includes('--no-throttle');
32
+
33
+ // axe-core from the project, else a pinned CDN copy checked against its hash (the same file as in
34
+ // the npm tarball), so runs are reproducible and a changed file is never run; without either the
35
+ // a11y pass is skipped. To bump: new version, and the sha384 of its axe.min.js.
36
+ const AXE_CDN = { url: 'https://cdn.jsdelivr.net/npm/axe-core@4.14.0/axe.min.js', sha384: 'lFUXB8tI4BaTE1bqxH9eeAXON2NH1qsdAhs7S5L++nUNP5QOy+hwr0C3TYEJUEl0' };
37
+ async function loadAxe() {
38
+ try { return fs.readFileSync(createRequire(path.join(process.cwd(), 'noop.js')).resolve('axe-core/axe.min.js'), 'utf8'); } catch {}
39
+ try {
40
+ const r = await fetch(AXE_CDN.url);
41
+ if (!r.ok) return null;
42
+ const body = Buffer.from(await r.arrayBuffer());
43
+ if (crypto.createHash('sha384').update(body).digest('base64') === AXE_CDN.sha384) return body.toString('utf8');
44
+ console.error(`axe-core from ${AXE_CDN.url} does not match its pinned hash; skipping the a11y pass`);
45
+ } catch {}
46
+ return null;
47
+ }
48
+
49
+ // One representative URL per page type: home, each top-level page, one item per collection
50
+ // (/work/a and /work/b are both "work-item"), plus a missing URL for the 404.
51
+ async function pickPages(start, max) {
52
+ const origin = new URL(start).origin;
53
+ const types = new Map([['home', new URL(start).href]]);
54
+ const queue = [new URL(start).href];
55
+ const seen = new Set(queue);
56
+ for (let fetched = 0; queue.length && fetched < 30 && types.size < max; fetched++) {
57
+ const u = queue.shift();
58
+ let html = '';
59
+ try { const r = await fetch(u); if (!r.ok || !(r.headers.get('content-type') || '').includes('html')) continue; html = await r.text(); } catch { continue; }
60
+ for (const m of html.matchAll(/<a\b[^>]*\shref=["']([^"'#]+)[^"']*["']/gi)) {
61
+ let next;
62
+ try { next = new URL(m[1].replace(/&amp;/g, '&'), u); } catch { continue; }
63
+ next.hash = ''; next.search = '';
64
+ if (next.origin !== origin || seen.has(next.href) || /\.(?!html?$)[a-z0-9]{2,5}$/i.test(next.pathname)) continue;
65
+ seen.add(next.href);
66
+ const segs = next.pathname.split('/').filter(Boolean);
67
+ if (!segs.length) continue;
68
+ const type = segs.length === 1 ? segs[0] : `${segs[0]}-item`;
69
+ if (!types.has(type) && types.size < max) types.set(type, next.href);
70
+ queue.push(next.href);
71
+ }
72
+ }
73
+ types.set('404', new URL(`/__shoot-missing-page-${Date.now()}`, origin).href);
74
+ return [...types].map(([name, href]) => ({ name: name.replace(/[^a-z0-9-]/gi, '_'), url: href }));
75
+ }
76
+
77
+ // Runs before any page script: records LCP (and its element), load-time CLS, and whether the
78
+ // page has a #loader at all (one that removes itself early would otherwise go unseen).
79
+ const vitalsInit = () => {
80
+ window.__vitals = { lcpMs: null, lcpElement: null, cls: 0, hadLoader: false };
81
+ document.addEventListener('DOMContentLoaded', () => { window.__vitals.hadLoader = !!document.getElementById('loader'); });
82
+ const describe = (e) => !e ? null : e.tagName.toLowerCase() + (e.id ? '#' + e.id : '') + (typeof e.className === 'string' && e.className ? '.' + e.className.trim().split(/\s+/)[0] : '');
83
+ try {
84
+ new PerformanceObserver((l) => { for (const e of l.getEntries()) { window.__vitals.lcpMs = Math.round(e.startTime); window.__vitals.lcpElement = describe(e.element) || e.url || null; } }).observe({ type: 'largest-contentful-paint', buffered: true });
85
+ new PerformanceObserver((l) => { for (const e of l.getEntries()) if (!e.hadRecentInput) window.__vitals.cls += e.value; }).observe({ type: 'layout-shift', buffered: true });
86
+ } catch {}
87
+ };
88
+ const vitals = (page) => page.evaluate(() => {
89
+ const { hadLoader, ...v } = window.__vitals;
90
+ return { ...v, cls: Math.round(v.cls * 1000) / 1000 };
91
+ });
92
+ const hadLoader = (page) => page.evaluate(() => !!window.__vitals?.hadLoader || !!document.getElementById('loader'));
93
+
94
+ // Opens a page the way a visitor meets it: as soon as the HTML is parsed, then up to `cap` ms
95
+ // for the load event. A heavy page on the throttled phone can take longer than any timeout to
96
+ // fire load, while visitors already see it. Returns ms from `t0` to load, or null if it never came.
97
+ async function open(page, url, t0, cap = 30000) {
98
+ await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
99
+ return page.waitForLoadState('load', { timeout: cap }).then(() => Date.now() - t0, () => null);
100
+ }
101
+
102
+ // A loader is any #loader element; it is done when removed or hidden.
103
+ const loaderGone = () => { const l = document.getElementById('loader'); if (!l || l.hidden) return true; const cs = getComputedStyle(l); return cs.display === 'none' || cs.visibility === 'hidden' || +cs.opacity === 0; };
104
+
105
+ // Fraction of pixels that differ between two PNG buffers, decoded on a blank `scratch` page (no
106
+ // CSP). `r` limits the comparison to a region of the images (x, y, width, height in image pixels).
107
+ const pxDiff = (scratch, a, b, r = null) => scratch.evaluate(async ([a, b, r]) => {
108
+ const read = async (s) => {
109
+ const img = new Image();
110
+ img.src = `data:image/png;base64,${s}`;
111
+ await img.decode();
112
+ const c = new OffscreenCanvas(img.width, img.height);
113
+ const x = c.getContext('2d');
114
+ x.drawImage(img, 0, 0);
115
+ const { x: rx, y: ry, width: rw, height: rh } = r || { x: 0, y: 0, width: img.width, height: img.height };
116
+ return x.getImageData(rx, ry, Math.max(1, rw), Math.max(1, rh)).data;
117
+ };
118
+ const [A, B] = await Promise.all([read(a), read(b)]);
119
+ if (A.length !== B.length) return 1;
120
+ let n = 0;
121
+ for (let i = 0; i < A.length; i += 4) if (Math.abs(A[i] - B[i]) + Math.abs(A[i + 1] - B[i + 1]) + Math.abs(A[i + 2] - B[i + 2]) > 40) n++;
122
+ return n / (A.length / 4);
123
+ }, [a.toString('base64'), b.toString('base64'), r]);
124
+
125
+ // Waits at least `min` ms, then until the screen stops changing, for at most `max` ms more. Sites
126
+ // without a #loader (most sites not built on the engine) often run an intro that a fixed wait
127
+ // would shoot mid-animation. Small ambient motion (particles, a slow shader) counts as settled.
128
+ // Still means three checks in a row (about 1.2 s) within 1% of the frame that began the run:
129
+ // intros pause between steps, and a single still pair mistook a pause for the end.
130
+ // Returns `settledMs`, the ms from `t0` by which the screen was still (null if it never was), and
131
+ // `changing`, whether it was still changing once `min` had passed.
132
+ async function settle(page, t0, min, max) {
133
+ await page.waitForTimeout(min);
134
+ const scratch = await page.context().newPage();
135
+ try {
136
+ const end = Date.now() + max;
137
+ let base = await page.screenshot();
138
+ let since = Date.now();
139
+ let still = 0;
140
+ let changing = false;
141
+ while (Date.now() < end) {
142
+ await page.waitForTimeout(400);
143
+ const next = await page.screenshot();
144
+ if (await pxDiff(scratch, base, next) < 0.01) {
145
+ if (++still >= 3) return { settledMs: since - t0, changing };
146
+ } else {
147
+ changing = true;
148
+ still = 0;
149
+ base = next;
150
+ since = Date.now();
151
+ }
152
+ }
153
+ return { settledMs: null, changing };
154
+ } finally {
155
+ await scratch.close();
156
+ }
157
+ }
158
+ // Wheel-scroll like a person so smooth-scroll libraries see real input.
159
+ const wheelTo = async (page, y) => {
160
+ for (let i = 0; i < 80; i++) {
161
+ const cur = await page.evaluate(() => scrollY);
162
+ const d = y - cur;
163
+ if (Math.abs(d) < 8) break;
164
+ await page.mouse.wheel(0, Math.max(-900, Math.min(900, d)));
165
+ await page.waitForTimeout(60);
166
+ }
167
+ await page.waitForTimeout(1300); // let reveals finish
168
+ };
169
+ const metrics = (page) => page.evaluate(() => {
170
+ const de = document.documentElement;
171
+ const overflowX = de.scrollWidth > innerWidth + 1;
172
+ const offenders = overflowX
173
+ ? [...document.querySelectorAll('body *')].filter((e) => e.getBoundingClientRect().right > innerWidth + 1).slice(0, 5).map((e) => e.tagName.toLowerCase() + (e.className && typeof e.className === 'string' ? '.' + e.className.split(' ').join('.') : ''))
174
+ : [];
175
+ const h1 = [...document.querySelectorAll('h1')].map((h) => h.innerText.trim().slice(0, 60));
176
+ const small = [...document.querySelectorAll('a, button, [role="button"]')].filter((e) => {
177
+ const r = e.getBoundingClientRect();
178
+ return r.width > 0 && (r.width < 24 || r.height < 24);
179
+ }).slice(0, 8).map((e) => `${(e.innerText || e.getAttribute('aria-label') || e.tagName).trim().slice(0, 24)} ${Math.round(e.getBoundingClientRect().width)}x${Math.round(e.getBoundingClientRect().height)}`);
180
+ // GL planes render on a canvas UNDER the content: an opaque background on the element or any
181
+ // ancestor inside <main> hides the plane completely (shows up as empty boxes).
182
+ const glHidden = de.classList.contains('gl-on') ? [...document.querySelectorAll('[data-gl]')].map((el) => {
183
+ for (let n = el; n && n.tagName !== 'MAIN' && n !== document.body; n = n.parentElement) {
184
+ const cs = getComputedStyle(n);
185
+ const a = cs.backgroundColor.match(/[\d.]+/g);
186
+ const opaque = (a && (a.length < 4 ? true : +a[3] > 0.05) && cs.backgroundColor !== 'rgba(0, 0, 0, 0)') || cs.backgroundImage !== 'none';
187
+ if (opaque) return `${el.tagName.toLowerCase()}${el.className ? '.' + String(el.className).split(' ')[0] : ''} covered by ${n === el ? 'itself' : n.tagName.toLowerCase() + (n.className ? '.' + String(n.className).split(' ')[0] : '')}`;
188
+ }
189
+ return null;
190
+ }).filter(Boolean).slice(0, 6) : [];
191
+ return { height: de.scrollHeight, overflowX, offenders, h1, smallTargets: small, glHidden, title: document.title, glOn: de.classList.contains('gl-on') };
192
+ });
193
+ // Frame rate over `ms`. With `scrollPx`, the page also scrolls that far each frame (touch-like).
194
+ const fps = (page, ms = 2000, scrollPx = 0) => page.evaluate(([ms, scrollPx]) => new Promise((res) => {
195
+ let n = 0; const t0 = performance.now(); let worst = 0; let last = t0;
196
+ const f = (t) => { n++; worst = Math.max(worst, t - last); last = t; if (scrollPx) scrollBy(0, scrollPx); if (t - t0 < ms) requestAnimationFrame(f); else res({ fps: Math.round((n * 1000) / (t - t0)), worstFrameMs: Math.round(worst) }); };
197
+ requestAnimationFrame(f);
198
+ }), [ms, scrollPx]);
199
+
200
+ // axe-core, WCAG 2.1 A/AA. Contrast failures carry the measured colors and ratio;
201
+ // "needsReview" counts text axe could not judge (usually text over images or canvas).
202
+ async function a11y(page, axeSource) {
203
+ if (!axeSource) return { skipped: 'axe-core not found: run npm i -D axe-core in the project' };
204
+ await page.evaluate(axeSource);
205
+ return page.evaluate(async () => {
206
+ const r = await window.axe.run(document, { runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'] }, resultTypes: ['violations', 'incomplete'] });
207
+ const violations = r.violations.map((v) => ({
208
+ id: v.id, impact: v.impact, help: v.help, count: v.nodes.length,
209
+ nodes: v.nodes.slice(0, 4).map((n) => {
210
+ const d = n.any.find((c) => c.data && c.data.contrastRatio)?.data;
211
+ return d ? `${n.target.join(' ')} (${d.fgColor} on ${d.bgColor}, ${d.contrastRatio}:1, needs ${d.expectedContrastRatio})` : n.target.join(' ');
212
+ }),
213
+ }));
214
+ const needsReview = r.incomplete.find((v) => v.id === 'color-contrast')?.nodes.length || 0;
215
+ return { violations, serious: violations.filter((v) => v.impact === 'serious' || v.impact === 'critical').length, contrastNeedsReview: needsReview };
216
+ });
217
+ }
218
+
219
+ // Tab through the page like a keyboard user. Flags focus stops with no visible change in style
220
+ // (heuristic: compares the element, its pseudo-elements and first children focused vs blurred)
221
+ // and focus landing on elements that are invisible or off screen.
222
+ async function keyboard(page, shot) {
223
+ const stops = [];
224
+ const noVisibleFocus = [];
225
+ const invisibleFocus = [];
226
+ let repeats = 0;
227
+ for (let i = 1; i <= tabs; i++) {
228
+ await page.keyboard.press('Tab');
229
+ await page.waitForTimeout(250);
230
+ const stop = await page.evaluate(() => {
231
+ const el = document.activeElement;
232
+ if (!el || el === document.body) return null;
233
+ const style = (e, pseudo) => { const cs = getComputedStyle(e, pseudo); return [cs.outlineStyle, cs.outlineWidth, cs.outlineColor, cs.boxShadow, cs.backgroundColor, cs.color, cs.textDecorationLine, cs.borderColor, cs.opacity, cs.transform, cs.content].join('|'); };
234
+ window.__snap = () => [style(el), style(el, '::before'), style(el, '::after'), ...[...el.children].slice(0, 3).map((c) => style(c))].join('#');
235
+ window.__focused = el;
236
+ let alpha = 1;
237
+ for (let n = el; n; n = n.parentElement) alpha *= parseFloat(getComputedStyle(n).opacity);
238
+ const r = el.getBoundingClientRect();
239
+ return {
240
+ tag: el.tagName.toLowerCase(),
241
+ label: (el.innerText || el.getAttribute('aria-label') || el.getAttribute('title') || el.getAttribute('href') || el.tagName).trim().replace(/\s+/g, ' ').slice(0, 40),
242
+ href: el.getAttribute('href'),
243
+ visible: alpha > 0.1 && r.width > 1 && r.height > 1 && r.bottom > 0 && r.top < innerHeight && r.right > 0 && r.left < innerWidth,
244
+ focused: window.__snap(),
245
+ };
246
+ });
247
+ if (!stop) { stops.push('(body: focus left the page)'); break; }
248
+ if (i <= 4) await shot(page, `k-${String(i).padStart(2, '0')}-focus`);
249
+ const blurred = await page.evaluate(async () => { window.__focused.blur(); await new Promise((r) => setTimeout(r, 300)); const s = window.__snap(); window.__focused.focus({ preventScroll: true }); return s; });
250
+ const name = `${stop.tag} "${stop.label}"`;
251
+ if (stops.length && stops[stops.length - 1] === name) repeats++;
252
+ stops.push(name);
253
+ if (!stop.visible) invisibleFocus.push(name);
254
+ else if (blurred === stop.focused) noVisibleFocus.push(name);
255
+ if (repeats >= 2) break;
256
+ }
257
+ const first = stops[0] || '';
258
+ return {
259
+ stops,
260
+ skipLinkFirst: /skip|#main|#content/i.test(first),
261
+ noVisibleFocus,
262
+ invisibleFocus,
263
+ stuck: repeats >= 2,
264
+ };
265
+ }
266
+
267
+ // Point at things like a mouse user. Picks varied targets (engine-marked ones first, then
268
+ // buttons, then links in content, nav and footer, one per class signature) and moves the pointer
269
+ // onto each, off-center (magnetic pull is zero at the exact center), after checking that the
270
+ // target is really what sits under the pointer. A target reacts if its computed style changes
271
+ // (element, pseudo-elements, descendants, cursor follower) or the pixels around it change by more
272
+ // than the page's own idle motion. Both are needed: a finished letter roll looks identical to
273
+ // rest but its transforms changed, while a shader hover changes pixels but not the target's style.
274
+ // The changed properties tell a color swap from movement: a primary target (a link or button
275
+ // that is not legal, cookie, social or small footer text) whose hover only changes color lands
276
+ // in `colorOnly`, a list to review by eye (a full fill or inversion is a real treatment, a
277
+ // text-color swap is not). When the area already moves at rest (a live shader) and no style
278
+ // changed, pixels can't tell a hover apart: the target is `masked`, judged from its pair. Each
279
+ // target is saved as a clipped pair, h-NN-rest.png and h-NN-hover.png, at the same coordinates.
280
+ // Also records whether anything moves while the pointer is still, at the top and further down.
281
+ const COLOR_PROPS = new Set(['color', 'backgroundColor', 'borderColor', 'textDecorationLine', 'textDecorationColor']);
282
+ async function hover(page, save) {
283
+ const scratch = await page.context().newPage();
284
+ const diff = (a, b, r) => pxDiff(scratch, a, b, r);
285
+
286
+ // Idle: pointer parked mid-left edge (the corners hold UI), cursor follower masked, after
287
+ // intros and the follower have settled. Sampled at the top, then lower down if nothing moved.
288
+ const mask = [page.locator('#cursor')];
289
+ const still = async () => {
290
+ await page.mouse.move(2, 450);
291
+ await page.waitForTimeout(1500);
292
+ const a = await page.screenshot({ mask });
293
+ await page.waitForTimeout(1500);
294
+ return (await diff(a, await page.screenshot({ mask }))) > 0.0005;
295
+ };
296
+ let idleAt = (await still()) ? 'top' : null;
297
+ if (!idleAt) {
298
+ const room = await page.evaluate(() => document.documentElement.scrollHeight - innerHeight);
299
+ for (const f of room > 200 ? [0.35, 0.7] : []) {
300
+ await wheelTo(page, Math.round(room * f));
301
+ if (await still()) { idleAt = `${Math.round(f * 100)}%`; break; }
302
+ }
303
+ if (room > 200) await wheelTo(page, 0);
304
+ }
305
+
306
+ const targets = await page.evaluate((max) => {
307
+ const sel = 'a[href], button, [role="button"], [data-magnetic], [data-cursor], [data-gl]';
308
+ const rank = (e) => (e.matches('[data-cursor], [data-magnetic], [data-gl]') ? 0 : e.matches('button, [role="button"]') ? 1 : e.closest('main') ? 2 : 3);
309
+ // Utility links may answer with color alone: legal, cookie, social, small footer text.
310
+ const utility = (e) => {
311
+ const href = e.getAttribute('href') || '';
312
+ if (/privacy|legal|cookie|terms|imprint|impressum|colophon/i.test(href)) return true;
313
+ if (/\/\/(www\.)?(instagram|twitter|x|linkedin|github|dribbble|behance|vimeo|youtube|tiktok|threads|bsky|mastodon|facebook|read)\.(com|net|app|social|cv)\b/i.test(href)) return true;
314
+ return !!e.closest('footer') && rank(e) > 0 && parseFloat(getComputedStyle(e).fontSize) < 16;
315
+ };
316
+ const control = 'a[href], button, [role="button"]';
317
+ // Visible text with spaces between nodes (innerText needs layout; clones have none).
318
+ const text = (e) => {
319
+ const parts = [];
320
+ const walk = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
321
+ for (let n = walk.nextNode(); n; n = walk.nextNode()) if (!n.parentElement.closest('[aria-hidden="true"]')) parts.push(n.textContent);
322
+ return parts.join(' ').replace(/\s+/g, ' ').replace(/ ([,.;:!?])/g, '$1').trim();
323
+ };
324
+ const media = (e) => e.querySelector('img[alt]')?.getAttribute('alt') || e.querySelector('[role="img"][aria-label]')?.getAttribute('aria-label') || '';
325
+ const seen = new Set();
326
+ const picked = [];
327
+ const all = [...document.querySelectorAll(sel)].filter((e) => {
328
+ if (e.closest('[aria-hidden="true"], [hidden], #cursor, #curtain, #loader')) return false;
329
+ // An image or cursor zone inside a link is tested through that link.
330
+ if (!e.matches(control) && e.parentElement?.closest(control)) return false;
331
+ const r = e.getBoundingClientRect();
332
+ return r.width > 4 && r.height > 4 && getComputedStyle(e).visibility !== 'hidden';
333
+ });
334
+ all.sort((a, b) => rank(a) - rank(b));
335
+ for (const e of all) {
336
+ const sig = `${e.tagName}.${[...e.classList].sort().join('.')}|${e.closest('header, nav, footer, main')?.tagName || ''}`;
337
+ if (seen.has(sig)) continue;
338
+ seen.add(sig);
339
+ e.setAttribute('data-qa-hover', picked.length);
340
+ const interactive = e.matches(control);
341
+ picked.push({
342
+ i: picked.length,
343
+ interactive,
344
+ primary: interactive && !utility(e),
345
+ label: `${e.tagName.toLowerCase()} "${(text(e) || e.getAttribute('aria-label') || media(e) || e.getAttribute('href') || e.tagName).trim().replace(/\s+/g, ' ').slice(0, 40)}"`,
346
+ });
347
+ if (picked.length >= max) break;
348
+ }
349
+ const props = ['color', 'backgroundColor', 'borderColor', 'textDecorationLine', 'textDecorationColor', 'backgroundSize', 'backgroundPosition', 'opacity', 'transform', 'translate', 'scale', 'rotate', 'clipPath', 'filter', 'letterSpacing', 'boxShadow', 'fontVariationSettings'];
350
+ window.__hoverSnap = (e) => {
351
+ const snap = {};
352
+ const add = (key, el, pseudo) => { const cs = getComputedStyle(el, pseudo); for (const p of props) snap[`${key}:${p}`] = cs[p]; };
353
+ add('self', e);
354
+ add('before', e, '::before');
355
+ add('after', e, '::after');
356
+ [...e.querySelectorAll('*')].slice(0, 24).forEach((c, i) => add(`child${i}`, c));
357
+ const cursor = document.getElementById('cursor');
358
+ if (cursor) snap['cursor:follower'] = cursor.className;
359
+ return snap;
360
+ };
361
+ return picked;
362
+ }, hovers);
363
+
364
+ const results = [];
365
+ const covered = [];
366
+ for (const t of targets) {
367
+ const loc = page.locator(`[data-qa-hover="${t.i}"]`);
368
+ await loc.evaluate((e) => e.scrollIntoView({ block: 'center' }));
369
+ await page.waitForTimeout(900);
370
+ const box = await loc.boundingBox();
371
+ if (!box || box.y + box.height < 0 || box.y > 900) continue;
372
+ const at = { x: box.x + box.width * 0.35, y: box.y + box.height * 0.4 };
373
+ const hit = await loc.evaluate((e, { x, y }) => { const h = document.elementFromPoint(x, y); return !!h && (h === e || e.contains(h)); }, at);
374
+ if (!hit) { covered.push(t.label); continue; }
375
+ const away = box.x > 720 ? { x: 2, y: 450 } : { x: 1438, y: 450 };
376
+ await page.mouse.move(away.x, away.y);
377
+ await page.waitForTimeout(600);
378
+ const x = Math.max(0, box.x - 24);
379
+ const y = Math.max(0, box.y - 24);
380
+ const clip = { x, y, width: Math.min(box.x + box.width + 24, 1440) - x, height: Math.min(box.y + box.height + 24, 900) - y };
381
+ const restStyle = await loc.evaluate((e) => window.__hoverSnap(e));
382
+ const rest1 = await page.screenshot({ clip });
383
+ await page.waitForTimeout(700);
384
+ const rest2 = await page.screenshot({ clip });
385
+ await page.mouse.move(at.x, at.y, { steps: 8 });
386
+ await page.waitForTimeout(700);
387
+ const hoverStyle = await loc.evaluate((e) => window.__hoverSnap(e));
388
+ const hovered = await page.screenshot({ clip });
389
+ // Pixels are judged inside the target's own box: the saved pairs keep a margin for context,
390
+ // but a moving neighbour in that margin must not hide a dead link.
391
+ const ox = Math.max(0, Math.round(box.x - x));
392
+ const oy = Math.max(0, Math.round(box.y - y));
393
+ const own = {
394
+ x: ox, y: oy,
395
+ width: Math.max(1, Math.floor(Math.min(box.x + box.width, x + clip.width) - x) - ox),
396
+ height: Math.max(1, Math.floor(Math.min(box.y + box.height, y + clip.height) - y) - oy),
397
+ };
398
+ const noise = await diff(rest1, rest2, own);
399
+ const pixels = await diff(rest2, hovered, own) > Math.max(0.01, noise * 2);
400
+ const changed = [...new Set(Object.keys(restStyle).filter((k) => restStyle[k] !== hoverStyle[k]).map((k) => k.split(':')[1]))];
401
+ const react = changed.length ? (changed.every((p) => COLOR_PROPS.has(p)) ? 'color' : 'moves')
402
+ : pixels ? 'pixels' : noise > 0.05 ? 'masked' : 'none';
403
+ const n = `h-${String(results.length + 1).padStart(2, '0')}`;
404
+ save(`${n}-rest`, rest2);
405
+ save(`${n}-hover`, hovered);
406
+ results.push({ shot: n, label: t.label, interactive: t.interactive, primary: t.primary, react, changed });
407
+ }
408
+ await scratch.close();
409
+ const cursorFollower = await page.evaluate(() => !!document.querySelector('#cursor.is-ready'));
410
+ return {
411
+ targets: results,
412
+ noHoverChange: results.filter((r) => r.interactive && r.react === 'none').map((r) => `${r.shot} ${r.label}`),
413
+ colorOnly: results.filter((r) => r.primary && r.react === 'color').map((r) => `${r.shot} ${r.label}`),
414
+ covered,
415
+ cursorFollower,
416
+ idleMotion: !!idleAt,
417
+ idleAt,
418
+ };
419
+ }
420
+
421
+ async function shootPage(browser, axeSource, url, out) {
422
+ fs.mkdirSync(out, { recursive: true });
423
+ for (const f of fs.readdirSync(out)) if (f.endsWith('.png')) fs.rmSync(path.join(out, f));
424
+ const report = { url, errors: [], failed: [], desktop: {}, mobile: {}, files: [], notes: [] };
425
+ const shot = async (page, name) => {
426
+ const file = path.join(out, `${name}.png`);
427
+ await page.screenshot({ path: file });
428
+ report.files.push(file);
429
+ };
430
+ const save = (name, buf) => {
431
+ const file = path.join(out, `${name}.png`);
432
+ fs.writeFileSync(file, buf);
433
+ report.files.push(file);
434
+ };
435
+ // Shooting a missing URL on purpose (to review the 404 page) is not an error.
436
+ const expect404 = /404|not-?found|nothing|missing/i.test(new URL(url).pathname);
437
+ const watch = (page, tag) => {
438
+ page.on('console', (m) => {
439
+ if (m.type() !== 'error') return;
440
+ if (expect404 && /status of 404/.test(m.text())) return;
441
+ report.errors.push(`[${tag}] ${m.text()}`);
442
+ });
443
+ page.on('pageerror', (e) => report.errors.push(`[${tag}] pageerror: ${e.message}`));
444
+ page.on('requestfailed', (r) => report.failed.push(`[${tag}] ${r.url()} ${r.failure()?.errorText}`));
445
+ page.on('response', (r) => {
446
+ if (r.status() < 400) return;
447
+ if (expect404 && r.status() === 404 && r.request().resourceType() === 'document') return;
448
+ report.failed.push(`[${tag}] ${r.status()} ${r.url()}`);
449
+ });
450
+ };
451
+
452
+ // Desktop
453
+ let introMs = 0; // from the page being ready (loaded, loader gone) to the hero frame
454
+ {
455
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
456
+ await ctx.addInitScript(vitalsInit);
457
+ const page = await ctx.newPage();
458
+ watch(page, 'desktop');
459
+ const t0 = Date.now();
460
+ report.desktop.loadMs = await open(page, url, t0);
461
+ const loader = await hadLoader(page);
462
+ await page.waitForTimeout(400);
463
+ await shot(page, 'd-00-firstpaint');
464
+ await page.waitForFunction(loaderGone, null, { timeout: 8000 }).catch(() => report.errors.push('[desktop] loader still present after 8s'));
465
+ const ready = Date.now();
466
+ report.desktop.loaderMs = loader ? ready - t0 : null;
467
+ report.desktop.settledMs = (await settle(page, t0, 1600, 8000)).settledMs;
468
+ introMs = Date.now() - ready;
469
+ await shot(page, 'd-01-hero');
470
+ report.desktop.vitals = await vitals(page);
471
+ await page.mouse.move(720, 450);
472
+ const m = await metrics(page);
473
+ report.desktop = { ...report.desktop, ...m };
474
+ const max = m.height - 900;
475
+ for (let i = 1; i <= steps; i++) {
476
+ await wheelTo(page, Math.round((max * i) / steps));
477
+ await shot(page, `d-${String(i + 1).padStart(2, '0')}-scroll`);
478
+ }
479
+ // FPS while scrolling back up through the page
480
+ const fpsP = fps(page, 2500);
481
+ for (let i = 0; i < 12; i++) { await page.mouse.wheel(0, -500); await page.waitForTimeout(120); }
482
+ report.desktop.scrollFps = await fpsP;
483
+ if (nav) {
484
+ await wheelTo(page, 0);
485
+ // Up to four links to other pages on this site, relative or absolute. Some can't be
486
+ // clicked (inside a carousel, an off-canvas menu), so each gets a short try.
487
+ const links = await page.evaluate(() => {
488
+ const out = [];
489
+ for (const a of document.querySelectorAll('a[href]')) {
490
+ const u = new URL(a.href, location.href);
491
+ if (u.origin !== location.origin || u.pathname === location.pathname || a.target === '_blank' || a.hasAttribute('download')) continue;
492
+ if (/\.(?!html?$)[a-z0-9]{2,5}$/i.test(u.pathname) || out.some((l) => l.path === u.pathname)) continue;
493
+ a.setAttribute('data-qa-nav', out.length);
494
+ out.push({ i: out.length, path: u.pathname });
495
+ if (out.length >= 4) break;
496
+ }
497
+ return out;
498
+ });
499
+ let href = null;
500
+ for (const l of links) {
501
+ const link = page.locator(`[data-qa-nav="${l.i}"]`);
502
+ try {
503
+ await link.scrollIntoViewIfNeeded({ timeout: 3000 });
504
+ await page.waitForTimeout(800);
505
+ await link.click({ timeout: 3000 });
506
+ href = l.path;
507
+ break;
508
+ } catch {}
509
+ }
510
+ if (!href) report.notes.push(`--nav: no link to another page could be clicked (tried ${links.map((l) => l.path).join(', ') || 'none found'})`);
511
+ if (href) {
512
+ await page.waitForTimeout(300);
513
+ await shot(page, 'd-90-transition-a');
514
+ await page.waitForTimeout(400);
515
+ await shot(page, 'd-90-transition-b');
516
+ await page.waitForTimeout(500);
517
+ await shot(page, 'd-90-transition-c');
518
+ await page.waitForURL((u) => u.pathname.startsWith(href.replace(/\/$/, '')), { timeout: 8000 }).catch(() => report.errors.push(`[nav] did not reach ${href}`));
519
+ await page.waitForTimeout(2200);
520
+ await shot(page, 'd-91-after-nav');
521
+ report.desktop.nav = { href, scrollYAfter: await page.evaluate(() => scrollY), title: await page.title() };
522
+ await page.goBack({ timeout: 10000 }).catch(() => report.notes.push('--nav: going back did not finish loading within 10 s'));
523
+ await page.waitForTimeout(2500);
524
+ await shot(page, 'd-92-back');
525
+ }
526
+ }
527
+ await ctx.close();
528
+ }
529
+
530
+ // Fresh desktop loads below wait as long as the desktop pass did between the page being ready
531
+ // and the hero frame, so their frames don't land mid-intro either. With a #loader, its end
532
+ // already marks the intro's end, and the fixed wait covers the hero's entrance.
533
+ const introWait = (fixed) => (report.desktop.loaderMs != null ? fixed : Math.max(fixed, introMs));
534
+
535
+ // Keyboard: a fresh load, then Tab from the top of the page.
536
+ {
537
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
538
+ const page = await ctx.newPage();
539
+ watch(page, 'keyboard');
540
+ await open(page, url, Date.now());
541
+ await page.waitForFunction(loaderGone, null, { timeout: 8000 }).catch(() => {});
542
+ await page.waitForTimeout(introWait(1600));
543
+ report.keyboard = await keyboard(page, shot);
544
+ await ctx.close();
545
+ }
546
+
547
+ // Hover: a fresh load, the pointer still for a moment, then onto each target.
548
+ {
549
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
550
+ const page = await ctx.newPage();
551
+ watch(page, 'hover');
552
+ await open(page, url, Date.now());
553
+ await page.waitForFunction(loaderGone, null, { timeout: 8000 }).catch(() => {});
554
+ await page.waitForTimeout(introWait(2200));
555
+ const { idleMotion, idleAt, ...h } = await hover(page, save);
556
+ report.desktop.idleMotion = idleMotion;
557
+ report.desktop.idleAt = idleAt;
558
+ report.hover = h;
559
+ await ctx.close();
560
+ }
561
+
562
+ // Mobile, on a mid-range phone: 4x CPU slowdown and slow 4G, like Lighthouse's mobile run.
563
+ {
564
+ const ctx = await browser.newContext({ viewport: { width: 390, height: 844 }, deviceScaleFactor: 2, isMobile: true, hasTouch: true });
565
+ await ctx.addInitScript(vitalsInit);
566
+ const page = await ctx.newPage();
567
+ watch(page, 'mobile');
568
+ if (throttle) {
569
+ const cdp = await ctx.newCDPSession(page);
570
+ await cdp.send('Emulation.setCPUThrottlingRate', { rate: 4 });
571
+ await cdp.send('Network.enable');
572
+ await cdp.send('Network.emulateNetworkConditions', { offline: false, latency: 150, downloadThroughput: (1.6 * 1024 * 1024) / 8, uploadThroughput: (750 * 1024) / 8 });
573
+ }
574
+ const t0 = Date.now();
575
+ const loadMs = await open(page, url, t0, 60000);
576
+ const loader = await hadLoader(page);
577
+ await page.waitForFunction(loaderGone, null, { timeout: 20000 }).catch(() => report.errors.push('[mobile] loader still present after 20s'));
578
+ const loaderMs = loader ? Date.now() - t0 : null;
579
+ const { settledMs } = await settle(page, t0, 1800, 8000);
580
+ await shot(page, 'm-01-hero');
581
+ const v = await vitals(page);
582
+ report.mobile = { throttled: throttle, loadMs, loaderMs, settledMs, vitals: v, ...(await metrics(page)) };
583
+ report.mobile.scrollFps = await fps(page, 2500, 6);
584
+ await page.evaluate(() => scrollTo(0, 0));
585
+ const max = report.mobile.height - 844;
586
+ for (let i = 1; i <= Math.min(steps, 5); i++) {
587
+ await page.evaluate((y) => scrollTo(0, y), Math.round((max * i) / Math.min(steps, 5)));
588
+ await page.waitForTimeout(1500);
589
+ await shot(page, `m-${String(i + 1).padStart(2, '0')}-scroll`);
590
+ }
591
+ await ctx.close();
592
+ }
593
+
594
+ // Reduced motion: content must be fully visible with no animation. Also the axe pass, since
595
+ // every text is in its final state here.
596
+ {
597
+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 }, reducedMotion: 'reduce' });
598
+ const page = await ctx.newPage();
599
+ watch(page, 'reduced');
600
+ const t0 = Date.now();
601
+ await open(page, url, Date.now());
602
+ // `moving`: the screen was still changing 1.5 s after load, with reduced motion requested.
603
+ const { changing: moving } = await settle(page, t0, 1500, 4000);
604
+ await shot(page, 'r-01-hero');
605
+ report.reduced = await page.evaluate(() => ({
606
+ hiddenText: [...document.querySelectorAll('h1,h2,h3,p,a')].filter((e) => {
607
+ const cs = getComputedStyle(e);
608
+ return e.getBoundingClientRect().height > 0 && (cs.visibility === 'hidden' || parseFloat(cs.opacity) < 0.05);
609
+ }).length,
610
+ }));
611
+ report.reduced.moving = moving;
612
+ report.a11y = await a11y(page, axeSource).catch((e) => ({ skipped: `axe failed: ${e.message}` }));
613
+ await page.evaluate(() => scrollTo(0, document.documentElement.scrollHeight / 2));
614
+ await page.waitForTimeout(600);
615
+ await shot(page, 'r-02-mid');
616
+ await ctx.close();
617
+ }
618
+
619
+ report.notes.push('desktop FPS runs headless on a software GPU: treat it as a floor, not a measurement of real hardware');
620
+ if (throttle) report.notes.push('mobile runs at 4x CPU slowdown on slow 4G: mobile.vitals and mobile.scrollFps are the numbers that count');
621
+ report.notes.push('loadMs: ms from navigation to the load event, null if it had not fired after 30 s (desktop) or 60 s (phone); a heavy page takes long, while visitors see content at vitals.lcpMs. loaderMs: ms until the #loader ended, null when the page has none');
622
+ report.notes.push('settledMs: ms from navigation by which the first screen stopped changing, never before the fixed wait. null: still changing at the cap, either a long intro or continuous motion (a live shader, video); d-01-hero / m-01-hero tell which. reduced.moving: the screen was still changing 1.5 s after load with reduced motion on');
623
+ fs.writeFileSync(path.join(out, 'report.json'), JSON.stringify(report, null, 2));
624
+ return report;
625
+ }
626
+
627
+ // The numbers to act on, one line per page.
628
+ const brief = (name, r) => ({
629
+ page: name,
630
+ url: r.url,
631
+ errors: r.errors.length + r.failed.length,
632
+ overflow: !!(r.desktop.overflowX || r.mobile.overflowX),
633
+ smallTargets: r.mobile.smallTargets?.length || 0,
634
+ hiddenTextReduced: r.reduced?.hiddenText ?? null,
635
+ movingReduced: r.reduced?.moving ?? null,
636
+ heroSettledMs: r.desktop.settledMs ?? null,
637
+ mobileLcpMs: r.mobile.vitals?.lcpMs ?? null,
638
+ mobileCls: r.mobile.vitals?.cls ?? null,
639
+ desktopFps: r.desktop.scrollFps?.fps ?? null,
640
+ mobileFps: r.mobile.scrollFps?.fps ?? null,
641
+ axeSerious: r.a11y?.serious ?? null,
642
+ axeViolations: r.a11y?.violations?.map((v) => `${v.id} x${v.count}`) ?? r.a11y?.skipped,
643
+ skipLinkFirst: r.keyboard?.skipLinkFirst ?? null,
644
+ noVisibleFocus: r.keyboard?.noVisibleFocus?.length ?? null,
645
+ invisibleFocus: r.keyboard?.invisibleFocus?.length ?? null,
646
+ noHoverChange: r.hover?.noHoverChange?.length ?? null,
647
+ colorOnly: r.hover?.colorOnly?.length ?? null,
648
+ idleMotion: r.desktop.idleMotion ?? null,
649
+ });
650
+
651
+ const browser = await launch();
652
+ const axeSource = await loadAxe();
653
+ if (crawl) {
654
+ const targets = await pickPages(url, parseInt(opt('max', '8'), 10));
655
+ const summary = [];
656
+ for (const t of targets) {
657
+ console.error(`shooting ${t.name}: ${t.url}`);
658
+ // One page the browser can't get through must not cost the rest of the crawl.
659
+ try {
660
+ summary.push(brief(t.name, await shootPage(browser, axeSource, t.url, path.join(outRoot, t.name))));
661
+ } catch (e) {
662
+ const why = e.message.split('\n')[0];
663
+ console.error(` failed: ${why}`);
664
+ summary.push({ page: t.name, url: t.url, shootFailed: why });
665
+ for (const c of browser.contexts()) await c.close().catch(() => {});
666
+ }
667
+ }
668
+ fs.writeFileSync(path.join(outRoot, 'summary.json'), JSON.stringify(summary, null, 2));
669
+ console.log(JSON.stringify(summary, null, 2));
670
+ console.log(`\n${targets.length} pages shot into ${outRoot}/<page>/ (report.json in each). Read every PNG.`);
671
+ } else {
672
+ const report = await shootPage(browser, axeSource, url, outRoot);
673
+ console.log(JSON.stringify({ ...report, files: `${report.files.length} screenshots in ${outRoot}` }, null, 2));
674
+ }
675
+ await browser.close();