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,288 @@
1
+ // The Skymaster gear console, laid out at 1600 x 900: the orange 337 badge and the title,
2
+ // the mechanism state with its live schematic, the flight panel, the system overview, the sequence switch, the views,
3
+ // the display toggles, the gear operation timeline, floor notes and the labels with leaders into the mechanism.
4
+ // update(s) redraws every live part from the frame's state.
5
+ export const C = {ink: '#2a2521', mute: '#9b8f80', faint: '#d9cdbb', line: '#eadfcd', panel: 'rgba(252,249,244,.95)', or: '#e3562a', green: '#2fa36b', blue: '#3c79a8'};
6
+ export const VIEWS = ['hero', 'front', 'plan', 'top', 'gearbox', 'sidetube'];
7
+ export const VIEW_LABEL = {hero: 'HERO', front: 'FRONT', plan: 'PLAN', top: 'TOP ¾', gearbox: 'GEARBOX', sidetube: 'SIDE TUBE'};
8
+ export const DISPLAY = ['labels', 'section', 'xray', 'exploded', 'fuselage', 'orbit'];
9
+ export const DISPLAY_LABEL = {labels: 'LABELS', section: 'SECTION', xray: 'X-RAY PLATE', exploded: 'EXPLODED', fuselage: 'FUSELAGE', orbit: 'ORBIT'};
10
+ const CSS = `
11
+ #app{font-family:Inter,system-ui,sans-serif;color:${C.ink};-webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums}
12
+ .ui{position:absolute;inset:0;pointer-events:none}
13
+ .mo{font-family:'JetBrains Mono',ui-monospace,monospace}
14
+ .cp{position:absolute;background:${C.panel};border:1px solid ${C.line};border-radius:6px;box-shadow:0 2px 10px rgba(120,90,50,.08)}
15
+ .ph{position:absolute;display:flex;align-items:center;gap:9px;font:700 10.5px 'JetBrains Mono',monospace;letter-spacing:1.8px}
16
+ .ph i{display:block;width:3px;height:13px;background:${C.or}}
17
+ .pn{position:absolute;font:500 9.5px 'JetBrains Mono',monospace;color:${C.mute};letter-spacing:1px}
18
+ .sm{font:500 9px 'JetBrains Mono',monospace;letter-spacing:1.6px;color:${C.mute};text-transform:uppercase;white-space:nowrap}
19
+ .bt{position:absolute;height:21px;padding:0 10px;display:flex;align-items:center;justify-content:center;border:1px solid ${C.faint};border-radius:4px;background:#fffdf9;font:700 9.4px 'JetBrains Mono',monospace;letter-spacing:1.3px;color:${C.ink};white-space:nowrap}
20
+ .call{position:absolute;white-space:nowrap}
21
+ .call b{display:flex;align-items:center;gap:6px;font:700 9.4px 'JetBrains Mono',monospace;letter-spacing:1.3px;color:${C.ink}}
22
+ .call b i{display:block;width:6px;height:6px;background:${C.or}}
23
+ .call span{display:block;font:500 7.8px 'JetBrains Mono',monospace;letter-spacing:1.2px;color:${C.mute};margin-top:2px}
24
+ .cur{position:absolute;left:0;top:0;z-index:50;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3))}
25
+ .ring{position:absolute;width:34px;height:34px;margin:-17px 0 0 -17px;border-radius:50%;border:1.5px solid ${C.or};opacity:0;z-index:49}
26
+ `;
27
+ const el = (h) => {
28
+ const d = document.createElement('div');
29
+ d.innerHTML = h.trim();
30
+ return d.firstElementChild;
31
+ };
32
+
33
+ export function createConsole(app) {
34
+ const style = document.createElement('style');
35
+ style.textContent = CSS;
36
+ document.head.appendChild(style);
37
+ const ui = el(`<div class="ui"></div>`);
38
+ app.appendChild(ui);
39
+ const add = (h) => {
40
+ const n = el(h);
41
+ ui.appendChild(n);
42
+ return n;
43
+ };
44
+ const panel = (x, y, w, h, title, n) => {
45
+ add(`<div class="cp" style="left:${x}px;top:${y}px;width:${w}px;height:${h}px"></div>`);
46
+ add(`<div class="ph" style="left:${x + 14}px;top:${y + 13}px"><i></i>${title}</div>`);
47
+ add(`<div class="pn" style="right:${1600 - x - w + 14}px;top:${y + 15}px">${n}</div>`);
48
+ };
49
+
50
+ // ------------------------------------------------------------ header
51
+ add(`<div style="position:absolute;left:0;top:0;width:160px;height:89px;background:${C.or}"></div>`);
52
+ add(`<svg style="position:absolute;left:26px;top:30px" width="46" height="28"><g fill="#fff"><path d="M6 0h7L7 28H0z"/><path d="M19 0h7l-6 28h-7z"/><path d="M32 0h7l-6 28h-7z"/></g><circle cx="43" cy="25" r="3" fill="#fff"/></svg>`);
53
+ add(`<div class="mo" style="position:absolute;left:85px;top:35px;color:#fff;font-size:16px;font-weight:600;letter-spacing:4px">337</div>`);
54
+ add(`<div class="sm" style="position:absolute;left:182px;top:22px;letter-spacing:2.4px">GENERAL AVIATION</div>`);
55
+ add(`<div style="position:absolute;left:181px;top:37px;font-size:33px;font-weight:700;letter-spacing:-.6px;line-height:1">Cessna 337 Skymaster <span style="color:${C.or};font-weight:400">/</span></div>`);
56
+ add(`<div class="mo" style="position:absolute;left:182px;top:77px;font-size:11.2px;letter-spacing:2.2px;color:#6d6357">MAIN LANDING GEAR / RETRACTION MECHANISM</div>`);
57
+ add(`<div class="sm" style="position:absolute;left:1087px;top:49px;letter-spacing:2.6px;font-size:9.6px">TWIN ENGINE · CENTRELINE THRUST</div>`);
58
+ add(`<div class="mo" style="position:absolute;left:1352px;top:47px;color:${C.or};font-size:12px;letter-spacing:-1px">//////</div>`);
59
+ add(`<div style="position:absolute;left:1418px;top:34px;color:${C.or};font-size:39px;font-weight:700;letter-spacing:-.8px;line-height:1">337</div>`);
60
+ add(`<div style="position:absolute;left:1500px;top:33px;width:1px;height:44px;background:${C.faint}"></div>`);
61
+ add(`<div class="sm" style="position:absolute;left:1516px;top:34px;line-height:14px;letter-spacing:2.2px">PUSH<br>PULL<br>PERFORM</div>`);
62
+ {
63
+ let h = '';
64
+ for (let r = 0; r < 3; r++) for (let c = 0; c < 12; c++) h += `<path d="M${c * 25.5 + 4} ${r * 25.5}v8M${c * 25.5} ${r * 25.5 + 4}h8" stroke="${C.or}" stroke-width="1.1" opacity=".75"/>`;
65
+ add(`<svg style="position:absolute;left:808px;top:80px" width="300" height="64">${h}</svg>`);
66
+ }
67
+
68
+ // ------------------------------------------------------------ 01 mechanism state
69
+ panel(28, 126, 282, 254, 'MECHANISM STATE', '01');
70
+ const chip = add(`<div style="position:absolute;left:42px;top:166px;width:13px;height:24px;border-radius:2px"></div>`);
71
+ const stTitle = add(`<div style="position:absolute;left:66px;top:164px;font-size:15px;font-weight:600"></div>`);
72
+ const stSub = add(`<div class="sm" style="position:absolute;left:67px;top:183px"></div>`);
73
+ add(`<div style="position:absolute;left:42px;top:202px;width:254px;height:1px;background:${C.line}"></div>`);
74
+ const sch = add(`<svg style="position:absolute;left:42px;top:214px" width="254" height="156"></svg>`);
75
+
76
+ // ------------------------------------------------------------ 02 flight
77
+ panel(28, 394, 282, 232, 'FLIGHT', '02');
78
+ const fl = add(`<svg style="position:absolute;left:42px;top:430px" width="254" height="70"></svg>`);
79
+ const bars = ['HEIGHT', 'GEAR', 'STROKE'].map((n, i) => {
80
+ const y = 508 + i * 23;
81
+ add(`<div class="sm" style="position:absolute;left:42px;top:${y}px">${n}</div>`);
82
+ add(`<div style="position:absolute;left:97px;top:${y + 4}px;width:134px;height:4px;background:#efe6d8;border-radius:2px"></div>`);
83
+ const f = add(`<div style="position:absolute;left:97px;top:${y + 4}px;height:4px;background:${C.or};border-radius:2px"></div>`);
84
+ const v = add(`<div class="mo" style="position:absolute;right:${1600 - 296}px;top:${y - 2}px;font-size:11px;font-weight:600"></div>`);
85
+ return {f, v};
86
+ });
87
+ add(`<div style="position:absolute;left:42px;top:578px;width:254px;height:1px;background:${C.line}"></div>`);
88
+ add(`<div class="sm" style="position:absolute;left:42px;top:596px">WHEEL</div>`);
89
+ const wheelIcon = add(`<svg style="position:absolute;left:274px;top:590px" width="22" height="22"><g data-r><circle cx="11" cy="11" r="9" fill="none" stroke="${C.blue}" stroke-width="1.5"/><path d="M11 11V2M11 11l7.8 4.5M11 11l-7.8 4.5" stroke="${C.blue}" stroke-width="1.4"/><circle cx="11" cy="11" r="2.4" fill="${C.blue}"/></g></svg>`);
90
+
91
+ // ------------------------------------------------------------ 03 system overview
92
+ panel(1313, 126, 258, 210, 'SYSTEM OVERVIEW', '03');
93
+ add(`<div class="mo" style="position:absolute;left:1327px;top:163px;font-size:10.5px;font-weight:700;letter-spacing:1.6px">MAIN LANDING GEAR</div>`);
94
+ add(`<div class="mo" style="position:absolute;left:1327px;top:183px;width:232px;font-size:9.4px;line-height:1.75;color:#5f564b">One hydraulic actuator, a single rack and pinion, and a universal joint at each end of the output shaft. The side tubes spin; they never swing.</div>`);
95
+ add(`<div style="position:absolute;left:1327px;top:276px;width:232px;height:1px;background:${C.line}"></div>`);
96
+ [['1', 'ACTUATOR'], ['2', 'LEGS'], ['180°', 'SWEEP']].forEach(([v, n], i) => {
97
+ const x = 1327 + i * 85;
98
+ if (i) add(`<div style="position:absolute;left:${x - 8}px;top:286px;width:1px;height:38px;background:${C.line}"></div>`);
99
+ add(`<div style="position:absolute;left:${x}px;top:288px;font-size:20px;font-weight:700">${v}</div>`);
100
+ add(`<div class="sm" style="position:absolute;left:${x}px;top:313px">${n}</div>`);
101
+ });
102
+
103
+ // ------------------------------------------------------------ 04 sequence, 05 views, 06 display
104
+ const btn = {};
105
+ panel(1313, 353, 258, 82, 'SEQUENCE', '04');
106
+ add(`<div style="position:absolute;left:1327px;top:390px;width:230px;height:30px;border-radius:5px;background:#efe6d8"></div>`);
107
+ btn.takeoff = add(`<div class="bt" style="left:1330px;top:393px;width:112px;height:24px;border:none;background:transparent">TAKEOFF</div>`);
108
+ btn.landing = add(`<div class="bt" style="left:1442px;top:393px;width:112px;height:24px;border:none;background:transparent">LANDING</div>`);
109
+ const btnRow = (keys, labels, x0, y, wmax = 230) => {
110
+ let x = x0;
111
+ let yy = y;
112
+ for (const k of keys) {
113
+ const w = Math.round(labels[k].length * 7.1 + 22);
114
+ if (x + w > x0 + wmax) {
115
+ x = x0;
116
+ yy += 31;
117
+ }
118
+ btn[k] = add(`<div class="bt" style="left:${x}px;top:${yy}px;width:${w}px;height:23px">${labels[k]}</div>`);
119
+ x += w + 6;
120
+ }
121
+ };
122
+ panel(1313, 450, 258, 107, 'VIEWS', '05');
123
+ btnRow(VIEWS, VIEW_LABEL, 1327, 487);
124
+ panel(1313, 572, 258, 138, 'DISPLAY', '06');
125
+ btnRow(DISPLAY, DISPLAY_LABEL, 1327, 609);
126
+
127
+ // ------------------------------------------------------------ 07 gear operation
128
+ panel(430, 752, 740, 108, 'GEAR OPERATION', '07');
129
+ btn.play = add(`<div class="bt" style="left:445px;top:795px;width:44px;height:44px;border-radius:50%;border:none;background:${C.or};color:#fff;font-size:15px"></div>`);
130
+ const opFrom = add(`<div class="sm" style="position:absolute;left:506px;top:791px"></div>`);
131
+ const opPhase = add(`<div class="mo" style="position:absolute;left:506px;width:500px;top:790px;text-align:center;font-size:9.6px;font-weight:700;letter-spacing:1.6px;color:${C.or}"></div>`);
132
+ const opTo = add(`<div class="sm" style="position:absolute;right:${1600 - 1010}px;top:791px"></div>`);
133
+ const TL = {x: 508, w: 504};
134
+ add(`<div style="position:absolute;left:${TL.x}px;top:820px;width:${TL.w}px;height:3px;background:#efe6d8;border-radius:2px"></div>`);
135
+ const tlFill = add(`<div style="position:absolute;left:${TL.x}px;top:820px;height:3px;background:${C.or};border-radius:2px"></div>`);
136
+ const tlKnob = add(`<div style="position:absolute;top:814px;width:15px;height:15px;margin-left:-7.5px;border-radius:50%;background:#fff;border:2px solid ${C.or};box-sizing:border-box"></div>`);
137
+ const tlTime = add(`<div class="mo" style="position:absolute;left:506px;top:834px;font-size:9.6px;color:${C.mute};letter-spacing:1px"></div>`);
138
+ add(`<div class="sm" style="position:absolute;left:1029px;top:805px">SPEED</div>`);
139
+ const SP = {x: 1031, w: 92};
140
+ add(`<div style="position:absolute;left:${SP.x}px;top:823px;width:${SP.w}px;height:3px;background:#efe6d8;border-radius:2px"></div>`);
141
+ const spFill = add(`<div style="position:absolute;left:${SP.x}px;top:823px;height:3px;background:${C.or};border-radius:2px"></div>`);
142
+ const spKnob = add(`<div style="position:absolute;top:817px;width:15px;height:15px;margin-left:-7.5px;border-radius:50%;background:#fff;border:2px solid ${C.or};box-sizing:border-box"></div>`);
143
+ const spVal = add(`<div class="mo" style="position:absolute;left:1128px;top:818px;font-size:10px;font-weight:700"></div>`);
144
+
145
+ // ------------------------------------------------------------ footer and floor notes
146
+ add(`<div class="sm" style="position:absolute;left:27px;top:882px;letter-spacing:2.2px">MECHANISM STUDY &nbsp;·&nbsp; PROCEDURAL MODEL &nbsp;·&nbsp; SINGLE DEGREE OF FREEDOM</div>`);
147
+ add(`<div class="sm" style="position:absolute;right:28px;top:882px;letter-spacing:2.2px">BUILT FROM THE TRACED PLATE <span style="color:${C.or}">//////</span></div>`);
148
+ const notes = add(`<div style="position:absolute;inset:0"></div>`);
149
+ notes.innerHTML = `<div class="sm" style="position:absolute;left:367px;top:658px;line-height:16px;letter-spacing:2px">RIGHT MAIN GEAR<br>SHOWN (TYPICAL)</div>
150
+ <svg style="position:absolute;left:752px;top:658px" width="48" height="10"><path d="M0 5h40" stroke="${C.mute}" stroke-width="1.2"/><path d="M40 1l7 4-7 4z" fill="${C.mute}"/></svg>
151
+ <div class="sm" style="position:absolute;left:768px;top:677px">FWD</div>
152
+ <div class="sm" style="position:absolute;left:912px;top:682px;line-height:16px;letter-spacing:2px"><span style="color:${C.mute}">//////</span><br>MAIN LANDING GEAR<br>REV B</div>
153
+ <div style="position:absolute;left:1046px;top:690px;font-size:28px;font-weight:700;color:rgba(155,143,128,.25)">337</div>
154
+ <svg style="position:absolute;left:398px;top:162px" width="90" height="80"><path d="M0 80V0h80" fill="none" stroke="${C.or}" stroke-width="1" stroke-dasharray="3 3" opacity=".6"/></svg>
155
+ <svg style="position:absolute;left:1088px;top:606px" width="80" height="80"><path d="M80 0v76H0" fill="none" stroke="${C.or}" stroke-width="1" stroke-dasharray="3 3" opacity=".6"/></svg>`;
156
+
157
+ // ------------------------------------------------------------ labels, the pointer
158
+ const callSvg = add(`<svg data-callouts style="position:absolute;inset:0;overflow:visible" width="1600" height="900"></svg>`);
159
+ const callG = add(`<div data-callouts style="position:absolute;inset:0"></div>`);
160
+ const ring = add(`<div class="ring"></div>`);
161
+ const cur = add(`<div class="cur"><svg width="22" height="22" viewBox="0 0 34 34"><path d="M4 3 L30 13.5 L17.5 17.5 L13.5 30 Z" fill="#111" stroke="#fff" stroke-width="2.2" stroke-linejoin="round"/></svg></div>`);
162
+ const centre = (n) => {
163
+ const r = n.getBoundingClientRect();
164
+ return [r.left + r.width / 2, r.top + r.height / 2];
165
+ };
166
+ const spots = Object.fromEntries(Object.entries(btn).map(([k, n]) => [k, centre(n)]));
167
+ const pointer = (c) => {
168
+ cur.style.display = c.x < 0 ? 'none' : 'block';
169
+ cur.style.transform = `translate(${(c.x - 3).toFixed(2)}px, ${(c.y - 2).toFixed(2)}px) scale(${c.press ? 0.88 : 1})`;
170
+ ring.style.left = `${c.ringX}px`;
171
+ ring.style.top = `${c.ringY}px`;
172
+ ring.style.opacity = String(c.ring * 0.85);
173
+ ring.style.transform = `scale(${(0.35 + 0.9 * (1 - c.ring)).toFixed(3)})`;
174
+ };
175
+ const fmt = (s) => `00:${String(Math.floor(s)).padStart(2, '0')}`;
176
+
177
+ return {
178
+ spots,
179
+ btn,
180
+ root: ui,
181
+ timeline: (k) => [TL.x + k * TL.w, 821],
182
+ speedKnob: (k) => [SP.x + k * SP.w, 824],
183
+ TL,
184
+ SP,
185
+ update(s) {
186
+ // state chip and the schematic: actuator, rack, pinion, shaft, the two legs from the front
187
+ const [title, sub, kind] = s.state;
188
+ chip.style.background = kind === 'ok' ? C.green : C.or;
189
+ stTitle.textContent = title;
190
+ stSub.textContent = sub;
191
+ {
192
+ const d = s.stroke;
193
+ const rx = 92 - d * 52;
194
+ const th = s.stroke * Math.PI;
195
+ let h = `<text x="2" y="10" font-size="7.4" letter-spacing="1" fill="${C.mute}" font-family="JetBrains Mono">ACTUATOR</text>`;
196
+ h += `<rect x="2" y="18" width="${rx - 8}" height="17" rx="8" fill="#fbf8f2" stroke="${C.ink}" stroke-width="1.2"/>`;
197
+ h += `<line x1="${rx - 8}" x2="${rx + 2}" y1="26.5" y2="26.5" stroke="${C.ink}" stroke-width="1.6"/><rect x="${rx}" y="14" width="7" height="27" fill="${C.or}"/>`;
198
+ h += `<line x1="0" x2="250" y1="36.5" y2="36.5" stroke="${C.ink}" stroke-width="1"/>`;
199
+ h += `<rect x="${rx - 70}" y="40" width="96" height="7" fill="#fbf8f2" stroke="${C.ink}" stroke-width="1"/>`;
200
+ for (let i = 0; i < 16; i++) h += `<line x1="${rx - 68 + i * 6}" x2="${rx - 68 + i * 6}" y1="47" y2="51" stroke="${C.ink}" stroke-width=".9"/>`;
201
+ h += `<text x="24" y="72" font-size="7.4" letter-spacing="1" fill="${C.mute}" font-family="JetBrains Mono">RACK</text><text x="134" y="76" font-size="7.4" letter-spacing="1" fill="${C.mute}" font-family="JetBrains Mono">PINION</text>`;
202
+ h += `<g transform="translate(108 70) rotate(${((th * 180) / Math.PI).toFixed(1)})"><circle r="17" fill="none" stroke="${C.ink}" stroke-width="1.1"/>${Array.from({length: 16}, (_, i) => `<line x1="0" y1="-17" x2="0" y2="-20.5" stroke="${C.ink}" stroke-width="1" transform="rotate(${i * 22.5})"/>`).join('')}<path d="M-12 -12L12 12M12 -12L-12 12" stroke="${C.ink}" stroke-width="1"/></g>`;
203
+ h += `<text x="96" y="104" font-size="7.4" letter-spacing="1" fill="${C.mute}" font-family="JetBrains Mono">SHAFT</text><text x="220" y="100" font-size="7.4" letter-spacing="1" fill="${C.mute}" font-family="JetBrains Mono">LEG</text>`;
204
+ h += `<line x1="108" x2="108" y1="88" y2="150" stroke="${C.mute}" stroke-width=".8" stroke-dasharray="3 3"/>`;
205
+ // the legs from the front: a stub out, then the leg down, folding up as the tube turns
206
+ const leg = (sx) => {
207
+ const x0 = 108 + sx * 46;
208
+ const y0 = 122;
209
+ const xa = x0 + sx * 44;
210
+ const a = th;
211
+ const lx = xa + sx * 6 * Math.cos(a);
212
+ const ly = y0 + 34 * Math.cos(a);
213
+ const lx2 = xa - sx * 30 * Math.sin(a) * 0.9;
214
+ const X = lx * (1 - Math.sin(a)) + lx2 * Math.sin(a);
215
+ return `<path d="M${x0} ${y0}H${xa}L${X.toFixed(1)} ${ly.toFixed(1)}" fill="none" stroke="${C.or}" stroke-width="2.6" stroke-linejoin="round"/><circle cx="${X.toFixed(1)}" cy="${ly.toFixed(1)}" r="5.5" fill="${C.or}"/><circle cx="${x0}" cy="${y0}" r="4" fill="${C.or}"/>`;
216
+ };
217
+ h += `<line x1="62" x2="154" y1="122" y2="122" stroke="${C.ink}" stroke-width="1.4"/>` + leg(1) + leg(-1);
218
+ sch.innerHTML = h;
219
+ }
220
+ // flight: the climb or the descent, the marker where the aircraft is
221
+ {
222
+ const W = 254;
223
+ const X = (u) => 20 + u * (W - 30);
224
+ const Y = (h) => 58 - (h / 1.7) * 46;
225
+ let p = '';
226
+ for (let i = 0; i <= 40; i++) {
227
+ const u = i / 40;
228
+ const h = s.seq === 'takeoff' ? 1.7 * Math.pow(Math.max(0, (u - 0.38) / 0.62), 1.6) : 1.7 * Math.pow(Math.max(0, 1 - u / 0.74), 1.6);
229
+ p += `${i ? 'L' : 'M'}${X(u).toFixed(1)} ${Y(h).toFixed(1)}`;
230
+ }
231
+ const u = s.prog;
232
+ const mh = s.height;
233
+ const dir = s.seq === 'takeoff' ? 1 : -1;
234
+ const ang = (Math.atan2(-(s.climb ?? 0) * 18, 1) * 180) / Math.PI;
235
+ fl.innerHTML = `<line x1="0" x2="${W}" y1="58" y2="58" stroke="${C.ink}" stroke-width="1"/><path d="${p}" fill="none" stroke="${C.or}" stroke-width="1.1" stroke-dasharray="3 3"/><g transform="translate(${X(u).toFixed(1)} ${Y(mh).toFixed(1)}) scale(${dir} 1) rotate(${ang.toFixed(1)})"><path d="M-10 -6L8 0L-10 6L-6 0z" fill="${C.or}"/></g>`;
236
+ const vals = [[s.height / 1.7, `${s.height.toFixed(2)} m`], [s.stroke, `${Math.round(s.stroke * 180)}°`], [s.stroke, `${Math.round(s.stroke * 201)} mm`]];
237
+ bars.forEach((b, i) => {
238
+ b.f.style.width = `${(Math.min(1, vals[i][0]) * 134).toFixed(1)}px`;
239
+ b.v.textContent = vals[i][1];
240
+ });
241
+ wheelIcon.querySelector('[data-r]').setAttribute('transform', `rotate(${((s.roll * 180) / Math.PI) % 360} 11 11)`);
242
+ }
243
+ // sequence, views, display
244
+ const onBtn = (k, on) => {
245
+ btn[k].style.background = on ? C.or : '#fffdf9';
246
+ btn[k].style.color = on ? '#fff' : C.ink;
247
+ btn[k].style.borderColor = on ? C.or : C.faint;
248
+ };
249
+ for (const k of ['takeoff', 'landing']) {
250
+ const on = s.seq === k;
251
+ btn[k].style.background = on ? C.or : 'transparent';
252
+ btn[k].style.color = on ? '#fff' : '#8d8274';
253
+ btn[k].style.borderRadius = '4px';
254
+ }
255
+ for (const k of VIEWS) onBtn(k, s.view === k);
256
+ for (const k of DISPLAY) onBtn(k, !!s.display[k]);
257
+ // the operation timeline
258
+ btn.play.innerHTML = s.paused ? '▶' : '❚❚';
259
+ opFrom.textContent = s.from;
260
+ opTo.textContent = s.to;
261
+ opPhase.textContent = s.phase;
262
+ const kx = TL.x + s.prog * TL.w;
263
+ tlFill.style.width = `${(s.prog * TL.w).toFixed(1)}px`;
264
+ tlKnob.style.left = `${kx.toFixed(1)}px`;
265
+ tlTime.textContent = `${fmt(s.tau)} / ${fmt(s.dur)}`;
266
+ const sk = SP.x + s.speedK * SP.w;
267
+ spFill.style.width = `${(s.speedK * SP.w).toFixed(1)}px`;
268
+ spKnob.style.left = `${sk.toFixed(1)}px`;
269
+ spVal.textContent = `${s.speed.toFixed(1)}×`;
270
+ // labels: an orange square, the name, the note, a thin leader to the part
271
+ let lh = '';
272
+ let ch = '';
273
+ for (const c of s.callouts) {
274
+ if (c.o < 0.02 || !c.at) continue;
275
+ const [ax, ay] = c.at;
276
+ const [lx, ly] = c.label;
277
+ const right = lx > ax;
278
+ const ex = right ? lx - 6 : lx + c.w + 6;
279
+ lh += `<polyline points="${ax.toFixed(1)},${ay.toFixed(1)} ${ex.toFixed(1)},${(ly + 6).toFixed(1)}" fill="none" stroke="${C.or}" stroke-width=".9" opacity="${c.o.toFixed(2)}"/><circle cx="${ax.toFixed(1)}" cy="${ay.toFixed(1)}" r="2.4" fill="${C.or}" opacity="${c.o.toFixed(2)}"/>`;
280
+ ch += `<div class="call" style="left:${lx.toFixed(1)}px;top:${(ly - 1).toFixed(1)}px;opacity:${c.o.toFixed(2)}"><b><i></i>${c.name}</b><span>${c.sub}</span></div>`;
281
+ }
282
+ callSvg.innerHTML = lh;
283
+ callG.innerHTML = ch;
284
+ pointer(s.cursor);
285
+ },
286
+ pointer,
287
+ };
288
+ }
@@ -0,0 +1,254 @@
1
+ // CESSNA 337 SKYMASTER, the main landing gear film: the gear (gear.js) over the runway (stage.js) under the
2
+ // reference-style console (console.js). The operator flies two takeoffs and two landings (flight.js) and walks the
3
+ // views and display modes: the airframe ghost, the gearbox close-up with the labels on, the side tube spinning, the
4
+ // front, the x-ray plate, the plan from above, the exploded set, and an orbit for the last landing. A pure function of t.
5
+ import {runSim} from '../kit/runtime.js';
6
+ import {createConsole, DISPLAY} from './console.js';
7
+ import {phaseAt, SEQ, stateAt} from './flight.js';
8
+ import {AXIS, E0, G, J, LEG0} from './gear.js';
9
+ import {createCessnaStage} from './stage.js';
10
+ import * as THREE from 'three';
11
+
12
+ export const SCRIPT = [
13
+ {t: 0, seq: 'takeoff', view: 'hero'},
14
+ {t: 2.4, display: 'fuselage'},
15
+ {t: 5.4, seq: 'landing'},
16
+ {t: 5.9, view: 'gearbox'},
17
+ {t: 6.5, display: 'labels'},
18
+ {t: 8.7, view: 'sidetube'},
19
+ {t: 10.9, view: 'front'},
20
+ {t: 11.5, display: 'xray'},
21
+ {t: 12.7, display: 'labels'},
22
+ {t: 13.0, seq: 'takeoff'},
23
+ {t: 13.4, view: 'plan'},
24
+ {t: 16.2, display: 'exploded'},
25
+ {t: 17.8, display: 'exploded'},
26
+ {t: 18.3, view: 'hero'},
27
+ {t: 18.7, display: 'orbit'},
28
+ {t: 19.1, seq: 'landing'},
29
+ ];
30
+ export const DURATION = 26.2;
31
+ export const DEFAULTS = {duration: DURATION, fps: 60, theme: 'light', hud: {enabled: false, title: 'cessna', subtitle: ''}, director: {enabled: false}, watermark: ''};
32
+ const D2R = Math.PI / 180;
33
+ const smoother = (x) => {
34
+ const u = Math.min(1, Math.max(0, x));
35
+ return u * u * u * (u * (u * 6 - 15) + 10);
36
+ };
37
+ const ss = (a, b, t) => smoother((t - a) / (b - a));
38
+
39
+ // ------------------------------------------------------------ the sequence, the display toggles at film time t
40
+ export const seqAt = (t) => {
41
+ const e = SCRIPT.filter((x) => x.seq && x.t <= t).pop();
42
+ return {seq: e.seq, tau: Math.min(SEQ[e.seq].dur, t - e.t)};
43
+ };
44
+ export const displayAt = (t) => {
45
+ const out = Object.fromEntries(DISPLAY.map((k) => [k, 0]));
46
+ for (const e of SCRIPT) if (e.display && e.t <= t) out[e.display] = out[e.display] ? 0 : 1;
47
+ return out;
48
+ };
49
+ const lastFlip = (key, t) => SCRIPT.filter((e) => e.display === key && e.t <= t).pop()?.t ?? -9;
50
+ // an eased 0..1 for a display toggle
51
+ export const easedDisplay = (key, t, dur = 0.7) => {
52
+ const on = displayAt(t)[key];
53
+ const k = ss(lastFlip(key, t), lastFlip(key, t) + dur, t);
54
+ return on ? k : 1 - k;
55
+ };
56
+ export const mechAt = (seq, tau) => {
57
+ const S = SEQ[seq];
58
+ return {stroke: S.stroke(tau), height: S.height(tau), speed: S.speed(tau)};
59
+ };
60
+ // the runway distance and the wheel spin, integrated over the film
61
+ const DT = 1 / 240;
62
+ const DIST = [0];
63
+ const ROLL = [0];
64
+ {
65
+ let w = 0;
66
+ for (let i = 1; i * DT <= DURATION + 1; i++) {
67
+ const t = (i - 0.5) * DT;
68
+ const {seq, tau} = seqAt(t);
69
+ const m = mechAt(seq, tau);
70
+ DIST.push(DIST[i - 1] + m.speed * DT);
71
+ // the wheels roll with the runway, coast down once airborne
72
+ w = m.height < 0.005 ? m.speed / G.wheelR : w * Math.exp(-DT / 1.2);
73
+ ROLL.push(ROLL[i - 1] + w * DT);
74
+ }
75
+ }
76
+ const look = (A, t) => {
77
+ const u = Math.max(0, Math.min(A.length - 2, t / DT));
78
+ const i = Math.floor(u);
79
+ return A[i] + (A[i + 1] - A[i]) * (u - i);
80
+ };
81
+ export const distAt = (t) => look(DIST, t);
82
+ export const rollAt = (t) => look(ROLL, t);
83
+
84
+ // ------------------------------------------------------------ views (target relative to the gear), u = seconds on
85
+ export const VIEW_FN = {
86
+ hero: (u) => ({tx: 0.1, ty: -0.36, tz: 0, az: 222 + 2.5 * u, el: 21, d: 4.8, sx: 0, sy: -44}),
87
+ front: (u) => ({tx: 0, ty: -0.36, tz: 0, az: 4 + 2 * u, el: 7, d: 4.7, sx: 0, sy: -44}),
88
+ plan: (u) => ({tx: 0, ty: -0.1, tz: -0.1, az: 180 + 1.5 * u, el: 86, d: 4.8, sx: 0, sy: -30}),
89
+ top: (u) => ({tx: 0, ty: -0.25, tz: 0, az: 200 + 2 * u, el: 48, d: 5.0, sx: 0, sy: -36}),
90
+ gearbox: (u) => ({tx: 0.06, ty: -0.14, tz: 0.0, az: 238 + 3 * u, el: 8, d: 2.0, sx: 0, sy: -36}),
91
+ sidetube: (u) => ({tx: 0.38, ty: -0.36, tz: -0.04, az: 148 + 3 * u, el: 14, d: 2.8, sx: 0, sy: -36}),
92
+ };
93
+ const VIEWS = SCRIPT.filter((e) => e.view).map((e) => [e.t, e.view]);
94
+ const blend = (a, b, k) => {
95
+ const o = {};
96
+ for (const key in b) o[key] = key === 'az' ? a.az + ((((b.az - a.az + 540) % 360) - 180) * k) : a[key] + (b[key] - a[key]) * k;
97
+ const swing = Math.min(1, Math.abs(((b.az - a.az + 540) % 360) - 180) / 90);
98
+ o.d += Math.max(0, Math.max(a.d, b.d) + 0.6 * swing - o.d) * Math.sin(Math.PI * k);
99
+ return o;
100
+ };
101
+ export const camAt = (t, orbit = 0) => {
102
+ let i = 0;
103
+ while (i < VIEWS.length - 1 && VIEWS[i + 1][0] <= t) i++;
104
+ const cur = VIEW_FN[VIEWS[i][1]](t - VIEWS[i][0]);
105
+ let o = cur;
106
+ if (i > 0) {
107
+ const k = ss(VIEWS[i][0], VIEWS[i][0] + 1.6, t);
108
+ if (k < 1) o = blend(VIEW_FN[VIEWS[i - 1][1]](t - VIEWS[i - 1][0]), cur, k);
109
+ }
110
+ // the orbit: a steady turn from when it came on
111
+ if (orbit > 0) o = {...o, az: o.az + 14 * Math.max(0, t - lastFlip('orbit', t)) * orbit};
112
+ return o;
113
+ };
114
+ export const viewAt = (t) => VIEWS.filter(([a]) => a <= t).pop();
115
+
116
+ // ------------------------------------------------------------ the operator's pointer
117
+ const REST = [[860, 470], [760, 420], [940, 520], [820, 380]];
118
+ export function makeCursor(ui) {
119
+ const EV = SCRIPT.filter((e) => e.t > 0).flatMap((e) => {
120
+ const out = [];
121
+ if (e.seq) out.push({t: e.t, spot: ui.spots[e.seq]});
122
+ if (e.view) out.push({t: e.t + (e.seq ? 0.35 : 0), spot: ui.spots[e.view]});
123
+ if (e.display) out.push({t: e.t, spot: ui.spots[e.display]});
124
+ return out;
125
+ });
126
+ const WP = [[0, 900, 600]];
127
+ EV.forEach((e, i) => {
128
+ WP.push([e.t - 0.16, ...e.spot], [e.t + 0.22, ...e.spot]);
129
+ WP.push([e.t + 1.4, ...REST[i % REST.length]]);
130
+ });
131
+ WP.sort((a, b) => a[0] - b[0]);
132
+ return (t) => {
133
+ let i = 0;
134
+ while (i < WP.length - 2 && t > WP[i + 1][0]) i++;
135
+ const [t0, x0, y0] = WP[i];
136
+ const [t1, x1, y1] = WP[i + 1];
137
+ const k = ss(t0, t1, t);
138
+ const len = Math.hypot(x1 - x0, y1 - y0);
139
+ const bow = Math.sin(Math.PI * k) * Math.min(24, len * 0.07);
140
+ let press = false;
141
+ let ring = 0;
142
+ let rx = 0;
143
+ let ry = 0;
144
+ for (const e of EV) {
145
+ if (t >= e.t - 0.07 && t < e.t + 0.09) press = true;
146
+ if (t >= e.t && t < e.t + 0.55) {
147
+ ring = 1 - (t - e.t) / 0.55;
148
+ [rx, ry] = e.spot;
149
+ }
150
+ }
151
+ return {x: x0 + (x1 - x0) * k + (len ? (-(y1 - y0) / len) * bow : 0), y: y0 + (y1 - y0) * k + (len ? ((x1 - x0) / len) * bow : 0), press, ring, ringX: rx, ringY: ry};
152
+ };
153
+ }
154
+
155
+ // ------------------------------------------------------------ the labels: parts of the right gear, in the gear's frame
156
+ const V3 = THREE.Vector3;
157
+ const PARTS = [
158
+ {name: 'HYDRAULIC ACTUATOR', sub: 'EXTENDS / RETRACTS THE GEAR', at: () => new V3(0, 0.06, -0.42)},
159
+ {name: 'MAIN PLATE', sub: 'AIRFRAME ATTACHMENT', at: () => new V3(0.36, 0.0, 0.08)},
160
+ {name: 'ROD-END CONNECTOR', sub: 'RUNS IN THE PLATE SLOT', at: (m) => new V3(0, 0.06, 0.32 - m.stroke * G.stroke)},
161
+ {name: 'GEAR RACK', sub: 'ONE RACK, FORE AND AFT', at: (m) => new V3(0, -0.055, 0.12 - m.stroke * G.stroke)},
162
+ {name: 'PINION', sub: '32 TEETH, 4 MM MODULE', at: () => new V3(0, G.shaftY - G.pinionR * 0.6, 0)},
163
+ {name: 'ROTARY OUTPUT SHAFT', sub: 'DRIVES BOTH SIDES', at: () => new V3(-0.16, G.shaftY, 0)},
164
+ {name: 'CLEVIS JOINT', sub: 'TRANSFERS ROTATION ONLY', at: () => J.clone()},
165
+ {name: 'SIDE TUBE', sub: 'SPINS ABOUT ITS AXIS', at: () => J.clone().addScaledVector(AXIS, 0.17)},
166
+ {name: 'SPRING LEG', sub: 'STEEL, FLEXES ON TOUCHDOWN', at: (m) => E0.clone().addScaledVector(LEG0, 0.22).sub(J).applyAxisAngle(AXIS, m.stroke * Math.PI).add(J)},
167
+ ];
168
+ export function makeLabels(st) {
169
+ return (m, o) => {
170
+ if (o < 0.02) return [];
171
+ const y0 = st.gear.root.position.y;
172
+ const pts = PARTS.map((p) => {
173
+ const q = p.at(m);
174
+ const ex = m.explode ?? 0;
175
+ return {p, at: st.project(q.x, q.y + y0, q.z), ex};
176
+ }).filter((x) => x.at && x.at[0] > 320 && x.at[0] < 1300 && x.at[1] > 130 && x.at[1] < 745);
177
+ // two columns, stacked by height so no two labels touch
178
+ const L = pts.filter((x) => x.at[0] < 800).sort((a, b) => a.at[1] - b.at[1]);
179
+ const R = pts.filter((x) => x.at[0] >= 800).sort((a, b) => a.at[1] - b.at[1]);
180
+ const out = [];
181
+ const stack = (col, x, w) => {
182
+ let y = 150;
183
+ for (const c of col) {
184
+ y = Math.max(y, Math.min(700, c.at[1] - 10));
185
+ out.push({name: c.p.name, sub: c.p.sub, at: c.at, label: [x, y], w, o});
186
+ y += 34;
187
+ }
188
+ };
189
+ stack(L, 340, 170);
190
+ stack(R, 1110, 170);
191
+ return out;
192
+ };
193
+ }
194
+
195
+ export function makeConsoleFrame(ui, st) {
196
+ const labels = makeLabels(st);
197
+ return (t, s) => {
198
+ const S = SEQ[s.seq];
199
+ const m = s.mech;
200
+ const climb = (S.height(Math.min(S.dur, s.tau + 0.05)) - S.height(s.tau)) / 0.05;
201
+ ui.update({
202
+ state: stateAt(m.stroke, m.height),
203
+ stroke: m.stroke,
204
+ seq: s.seq,
205
+ prog: s.tau / S.dur,
206
+ height: m.height,
207
+ climb,
208
+ roll: s.roll,
209
+ view: s.view,
210
+ display: s.display,
211
+ paused: s.paused ?? false,
212
+ from: S.from,
213
+ to: S.to,
214
+ phase: phaseAt(s.seq, s.tau),
215
+ tau: s.tau,
216
+ dur: S.dur,
217
+ speed: s.speed ?? 1,
218
+ speedK: s.speedK ?? 0.5,
219
+ callouts: labels({...m, explode: s.explode}, s.labels),
220
+ cursor: s.cursor,
221
+ });
222
+ };
223
+ }
224
+
225
+ export function makeFilm() {
226
+ return async ({canvas, capture}) => {
227
+ const st = createCessnaStage({canvas});
228
+ const resize = () => st.resize(1600, 900, capture ? devicePixelRatio || 1 : Math.min(devicePixelRatio || 1, 2));
229
+ resize();
230
+ const ui = createConsole(document.getElementById('app'));
231
+ const cursorAt = makeCursor(ui);
232
+ const frame = makeConsoleFrame(ui, st);
233
+ window.CS = st;
234
+ return {
235
+ resize,
236
+ render(t) {
237
+ const {seq, tau} = seqAt(t);
238
+ const m = mechAt(seq, tau);
239
+ const disp = displayAt(t);
240
+ const explode = easedDisplay('exploded', t, 0.8);
241
+ const cam = camAt(t, disp.orbit);
242
+ st.frame(
243
+ {stroke: m.stroke, roll: rollAt(t), height: m.height, dist: distAt(t), fuselage: easedDisplay('fuselage', t) * 0.9, xray: easedDisplay('xray', t), explode, section: !!disp.section},
244
+ {...cam, az: cam.az * D2R, el: cam.el * D2R},
245
+ );
246
+ const [vt0, view] = viewAt(t);
247
+ frame(t, {seq, tau, mech: m, roll: rollAt(t), view, display: disp, explode, labels: easedDisplay('labels', t, 0.5) * ss(vt0 + 1.1, vt0 + 1.7, t), cursor: cursorAt(t)});
248
+ return {};
249
+ },
250
+ };
251
+ };
252
+ }
253
+
254
+ export const run = () => runSim(DEFAULTS, makeFilm());
@@ -0,0 +1,53 @@
1
+ // The two sequences the gear lives through, as functions of tau (seconds into the sequence): the takeoff (roll, lift
2
+ // off, the gear comes up) and the landing (the gear comes down, the flare, touchdown, rollout). Each gives the
3
+ // stroke (0 down, 1 up), the height above the runway, the ground speed and the phase line the console shows.
4
+ const smoother = (x) => {
5
+ const u = Math.min(1, Math.max(0, x));
6
+ return u * u * u * (u * (u * 6 - 15) + 10);
7
+ };
8
+ const ss = (a, b, t) => smoother((t - a) / (b - a));
9
+ export const H_MAX = 1.7;
10
+ export const V_MAX = 14;
11
+
12
+ export const SEQ = {
13
+ takeoff: {
14
+ dur: 5,
15
+ from: 'RUNWAY',
16
+ to: 'GEAR UP',
17
+ stroke: (t) => ss(2.3, 4.5, t),
18
+ height: (t) => H_MAX * Math.pow(ss(1.9, 5.0, t), 1.25),
19
+ speed: (t) => V_MAX * ss(0, 2.0, t),
20
+ phases: [
21
+ [0, 'RUNWAY'],
22
+ [0.6, 'TAKEOFF ROLL'],
23
+ [1.9, 'LIFT OFF'],
24
+ [2.3, 'ACTUATOR STROKES AFT'],
25
+ [3.0, 'RACK TURNS THE PINION'],
26
+ [3.6, 'SIDE TUBES SPIN THE LEGS UP'],
27
+ [4.5, 'GEAR UP & LOCKED'],
28
+ ],
29
+ },
30
+ landing: {
31
+ dur: 7,
32
+ from: 'GEAR UP',
33
+ to: 'RUNWAY',
34
+ stroke: (t) => 1 - ss(0.6, 3.0, t),
35
+ height: (t) => H_MAX * (1 - ss(0, 5.2, t)),
36
+ speed: (t) => V_MAX * (1 - ss(5.2, 7.0, t)),
37
+ phases: [
38
+ [0, 'GEAR DOWN SELECTED'],
39
+ [0.6, 'ACTUATOR STROKES FORWARD'],
40
+ [1.3, 'SIDE TUBES SPIN THE LEGS DOWN'],
41
+ [3.0, 'GEAR DOWN & LOCKED'],
42
+ [5.0, 'TOUCHDOWN'],
43
+ [5.5, 'ROLLOUT'],
44
+ ],
45
+ },
46
+ };
47
+ export const phaseAt = (seq, t) => SEQ[seq].phases.filter(([a]) => a <= t).pop()[1];
48
+ /** the mechanism state chip: [title, sub, colour key] */
49
+ export const stateAt = (stroke, height) => {
50
+ if (stroke < 0.002) return height < 0.01 ? ['Gear down & locked', 'ON THE RUNWAY', 'ok'] : ['Gear down & locked', `AIRBORNE · ${height.toFixed(2)} M`, 'ok'];
51
+ if (stroke > 0.998) return ['Gear up & locked', `AIRBORNE · ${height.toFixed(2)} M`, 'ok'];
52
+ return ['In transit', height < 0.01 ? 'ON THE RUNWAY' : `AIRBORNE · ${height.toFixed(2)} M`, 'move'];
53
+ };