frameyard 0.7.0 → 0.9.0

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 (334) hide show
  1. package/CHANGELOG.md +164 -7
  2. package/GLOSSARY.md +152 -18
  3. package/README.md +328 -285
  4. package/dist/assets/integrations.d.ts +8 -4
  5. package/dist/assets/integrations.d.ts.map +1 -1
  6. package/dist/assets/integrations.js +8 -4
  7. package/dist/assets/integrations.js.map +1 -1
  8. package/dist/assets/provenance.d.ts +2 -2
  9. package/dist/assets/provenance.d.ts.map +1 -1
  10. package/dist/assets/provenance.js +5 -3
  11. package/dist/assets/provenance.js.map +1 -1
  12. package/dist/assets/tts-supertonic.d.ts +28 -0
  13. package/dist/assets/tts-supertonic.d.ts.map +1 -0
  14. package/dist/assets/tts-supertonic.js +156 -0
  15. package/dist/assets/tts-supertonic.js.map +1 -0
  16. package/dist/assets/tts.d.ts +18 -6
  17. package/dist/assets/tts.d.ts.map +1 -1
  18. package/dist/assets/tts.js +219 -97
  19. package/dist/assets/tts.js.map +1 -1
  20. package/dist/cli.js +1705 -106
  21. package/dist/cli.js.map +1 -1
  22. package/dist/composition/descriptor.d.ts +17 -3
  23. package/dist/composition/descriptor.d.ts.map +1 -1
  24. package/dist/composition/descriptor.js +51 -28
  25. package/dist/composition/descriptor.js.map +1 -1
  26. package/dist/composition/format.d.ts +12 -0
  27. package/dist/composition/format.d.ts.map +1 -0
  28. package/dist/composition/format.js +28 -0
  29. package/dist/composition/format.js.map +1 -0
  30. package/dist/composition/index.d.ts +2 -1
  31. package/dist/composition/index.d.ts.map +1 -1
  32. package/dist/composition/index.js +1 -0
  33. package/dist/composition/index.js.map +1 -1
  34. package/dist/context.d.ts +82 -0
  35. package/dist/context.d.ts.map +1 -0
  36. package/dist/context.js +277 -0
  37. package/dist/context.js.map +1 -0
  38. package/dist/contracts.d.ts +80 -6
  39. package/dist/contracts.d.ts.map +1 -1
  40. package/dist/contracts.js +3 -0
  41. package/dist/contracts.js.map +1 -1
  42. package/dist/doctor.d.ts +14 -1
  43. package/dist/doctor.d.ts.map +1 -1
  44. package/dist/doctor.js +166 -7
  45. package/dist/doctor.js.map +1 -1
  46. package/dist/errors.d.ts +1 -1
  47. package/dist/errors.d.ts.map +1 -1
  48. package/dist/errors.js.map +1 -1
  49. package/dist/fonts/add.d.ts +41 -0
  50. package/dist/fonts/add.d.ts.map +1 -0
  51. package/dist/fonts/add.js +259 -0
  52. package/dist/fonts/add.js.map +1 -0
  53. package/dist/fonts/binary.d.ts +4 -0
  54. package/dist/fonts/binary.d.ts.map +1 -0
  55. package/dist/fonts/binary.js +21 -0
  56. package/dist/fonts/binary.js.map +1 -0
  57. package/dist/fonts/css.d.ts +4 -0
  58. package/dist/fonts/css.d.ts.map +1 -0
  59. package/dist/fonts/css.js +50 -0
  60. package/dist/fonts/css.js.map +1 -0
  61. package/dist/fonts/fontsource.d.ts +107 -0
  62. package/dist/fonts/fontsource.d.ts.map +1 -0
  63. package/dist/fonts/fontsource.js +565 -0
  64. package/dist/fonts/fontsource.js.map +1 -0
  65. package/dist/fonts/index.d.ts +11 -0
  66. package/dist/fonts/index.d.ts.map +1 -0
  67. package/dist/fonts/index.js +11 -0
  68. package/dist/fonts/index.js.map +1 -0
  69. package/dist/fonts/install.d.ts +24 -0
  70. package/dist/fonts/install.d.ts.map +1 -0
  71. package/dist/fonts/install.js +145 -0
  72. package/dist/fonts/install.js.map +1 -0
  73. package/dist/fonts/manifest.d.ts +21 -0
  74. package/dist/fonts/manifest.d.ts.map +1 -0
  75. package/dist/fonts/manifest.js +96 -0
  76. package/dist/fonts/manifest.js.map +1 -0
  77. package/dist/fonts/options.d.ts +9 -0
  78. package/dist/fonts/options.d.ts.map +1 -0
  79. package/dist/fonts/options.js +66 -0
  80. package/dist/fonts/options.js.map +1 -0
  81. package/dist/fonts/schema.d.ts +4 -0
  82. package/dist/fonts/schema.d.ts.map +1 -0
  83. package/dist/fonts/schema.js +316 -0
  84. package/dist/fonts/schema.js.map +1 -0
  85. package/dist/fonts/summary.d.ts +16 -0
  86. package/dist/fonts/summary.d.ts.map +1 -0
  87. package/dist/fonts/summary.js +22 -0
  88. package/dist/fonts/summary.js.map +1 -0
  89. package/dist/fonts/types.d.ts +56 -0
  90. package/dist/fonts/types.d.ts.map +1 -0
  91. package/dist/fonts/types.js +8 -0
  92. package/dist/fonts/types.js.map +1 -0
  93. package/dist/fonts/verify.d.ts +33 -0
  94. package/dist/fonts/verify.d.ts.map +1 -0
  95. package/dist/fonts/verify.js +200 -0
  96. package/dist/fonts/verify.js.map +1 -0
  97. package/dist/html/document-adapter.d.ts +3 -3
  98. package/dist/html/document-adapter.d.ts.map +1 -1
  99. package/dist/html/document-adapter.js +1 -1
  100. package/dist/html/document-adapter.js.map +1 -1
  101. package/dist/html/index.d.ts +1 -1
  102. package/dist/html/index.d.ts.map +1 -1
  103. package/dist/html/parse.d.ts +10 -2
  104. package/dist/html/parse.d.ts.map +1 -1
  105. package/dist/html/parse.js +14 -5
  106. package/dist/html/parse.js.map +1 -1
  107. package/dist/html/validate.d.ts +12 -1
  108. package/dist/html/validate.d.ts.map +1 -1
  109. package/dist/html/validate.js +292 -61
  110. package/dist/html/validate.js.map +1 -1
  111. package/dist/index.d.ts +4 -4
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +2 -2
  114. package/dist/index.js.map +1 -1
  115. package/dist/inspect.d.ts +61 -0
  116. package/dist/inspect.d.ts.map +1 -0
  117. package/dist/inspect.js +325 -0
  118. package/dist/inspect.js.map +1 -0
  119. package/dist/lint.d.ts +63 -0
  120. package/dist/lint.d.ts.map +1 -0
  121. package/dist/lint.js +265 -0
  122. package/dist/lint.js.map +1 -0
  123. package/dist/policy.d.ts +69 -0
  124. package/dist/policy.d.ts.map +1 -0
  125. package/dist/policy.js +361 -0
  126. package/dist/policy.js.map +1 -0
  127. package/dist/preview/main.d.ts +2 -2
  128. package/dist/preview/main.d.ts.map +1 -1
  129. package/dist/preview/main.js +35 -14
  130. package/dist/preview/main.js.map +1 -1
  131. package/dist/preview/timeline-data.d.ts +17 -65
  132. package/dist/preview/timeline-data.d.ts.map +1 -1
  133. package/dist/preview/timeline-host.d.ts.map +1 -1
  134. package/dist/preview/timeline-host.js +73 -38
  135. package/dist/preview/timeline-host.js.map +1 -1
  136. package/dist/preview/timeline-main.d.ts.map +1 -1
  137. package/dist/preview/timeline-main.js +47 -3
  138. package/dist/preview/timeline-main.js.map +1 -1
  139. package/dist/project.d.ts +13 -8
  140. package/dist/project.d.ts.map +1 -1
  141. package/dist/project.js +20 -17
  142. package/dist/project.js.map +1 -1
  143. package/dist/renderer/browser.d.ts +2 -2
  144. package/dist/renderer/browser.d.ts.map +1 -1
  145. package/dist/renderer/browser.js +10 -4
  146. package/dist/renderer/browser.js.map +1 -1
  147. package/dist/renderer/ffmpeg.d.ts +44 -1
  148. package/dist/renderer/ffmpeg.d.ts.map +1 -1
  149. package/dist/renderer/ffmpeg.js +371 -73
  150. package/dist/renderer/ffmpeg.js.map +1 -1
  151. package/dist/renderer/index.d.ts +40 -4
  152. package/dist/renderer/index.d.ts.map +1 -1
  153. package/dist/renderer/index.js +100 -25
  154. package/dist/renderer/index.js.map +1 -1
  155. package/dist/renderer/keyframe-expressions.d.ts +39 -0
  156. package/dist/renderer/keyframe-expressions.d.ts.map +1 -0
  157. package/dist/renderer/keyframe-expressions.js +180 -0
  158. package/dist/renderer/keyframe-expressions.js.map +1 -0
  159. package/dist/renderer/timeline.d.ts +2 -0
  160. package/dist/renderer/timeline.d.ts.map +1 -1
  161. package/dist/renderer/timeline.js +168 -106
  162. package/dist/renderer/timeline.js.map +1 -1
  163. package/dist/runtime/host.d.ts.map +1 -1
  164. package/dist/runtime/host.js +159 -31
  165. package/dist/runtime/host.js.map +1 -1
  166. package/dist/scaffold.d.ts +3 -0
  167. package/dist/scaffold.d.ts.map +1 -1
  168. package/dist/scaffold.js +48 -317
  169. package/dist/scaffold.js.map +1 -1
  170. package/dist/server/composition-html.d.ts +15 -7
  171. package/dist/server/composition-html.d.ts.map +1 -1
  172. package/dist/server/composition-html.js +72 -16
  173. package/dist/server/composition-html.js.map +1 -1
  174. package/dist/server/server.d.ts.map +1 -1
  175. package/dist/server/server.js +56 -6
  176. package/dist/server/server.js.map +1 -1
  177. package/dist/server/timeline-preview-data.d.ts.map +1 -1
  178. package/dist/server/timeline-preview-data.js +12 -23
  179. package/dist/server/timeline-preview-data.js.map +1 -1
  180. package/dist/server/timeline-preview-html.d.ts.map +1 -1
  181. package/dist/server/timeline-preview-html.js +20 -3
  182. package/dist/server/timeline-preview-html.js.map +1 -1
  183. package/dist/templates.d.ts +16 -0
  184. package/dist/templates.d.ts.map +1 -0
  185. package/dist/templates.js +186 -0
  186. package/dist/templates.js.map +1 -0
  187. package/dist/timeline/easing.d.ts +36 -0
  188. package/dist/timeline/easing.d.ts.map +1 -0
  189. package/dist/timeline/easing.js +225 -0
  190. package/dist/timeline/easing.js.map +1 -0
  191. package/dist/timeline/keyframes.d.ts +23 -0
  192. package/dist/timeline/keyframes.d.ts.map +1 -0
  193. package/dist/timeline/keyframes.js +95 -0
  194. package/dist/timeline/keyframes.js.map +1 -0
  195. package/dist/timeline/plan.d.ts +6 -12
  196. package/dist/timeline/plan.d.ts.map +1 -1
  197. package/dist/timeline/plan.js +17 -30
  198. package/dist/timeline/plan.js.map +1 -1
  199. package/dist/timeline/resolve.d.ts +16 -3
  200. package/dist/timeline/resolve.d.ts.map +1 -1
  201. package/dist/timeline/resolve.js +119 -13
  202. package/dist/timeline/resolve.js.map +1 -1
  203. package/dist/timeline/scene.d.ts +126 -0
  204. package/dist/timeline/scene.d.ts.map +1 -0
  205. package/dist/timeline/scene.js +109 -0
  206. package/dist/timeline/scene.js.map +1 -0
  207. package/dist/timeline/schema.d.ts +38 -0
  208. package/dist/timeline/schema.d.ts.map +1 -1
  209. package/dist/timeline/schema.js +290 -9
  210. package/dist/timeline/schema.js.map +1 -1
  211. package/dist/timeline/transitions.d.ts +21 -0
  212. package/dist/timeline/transitions.d.ts.map +1 -0
  213. package/dist/timeline/transitions.js +23 -0
  214. package/dist/timeline/transitions.js.map +1 -0
  215. package/dist/version.d.ts +1 -1
  216. package/dist/version.js +1 -1
  217. package/docs/adr/0007-make-html-documents-the-composition-unit.md +2 -2
  218. package/docs/adr/0008-share-the-composition-document-grammar.md +1 -1
  219. package/docs/adr/0010-make-timelines-the-render-unit.md +3 -2
  220. package/docs/adr/0011-compose-timeline-frames-in-a-live-browser-host.md +1 -1
  221. package/docs/adr/0012-render-timelines-with-segmented-lossless-clip-intermediates.md +1 -1
  222. package/docs/adr/0014-compose-timeline-clips-with-css-blend-modes.md +38 -0
  223. package/docs/adr/0015-inherit-composition-format-from-the-project.md +28 -0
  224. package/docs/adr/0016-author-compositions-as-html-fragments.md +32 -0
  225. package/docs/adr/0017-render-timeless-compositions-as-stills.md +99 -0
  226. package/docs/adr/0018-animate-timeline-clips-with-keyframes.md +35 -0
  227. package/docs/adr/0019-make-same-track-overlap-the-transition-window.md +36 -0
  228. package/docs/adr/0020-crossfade-audio-clips-on-audio-tracks.md +27 -0
  229. package/docs/adr/0021-project-timeline-scenes-once.md +32 -0
  230. package/docs/adr/0022-gate-heavy-operations-with-a-workspace-resource-policy.md +35 -0
  231. package/docs/adr/0023-pin-fonts-as-project-assets.md +98 -0
  232. package/docs/migration-0.4.md +5 -3
  233. package/docs/migration-0.8.md +163 -0
  234. package/docs/preview-testing.md +23 -3
  235. package/docs/{v0.1-design.md → v0.x-design.md} +86 -53
  236. package/examples/blend/README.md +106 -0
  237. package/examples/blend/assets/ink.mp4 +0 -0
  238. package/examples/blend/compositions/aurora.html +55 -0
  239. package/examples/blend/compositions/backdrop.html +74 -0
  240. package/examples/blend/compositions/labels.html +149 -0
  241. package/examples/blend/fy.config.js +11 -0
  242. package/examples/blend/scripts/make-ink.sh +26 -0
  243. package/examples/blend/timelines/blend.timeline.json +155 -0
  244. package/examples/demo/README.md +2 -2
  245. package/examples/demo/compositions/demo.html +243 -251
  246. package/examples/intro/README.md +71 -0
  247. package/examples/intro/assets/fonts/figtree/LICENSE.txt +93 -0
  248. package/examples/intro/assets/fonts/figtree/figtree-latin-wght-normal.woff2 +0 -0
  249. package/examples/intro/assets/fonts/instrument-serif/LICENSE.txt +93 -0
  250. package/examples/intro/assets/fonts/instrument-serif/instrument-serif-latin-400-italic.woff2 +0 -0
  251. package/examples/intro/assets/fonts/space-mono/LICENSE.txt +93 -0
  252. package/examples/intro/assets/fonts/space-mono/space-mono-latin-400-normal.woff2 +0 -0
  253. package/examples/intro/assets/fonts/space-mono/space-mono-latin-700-normal.woff2 +0 -0
  254. package/examples/intro/assets/grain.png +0 -0
  255. package/examples/intro/assets/score.ogg +0 -0
  256. package/examples/intro/compositions/brand.html +412 -0
  257. package/examples/intro/compositions/chrome.controller.js +63 -0
  258. package/examples/intro/compositions/chrome.html +256 -0
  259. package/examples/intro/compositions/lattice.controller.js +148 -0
  260. package/examples/intro/compositions/lattice.html +308 -0
  261. package/examples/intro/compositions/opening.html +504 -0
  262. package/examples/intro/compositions/studio.html +930 -0
  263. package/examples/intro/compositions/theme.css +218 -0
  264. package/examples/intro/fy.config.js +13 -0
  265. package/examples/intro/fy.fonts.json +100 -0
  266. package/examples/intro/scripts/make-grain.mjs +79 -0
  267. package/examples/intro/scripts/make-score.mjs +702 -0
  268. package/examples/intro/timelines/intro.timeline.json +60 -0
  269. package/examples/keyframes/README.md +76 -0
  270. package/examples/keyframes/compositions/backdrop.html +60 -0
  271. package/examples/keyframes/compositions/card.html +99 -0
  272. package/examples/keyframes/fy.config.js +10 -0
  273. package/examples/keyframes/timelines/keyframes.timeline.json +60 -0
  274. package/examples/nested/README.md +112 -0
  275. package/examples/nested/assets/pulse.wav +0 -0
  276. package/examples/nested/compositions/backdrop.html +84 -0
  277. package/examples/nested/compositions/card.html +275 -0
  278. package/examples/nested/compositions/overlay.html +307 -0
  279. package/examples/nested/fy.config.js +13 -0
  280. package/examples/nested/scripts/make-pulse.sh +20 -0
  281. package/examples/nested/timelines/chapter-a.timeline.json +39 -0
  282. package/examples/nested/timelines/chapter-b.timeline.json +39 -0
  283. package/examples/nested/timelines/nested-reel.timeline.json +52 -0
  284. package/examples/static/README.md +17 -0
  285. package/examples/static/compositions/still.html +37 -0
  286. package/examples/static/fy.config.js +9 -0
  287. package/examples/static/timelines/still.timeline.json +13 -0
  288. package/examples/transitions/README.md +128 -0
  289. package/examples/transitions/assets/alpha.wav +0 -0
  290. package/examples/transitions/assets/beta.wav +0 -0
  291. package/examples/transitions/assets/gamma.wav +0 -0
  292. package/examples/transitions/compositions/alpha.html +56 -0
  293. package/examples/transitions/compositions/beta.html +56 -0
  294. package/examples/transitions/compositions/gamma.html +56 -0
  295. package/examples/transitions/fy.config.js +12 -0
  296. package/examples/transitions/timelines/audio-crossfade.timeline.json +44 -0
  297. package/examples/transitions/timelines/transitions.timeline.json +31 -0
  298. package/examples/video/README.md +4 -4
  299. package/examples/video/compositions/video-mp4.html +349 -357
  300. package/examples/video/compositions/video-overlay.html +337 -345
  301. package/examples/video/compositions/video.html +349 -357
  302. package/examples/webgl/README.md +1 -1
  303. package/examples/webgl/compositions/webgl.html +205 -213
  304. package/package.json +13 -5
  305. package/scaffolds/init/AGENTS.md +131 -0
  306. package/scaffolds/init/README.md +56 -0
  307. package/scaffolds/init/compositions/hello.html +79 -0
  308. package/scaffolds/init/fy.config.js +9 -0
  309. package/scaffolds/init/gitignore.template +1 -0
  310. package/scaffolds/init/package.json +11 -0
  311. package/scaffolds/init/props/hello.json +4 -0
  312. package/scaffolds/init/props/main.json +6 -0
  313. package/scaffolds/init/timelines/main.timeline.json +20 -0
  314. package/scaffolds/local-models/LOCAL-MODELS.md +77 -0
  315. package/scaffolds/local-models/fy.policy.json +5 -0
  316. package/scaffolds/local-models/opencode/opencode.jsonc +17 -0
  317. package/scaffolds/local-models/pi/APPEND_SYSTEM.md +21 -0
  318. package/scaffolds/local-models/pi/sandbox.json +15 -0
  319. package/scaffolds/local-models/pi/settings.json +15 -0
  320. package/skills/frameyard/README.md +1 -0
  321. package/skills/frameyard/SKILL.md +59 -59
  322. package/skills/frameyard/references/audio-assets.md +32 -3
  323. package/skills/frameyard/references/common-mistakes.md +81 -7
  324. package/skills/frameyard/references/controllers.md +5 -4
  325. package/skills/frameyard/references/deterministic-authoring.md +49 -37
  326. package/skills/frameyard/references/diagnostics.md +42 -4
  327. package/skills/frameyard/references/failure-recovery.md +56 -10
  328. package/skills/frameyard/references/fonts.md +132 -0
  329. package/skills/frameyard/references/json-results.md +165 -10
  330. package/skills/frameyard/references/quick-reference.md +222 -0
  331. package/skills/frameyard/references/timelines.md +109 -15
  332. /package/examples/demo/{video.config.js → fy.config.js} +0 -0
  333. /package/examples/video/{video.config.js → fy.config.js} +0 -0
  334. /package/examples/webgl/{video.config.js → fy.config.js} +0 -0
