sera-code 0.1.2 → 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 (333) hide show
  1. package/README.md +9 -1
  2. package/bin/sera.mjs +31 -0
  3. package/dist/bundle/chunks/{chunk-LOMPDCMP.js → chunk-DFRGGJWV.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-AZC5WTED.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-Z2V3PTLI.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/auto-memory.ts +249 -0
  325. package/sera-core/src/extension.ts +69 -3
  326. package/sera-core/src/generated/build-rules.ts +81 -17
  327. package/sera-core/src/generated/quality-probe.ts +2 -0
  328. package/sera-core/src/generated/zero-knowledge.ts +36 -9
  329. package/sera-core/src/image-tool.ts +124 -7
  330. package/sera-core/src/link-data-tools.ts +411 -0
  331. package/sera-core/src/skills.ts +54 -18
  332. package/sera-core/src/video-tool.ts +51 -0
  333. package/sera-core/src/zk.ts +7 -3
@@ -0,0 +1,420 @@
1
+ // SB-10 as a page you drive: the film's console (console.js) over the stage (stage.js), run in real time. The view
2
+ // buttons and keys 1-5, ISOLATE LEG (I), TRACE FEET (T), PAUSE (space), the wind slider, an orbit you drag and a zoom
3
+ // on the wheel. Left alone it plays the film's script as an auto tour with the operator's cursor, looped; a click,
4
+ // drag, wheel or key hands control to the visitor, and 25 s of quiet hands it back. Wind drives the crank here too:
5
+ // theta is integrated frame by frame, and the console reads its last seconds from a short history.
6
+ import {warmComposer} from '../kit/warm.js';
7
+ import {legAt, legZ, phaseOf, S} from './beast.js';
8
+ import {createConsole, VIEW_KEYS, WIND_MAX} from './console.js';
9
+ import {DURATION, HERO, isoAt, makeConsoleFrame, makeCursor, rpsAt, scriptView, VIEW_FN, windAt} from './film.js';
10
+ import {footLift} from './jansen.js';
11
+ import {createBeestStage} from './stage.js';
12
+
13
+ const W = 1600;
14
+ const H = 900;
15
+ const IDLE = 25;
16
+ const D2R = Math.PI / 180;
17
+ const clamp = (x, a, b) => Math.min(b, Math.max(a, x));
18
+ const smoother = (x) => {
19
+ const u = clamp(x, 0, 1);
20
+ return u * u * u * (u * (u * 6 - 15) + 10);
21
+ };
22
+ const ss = (a, b, t) => smoother((t - a) / (b - a));
23
+ const wrapDeg = (d) => ((((d + 180) % 360) + 360) % 360) - 180;
24
+
25
+ const CSS = (top) => `
26
+ html,body{background:#e9e2d6;overflow:hidden}
27
+ #app{position:absolute!important;inset:auto!important;left:0;top:0;width:${W}px;height:${H}px;transform-origin:0 0}
28
+ #gl{touch-action:none;cursor:grab}
29
+ #gl.drag{cursor:grabbing}
30
+ .vb{pointer-events:auto;cursor:pointer}
31
+ .vb:hover{filter:brightness(.94)}
32
+ .windhit{position:absolute;pointer-events:auto;cursor:ew-resize}
33
+ .tourchip{position:absolute;left:800px;top:48px;transform:translateX(-50%);display:flex;align-items:center;gap:7px;height:21px;padding:0 11px;border:1px solid rgba(110,98,78,.55);background:rgba(243,238,227,.92);color:#3a342b;font:700 8.5px Inter,sans-serif;letter-spacing:1.4px;white-space:nowrap;cursor:pointer;pointer-events:auto}
34
+ .tourchip i{display:block;width:6px;height:6px;border-radius:50%;background:#d0592a}
35
+ .tourchip.on i{animation:blink 1.2s steps(2) infinite}
36
+ @keyframes blink{50%{opacity:.15}}
37
+ .turn{position:fixed;left:0;right:0;bottom:18px;text-align:center;font:600 12px/1.4 'JetBrains Mono',monospace;letter-spacing:1px;color:#8a7f6c;text-transform:uppercase;display:none}
38
+ @media (orientation:portrait) and (max-width:820px){.turn{display:block}}
39
+ `;
40
+
41
+ export function runLive() {
42
+ const top = Number(document.body.dataset.top || 0);
43
+ const style = document.createElement('style');
44
+ style.textContent = CSS(top);
45
+ document.head.appendChild(style);
46
+ const app = document.getElementById('app');
47
+ const canvas = document.createElement('canvas');
48
+ canvas.id = 'gl';
49
+ app.appendChild(canvas);
50
+
51
+ const st = createBeestStage({canvas, palette: 'dune', ink: 0.7});
52
+ st.usePrintRing(640);
53
+ const ui = createConsole(app);
54
+ const tourCursorAt = makeCursor(ui);
55
+
56
+ // ------------------------------------------------------------ quality tiers
57
+ // the film's look, then lighter shadows and MSAA, then the outline without AO, PCF shadows and no MSAA; integrated
58
+ // GPUs settle within a couple of seconds, phones start on the last step
59
+ const TIERS = [
60
+ {samples: 8, shadow: 4096, blur: 20, radius: 7, ao: 16, pcf: false, grains: 9000, pr: 2},
61
+ {samples: 4, shadow: 2048, blur: 10, radius: 5, ao: 8, pcf: false, grains: 6000, pr: 1.5},
62
+ {samples: 0, shadow: 1024, blur: 6, radius: 2, ao: 0, pcf: true, grains: 3000, pr: 1.1},
63
+ ];
64
+ const light = matchMedia('(pointer: coarse)').matches || Math.min(innerWidth, innerHeight) < 700;
65
+ let tier = light ? 2 : 0;
66
+ let fitReady = false;
67
+ const applyTier = () => {
68
+ const {pr, ...q} = TIERS[tier];
69
+ st.setQuality(q);
70
+ if (fitReady) fit();
71
+ };
72
+ applyTier();
73
+
74
+ // ------------------------------------------------------------ fit the 1600 x 900 console into the window
75
+ let scale = 1;
76
+ const fit = () => {
77
+ const h = innerHeight - top;
78
+ scale = Math.min(innerWidth / W, h / H);
79
+ app.style.transform = `translate(${(innerWidth - W * scale) / 2}px, ${top + (h - H * scale) / 2}px) scale(${scale})`;
80
+ st.resize(W, H, clamp((devicePixelRatio || 1) * scale, 0.75, TIERS[tier].pr));
81
+ };
82
+ addEventListener('resize', fit);
83
+ fit();
84
+ fitReady = true;
85
+ const toStage = (cx, cy) => {
86
+ const r = app.getBoundingClientRect();
87
+ return [(cx - r.left) / scale, (cy - r.top) / scale];
88
+ };
89
+
90
+ const tourChip = document.createElement('div');
91
+ tourChip.className = 'tourchip';
92
+ ui.root.appendChild(tourChip);
93
+ const turnNote = document.createElement('div');
94
+ turnNote.className = 'turn';
95
+ turnNote.textContent = 'Turn your phone sideways for the full console';
96
+ document.body.appendChild(turnNote);
97
+ // the wind slider's hit area over its track
98
+ const [kx0, ky] = ui.knobAt(0);
99
+ const [kx1] = ui.knobAt(WIND_MAX);
100
+ const windHit = document.createElement('div');
101
+ windHit.className = 'windhit';
102
+ Object.assign(windHit.style, {left: `${kx0 - 12}px`, top: `${ky - 13}px`, width: `${kx1 - kx0 + 24}px`, height: '26px'});
103
+ ui.root.appendChild(windHit);
104
+
105
+ // ------------------------------------------------------------ state
106
+ let T = 0; // wall clock
107
+ let simT = 0; // stops while paused
108
+ let theta = 0;
109
+ let flow = 0;
110
+ let dist = 0;
111
+ let paused = false;
112
+ let wind = 6;
113
+ let windTarget = 6;
114
+ let iso = 0;
115
+ let isoTarget = 0;
116
+ let isoOnAt = Infinity;
117
+ const tr = {on: false, theta0: 0, done: null, fade: 0};
118
+ let view = 'cine';
119
+ let viewAt0 = 0;
120
+ const off = {az: 0, el: 0, k: 1};
121
+ const cam = {...VIEW_FN.cine(0, 0)};
122
+ let ring = {t: -9, x: 0, y: 0};
123
+ // the last 14 s of the crank and the wind, for the console's histories
124
+ const hist = [];
125
+ const histAt = (t, key) => {
126
+ if (!hist.length) return key === 'th' ? theta : wind;
127
+ if (t <= hist[0].t) return key === 'th' ? hist[0].th - rpsAt(hist[0].w) * Math.PI * 2 * (hist[0].t - t) : hist[0].w;
128
+ const last = hist[hist.length - 1];
129
+ if (t >= last.t) return last[key];
130
+ let lo = 0;
131
+ let hi = hist.length - 1;
132
+ while (hi - lo > 1) {
133
+ const m = (lo + hi) >> 1;
134
+ if (hist[m].t <= t) lo = m;
135
+ else hi = m;
136
+ }
137
+ const a = hist[lo];
138
+ const b = hist[hi];
139
+ return a[key] + (b[key] - a[key]) * ((t - a.t) / (b.t - a.t || 1));
140
+ };
141
+ const frameConsole = makeConsoleFrame(ui, st, {thetaAt: (t) => histAt(t, 'th'), windAt: (t) => histAt(t, 'w')});
142
+ const pulse = (key) => {
143
+ const r = ui.btn[key].getBoundingClientRect();
144
+ const [x, y] = toStage(r.left + r.width / 2, r.top + r.height / 2);
145
+ ring = {t: T, x, y};
146
+ };
147
+
148
+ const setView = (v) => {
149
+ if (v === view) return;
150
+ view = v;
151
+ viewAt0 = T;
152
+ };
153
+ const setIso = (on) => {
154
+ isoTarget = on ? 1 : 0;
155
+ if (on) {
156
+ isoOnAt = simT;
157
+ setView('leg');
158
+ } else if (view === 'leg') setView('front');
159
+ };
160
+ const setTrace = (on) => {
161
+ if (on === tr.on) return;
162
+ tr.on = on;
163
+ if (on) Object.assign(tr, {theta0: theta, done: null});
164
+ };
165
+ const setPaused = (p) => {
166
+ paused = p;
167
+ ui.btn.pause.textContent = p ? '▶ RESUME' : '❚❚ PAUSE';
168
+ };
169
+
170
+ // ------------------------------------------------------------ the tour: the film's script, looped
171
+ const AP = {on: true, t0: 0, loop: 0, prevIso: 0};
172
+ let lastInput = 0;
173
+ const startTour = () => {
174
+ AP.on = true;
175
+ AP.t0 = T;
176
+ AP.loop = 0;
177
+ AP.prevIso = 0;
178
+ if (paused) setPaused(false);
179
+ setTrace(false);
180
+ Object.assign(off, {az: 0, el: 0, k: 1});
181
+ };
182
+ const takeOver = () => {
183
+ lastInput = T;
184
+ if (!AP.on) return;
185
+ AP.on = false;
186
+ windTarget = wind;
187
+ isoTarget = iso > 0.5 ? 1 : 0;
188
+ };
189
+ tourChip.addEventListener('pointerdown', (e) => {
190
+ e.stopPropagation();
191
+ lastInput = T;
192
+ if (AP.on) takeOver();
193
+ else startTour();
194
+ });
195
+ addEventListener('pointerdown', takeOver);
196
+ for (const k of VIEW_KEYS)
197
+ ui.btn[k].addEventListener('click', () => {
198
+ takeOver();
199
+ pulse(k);
200
+ if (k !== 'leg' && isoTarget) isoTarget = 0;
201
+ if (k === 'leg') setIso(true);
202
+ else setView(k);
203
+ Object.assign(off, {az: 0, el: 0, k: 1});
204
+ });
205
+ ui.btn.iso.addEventListener('click', () => {
206
+ takeOver();
207
+ pulse('iso');
208
+ setIso(!isoTarget);
209
+ });
210
+ ui.btn.trace.addEventListener('click', () => {
211
+ takeOver();
212
+ pulse('trace');
213
+ setTrace(!tr.on);
214
+ });
215
+ ui.btn.pause.addEventListener('click', () => {
216
+ takeOver();
217
+ pulse('pause');
218
+ setPaused(!paused);
219
+ });
220
+ {
221
+ const onMove = (e) => {
222
+ const [x] = toStage(e.clientX, e.clientY);
223
+ windTarget = clamp(((x - kx0) / (kx1 - kx0)) * WIND_MAX, 0, WIND_MAX);
224
+ lastInput = T;
225
+ };
226
+ windHit.addEventListener('pointerdown', (e) => {
227
+ takeOver();
228
+ windHit.setPointerCapture(e.pointerId);
229
+ const up = () => {
230
+ removeEventListener('pointermove', onMove);
231
+ removeEventListener('pointerup', up);
232
+ };
233
+ addEventListener('pointermove', onMove);
234
+ addEventListener('pointerup', up);
235
+ onMove(e);
236
+ });
237
+ }
238
+ addEventListener('keydown', (e) => {
239
+ if (e.altKey || e.ctrlKey || e.metaKey) return;
240
+ const key = e.key.toLowerCase();
241
+ const v = {1: 'cine', 2: 'leg', 3: 'front', 4: 'side', 5: 'top'}[key];
242
+ if (v) ui.btn[v].click();
243
+ else if (key === 'i') ui.btn.iso.click();
244
+ else if (key === 't') ui.btn.trace.click();
245
+ else if (key === ' ') ui.btn.pause.click();
246
+ else if (key === 'arrowright' || key === 'arrowleft') {
247
+ takeOver();
248
+ windTarget = clamp(windTarget + (key === 'arrowright' ? 1 : -1), 0, WIND_MAX);
249
+ } else return;
250
+ e.preventDefault();
251
+ });
252
+ let drag = null;
253
+ canvas.addEventListener('pointerdown', (e) => {
254
+ drag = {x: e.clientX, y: e.clientY};
255
+ canvas.setPointerCapture(e.pointerId);
256
+ canvas.classList.add('drag');
257
+ });
258
+ canvas.addEventListener('pointermove', (e) => {
259
+ if (!drag) return;
260
+ const dx = (e.clientX - drag.x) / scale;
261
+ const dy = (e.clientY - drag.y) / scale;
262
+ drag = {x: e.clientX, y: e.clientY};
263
+ off.az -= dx * 0.3;
264
+ off.el = clamp(off.el + dy * 0.2, -10, 70);
265
+ lastInput = T;
266
+ });
267
+ const endDrag = () => {
268
+ drag = null;
269
+ canvas.classList.remove('drag');
270
+ };
271
+ canvas.addEventListener('pointerup', endDrag);
272
+ canvas.addEventListener('pointercancel', endDrag);
273
+ canvas.addEventListener(
274
+ 'wheel',
275
+ (e) => {
276
+ e.preventDefault();
277
+ takeOver();
278
+ off.k = clamp(off.k * Math.exp(e.deltaY * 0.0012), 0.45, 2.2);
279
+ },
280
+ {passive: false},
281
+ );
282
+
283
+ // ------------------------------------------------------------ footprints as the feet land
284
+ const wasDown = new Array(20).fill(true);
285
+ const layPrints = (bx) => {
286
+ for (let r = 0; r < 20; r++) {
287
+ const s = r % 10;
288
+ const side = r < 10 ? 0 : 1;
289
+ const ps = theta + phaseOf(s);
290
+ const down = footLift(side ? Math.PI - ps : ps) < 0.5;
291
+ if (down && !wasDown[r]) st.addPrint(bx + legAt(s, side, theta).F[0] * S, legZ(s, side) * S, simT, (((r * 7919) % 100) / 100 - 0.5) * 0.25);
292
+ wasDown[r] = down;
293
+ }
294
+ };
295
+
296
+ // ------------------------------------------------------------ the frame
297
+ startTour();
298
+ let last = performance.now();
299
+ const perf = {n: 0, sum: 0, slow: 0, age: 0};
300
+ let odd = false;
301
+ const frame = (now) => {
302
+ const dt = Math.min(0.1, Math.max(0, (now - last) / 1000));
303
+ last = now;
304
+ T += dt;
305
+ // quality steps down after a 0.5 s window slower than 45 fps (two in a row once the page has settled)
306
+ if (tier < TIERS.length - 1) {
307
+ perf.age += dt;
308
+ if (perf.age > 0.4) {
309
+ perf.sum += dt;
310
+ perf.n++;
311
+ if (perf.sum >= 0.5 && perf.n >= 6) {
312
+ perf.slow = perf.sum / perf.n > 0.022 ? perf.slow + 1 : 0;
313
+ perf.sum = 0;
314
+ perf.n = 0;
315
+ if (perf.slow >= (perf.age < 6 ? 1 : 2)) {
316
+ tier++;
317
+ applyTier();
318
+ Object.assign(perf, {age: 0, slow: 0});
319
+ }
320
+ }
321
+ }
322
+ }
323
+
324
+ // the operator: the tour's script, or the visitor's last choices
325
+ let cyc = 0;
326
+ let since = T - viewAt0;
327
+ let cursor;
328
+ if (AP.on) {
329
+ const c = T - AP.t0;
330
+ const loop = Math.floor(c / DURATION);
331
+ if (loop > AP.loop) {
332
+ AP.loop = loop;
333
+ AP.prevIso = 0;
334
+ }
335
+ cyc = c - loop * DURATION;
336
+ const [t0, v] = scriptView(cyc);
337
+ view = v;
338
+ since = cyc - t0;
339
+ // keep the view's clock running so a takeover continues the move instead of jumping
340
+ viewAt0 = T - since;
341
+ windTarget = windAt(cyc);
342
+ const isoNow = isoAt(cyc);
343
+ if (isoNow > 0.01 && AP.prevIso <= 0.01) isoOnAt = simT;
344
+ AP.prevIso = isoNow;
345
+ isoTarget = isoNow;
346
+ cursor = tourCursorAt(cyc);
347
+ // from the second loop on, the pointer glides from where the last one left it
348
+ if (AP.loop > 0 && cyc < 0.8) {
349
+ const end = tourCursorAt(DURATION - 0.01);
350
+ const k = ss(0, 0.8, cyc);
351
+ cursor = {...cursor, x: end.x + (cursor.x - end.x) * k, y: end.y + (cursor.y - end.y) * k};
352
+ }
353
+ } else {
354
+ if (T - lastInput > IDLE) startTour();
355
+ const rk = Math.max(0, 1 - (T - ring.t) / 0.55);
356
+ cursor = {x: -99, y: -99, press: false, drag: false, ring: rk, ringX: ring.x, ringY: ring.y};
357
+ }
358
+ wind += (windTarget - wind) * (1 - Math.exp(-dt / 0.35));
359
+ iso += (isoTarget - iso) * (1 - Math.exp(-dt / 0.2));
360
+
361
+ // the crank: wind sets its rate, a dead calm lets it coast to a stop
362
+ if (!paused) {
363
+ simT += dt;
364
+ const rps = rpsAt(wind) * ss(0.3, 1.5, wind);
365
+ const th0 = theta;
366
+ theta += rps * Math.PI * 2 * dt;
367
+ flow += wind * dt * 0.35;
368
+ dist += Math.abs(st.bodyPos(theta).x - st.bodyPos(th0).x);
369
+ }
370
+ if (!paused || !hist.length) hist.push({t: simT, th: theta, w: wind});
371
+ while (hist.length > 2 && hist[0].t < simT - 14) hist.shift();
372
+ const b = st.bodyPos(theta);
373
+ if (!paused) layPrints(b.x);
374
+
375
+ // the foot traces: the hero's loop draws itself from the click, the rest fade in when it closes
376
+ let heroTrace = 0;
377
+ let trace = 0;
378
+ tr.fade += ((tr.on ? 1 : 0) - tr.fade) * (1 - Math.exp(-dt / 0.25));
379
+ if (tr.on || tr.fade > 0.01) {
380
+ heroTrace = Math.min(1, (theta - tr.theta0) / (Math.PI * 2));
381
+ if (heroTrace >= 1 && tr.done === null) tr.done = simT;
382
+ trace = tr.done === null ? 0 : ss(tr.done, tr.done + 0.9, simT);
383
+ }
384
+
385
+ // the camera eases toward the view's own move plus the visitor's orbit; a wide swing backs off on the way
386
+ const tgt = VIEW_FN[view](since, b.x);
387
+ tgt.az += off.az;
388
+ tgt.el = clamp(tgt.el + off.el, 2, 82);
389
+ tgt.d *= off.k;
390
+ const k = 1 - Math.exp(-dt / 0.55);
391
+ const dAz = wrapDeg(tgt.az - cam.az);
392
+ cam.az += dAz * k;
393
+ for (const key of ['tx', 'ty', 'tz', 'el', 'd', 'sx', 'sy']) cam[key] += (tgt[key] - cam[key]) * k;
394
+ const swing = Math.min(1, Math.abs(dAz) / 90);
395
+ st.frame(theta, simT, {...cam, el: (cam.el + 8 * swing) * D2R, az: cam.az * D2R, d: cam.d + 2.5 * swing}, {wind, flow, iso, hero: HERO, trace, heroTrace, traceFade: tr.on ? 1 : tr.fade});
396
+
397
+ // the console: every frame on a fast GPU, every other frame (the pointer every frame) on a slow one
398
+ odd = !odd;
399
+ if (tier > 0 && odd) ui.pointer(cursor);
400
+ else frameConsole(simT, {view, since, iso, cursor, labelStart: isoOnAt, trace: tr.on ? 1 : 0, dist});
401
+
402
+ if (tourChip.classList.contains('on') !== AP.on || !tourChip.firstChild) {
403
+ tourChip.classList.toggle('on', AP.on);
404
+ tourChip.innerHTML = AP.on ? '<i></i>AUTO TOUR · CLICK TO TAKE OVER' : '▶ RESUME TOUR';
405
+ }
406
+ // the site page swaps its poster for the canvas on this
407
+ if (!window.SIM_SHOWN) {
408
+ window.SIM_SHOWN = true;
409
+ dispatchEvent(new Event('simframe'));
410
+ }
411
+ requestAnimationFrame(frame);
412
+ };
413
+ // every shader compiles at once off the main thread before the first frame (kit/warm.js)
414
+ warmComposer(st.renderer, st.composer, st.scene, st.camera).then(() => requestAnimationFrame(frame));
415
+ window.LIVE = {st, cam, startTour, takeOver, get tier() {
416
+ return tier;
417
+ }, get T() {
418
+ return T;
419
+ }};
420
+ }
@@ -0,0 +1,85 @@
1
+ """Score for the STRANDBEEST SB-10 console film: a warm bed (Fmaj9 chords, 88 bpm) at one level the whole way, wind
2
+ under it that rises when the operator opens the slider, a soft sand thud on every touchdown of leg 01F, a quiet click
3
+ on every button press and a typewriter tick for each of the thirteen letters on the isolated leg.
4
+
5
+ python run_sfx.py sims/strandbeest-shared/score.py
6
+
7
+ Times from strandbeest-shared/film.js (SCRIPT, the label cadence, the wind and crank model, which is mirrored here).
8
+ """
9
+
10
+ import math
11
+ import os
12
+
13
+ from sfx.score_kit import airy, bed, chords, hz, thud
14
+ from sfx.synth import click
15
+
16
+ TIMELINE = "../strandbeest-film/timeline.json"
17
+ OUT = os.path.join(os.environ.get("TEARDOWN_OUT", "teardown-out"), "strandbeest-score.wav")
18
+ TARGET_LUFS = -14.0
19
+ SEED = 11
20
+
21
+ CHORDS = chords("Fmaj9:F2 C3 E3 G3 A3/F1", "Dm9:D2 A2 C3 E3 F3/D1", "Bbmaj7:Bb1 F2 A2 D3/Bb0", "C6sus:C2 F2 G2 A2 D3/C1")
22
+ MOTIF = [(0.5, hz("C5")), (1.5, hz("A4")), (2.5, hz("G4"))]
23
+
24
+ CLICKS = (3.4, 9.6, 13.0, 16.8, 21.0, 25.8)
25
+ LABELS = [3.4 + 0.9 + i * 0.3 for i in range(13)]
26
+ WIND_EV = (13.0, 6.0, 12.5, 1.6)
27
+
28
+
29
+ def smoother(x):
30
+ u = min(1.0, max(0.0, x))
31
+ return u * u * u * (u * (u * 6 - 15) + 10)
32
+
33
+
34
+ def wind_at(t):
35
+ t0, w0, w1, dur = WIND_EV
36
+ return w0 + (w1 - w0) * smoother((t - t0) / dur) + 0.35 * math.sin(t * 0.9) + 0.2 * math.sin(t * 2.3 + 1)
37
+
38
+
39
+ def rps_at(w):
40
+ return 0.42 * (max(0.5, w) / 6) ** 0.75
41
+
42
+
43
+ def theta_table(dur, dt=1 / 240):
44
+ th, out, t = 0.0, [], 0.0
45
+ while t <= dur:
46
+ out.append((t, th))
47
+ th += rps_at(wind_at(t + dt / 2)) * 2 * math.pi * dt
48
+ t += dt
49
+ return out
50
+
51
+
52
+ def touchdowns(dur):
53
+ """Leg 01F lands where its crank angle crosses the start of the flat stretch (290° on Jansen's path)."""
54
+ land = math.radians(290)
55
+ out = []
56
+ prev = None
57
+ for t, th in theta_table(dur):
58
+ k = math.floor((th - land) / (2 * math.pi))
59
+ if prev is not None and k != prev:
60
+ out.append(t)
61
+ prev = k
62
+ return out
63
+
64
+
65
+ def score(mix, tl):
66
+ dur = tl["duration"]
67
+ left, right, low, drums = bed(dur, 88, CHORDS, MOTIF, motif_voice="epiano", kicks=(0, 2.5), snares=(), hats=8, swing=0.0, keys_vel=0.7, keys_lp=3400)
68
+ mix.put_stereo(0, left, right, 0.12)
69
+ mix.put(0, low, 0.13)
70
+ mix.put(0, drums, 0.045)
71
+
72
+ # wind: a low steady breath, a gust swelling up the slider drag, a stronger bed after it
73
+ mix.put(0, airy(WIND_EV[0] + 0.4, 380, 520, 0.5), 0.012)
74
+ mix.put(WIND_EV[0], airy(WIND_EV[3] + 0.8, 500, 1900, 0.6), 0.04)
75
+ mix.put(WIND_EV[0] + WIND_EV[3], airy(dur - WIND_EV[0] - WIND_EV[3], 650, 820, 0.5), 0.02)
76
+
77
+ for t in touchdowns(dur):
78
+ if t < dur - 0.4:
79
+ mix.put(t, thud(105, 0.035, 0.25), 0.05)
80
+ for t in CLICKS:
81
+ mix.put(t, click(2400, 0.025), 0.055)
82
+ for t in LABELS:
83
+ mix.put(t, click(3400, 0.012), 0.03)
84
+ for t in (9.7, 16.9, 21.1, 25.9):
85
+ mix.put(t, airy(1.1, 700, 1600, 0.6), 0.02)