package/dist/scaffold.js CHANGED
@@ -1,308 +1,27 @@
1
+ import { readFileSync, readdirSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
1
4
  import { VERSION } from "./version.js";
2
- const AGENTS_GUIDE = `# AGENTS.md
3
-
4
- This project produces deterministic, parameterized video with Frameyard. Follow this guide when editing or rendering it.
5
-
6
- ## Project layout
7
-
8
- - \`video.config.js\` explicitly maps project IDs to sources. There is no directory scanning. It declares the project \`format\`, \`compositions\`, and \`timelines\`.
9
- - \`compositions/\` contains HTML/CSS compositions. An optional controller lives beside the document as a \`.controller.js\` module; import \`frameyard/runtime\` for \`random("stable:key")\` and other browser APIs.
10
- - \`timelines/\` contains JSON timeline documents that assemble composition and media clips into one video.
11
- - \`props/hello.json\` contains composition props; \`props/main.json\` contains timeline clip overrides keyed by composition clip ID.
12
- - \`out/\` contains rendered MP4s and is gitignored. \`render\` writes \`out/<id>.mp4\` by default.
13
- - \`assets/\` (create it when needed) contains audio, images, fonts, and generated assets.
14
- - \`package.json\` pins the CLI version in \`dev\`, \`check\`, \`render\`, and \`still\` scripts. Run \`dev\` with \`npm run dev\` or \`pnpm dev\`; for the others, pass the timeline or composition id: \`npm run check -- main\` (npm) or \`pnpm check main\` (pnpm).
15
-
16
- \`width\`, \`height\`, \`fps\`, and \`duration-in-frames\` are fixed on \`<fy-composition>\`. Do not derive them from props.
17
-
18
- ## Composition skeleton
19
-
20
- \`\`\`html
21
- <!doctype html>
22
- <html>
23
- <head>
24
- <meta charset="utf-8">
25
- <script type="application/json" data-fy="props">{ "title": "Hello" }</script>
26
- </head>
27
- <body>
28
- <fy-composition width="1280" height="720" fps="30" duration-in-frames="150">
29
- <h1 data-fy-text="title"></h1>
30
- </fy-composition>
31
- </body>
32
- </html>
33
- \`\`\`
34
-
35
- ## Timeline skeleton
36
-
37
- \`timelines/main.timeline.json\` assembles clips in the project format:
38
-
39
- \`\`\`json
40
- {
41
- "version": 1,
42
- "tracks": [
43
- { "id": "v1", "kind": "video" },
44
- { "id": "a1", "kind": "audio" }
45
- ],
46
- "clips": [
47
- {
48
- "id": "hello",
49
- "track": "v1",
50
- "source": { "kind": "composition", "id": "hello" },
51
- "start": 0
52
- },
53
- {
54
- "id": "music",
55
- "track": "a1",
56
- "source": { "kind": "audio", "src": "assets/music.wav" },
57
- "start": 0,
58
- "duration": 150,
59
- "audio": { "gain": 0.6 }
60
- }
61
- ]
5
+ const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
6
+ const INIT_TEMPLATES = path.join(PACKAGE_ROOT, "scaffolds", "init");
7
+ const LOCAL_MODELS_TEMPLATES = path.join(PACKAGE_ROOT, "scaffolds", "local-models");
8
+ function readTemplates(directory) {
9
+ const files = {};
10
+ const visit = (current) => {
11
+ const entries = readdirSync(current, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name));
12
+ for (const entry of entries) {
13
+ const fullPath = path.join(current, entry.name);
14
+ if (entry.isDirectory()) {
15
+ visit(fullPath);
16
+ }
17
+ else if (entry.isFile()) {
18
+ files[path.relative(directory, fullPath).split(path.sep).join("/")] = readFileSync(fullPath, "utf8");
19
+ }
20
+ }
21
+ };
22
+ visit(directory);
23
+ return files;
62
24
  }
63
- \`\`\`
64
-
65
- - \`source.kind\` is \`composition\` (with \`id\`), \`timeline\` (with \`id\`), or \`video\`, \`image\`, \`audio\` (with a project-relative \`src\`).
66
- - \`start\`, \`sourceIn\`, and \`duration\` use timeline frames. Omitted durations use the rest of the source; image clips require a duration.
67
- - Composition clips may declare \`props\`; the same composition can appear multiple times with different props, trims, and transforms.
68
- - Visual clips support static \`transform\` values: \`fit\` (\`contain\`, \`cover\`, \`stretch\`), \`width\`/\`height\` (an explicit box, both together), \`x\`, \`y\`, \`scale\`, \`rotation\`, and \`opacity\`. \`width\`/\`height\` are mutually exclusive with \`scale\`.
69
- - Video and audio clips are muted with \`audio.muted\`; \`audio.gain\` is 0-1. Composition audio is included automatically.
70
- - Tracks composite from bottom to top. Clips on the same track cannot overlap. No transitions or keyframes in 0.6.
71
- - Project \`format\` fixes width, height, and fps for every timeline. Composition fps must match the project; different composition sizes are fitted by the clip.
72
-
73
- ## Bindings
74
-
75
- - \`data-fy-text="path"\` sets text content.
76
- - \`data-fy-attr-src="path"\` (and other \`data-fy-attr-*\` names) sets an attribute.
77
- - \`data-fy-class-active="path"\` toggles a class.
78
- - \`data-fy-if="path"\` removes the element when the value is false.
79
- - \`<template data-fy-repeat="items">\` clones its content for each item; use \`item\` and \`index\`, and style stagger with \`--fy-index\`.
80
- - Paths are dot-separated (\`user.name\`, \`items.0.label\`). Missing paths warn and resolve to an empty value.
81
- - Primitive top-level props are also available as \`--fy-prop-<name>\` CSS custom properties.
82
-
83
- ## Animation
84
-
85
- - CSS \`@keyframes\` and Web Animations API animations are paused and seeked from the frame clock.
86
- - \`data-fy-anim-start\`, \`data-fy-anim-duration\`, and \`data-fy-anim-easing\` schedule one animation per element in composition frames. The CSS \`animation\` shorthand supplies keyframes and fill mode.
87
- - Frame-state variables are set on \`:root\`: \`--fy-frame\`, \`--fy-time\`, \`--fy-progress\`, \`--fy-fps\`, \`--fy-duration\`, and \`--fy-duration-frames\`.
88
- - Use \`--fy-progress\` for progress bars and \`--fy-frame\`/\`--fy-time\` in \`calc()\` for simple computed motion.
89
- - CSS transitions are not deterministic; do not use them.
90
-
91
- ## Controller
92
-
93
- Exactly one optional controller is allowed, inline or external:
94
-
95
- \`\`\`html
96
- <script type="text/fy-controller">
97
- export default {
98
- mount({ root, props }) {},
99
- update({ frame, props, root }) {},
100
- };
101
- </script>
102
- \`\`\`
103
-
104
- \`\`\`html
105
- <script type="text/fy-controller" src="./hello.controller.js"></script>
106
- \`\`\`
107
-
108
- - \`mount\` may be asynchronous; \`update\` and \`validateProps\` are synchronous and seek-safe; \`dispose\` releases resources.
109
- - Use inline for small, single-use controllers; extract to an external module for Canvas 2D, WebGL, karaoke, reuse, tests, or a large controller.
110
- - A controller may be validation-only and export just \`validateProps(props)\`.
111
- - The controller is the only executable code. Other scripts and \`on*\` handlers are rejected.
112
- - Controller-created DOM is not re-bound; declarative bindings apply once before \`mount\`.
113
-
114
- ## Determinism rules
115
-
116
- - A composition frame may depend only on its integer \`frame\`, immutable \`props\`, and assets loaded before frame production. A timeline frame is derived from its active clips and the same composition rules.
117
- - Never use \`Math.random()\`, \`Date.now()\`, \`performance.now()\`, timers, independent \`requestAnimationFrame()\` loops, CSS transitions, or state left from a previously visited frame as animation inputs.
118
- - Use \`random("stable:key")\` from \`frameyard/runtime\` for randomness.
119
- - Load remote data, fonts, and images before frame production. Network requests are blocked during capture; a \`fetch()\` from \`update()\` is a bug.
120
- - Redraw Canvas 2D and WebGL from the current frame. Production pins software WebGL for reproducible pixels.
121
- - Embedded video and audio use local project files and \`data-fy-start\` (frames), \`data-fy-trim\` (seconds), optional \`data-fy-duration\` (seconds), and \`data-fy-volume\` (0-1). Let the runtime seek video; do not call \`play()\`, \`pause()\`, or set \`currentTime\` in \`update()\`.
122
- - Media and transcript \`src\` values resolve from the project root. The controller \`src\` and ordinary HTML asset URLs resolve relative to the composition document.
123
-
124
- ## Audio and transcripts
125
-
126
- - Composition audio clips are \`<audio>\` elements placed by composition frames and trimmed by seconds. Timeline audio clips use frames and are placed on audio tracks.
127
- - Visual clips contribute their audio automatically unless muted; there are no linked A/V pairs. For a J/L cut, mute the video and add a separate audio clip with a different sourceIn.
128
- - Frameyard does not time-stretch audio or change timeline duration to fit it.
129
- - An unmuted embedded video contributes its audio track to the same mix; use \`muted\` or \`data-fy-audio="off"\` for a visual-only video.
130
- - Declare required transcripts with \`<fy-transcript src="assets/voice.transcript.json" words></fy-transcript>\`.
131
- - Produce speech with \`npx frameyard tts\` and transcripts with \`npx frameyard transcribe\`; never call \`qwen-tts\` or \`whisper-cli\` directly, and never run inference inside a controller.
132
- - Do not overwrite or regenerate generated assets without explicit approval.
133
- - \`words\` requires measured word timings; never interpolate segment timings.
134
- - Commit \`frameyard.assets.json\` when present; do not edit hashes or manifest entries by hand.
135
-
136
- ## Agent workflow
137
-
138
- 1. Read \`video.config.js\`, the timeline document, the referenced composition HTML, the optional controller, and the props files before changing behavior.
139
- 2. Author compositions with native HTML, CSS, SVG, Canvas 2D, WebGL, embedded video, and an optional controller. Arrange composition and media clips in the timeline JSON. Do not add a bundling step.
140
- 3. Validate every frame: \`npx frameyard check main --json\`. Static validation runs before Chromium and reports stable diagnostic codes with source locations. Use \`--props <file>\` for composition props or a timeline clip override map.
141
- 4. Inspect representative frames: \`npx frameyard still main --frame <spec> --out <dir|file.png> --json\`, where \`<spec>\` is a frame number, an inclusive range like \`2-12\`, or a comma-separated list with at most 32 unique frames. With multiple frames, \`--out\` is a directory. Then view the PNGs when the host supports images. State explicitly when visual inspection is not possible.
142
- 5. Render: \`npx frameyard render main --props props/main.json [--workers <n>] [--scratch <dir>] --json\`. The video is written to \`out/main.mp4\` unless \`--out\` is passed.
143
- 6. Report the timeline, composition sources, props, validation result, diagnostics, still paths and inspection status, video path, and any failure. Never claim success when \`check\` fails, a still is missing, or a render exits nonzero.
144
-
145
- ## Commands
146
-
147
- \`\`\`sh
148
- npx frameyard dev
149
- npx frameyard doctor --json
150
- npx frameyard check main --json
151
- npx frameyard still main --frame 42 --out main-42.png --json
152
- npx frameyard still main --frame 0,118-126 --out out/stills --json
153
- npx frameyard render main --props props/main.json --workers 8 --scratch /path/to/scratch --json
154
- npx frameyard check hello --json
155
- npx frameyard render hello --props props/hello.json --json
156
- \`\`\`
157
-
158
- - Use \`--json\` for non-interactive commands. Parse stdout as the structured result; treat stderr as progress and diagnostics.
159
- - Use \`--project <dir>\` when running outside the project root.
160
- - \`render\` writes to \`out/<id>.mp4\` in the project unless \`--out\` is passed. \`out/\` is gitignored.
161
- - Use \`--concurrency <n>\` for composition renders (1-16). Use \`--workers <n>\` for timeline renders (1-16); the default is 8. Timeline renders also accept \`--scratch <dir>\` for FFV1 intermediates. \`--container <mp4|mov|mkv|webm>\`, \`--codec <h264|hevc|vp9>\`, and \`--encoder <auto|software|nvenc|qsv>\` select the delivery pair and encoder; the defaults are MP4 with H.264 and \`auto\`, which falls back to software.
162
- - \`still\` and \`render\` replace existing outputs only with \`--overwrite\`. Generated assets are replaced only with \`--force\`, and only with user approval.
163
-
164
- The official \`frameyard\` agent skill contains the full host-neutral contract. Install it with \`npx skills add vladiantio/frameyard\` or see the \`skills/frameyard/\` directory in the \`frameyard\` npm package. This file is the project-local summary.
165
-
166
- This project was scaffolded with frameyard ${VERSION}. \`npx frameyard\` resolves the latest published version; run \`npx frameyard@${VERSION}\` when you need the CLI version that scaffolded the project.
167
- `;
168
- const PROJECT_README = `# My Frameyard project
169
-
170
- Coding agents should read \`AGENTS.md\` for the project rules and the check, still, and render workflow.
171
-
172
- The reusable composition is a plain HTML document at \`compositions/hello.html\`. The edit is \`timelines/main.timeline.json\`, which places that composition as a clip in the project format. The project format is fixed in \`video.config.js\`.
173
-
174
- Start the preview:
175
-
176
- \`\`\`sh
177
- npx frameyard dev
178
- \`\`\`
179
-
180
- The preview lists the timeline next to the compositions. Open the timeline to scrub it and inspect the program monitor.
181
-
182
- Validate and render the timeline:
183
-
184
- \`\`\`sh
185
- npx frameyard doctor
186
- npx frameyard check main
187
- npx frameyard render main --props props/main.json
188
- \`\`\`
189
-
190
- \`props/main.json\` maps composition clip IDs to props overrides. The video is written to \`out/main.mp4\` in the project. Pass \`--out <file.mp4>\` to choose another path. Timelines with heavy composition work accept \`--workers <n>\` and \`--scratch <dir>\`.
191
-
192
- The composition can still be previewed and rendered on its own:
193
-
194
- \`\`\`sh
195
- npx frameyard check hello
196
- npx frameyard render hello --props props/hello.json
197
- \`\`\`
198
-
199
- Or run the pinned scripts from \`package.json\`:
200
-
201
- \`\`\`sh
202
- npm run dev
203
- npm run check -- main
204
- npm run render -- main --props props/main.json
205
- npm run still -- main --frame 42 --out main-42.png
206
- \`\`\`
207
- `;
208
- const SCAFFOLD_TEMPLATES = {
209
- ".gitignore": "out/\n",
210
- "video.config.js": `export default {\n format: { width: 1280, height: 720, fps: 30 },\n compositions: {\n hello: "./compositions/hello.html",\n },\n timelines: {\n main: "./timelines/main.timeline.json",\n },\n};\n`,
211
- "props/hello.json": `${JSON.stringify({ title: "Hello, Frameyard", accent: "#b8f36b" }, null, 2)}\n`,
212
- "props/main.json": `${JSON.stringify({ hello: { title: "Hello, Frameyard", accent: "#b8f36b" } }, null, 2)}\n`,
213
- "timelines/main.timeline.json": `${JSON.stringify({
214
- version: 1,
215
- tracks: [{ id: "v1", kind: "video" }],
216
- clips: [
217
- {
218
- id: "hello",
219
- track: "v1",
220
- source: { kind: "composition", id: "hello" },
221
- start: 0,
222
- },
223
- ],
224
- }, null, 2)}\n`,
225
- "AGENTS.md": AGENTS_GUIDE,
226
- "README.md": PROJECT_README,
227
- "compositions/hello.html": `<!doctype html>
228
- <html>
229
- <head>
230
- <meta charset="utf-8">
231
- <script type="application/json" data-fy="props">
232
- { "title": "Hello, Frameyard", "accent": "#b8f36b" }
233
- </script>
234
- <style>
235
- @keyframes fade-up {
236
- from { opacity: 0; transform: translateY(28px); }
237
- to { opacity: 1; transform: translateY(0); }
238
- }
239
- @keyframes drift {
240
- from { transform: translate(-120px, -80px); }
241
- to { transform: translate(120px, 80px); }
242
- }
243
- #hello {
244
- position: relative;
245
- width: 100%;
246
- height: 100%;
247
- display: grid;
248
- place-items: center;
249
- overflow: hidden;
250
- background: #0b0d10;
251
- color: #e8edf3;
252
- font-family: Inter, system-ui, sans-serif;
253
- }
254
- #hello h1 {
255
- position: relative;
256
- margin: 0;
257
- font-size: 96px;
258
- letter-spacing: -0.04em;
259
- opacity: 0;
260
- animation: fade-up 1s cubic-bezier(0.215, 0.61, 0.355, 1) both;
261
- }
262
- #hello p {
263
- position: relative;
264
- margin: 18px 0 0;
265
- color: #8a97a6;
266
- font-size: 26px;
267
- }
268
- #glow {
269
- position: absolute;
270
- left: 50%;
271
- top: 50%;
272
- width: 520px;
273
- height: 520px;
274
- margin: -260px 0 0 -260px;
275
- border-radius: 50%;
276
- background: var(--fy-prop-accent);
277
- filter: blur(120px);
278
- opacity: 0.16;
279
- animation: drift 12s ease-in-out infinite alternate;
280
- }
281
- #sweep {
282
- position: absolute;
283
- left: 0;
284
- bottom: 0;
285
- width: calc(var(--fy-progress) * 100%);
286
- height: 4px;
287
- background: var(--fy-prop-accent);
288
- }
289
- </style>
290
- </head>
291
- <body>
292
- <fy-composition width="1280" height="720" fps="30" duration-in-frames="150">
293
- <div id="hello">
294
- <div id="glow"></div>
295
- <div style="position: relative; text-align: center">
296
- <h1 id="title" data-fy-text="title" data-fy-anim-start="0" data-fy-anim-duration="24"></h1>
297
- <p>Deterministic video, authored on the web.</p>
298
- </div>
299
- <div id="sweep"></div>
300
- </div>
301
- </fy-composition>
302
- </body>
303
- </html>
304
- `,
305
- };
306
25
  // Keep the generated package name valid for npm and pnpm.
307
26
  function packageName(projectName) {
308
27
  const normalized = projectName
@@ -313,21 +32,33 @@ function packageName(projectName) {
313
32
  .replace(/[._-]+$/g, "");
314
33
  return normalized === "" ? "frameyard-project" : normalized;
315
34
  }
35
+ function renderTemplates(templates, projectName) {
36
+ const name = packageName(projectName);
37
+ return Object.fromEntries(Object.entries(templates).map(([file, content]) => [
38
+ file === "gitignore.template" ? ".gitignore" : file,
39
+ content.replaceAll("{{PROJECT_NAME}}", name).replaceAll("{{VERSION}}", VERSION),
40
+ ]));
41
+ }
42
+ /** Reads the project scaffold templates from `scaffolds/init/`. */
316
43
  export function scaffoldFiles(projectName) {
317
- return {
318
- "package.json": `${JSON.stringify({
319
- name: packageName(projectName),
320
- private: true,
321
- type: "module",
322
- scripts: {
323
- dev: `npx --yes frameyard@${VERSION} dev`,
324
- check: `npx --yes frameyard@${VERSION} check`,
325
- render: `npx --yes frameyard@${VERSION} render`,
326
- still: `npx --yes frameyard@${VERSION} still`,
327
- },
328
- }, null, 2)}\n`,
329
- ...SCAFFOLD_TEMPLATES,
330
- };
44
+ return renderTemplates(readTemplates(INIT_TEMPLATES), projectName);
45
+ }
46
+ /** Reads the optional local-model host scaffold from `scaffolds/local-models/`. */
47
+ export function localModelScaffoldFiles() {
48
+ const templates = readTemplates(LOCAL_MODELS_TEMPLATES);
49
+ const files = {};
50
+ for (const [file, content] of Object.entries(templates)) {
51
+ if (file.startsWith("opencode/")) {
52
+ files[`.opencode/${file.slice("opencode/".length)}`] = content;
53
+ }
54
+ else if (file.startsWith("pi/")) {
55
+ files[`.pi/${file.slice("pi/".length)}`] = content;
56
+ }
57
+ else {
58
+ files[file] = content;
59
+ }
60
+ }
61
+ return files;
331
62
  }
332
63
  export const SCAFFOLD_NEXT = [
333
64
  "npx frameyard doctor",
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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OAAO,CAAC;QACjE,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,sBAAsB;IACtB,mBAAmB;IACnB,0BAA0B;IAC1B,2BAA2B;CAC5B,CAAC"}
@@ -1,20 +1,28 @@
1
+ import type { CompositionFormat } from "../contracts.js";
1
2
  export declare const FRAMEWORK_IMPORT_MAP: {
2
3
  readonly frameyard: "/__frameyard/framework/index.js";
3
4
  readonly "frameyard/runtime": "/__frameyard/framework/runtime/index.js";
4
5
  };
5
6
  export declare const COMPOSITION_HOST_SCRIPT_URL = "/__frameyard/framework/runtime/host.js";
6
7
  export declare const COMPOSITION_HOST_STYLE = "html, body { margin: 0; width: 100%; height: 100%; } fy-composition { display: block; width: 100%; height: 100%; } fy-composition[data-fy-pending] { visibility: hidden !important; }";
7
- export interface CompositionHostInjectionOptions {
8
- html: string;
8
+ export interface RenderCompositionDocumentOptions {
9
+ /** Authoring fragment: body content with one top-level `<fy-composition>`. */
10
+ fragment: string;
11
+ /**
12
+ * Project format the host uses to fill width, height, and fps the
13
+ * composition omits. Absent in projects without a format.
14
+ */
15
+ format?: CompositionFormat | null;
9
16
  importMap?: Record<string, string>;
10
17
  hostScriptUrl?: string;
11
18
  styleText?: string;
19
+ /** Project font stylesheet served by the preview server. */
20
+ fontStylesheetUrl?: string;
12
21
  }
13
22
  /**
14
- * Injects the framework import map, sizing style, and composition host into a
15
- * composition document. The host script is a deferred module, so it runs after
16
- * the document is parsed; author executable scripts are rejected by static
17
- * validation before this function is called.
23
+ * Wraps an authoring fragment in the fixed composition document shell. Top-level
24
+ * import maps and stylesheets are hoisted into `<head>`; the rest of the
25
+ * fragment becomes `<body>` content.
18
26
  */
19
- export declare function injectCompositionHost(options: CompositionHostInjectionOptions): string;
27
+ export declare function renderCompositionDocument(options: RenderCompositionDocumentOptions): string;
20
28
  //# sourceMappingURL=composition-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"composition-html.d.ts","sourceRoot":"","sources":["../../src/server/composition-html.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;aAC/B,SAAS,EAAE,iCAAiC;aAC5C,mBAAmB,EAAE,yCAAyC;CACtD,CAAC;AAEX,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AAEpF,eAAO,MAAM,sBAAsB,0LACsJ,CAAC;AAE1L,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CA4BtF"}
1
+ {"version":3,"file":"composition-html.d.ts","sourceRoot":"","sources":["../../src/server/composition-html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,eAAO,MAAM,oBAAoB;aAC/B,SAAS,EAAE,iCAAiC;aAC5C,mBAAmB,EAAE,yCAAyC;CACtD,CAAC;AAEX,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AAEpF,eAAO,MAAM,sBAAsB,0LACsJ,CAAC;AAE1L,MAAM,WAAW,gCAAgC;IAC/C,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gCAAgC,GAAG,MAAM,CA6F3F"}
@@ -1,5 +1,5 @@
1
1
  import { defaultTreeAdapter, html, parse, serialize } from "parse5";
2
- import { getElementByTagName } from "../html/parse.js";
2
+ import { getAttribute, getElementByTagName, isElement, parseHtmlFragment } from "../html/parse.js";
3
3
  export const FRAMEWORK_IMPORT_MAP = {
4
4
  frameyard: "/__frameyard/framework/index.js",
5
5
  "frameyard/runtime": "/__frameyard/framework/runtime/index.js",
@@ -7,39 +7,95 @@ export const FRAMEWORK_IMPORT_MAP = {
7
7
  export const COMPOSITION_HOST_SCRIPT_URL = "/__frameyard/framework/runtime/host.js";
8
8
  export const COMPOSITION_HOST_STYLE = "html, body { margin: 0; width: 100%; height: 100%; } fy-composition { display: block; width: 100%; height: 100%; } fy-composition[data-fy-pending] { visibility: hidden !important; }";
9
9
  /**
10
- * Injects the framework import map, sizing style, and composition host into a
11
- * composition document. The host script is a deferred module, so it runs after
12
- * the document is parsed; author executable scripts are rejected by static
13
- * validation before this function is called.
10
+ * Wraps an authoring fragment in the fixed composition document shell. Top-level
11
+ * import maps and stylesheets are hoisted into `<head>`; the rest of the
12
+ * fragment becomes `<body>` content.
14
13
  */
15
- export function injectCompositionHost(options) {
16
- const document = parse(options.html);
14
+ export function renderCompositionDocument(options) {
15
+ const document = parse('<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Frameyard composition</title></head><body></body></html>', { sourceCodeLocationInfo: false });
17
16
  const head = getElementByTagName(document, "head");
18
- if (!head) {
19
- throw new Error("Composition document has no <head> element.");
17
+ const body = getElementByTagName(document, "body");
18
+ if (!head || !body) {
19
+ throw new Error("Composition shell is missing <head> or <body>.");
20
20
  }
21
- const importMap = createElement("script", [
21
+ const fragment = parseHtmlFragment(options.fragment);
22
+ const bodyNodes = [];
23
+ const styleNodes = [];
24
+ const importMaps = [];
25
+ for (const node of fragment.childNodes) {
26
+ if (isElement(node)) {
27
+ if (node.tagName === "style") {
28
+ styleNodes.push(node);
29
+ continue;
30
+ }
31
+ if (node.tagName === "link" && isStyleSheetLink(node)) {
32
+ styleNodes.push(node);
33
+ continue;
34
+ }
35
+ if (node.tagName === "script" && getAttribute(node, "type")?.toLowerCase() === "importmap") {
36
+ importMaps.push(node);
37
+ continue;
38
+ }
39
+ }
40
+ bodyNodes.push(node);
41
+ }
42
+ if (options.format) {
43
+ const format = createElement("script", [
44
+ { name: "type", value: "application/json" },
45
+ { name: "data-fy", value: "format" },
46
+ { name: "data-fy-host", value: "" },
47
+ ]);
48
+ appendText(format, JSON.stringify({
49
+ width: options.format.width,
50
+ height: options.format.height,
51
+ fps: options.format.fps,
52
+ }));
53
+ appendChild(head, format);
54
+ }
55
+ const frameworkImportMap = createElement("script", [
22
56
  { name: "type", value: "importmap" },
23
57
  { name: "data-fy-host", value: "" },
24
58
  ]);
25
- appendText(importMap, JSON.stringify({ imports: options.importMap ?? FRAMEWORK_IMPORT_MAP }));
26
- const style = createElement("style", [{ name: "data-fy-host-style", value: "" }]);
27
- appendText(style, options.styleText ?? COMPOSITION_HOST_STYLE);
59
+ appendText(frameworkImportMap, JSON.stringify({ imports: options.importMap ?? FRAMEWORK_IMPORT_MAP }));
60
+ appendChild(head, frameworkImportMap);
61
+ for (const importMap of importMaps) {
62
+ appendChild(head, importMap);
63
+ }
64
+ const hostStyle = createElement("style", [{ name: "data-fy-host", value: "" }]);
65
+ appendText(hostStyle, options.styleText ?? COMPOSITION_HOST_STYLE);
66
+ appendChild(head, hostStyle);
67
+ if (options.fontStylesheetUrl !== undefined) {
68
+ appendChild(head, createElement("link", [
69
+ { name: "rel", value: "stylesheet" },
70
+ { name: "href", value: options.fontStylesheetUrl },
71
+ { name: "data-fy-host", value: "" },
72
+ ]));
73
+ }
74
+ for (const style of styleNodes) {
75
+ appendChild(head, style);
76
+ }
28
77
  const host = createElement("script", [
29
78
  { name: "type", value: "module" },
30
79
  { name: "src", value: options.hostScriptUrl ?? COMPOSITION_HOST_SCRIPT_URL },
31
80
  { name: "data-fy-host", value: "" },
32
81
  ]);
33
- head.childNodes.unshift(importMap, style, host);
34
- for (const child of [importMap, style, host]) {
35
- child.parentNode = head;
82
+ appendChild(head, host);
83
+ for (const node of bodyNodes) {
84
+ appendChild(body, node);
36
85
  }
37
86
  return serialize(document);
38
87
  }
88
+ function isStyleSheetLink(element) {
89
+ const rel = getAttribute(element, "rel")?.toLowerCase().split(/\s+/).filter(Boolean) ?? [];
90
+ return rel.includes("stylesheet");
91
+ }
39
92
  function createElement(tagName, attrs) {
40
93
  return defaultTreeAdapter.createElement(tagName, html.NS.HTML, attrs);
41
94
  }
42
95
  function appendText(element, value) {
43
96
  defaultTreeAdapter.appendChild(element, defaultTreeAdapter.createTextNode(value));
44
97
  }
98
+ function appendChild(parent, child) {
99
+ defaultTreeAdapter.appendChild(parent, child);
100
+ }
45
101
  //# sourceMappingURL=composition-html.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"composition-html.js","sourceRoot":"","sources":["../../src/server/composition-html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAoB,MAAM,kBAAkB,CAAC;AAEzE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE,iCAAiC;IAC5C,mBAAmB,EAAE,yCAAyC;CACtD,CAAC;AAEX,MAAM,CAAC,MAAM,2BAA2B,GAAG,wCAAwC,CAAC;AAEpF,MAAM,CAAC,MAAM,sBAAsB,GACjC,uLAAuL,CAAC;AAS1L;;;;;GAKG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,KAAK,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB,EAAE,KAAwC;IAChF,kBAAkB,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AAQA,OAAO,EAAe,KAAK,OAAO,EAA2B,MAAM,eAAe,CAAC;AAMnF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAkPD,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAmK9F"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AASA,OAAO,EAAe,KAAK,OAAO,EAA2B,MAAM,eAAe,CAAC;AAQnF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC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