@litfamily/litcodex 1.0.6 → 1.0.7

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 (816) hide show
  1. package/README.md +327 -23
  2. package/dist/cli.js +42 -0
  3. package/dist/config-migration/config-paths.js +9 -2
  4. package/dist/install/execute.d.ts +2 -0
  5. package/dist/install/execute.js +8 -3
  6. package/dist/install/generated-skill-payload-hashes.d.ts +617 -21
  7. package/dist/install/generated-skill-payload-hashes.js +617 -21
  8. package/dist/install/index.js +13 -2
  9. package/dist/install/marketplace-payload.d.ts +1 -0
  10. package/dist/install/marketplace-payload.js +73 -2
  11. package/dist/install/motion-runtime.d.ts +36 -0
  12. package/dist/install/motion-runtime.js +82 -0
  13. package/dist/install/office-runtime.d.ts +20 -0
  14. package/dist/install/office-runtime.js +37 -0
  15. package/dist/install/skill-catalog.d.ts +1 -1
  16. package/dist/install/skill-catalog.js +26 -2
  17. package/dist/install/skill-resource-hashes.d.ts +1 -1
  18. package/dist/install/skill-resource-hashes.js +1 -1
  19. package/dist/postinstall.js +14 -2
  20. package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
  21. package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
  22. package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
  23. package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
  24. package/marketplace/plugins/litcodex/components/lit-loop/directive.md +90 -5
  25. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-comprehend.md +13 -17
  26. package/marketplace/plugins/litcodex/components/lit-loop/directives/litwork.md +8 -0
  27. package/marketplace/plugins/litcodex/components/lit-loop/dist/codex-hook.js +8 -1
  28. package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-route.d.ts +18 -0
  29. package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-route.js +95 -0
  30. package/marketplace/plugins/litcodex/components/lit-loop/dist/skill-renames.d.ts +3 -1
  31. package/marketplace/plugins/litcodex/components/lit-loop/dist/skill-renames.js +10 -5
  32. package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
  33. package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
  34. package/marketplace/plugins/litcodex/components/rules/bundled-rules/lit-humanizer.md +12 -0
  35. package/marketplace/plugins/litcodex/components/rules/dist/cli.js +22 -10
  36. package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.d.ts +23 -34
  37. package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.js +420 -388
  38. package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
  39. package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
  40. package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
  41. package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
  42. package/marketplace/plugins/litcodex/hooks/hooks.json +32 -21
  43. package/marketplace/plugins/litcodex/skills/autoconference/assets/report_template.md +1 -1
  44. package/marketplace/plugins/litcodex/skills/browser-drive/SKILL.md +4 -0
  45. package/marketplace/plugins/litcodex/skills/browser-drive/scripts/capability-probe.mjs +25 -2
  46. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/SKILL.md +14 -15
  47. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/THIRD-PARTY-NOTICE.txt +7 -0
  48. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/examples/readme-ab/README.md +13 -0
  49. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/adaptive-layout.md +12 -83
  50. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/brand-and-imagery.md +17 -65
  51. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/complete-contract.md +44 -13
  52. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/composition.md +14 -80
  53. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/craft-floor.md +103 -0
  54. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/creative-directions.md +13 -82
  55. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/evidence-review.md +14 -112
  56. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/implementation-platforms.md +16 -68
  57. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/inclusive-interface.md +12 -86
  58. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/interaction-motion.md +13 -82
  59. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/motion-guide.md +123 -0
  60. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/operating-lanes.md +12 -100
  61. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/performance-delivery.md +12 -78
  62. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/probe-and-review.md +41 -0
  63. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/product-direction.md +10 -88
  64. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/production-interview.md +10 -12
  65. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/redesign-playbook.md +12 -74
  66. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/slop-register.md +98 -0
  67. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/system-foundations.md +13 -100
  68. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/visual-language.md +11 -74
  69. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/visual-reconstruction.md +9 -78
  70. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/hover-probe.mjs +28 -0
  71. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/page-probe.mjs +423 -0
  72. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/probe.mjs +261 -0
  73. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/route-mode.mjs +19 -0
  74. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/rule-data.mjs +115 -0
  75. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/serve-static.mjs +24 -0
  76. package/marketplace/plugins/litcodex/skills/lit-comprehend/SKILL.md +45 -53
  77. package/marketplace/plugins/litcodex/skills/lit-comprehend/references/artifact-template.md +10 -44
  78. package/marketplace/plugins/litcodex/skills/lit-comprehend/scripts/verify-explainer.ts +0 -18
  79. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/NOTICE +33 -0
  80. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/SKILL.md +167 -0
  81. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/agents/openai.yaml +6 -0
  82. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-architecture-dark.html +1 -0
  83. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-architecture-full.html +1 -0
  84. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-architecture-light.html +1 -0
  85. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bar-dark.html +1 -0
  86. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bar-full.html +1 -0
  87. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bar-light.html +1 -0
  88. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-beeswarm-dark.html +1 -0
  89. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-beeswarm-full.html +1 -0
  90. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-beeswarm-light.html +1 -0
  91. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bubble-dark.html +1 -0
  92. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bubble-full.html +1 -0
  93. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bubble-light.html +1 -0
  94. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bump-dark.html +1 -0
  95. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bump-full.html +1 -0
  96. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bump-light.html +1 -0
  97. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-data-flow-dark.html +1 -0
  98. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-data-flow-full.html +1 -0
  99. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-data-flow-light.html +1 -0
  100. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-datalake-dark.html +1 -0
  101. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-datalake-full.html +1 -0
  102. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-datalake-light.html +1 -0
  103. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-db-schema-dark.html +1 -0
  104. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-db-schema-full.html +1 -0
  105. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-db-schema-light.html +1 -0
  106. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dependency-dark.html +1 -0
  107. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dependency-full.html +1 -0
  108. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dependency-light.html +1 -0
  109. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-deployment-dark.html +1 -0
  110. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-deployment-full.html +1 -0
  111. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-deployment-light.html +1 -0
  112. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-integration-dark.html +1 -0
  113. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-integration-full.html +1 -0
  114. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-integration-light.html +1 -0
  115. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-dark.html +1 -0
  116. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-full.html +1 -0
  117. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-light.html +1 -0
  118. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-er-dark.html +1 -0
  119. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-er-full.html +1 -0
  120. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-er-light.html +1 -0
  121. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-fishbone-dark.html +1 -0
  122. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-fishbone-full.html +1 -0
  123. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-fishbone-light.html +1 -0
  124. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-flowchart-dark.html +1 -0
  125. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-flowchart-full.html +1 -0
  126. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-flowchart-light.html +1 -0
  127. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-gantt-dark.html +1 -0
  128. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-gantt-full.html +1 -0
  129. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-gantt-light.html +1 -0
  130. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-heatmap-dark.html +1 -0
  131. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-heatmap-full.html +1 -0
  132. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-heatmap-light.html +1 -0
  133. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-dark.html +1 -0
  134. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-full.html +1 -0
  135. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-light.html +1 -0
  136. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-dark.html +1 -0
  137. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-full.html +1 -0
  138. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-light.html +1 -0
  139. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-drawio-dark.html +1 -0
  140. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-drawio-full.html +1 -0
  141. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-drawio-light.html +1 -0
  142. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-dark.html +1 -0
  143. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-full.html +1 -0
  144. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-light.html +1 -0
  145. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-dark.html +1 -0
  146. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-full.html +1 -0
  147. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-light.html +1 -0
  148. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-it-state-dark.html +1 -0
  149. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-it-state-full.html +1 -0
  150. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-it-state-light.html +1 -0
  151. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-journey-dark.html +1 -0
  152. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-journey-full.html +1 -0
  153. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-journey-light.html +1 -0
  154. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-kanban-dark.html +1 -0
  155. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-kanban-full.html +1 -0
  156. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-kanban-light.html +1 -0
  157. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-layers-dark.html +1 -0
  158. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-layers-full.html +1 -0
  159. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-layers-light.html +1 -0
  160. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-line-dark.html +1 -0
  161. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-line-full.html +1 -0
  162. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-line-light.html +1 -0
  163. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-dark.html +1 -0
  164. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-full.html +1 -0
  165. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-light.html +1 -0
  166. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-dark.html +1 -0
  167. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-full.html +1 -0
  168. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-light.html +1 -0
  169. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-marimekko-dark.html +1 -0
  170. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-marimekko-full.html +1 -0
  171. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-marimekko-light.html +1 -0
  172. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-medallion-dark.html +1 -0
  173. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-medallion-full.html +1 -0
  174. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-medallion-light.html +1 -0
  175. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-nested-dark.html +1 -0
  176. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-nested-full.html +1 -0
  177. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-nested-light.html +1 -0
  178. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-org-chart-dark.html +1 -0
  179. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-org-chart-full.html +1 -0
  180. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-org-chart-light.html +1 -0
  181. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-dark.html +1 -0
  182. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-full.html +1 -0
  183. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-light.html +1 -0
  184. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-polar-dark.html +1 -0
  185. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-polar-full.html +1 -0
  186. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-polar-light.html +1 -0
  187. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-dark.html +1 -0
  188. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-full.html +1 -0
  189. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-light.html +1 -0
  190. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-process-dark.html +1 -0
  191. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-process-full.html +1 -0
  192. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-process-light.html +1 -0
  193. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-pyramid-dark.html +1 -0
  194. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-pyramid-full.html +1 -0
  195. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-pyramid-light.html +1 -0
  196. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-dark.html +1 -0
  197. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-full.html +1 -0
  198. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-light.html +1 -0
  199. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-dark.html +1 -0
  200. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-full.html +1 -0
  201. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-light.html +1 -0
  202. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-queue-animated-dark.html +1 -0
  203. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-queue-animated-full.html +1 -0
  204. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-queue-animated-light.html +1 -0
  205. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-radar-dark.html +1 -0
  206. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-radar-full.html +1 -0
  207. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-radar-light.html +1 -0
  208. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-ridgeline-dark.html +1 -0
  209. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-ridgeline-full.html +1 -0
  210. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-ridgeline-light.html +1 -0
  211. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sankey-dark.html +1 -0
  212. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sankey-full.html +1 -0
  213. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sankey-light.html +1 -0
  214. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-scatter-dark.html +1 -0
  215. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-scatter-full.html +1 -0
  216. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-scatter-light.html +1 -0
  217. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-dark.html +1 -0
  218. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-full.html +1 -0
  219. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-light.html +1 -0
  220. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-dark.html +1 -0
  221. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-full.html +1 -0
  222. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-light.html +1 -0
  223. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-slopegraph-dark.html +1 -0
  224. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-slopegraph-full.html +1 -0
  225. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-slopegraph-light.html +1 -0
  226. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-dark.html +1 -0
  227. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-full.html +1 -0
  228. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-dark.html +1 -0
  229. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-full.html +1 -0
  230. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-light.html +1 -0
  231. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-light.html +1 -0
  232. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-story-map-dark.html +1 -0
  233. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-story-map-full.html +1 -0
  234. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-story-map-light.html +1 -0
  235. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-streamgraph-dark.html +1 -0
  236. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-streamgraph-full.html +1 -0
  237. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-streamgraph-light.html +1 -0
  238. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-swimlane-dark.html +1 -0
  239. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-swimlane-full.html +1 -0
  240. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-swimlane-light.html +1 -0
  241. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-timeline-dark.html +1 -0
  242. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-timeline-full.html +1 -0
  243. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-timeline-light.html +1 -0
  244. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-dark.html +1 -0
  245. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-full.html +1 -0
  246. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-light.html +1 -0
  247. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-dark.html +1 -0
  248. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-full.html +1 -0
  249. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-light.html +1 -0
  250. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-treemap-dark.html +1 -0
  251. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-treemap-full.html +1 -0
  252. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-treemap-light.html +1 -0
  253. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-uml-class-dark.html +1 -0
  254. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-uml-class-full.html +1 -0
  255. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-uml-class-light.html +1 -0
  256. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-venn-dark.html +1 -0
  257. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-venn-full.html +1 -0
  258. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-venn-light.html +1 -0
  259. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-wardley-dark.html +1 -0
  260. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-wardley-full.html +1 -0
  261. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-wardley-light.html +1 -0
  262. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-waterfall-dark.html +1 -0
  263. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-waterfall-full.html +1 -0
  264. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-waterfall-light.html +1 -0
  265. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/fonts/OFL.txt +94 -0
  266. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/fonts/PretendardVariable.woff2 +0 -0
  267. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/fonts/provenance.json +22 -0
  268. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/icons.html +231 -0
  269. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/index.html +1 -0
  270. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/devicon-MIT.txt +20 -0
  271. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/diagram-design-MIT.txt +21 -0
  272. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/log-z-MIT.txt +21 -0
  273. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/simple-icons-CC0.md +30 -0
  274. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/tabler-MIT.txt +21 -0
  275. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/01-service-architecture/after.html +1 -0
  276. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/01-service-architecture/brief.md +33 -0
  277. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/01-service-architecture/constructed-naive-foil.html +1 -0
  278. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/02-release-decision/after.html +1 -0
  279. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/02-release-decision/brief.md +18 -0
  280. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/02-release-decision/constructed-naive-foil.html +1 -0
  281. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/03-data-retention/after.html +1 -0
  282. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/03-data-retention/brief.md +19 -0
  283. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/03-data-retention/constructed-naive-foil.html +1 -0
  284. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/04-oauth-sequence/after.html +1 -0
  285. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/04-oauth-sequence/brief.md +17 -0
  286. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/04-oauth-sequence/constructed-naive-foil.html +1 -0
  287. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/05-review-lanes/after.html +1 -0
  288. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/05-review-lanes/brief.md +17 -0
  289. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/05-review-lanes/constructed-naive-foil.html +1 -0
  290. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/06-rollout-gates/after.html +1 -0
  291. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/06-rollout-gates/brief.md +17 -0
  292. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/06-rollout-gates/constructed-naive-foil.html +1 -0
  293. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/07-deployment-boundary/after.html +1 -0
  294. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/07-deployment-boundary/brief.md +19 -0
  295. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/07-deployment-boundary/constructed-naive-foil.html +1 -0
  296. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/08-policy-traces/after.html +1 -0
  297. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/08-policy-traces/brief.md +20 -0
  298. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/08-policy-traces/constructed-naive-foil.html +1 -0
  299. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/accessibility.md +37 -0
  300. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/export.md +29 -0
  301. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-drawio.md +21 -0
  302. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-excalidraw.md +14 -0
  303. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-mermaid.md +18 -0
  304. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-schema.md +28 -0
  305. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/korean-typography.md +34 -0
  306. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/motion.md +29 -0
  307. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/office-pptx-docx.md +42 -0
  308. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/output-spec.md +48 -0
  309. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-annotation.md +12 -0
  310. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-icons.md +21 -0
  311. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-sketchy.md +11 -0
  312. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-terminal.md +11 -0
  313. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/profiles.md +24 -0
  314. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/semantic-patterns.md +27 -0
  315. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/style-guide.md +67 -0
  316. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-architecture.md +51 -0
  317. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-bar.md +51 -0
  318. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-beeswarm.md +49 -0
  319. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-bubble.md +49 -0
  320. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-bump.md +49 -0
  321. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-catalog.json +1433 -0
  322. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-data-flow.md +51 -0
  323. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-datalake.md +49 -0
  324. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-db-schema.md +49 -0
  325. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dependency.md +49 -0
  326. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-deployment.md +49 -0
  327. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dp-integration.md +49 -0
  328. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dp-security-matrix.md +49 -0
  329. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-er.md +49 -0
  330. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-fishbone.md +49 -0
  331. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-flowchart.md +49 -0
  332. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-gantt.md +49 -0
  333. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-heatmap.md +53 -0
  334. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-high-level-vertical.md +53 -0
  335. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-high-level.md +53 -0
  336. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-import-drawio.md +53 -0
  337. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-import-excalidraw.md +53 -0
  338. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-import-mermaid.md +53 -0
  339. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-it-state.md +54 -0
  340. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-journey.md +54 -0
  341. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-kanban.md +54 -0
  342. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-layers.md +54 -0
  343. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-line.md +54 -0
  344. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-loop-terminal.md +53 -0
  345. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-loop.md +54 -0
  346. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-marimekko.md +54 -0
  347. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-medallion.md +54 -0
  348. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-nested.md +59 -0
  349. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-org-chart.md +58 -0
  350. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-paved-road-animated.md +72 -0
  351. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-polar.md +67 -0
  352. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-policy-trace-animated.md +69 -0
  353. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-process.md +58 -0
  354. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-pyramid.md +59 -0
  355. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-quadrant-consultant.md +60 -0
  356. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-quadrant.md +57 -0
  357. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-queue-animated.md +63 -0
  358. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-radar.md +57 -0
  359. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-ridgeline.md +63 -0
  360. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-sankey.md +68 -0
  361. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-scatter.md +60 -0
  362. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-sequence-oauth.md +66 -0
  363. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-sequence.md +63 -0
  364. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-slopegraph.md +65 -0
  365. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-state-lifecycle.md +53 -0
  366. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-state.md +59 -0
  367. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-story-map.md +52 -0
  368. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-streamgraph.md +53 -0
  369. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-swimlane.md +52 -0
  370. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-timeline.md +52 -0
  371. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +57 -0
  372. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree.md +54 -0
  373. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-treemap.md +54 -0
  374. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-uml-class.md +52 -0
  375. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-venn.md +51 -0
  376. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-wardley.md +52 -0
  377. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-waterfall.md +54 -0
  378. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/verifier-guide.md +59 -0
  379. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/block-registry.mjs +43 -0
  380. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/brief-contract.mjs +94 -0
  381. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/check-visible-text.mjs +15 -0
  382. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +14 -0
  383. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/diagram-metrics.mjs +219 -0
  384. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/doctor.mjs +28 -0
  385. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/drawio-model.mjs +162 -0
  386. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/drawio-source.mjs +147 -0
  387. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/drawio-xml.mjs +148 -0
  388. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/export.mjs +122 -0
  389. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-common.mjs +85 -0
  390. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-drawio.mjs +48 -0
  391. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-excalidraw.mjs +234 -0
  392. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-mermaid.mjs +104 -0
  393. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-common.mjs +115 -0
  394. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-er.mjs +70 -0
  395. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-flowchart.mjs +178 -0
  396. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-sequence.mjs +137 -0
  397. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-state.mjs +80 -0
  398. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/office-safety.mjs +54 -0
  399. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/runtime-probes.mjs +11 -0
  400. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-all.mjs +85 -0
  401. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-brief.mjs +16 -0
  402. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-diagram.mjs +27 -0
  403. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-motion.mjs +12 -0
  404. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-type.mjs +48 -0
  405. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/visual-quality-geometry.mjs +226 -0
  406. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/visual-quality.mjs +147 -0
  407. package/marketplace/plugins/litcodex/skills/lit-docx/LICENSE +21 -0
  408. package/marketplace/plugins/litcodex/skills/lit-docx/NOTICE +3 -0
  409. package/marketplace/plugins/litcodex/skills/lit-docx/SKILL.md +102 -0
  410. package/marketplace/plugins/litcodex/skills/lit-docx/agents/openai.yaml +14 -0
  411. package/marketplace/plugins/litcodex/skills/lit-docx/references/frontmatter_schema.md +42 -0
  412. package/marketplace/plugins/litcodex/skills/lit-docx/references/journal_style_spec.md +17 -0
  413. package/marketplace/plugins/litcodex/skills/lit-docx/references/markdown_quality_checklist.md +37 -0
  414. package/marketplace/plugins/litcodex/skills/lit-docx/references/slop_phrase_list.yaml +58 -0
  415. package/marketplace/plugins/litcodex/skills/lit-docx/references/slop_rules.md +35 -0
  416. package/marketplace/plugins/litcodex/skills/lit-docx/runtime/requirements.in +5 -0
  417. package/marketplace/plugins/litcodex/skills/lit-docx/runtime/requirements.lock +20 -0
  418. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/clean_markdown.py +95 -0
  419. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/convert_md_to_docx.py +1046 -0
  420. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/convert_md_to_pdf.py +281 -0
  421. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/convert_pdf.py +130 -0
  422. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/docx_craft.py +95 -0
  423. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/edit_docx.py +297 -0
  424. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/embed_images.py +78 -0
  425. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/generate_docx_templates.py +491 -0
  426. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/slop_lint.py +473 -0
  427. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/visual_audit.py +41 -0
  428. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/acs.docx +0 -0
  429. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/elsevier.docx +0 -0
  430. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/ieee.docx +0 -0
  431. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/korean-generic.docx +0 -0
  432. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/nature.docx +0 -0
  433. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/acs/README.md +5 -0
  434. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/acs/template.tex +37 -0
  435. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/elsevier/README.md +5 -0
  436. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/elsevier/template.tex +38 -0
  437. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/ieee/README.md +5 -0
  438. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/ieee/template.tex +37 -0
  439. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/korean-generic/README.md +5 -0
  440. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/korean-generic/template.tex +37 -0
  441. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/nature/README.md +5 -0
  442. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/nature/template.tex +37 -0
  443. package/marketplace/plugins/litcodex/skills/lit-docx/templates/registry.yaml +1366 -0
  444. package/marketplace/plugins/litcodex/skills/lit-humanizer/NOTICE +160 -0
  445. package/marketplace/plugins/litcodex/skills/lit-humanizer/SKILL.md +146 -0
  446. package/marketplace/plugins/litcodex/skills/lit-humanizer/always-on-rule.md +9 -0
  447. package/marketplace/plugins/litcodex/skills/lit-humanizer/assets/always-on-rule.md +9 -0
  448. package/marketplace/plugins/litcodex/skills/lit-humanizer/assets/report-skeleton.md +25 -0
  449. package/marketplace/plugins/litcodex/skills/lit-humanizer/assets/slide-text-skeleton.md +28 -0
  450. package/marketplace/plugins/litcodex/skills/lit-humanizer/bench/prompts.md +73 -0
  451. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/accessibility-note/after.md +7 -0
  452. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/accessibility-note/before.md +7 -0
  453. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/api-reference/after.md +9 -0
  454. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/api-reference/before.md +15 -0
  455. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/changelog/after.md +5 -0
  456. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/changelog/before.md +12 -0
  457. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/code-comments/after.md +10 -0
  458. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/code-comments/before.md +19 -0
  459. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/commit/after.md +5 -0
  460. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/commit/before.md +7 -0
  461. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/data-release/after.md +7 -0
  462. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/data-release/before.md +9 -0
  463. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/english-essay/after.md +5 -0
  464. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/english-essay/before.md +5 -0
  465. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/incident-update/after.md +7 -0
  466. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/incident-update/before.md +7 -0
  467. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-essay/after.md +7 -0
  468. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-essay/before.md +9 -0
  469. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-report/after.md +9 -0
  470. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-report/before.md +13 -0
  471. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-slide/after.md +19 -0
  472. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-slide/before.md +21 -0
  473. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/meeting-brief/after.md +9 -0
  474. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/meeting-brief/before.md +11 -0
  475. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/policy-faq/after.md +9 -0
  476. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/policy-faq/before.md +9 -0
  477. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/pr/after.md +15 -0
  478. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/pr/before.md +17 -0
  479. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/project-update/after.md +7 -0
  480. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/project-update/before.md +9 -0
  481. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/readme/after.md +12 -0
  482. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/readme/before.md +14 -0
  483. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/report/after.md +13 -0
  484. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/report/before.md +11 -0
  485. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/research-abstract/after.md +5 -0
  486. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/research-abstract/before.md +5 -0
  487. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/slides/after.md +19 -0
  488. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/slides/before.md +19 -0
  489. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/troubleshooting/after.md +11 -0
  490. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/troubleshooting/before.md +11 -0
  491. package/marketplace/plugins/litcodex/skills/lit-humanizer/motion-guide.md +123 -0
  492. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/code-patterns.md +468 -0
  493. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/deliverable-channels.md +111 -0
  494. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns-checklist.md +43 -0
  495. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns-content.md +243 -0
  496. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns-structure.md +375 -0
  497. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns.md +57 -0
  498. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-metrics.md +33 -0
  499. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-patterns-a-d.md +659 -0
  500. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-patterns-e-j.md +387 -0
  501. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-patterns.md +31 -0
  502. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/prompt-injection-handling.md +7 -0
  503. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/rewrite-playbook.md +54 -0
  504. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/taxonomy.md +153 -0
  505. package/marketplace/plugins/litcodex/skills/lit-humanizer/rules.json +884 -0
  506. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/core.mjs +208 -0
  507. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/detect.mjs +83 -0
  508. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/extract_office_text.py +89 -0
  509. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/ko-metrics.mjs +124 -0
  510. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/test-fixtures.mjs +155 -0
  511. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/test-ko-metrics.mjs +27 -0
  512. package/marketplace/plugins/litcodex/skills/lit-init/references/deep-repository-map.md +6 -10
  513. package/marketplace/plugins/litcodex/skills/lit-loop/SKILL.md +95 -12
  514. package/marketplace/plugins/litcodex/skills/lit-loop/agents/openai.yaml +3 -2
  515. package/marketplace/plugins/litcodex/skills/lit-loop/references/full-workflow.md +10 -3
  516. package/marketplace/plugins/litcodex/skills/lit-pptx/NOTICE +7 -0
  517. package/marketplace/plugins/litcodex/skills/lit-pptx/SKILL.md +102 -0
  518. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/analyst.md +49 -0
  519. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/antithesis.md +59 -0
  520. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/architect.md +44 -0
  521. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/critic.md +42 -0
  522. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/openai.yaml +14 -0
  523. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/synthesizer.md +47 -0
  524. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/thesis.md +33 -0
  525. package/marketplace/plugins/litcodex/skills/lit-pptx/assets/azure/circle-lg.png +0 -0
  526. package/marketplace/plugins/litcodex/skills/lit-pptx/assets/azure/circle-md.png +0 -0
  527. package/marketplace/plugins/litcodex/skills/lit-pptx/assets/azure/circle-sm.png +0 -0
  528. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Black.otf +0 -0
  529. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Bold.otf +0 -0
  530. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Light.otf +0 -0
  531. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Medium.otf +0 -0
  532. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Regular.otf +0 -0
  533. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/OFL.txt +94 -0
  534. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/SOURCE.md +29 -0
  535. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/LICENSE.txt +94 -0
  536. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/PretendardGOV-Bold.otf +0 -0
  537. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/PretendardGOV-Regular.otf +0 -0
  538. package/marketplace/plugins/litcodex/skills/lit-pptx/references/anti-slop-checklist.md +71 -0
  539. package/marketplace/plugins/litcodex/skills/lit-pptx/references/authoring-guide.md +141 -0
  540. package/marketplace/plugins/litcodex/skills/lit-pptx/references/consensus-protocol.md +125 -0
  541. package/marketplace/plugins/litcodex/skills/lit-pptx/references/data-display-cookbook.md +45 -0
  542. package/marketplace/plugins/litcodex/skills/lit-pptx/references/design-system-azure.md +58 -0
  543. package/marketplace/plugins/litcodex/skills/lit-pptx/references/interview-protocol.md +113 -0
  544. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/package-lock.json +747 -0
  545. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/package.json +13 -0
  546. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/requirements.in +2 -0
  547. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/requirements.lock +14 -0
  548. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/check_ooxml.py +40 -0
  549. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/compile-deck.js +399 -0
  550. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/craft_extras.py +246 -0
  551. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/embed_fonts.py +201 -0
  552. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/inventory.py +95 -0
  553. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/learn_template.py +433 -0
  554. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/derive-palette.js +176 -0
  555. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/directive-parser.js +244 -0
  556. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/font-map.js +79 -0
  557. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/gen-bg.js +85 -0
  558. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/gen-gradient-assets.js +36 -0
  559. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/layout-resolver.js +734 -0
  560. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/markdown-loader.js +136 -0
  561. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-adapter-html.js +358 -0
  562. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-adapter-pptx.js +1885 -0
  563. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/slide-ast.js +517 -0
  564. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/spec-validator.js +94 -0
  565. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/template-registry.js +355 -0
  566. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/office-run.mjs +137 -0
  567. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/package.json +1 -0
  568. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/qa_deck.py +795 -0
  569. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/validate_pptx.py +206 -0
  570. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/markdown-slide-spec-v1.md +251 -0
  571. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/markdown-slide-spec-v2.md +207 -0
  572. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/slide-ast-v1.schema.json +229 -0
  573. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/slide-ast-v2.schema.json +144 -0
  574. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/template-enrollment-contract.md +379 -0
  575. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/bauhaus_light.css +4 -0
  576. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/boilerplate_professional.css +508 -0
  577. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/capabilities.yaml +146 -0
  578. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/layout-mapping.yaml +454 -0
  579. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/template.yaml +37 -0
  580. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/capabilities.yaml +154 -0
  581. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/layout-mapping.yaml +464 -0
  582. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/template.yaml +37 -0
  583. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/capabilities.yaml +179 -0
  584. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/layout-mapping.yaml +299 -0
  585. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/template.yaml +45 -0
  586. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml +181 -0
  587. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml +299 -0
  588. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml +44 -0
  589. package/marketplace/plugins/litcodex/skills/lit-scientific-visualization/SKILL.md +2 -0
  590. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/SKILL.md +73 -0
  591. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/agents/openai.yaml +15 -0
  592. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/NOTICE +23 -0
  593. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +32 -0
  594. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/browser-app.js +735 -0
  595. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/completion.mjs +9 -0
  596. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/compose.mjs +255 -0
  597. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/constants.mjs +264 -0
  598. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/driver.mjs +169 -0
  599. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/encode.mjs +163 -0
  600. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/flash.mjs +251 -0
  601. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/fonts.mjs +169 -0
  602. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/gate.mjs +466 -0
  603. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/image.mjs +267 -0
  604. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/look.mjs +182 -0
  605. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/passes.mjs +181 -0
  606. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/presets.mjs +110 -0
  607. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/report.mjs +56 -0
  608. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/runtime.mjs +287 -0
  609. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/scenes.mjs +309 -0
  610. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/sound.mjs +463 -0
  611. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-gate.mjs +155 -0
  612. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-init.js +215 -0
  613. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-kit.js +515 -0
  614. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.js +147 -0
  615. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.mjs +243 -0
  616. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-render.mjs +335 -0
  617. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-worker.mjs +26 -0
  618. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage.mjs +311 -0
  619. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stroke.mjs +264 -0
  620. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/timeline.mjs +153 -0
  621. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/treatment.mjs +280 -0
  622. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/type.mjs +234 -0
  623. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/util.mjs +198 -0
  624. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-wt400.ttf +0 -0
  625. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-wt700.ttf +0 -0
  626. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-wt900.ttf +0 -0
  627. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-wt400.ttf +0 -0
  628. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-wt700.ttf +0 -0
  629. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-wt900.ttf +0 -0
  630. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-wt400.ttf +0 -0
  631. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-wt700.ttf +0 -0
  632. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-wt900.ttf +0 -0
  633. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/OFL.txt +93 -0
  634. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/SHA256SUMS +16 -0
  635. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/CREDITS +6 -0
  636. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSAllure.svg +216 -0
  637. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSFelix.svg +216 -0
  638. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSOsmotron.svg +216 -0
  639. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSReadability.svg +216 -0
  640. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSTech.svg +217 -0
  641. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/OFL.txt +86 -0
  642. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/vt323/OFL.txt +93 -0
  643. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/vt323/VT323-Regular.ttf +0 -0
  644. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/quality-gate.md +137 -0
  645. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/runtime.md +68 -0
  646. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/scene-author.md +57 -0
  647. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/stage.md +175 -0
  648. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/style-bibles.md +103 -0
  649. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/treatment.md +119 -0
  650. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/type-and-timing.md +83 -0
  651. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/package-lock.json +59 -0
  652. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/package.json +1 -0
  653. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/requirements-audio.txt +1082 -0
  654. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/word-timing-models.json +11 -0
  655. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/beat-grid.py +50 -0
  656. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/render.mjs +807 -0
  657. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/runtime.mjs +43 -0
  658. package/marketplace/plugins/litcodex/skills/litresearch/SKILL.md +28 -41
  659. package/marketplace/plugins/litcodex/skills/litwork/SKILL.md +8 -0
  660. package/marketplace/plugins/litcodex/skills/litwork/references/delivery-playbook.md +6 -0
  661. package/node_modules/@litcodex/lit-loop/directive.md +90 -5
  662. package/node_modules/@litcodex/lit-loop/directives/lit-comprehend.md +13 -17
  663. package/node_modules/@litcodex/lit-loop/directives/litwork.md +8 -0
  664. package/node_modules/@litcodex/lit-loop/dist/codex-hook.js +8 -1
  665. package/node_modules/@litcodex/lit-loop/dist/motion-route.d.ts +18 -0
  666. package/node_modules/@litcodex/lit-loop/dist/motion-route.js +95 -0
  667. package/node_modules/@litcodex/lit-loop/dist/skill-renames.d.ts +3 -1
  668. package/node_modules/@litcodex/lit-loop/dist/skill-renames.js +10 -5
  669. package/node_modules/@litcodex/lit-loop/package.json +1 -1
  670. package/node_modules/@litcodex/lit-loop/skills/browser-drive/SKILL.md +4 -0
  671. package/node_modules/@litcodex/lit-loop/skills/browser-drive/scripts/capability-probe.mjs +25 -2
  672. package/node_modules/@litcodex/lit-loop/skills/lit-comprehend/SKILL.md +45 -53
  673. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/NOTICE +160 -0
  674. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/SKILL.md +146 -0
  675. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/always-on-rule.md +9 -0
  676. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/assets/always-on-rule.md +9 -0
  677. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/assets/report-skeleton.md +25 -0
  678. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/assets/slide-text-skeleton.md +28 -0
  679. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/bench/prompts.md +73 -0
  680. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/accessibility-note/after.md +7 -0
  681. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/accessibility-note/before.md +7 -0
  682. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/api-reference/after.md +9 -0
  683. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/api-reference/before.md +15 -0
  684. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/changelog/after.md +5 -0
  685. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/changelog/before.md +12 -0
  686. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/code-comments/after.md +10 -0
  687. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/code-comments/before.md +19 -0
  688. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/commit/after.md +5 -0
  689. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/commit/before.md +7 -0
  690. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/data-release/after.md +7 -0
  691. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/data-release/before.md +9 -0
  692. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/english-essay/after.md +5 -0
  693. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/english-essay/before.md +5 -0
  694. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/incident-update/after.md +7 -0
  695. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/incident-update/before.md +7 -0
  696. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-essay/after.md +7 -0
  697. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-essay/before.md +9 -0
  698. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-report/after.md +9 -0
  699. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-report/before.md +13 -0
  700. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-slide/after.md +19 -0
  701. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-slide/before.md +21 -0
  702. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/meeting-brief/after.md +9 -0
  703. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/meeting-brief/before.md +11 -0
  704. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/policy-faq/after.md +9 -0
  705. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/policy-faq/before.md +9 -0
  706. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/pr/after.md +15 -0
  707. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/pr/before.md +17 -0
  708. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/project-update/after.md +7 -0
  709. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/project-update/before.md +9 -0
  710. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/readme/after.md +12 -0
  711. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/readme/before.md +14 -0
  712. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/report/after.md +13 -0
  713. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/report/before.md +11 -0
  714. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/research-abstract/after.md +5 -0
  715. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/research-abstract/before.md +5 -0
  716. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/slides/after.md +19 -0
  717. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/slides/before.md +19 -0
  718. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/troubleshooting/after.md +11 -0
  719. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/troubleshooting/before.md +11 -0
  720. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/motion-guide.md +123 -0
  721. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/code-patterns.md +468 -0
  722. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/deliverable-channels.md +111 -0
  723. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns-checklist.md +43 -0
  724. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns-content.md +243 -0
  725. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns-structure.md +375 -0
  726. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns.md +57 -0
  727. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-metrics.md +33 -0
  728. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-patterns-a-d.md +659 -0
  729. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-patterns-e-j.md +387 -0
  730. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-patterns.md +31 -0
  731. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/prompt-injection-handling.md +7 -0
  732. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/rewrite-playbook.md +54 -0
  733. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/taxonomy.md +153 -0
  734. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/rules.json +884 -0
  735. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/core.mjs +208 -0
  736. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/detect.mjs +83 -0
  737. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/extract_office_text.py +89 -0
  738. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/ko-metrics.mjs +124 -0
  739. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/test-fixtures.mjs +155 -0
  740. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/test-ko-metrics.mjs +27 -0
  741. package/node_modules/@litcodex/lit-loop/skills/lit-init/references/deep-repository-map.md +6 -10
  742. package/node_modules/@litcodex/lit-loop/skills/lit-loop/SKILL.md +95 -12
  743. package/node_modules/@litcodex/lit-loop/skills/lit-scientific-visualization/SKILL.md +2 -0
  744. package/node_modules/@litcodex/lit-loop/skills/litresearch/SKILL.md +28 -41
  745. package/node_modules/@litcodex/lit-loop/skills/litwork/SKILL.md +8 -0
  746. package/package.json +3 -3
  747. package/readme-assets/ab-simple/assets/s11-baseline-desktop.webp +0 -0
  748. package/readme-assets/ab-simple/assets/s11-baseline-phone.webp +0 -0
  749. package/readme-assets/ab-simple/assets/s11-lit-desktop.webp +0 -0
  750. package/readme-assets/ab-simple/assets/s11-lit-phone.webp +0 -0
  751. package/readme-assets/ab-simple/assets/s3-baseline-desktop.webp +0 -0
  752. package/readme-assets/ab-simple/assets/s3-baseline-phone.webp +0 -0
  753. package/readme-assets/ab-simple/assets/s3-lit-desktop.webp +0 -0
  754. package/readme-assets/ab-simple/assets/s3-lit-phone.webp +0 -0
  755. package/readme-assets/ab-simple/assets/s4-baseline-desktop.webp +0 -0
  756. package/readme-assets/ab-simple/assets/s4-baseline-phone.webp +0 -0
  757. package/readme-assets/ab-simple/assets/s4-lit-desktop.webp +0 -0
  758. package/readme-assets/ab-simple/assets/s4-lit-phone.webp +0 -0
  759. package/readme-assets/ab-simple/assets/s5-baseline-slides.webp +0 -0
  760. package/readme-assets/ab-simple/assets/s5-lit-slides.webp +0 -0
  761. package/readme-assets/ab-simple/assets/s7-lit-diagram.webp +0 -0
  762. package/readme-assets/ab-simple/assets/s8-baseline-slides.webp +0 -0
  763. package/readme-assets/ab-simple/assets/s8-lit-slides.webp +0 -0
  764. package/readme-assets/ab-simple/assets/s9-lit-pages.webp +0 -0
  765. package/readme-assets/badge-version.svg +1 -1
  766. package/readme-assets/cover-motion-still.webp +0 -0
  767. package/readme-assets/cover-motion.webp +0 -0
  768. package/readme-assets/skills/autoconference.webp +0 -0
  769. package/readme-assets/skills/automatic-checks.webp +0 -0
  770. package/readme-assets/skills/autoresearch.webp +0 -0
  771. package/readme-assets/skills/browser-drive.webp +0 -0
  772. package/readme-assets/skills/coding-session-audit.webp +0 -0
  773. package/readme-assets/skills/debugging.webp +0 -0
  774. package/readme-assets/skills/deep-interview.webp +0 -0
  775. package/readme-assets/skills/frontend-ui-ux.webp +0 -0
  776. package/readme-assets/skills/lit-burnoff-file.webp +0 -0
  777. package/readme-assets/skills/lit-burnoff.webp +0 -0
  778. package/readme-assets/skills/lit-code.webp +0 -0
  779. package/readme-assets/skills/lit-commit.webp +0 -0
  780. package/readme-assets/skills/lit-comprehend.webp +0 -0
  781. package/readme-assets/skills/lit-crucible.webp +0 -0
  782. package/readme-assets/skills/lit-diagram-drawer.webp +0 -0
  783. package/readme-assets/skills/lit-docx.webp +0 -0
  784. package/readme-assets/skills/lit-fetch.webp +0 -0
  785. package/readme-assets/skills/lit-handoff.webp +0 -0
  786. package/readme-assets/skills/lit-humanizer.webp +0 -0
  787. package/readme-assets/skills/lit-init.webp +0 -0
  788. package/readme-assets/skills/lit-loop.webp +0 -0
  789. package/readme-assets/skills/lit-plan.webp +0 -0
  790. package/readme-assets/skills/lit-pptx.webp +0 -0
  791. package/readme-assets/skills/lit-recap.webp +0 -0
  792. package/readme-assets/skills/lit-scientific-visualization.webp +0 -0
  793. package/readme-assets/skills/lit-team.webp +0 -0
  794. package/readme-assets/skills/lit-typographic-motion.webp +0 -0
  795. package/readme-assets/skills/litcodex-contribute-bug-fix.webp +0 -0
  796. package/readme-assets/skills/litcodex-doctor.webp +0 -0
  797. package/readme-assets/skills/litcodex-report-bug.webp +0 -0
  798. package/readme-assets/skills/litgoal.webp +0 -0
  799. package/readme-assets/skills/litresearch.webp +0 -0
  800. package/readme-assets/skills/litwork.webp +0 -0
  801. package/readme-assets/skills/lsp-setup.webp +0 -0
  802. package/readme-assets/skills/readme-studio.webp +0 -0
  803. package/readme-assets/skills/refactor.webp +0 -0
  804. package/readme-assets/skills/review-work.webp +0 -0
  805. package/readme-assets/skills/start-approved-plan.webp +0 -0
  806. package/readme-assets/skills/structural-search.webp +0 -0
  807. package/readme-assets/skills/visual-qa.webp +0 -0
  808. package/readme-assets/skills/wikify.webp +0 -0
  809. package/marketplace/plugins/litcodex/skills/lit-korean/SKILL.md +0 -206
  810. package/marketplace/plugins/litcodex/skills/lit-korean/references/prompt-injection-handling.md +0 -23
  811. package/marketplace/plugins/litcodex/skills/lit-korean/references/quick-rules.md +0 -38
  812. package/marketplace/plugins/litcodex/skills/lit-korean/references/safety-checklist.md +0 -38
  813. package/node_modules/@litcodex/lit-loop/skills/lit-korean/SKILL.md +0 -206
  814. package/node_modules/@litcodex/lit-loop/skills/lit-korean/references/prompt-injection-handling.md +0 -23
  815. package/node_modules/@litcodex/lit-loop/skills/lit-korean/references/quick-rules.md +0 -38
  816. package/node_modules/@litcodex/lit-loop/skills/lit-korean/references/safety-checklist.md +0 -38
@@ -0,0 +1,463 @@
1
+ // Sound for both render paths. The generated bed is pure code: a tempo grid, a pulse on every beat
2
+ // and a pad that plays a chord progression changing on the film's cuts, in one of four documented
3
+ // timbre palettes, plus accents only where a treatment beat's `sound` asks for one. It is measured
4
+ // with ITU-R BS.1770-4 integrated loudness in product code and normalized to -16 LUFS with a peak
5
+ // at or under -2 dBFS. Supplied and authored tracks are fitted to the picture with ffmpeg (padded
6
+ // or trimmed, 50 ms fade) and always muxed. Nothing here touches the network or model weights.
7
+ import { spawnSync } from "node:child_process";
8
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
9
+ import { isAbsolute, join, resolve } from "node:path";
10
+ import { EXIT, Exit, SOUND_PALETTES } from "./constants.mjs";
11
+ import { ffmpegProbe, firstLine } from "./runtime.mjs";
12
+ import { fnv1a32, mulberry32 } from "./util.mjs";
13
+
14
+ export const SOUND = Object.freeze({
15
+ sampleRate: 48000,
16
+ targetLufs: -16,
17
+ lufsTolerance: 2,
18
+ bedPeakDb: -2,
19
+ muxPeakDb: -0.5,
20
+ silenceDb: -50,
21
+ silenceWindowSec: 0.05,
22
+ leadWindowSec: 3,
23
+ maxLeadSilenceSec: 1.5,
24
+ durationToleranceSec: 0.1,
25
+ fadeSec: 0.05,
26
+ shelf: Object.freeze({ b: Object.freeze([1.53512485958697, -2.69169618940638, 1.19839281085285]), a: Object.freeze([1, -1.69065929318241, 0.73248077421585]) }),
27
+ highpass: Object.freeze({ b: Object.freeze([1, -2, 1]), a: Object.freeze([1, -1.99004745483398, 0.99007225036621]) }),
28
+ });
29
+
30
+ // ------------------------------------------------------------------------------ measurement
31
+
32
+ function biquad(input, { b, a }) {
33
+ const out = new Float64Array(input.length);
34
+ let x1 = 0;
35
+ let x2 = 0;
36
+ let y1 = 0;
37
+ let y2 = 0;
38
+ for (let i = 0; i < input.length; i++) {
39
+ const x = input[i];
40
+ const y = b[0] * x + b[1] * x1 + b[2] * x2 - a[1] * y1 - a[2] * y2;
41
+ x2 = x1;
42
+ x1 = x;
43
+ y2 = y1;
44
+ y1 = y;
45
+ out[i] = y;
46
+ }
47
+ return out;
48
+ }
49
+
50
+ /**
51
+ * Integrated loudness (LUFS) per ITU-R BS.1770-4 at 48 kHz: K-weighting (shelf then high-pass),
52
+ * 400 ms blocks with 75 % overlap, an absolute gate at -70 LUFS and a relative gate 10 LU below.
53
+ * Channels weigh 1.0 each (left and right). Returns -Infinity for silence.
54
+ */
55
+ export function integratedLoudness(channels, sampleRate = SOUND.sampleRate) {
56
+ const block = Math.round(0.4 * sampleRate);
57
+ const hop = Math.round(0.1 * sampleRate);
58
+ const weighted = channels.map((ch) => biquad(biquad(ch, SOUND.shelf), SOUND.highpass));
59
+ const n = weighted[0].length;
60
+ const blocks = [];
61
+ for (let start = 0; start + block <= n; start += hop) {
62
+ let sum = 0;
63
+ for (const ch of weighted) {
64
+ let z = 0;
65
+ for (let i = start; i < start + block; i++) z += ch[i] * ch[i];
66
+ sum += z / block;
67
+ }
68
+ blocks.push(sum);
69
+ }
70
+ const loudness = (z) => -0.691 + 10 * Math.log10(z);
71
+ const absolute = blocks.filter((z) => loudness(z) > -70);
72
+ if (!absolute.length) return Number.NEGATIVE_INFINITY;
73
+ const mean = (list) => list.reduce((a, b) => a + b, 0) / list.length;
74
+ const relative = loudness(mean(absolute)) - 10;
75
+ const gated = absolute.filter((z) => loudness(z) > relative);
76
+ return gated.length ? loudness(mean(gated)) : Number.NEGATIVE_INFINITY;
77
+ }
78
+
79
+ const toDb = (v) => (v > 0 ? 20 * Math.log10(v) : Number.NEGATIVE_INFINITY);
80
+
81
+ /** Sample peak (dBFS) and the longest run under -50 dBFS RMS (50 ms windows) in the first 3 s. */
82
+ export function soundStats(channels, sampleRate = SOUND.sampleRate) {
83
+ let peak = 0;
84
+ for (const ch of channels) for (let i = 0; i < ch.length; i++) peak = Math.max(peak, Math.abs(ch[i]));
85
+ const window = Math.round(SOUND.silenceWindowSec * sampleRate);
86
+ const lead = Math.min(channels[0].length, Math.round(SOUND.leadWindowSec * sampleRate));
87
+ let longest = 0;
88
+ let run = 0;
89
+ for (let start = 0; start < lead; start += window) {
90
+ let sum = 0;
91
+ let count = 0;
92
+ for (const ch of channels)
93
+ for (let i = start; i < Math.min(start + window, ch.length); i++) {
94
+ sum += ch[i] * ch[i];
95
+ count++;
96
+ }
97
+ const quiet = toDb(Math.sqrt(sum / Math.max(1, count))) < SOUND.silenceDb;
98
+ run = quiet ? run + window : 0;
99
+ longest = Math.max(longest, run);
100
+ }
101
+ return { peakDb: toDb(peak), leadSilenceSec: longest / sampleRate, durationSec: channels[0].length / sampleRate };
102
+ }
103
+
104
+ // ------------------------------------------------------------------------------ WAV
105
+
106
+ /** 16-bit PCM WAV from float channels in [-1, 1]. */
107
+ export function writeWav(channels, sampleRate = SOUND.sampleRate) {
108
+ const n = channels[0].length;
109
+ const c = channels.length;
110
+ const data = Buffer.alloc(n * c * 2);
111
+ for (let i = 0; i < n; i++) for (let k = 0; k < c; k++) data.writeInt16LE(Math.max(-32768, Math.min(32767, Math.round(channels[k][i] * 32767))), (i * c + k) * 2);
112
+ const header = Buffer.alloc(44);
113
+ header.write("RIFF", 0, "ascii");
114
+ header.writeUInt32LE(36 + data.length, 4);
115
+ header.write("WAVE", 8, "ascii");
116
+ header.write("fmt ", 12, "ascii");
117
+ header.writeUInt32LE(16, 16);
118
+ header.writeUInt16LE(1, 20);
119
+ header.writeUInt16LE(c, 22);
120
+ header.writeUInt32LE(sampleRate, 24);
121
+ header.writeUInt32LE(sampleRate * c * 2, 28);
122
+ header.writeUInt16LE(c * 2, 32);
123
+ header.writeUInt16LE(16, 34);
124
+ header.write("data", 36, "ascii");
125
+ header.writeUInt32LE(data.length, 40);
126
+ return Buffer.concat([header, data]);
127
+ }
128
+
129
+ /** Read a PCM (16/24/32-bit integer) or 32-bit float WAV into float channels. */
130
+ export function readWav(buffer) {
131
+ let format = 0;
132
+ let channels = 0;
133
+ let sampleRate = 0;
134
+ let bits = 0;
135
+ let data = null;
136
+ for (let o = 12; o + 8 <= buffer.length; ) {
137
+ const id = buffer.toString("ascii", o, o + 4);
138
+ const size = buffer.readUInt32LE(o + 4);
139
+ if (id === "fmt ") {
140
+ format = buffer.readUInt16LE(o + 8);
141
+ channels = buffer.readUInt16LE(o + 10);
142
+ sampleRate = buffer.readUInt32LE(o + 12);
143
+ bits = buffer.readUInt16LE(o + 22);
144
+ if (format === 0xfffe) format = buffer.readUInt16LE(o + 32);
145
+ } else if (id === "data") data = buffer.subarray(o + 8, o + 8 + size);
146
+ o += 8 + size + (size % 2);
147
+ }
148
+ if (!data || !channels) throw new Error("not a WAV file with fmt and data chunks");
149
+ const bytes = bits / 8;
150
+ const n = Math.floor(data.length / (bytes * channels));
151
+ const out = Array.from({ length: channels }, () => new Float64Array(n));
152
+ for (let i = 0; i < n; i++)
153
+ for (let k = 0; k < channels; k++) {
154
+ const o = (i * channels + k) * bytes;
155
+ out[k][i] = format === 3 ? data.readFloatLE(o) : bits === 16 ? data.readInt16LE(o) / 32768 : bits === 24 ? data.readIntLE(o, 3) / 8388608 : data.readInt32LE(o) / 2147483648;
156
+ }
157
+ return { sampleRate, bits, channels: out };
158
+ }
159
+
160
+ // ------------------------------------------------------------------------------ the generated bed
161
+
162
+ const NOTES = { C: 0, D: 2, E: 4, F: 5, G: 7, A: 9, B: 11 };
163
+ /** MIDI note of the key's root in octave 3 ("D minor" -> D3 = 50). */
164
+ function keyRoot(key) {
165
+ const [, letter, accidental, mode] = /^([A-G])(#|b)?\s+(major|minor)$/u.exec(key ?? "") ?? [null, "D", "", "minor"];
166
+ return { root: 48 + NOTES[letter] + (accidental === "#" ? 1 : accidental === "b" ? -1 : 0), minor: mode !== "major" };
167
+ }
168
+ // Diatonic progressions, as semitone offsets from the root: minor i-VI-III-VII, major I-V-vi-IV.
169
+ const PROGRESSION = { minor: [[0, 3, 7], [8, 12, 15], [3, 7, 10], [10, 14, 17]], major: [[0, 4, 7], [7, 11, 14], [9, 12, 16], [5, 9, 12]] };
170
+ const hz = (midi) => 440 * 2 ** ((midi - 69) / 12);
171
+
172
+ // The four timbre palettes. Each is a recipe of plain oscillators, so a bed never needs a sample.
173
+ export const PALETTES = Object.freeze({
174
+ air: Object.freeze({ padHarmonics: [1, 0.25], padNoise: 0.35, padGain: 0.5, pulse: "breath", brightness: 0.35, description: "breathy noise-and-sine pad, brushed pulse" }),
175
+ felt: Object.freeze({ padHarmonics: [1, 0.3, 0.1], padNoise: 0, padGain: 0.55, pulse: "thump", brightness: 0.25, description: "soft sine pad, muted low thump and pluck" }),
176
+ glass: Object.freeze({ padHarmonics: [1, 0, 0.2, 0, 0.1], padNoise: 0, padGain: 0.42, pulse: "tick", brightness: 0.8, description: "bell-like FM tones, glassy ticks" }),
177
+ pulse: Object.freeze({ padHarmonics: [1, 0.5, 0.33, 0.25, 0.2, 0.16, 0.14], padNoise: 0, padGain: 0.38, pulse: "kick", brightness: 0.55, description: "saw pad under a kick and offbeat hats" }),
178
+ });
179
+
180
+ const ACCENTS = [
181
+ ["hit", /\bhit|impact|thump|punch|boom|slam|stab|타격|쿵|임팩트/iu],
182
+ ["rise", /\brise|riser|build|swell|lift|sweep|고조|상승|빌드/iu],
183
+ ["cadence", /\bcadence|resolve|resolution|close|closing|ending|final|land|마무리|종지|끝/iu],
184
+ ["chime", /\bchime|bell|sparkle|ping|shimmer|반짝|종소리|차임/iu],
185
+ ["drop", /\bdrop|hush|silence|pause|duck|breath out|쉼|정적|멈춤/iu],
186
+ ];
187
+ /** Accent kinds a beat's `sound` field asks for. */
188
+ export const accentsFor = (text) => ACCENTS.filter(([, pattern]) => pattern.test(String(text ?? ""))).map(([kind]) => kind);
189
+
190
+ const envelope = (t, attack, decay) => (t < 0 ? 0 : t < attack ? t / attack : Math.exp(-(t - attack) / decay));
191
+
192
+ /**
193
+ * The bed for a film of `frameCount` frames at `fps`: exactly round(frameCount * 48000 / fps)
194
+ * stereo samples. `cuts` are the times the picture cuts (default: every beat's t0 after the
195
+ * first); chords change on them and accents land on them. Returns { wav, cues, stats }.
196
+ */
197
+ export function buildBed({ treatment, frameCount, fps, cuts = null }) {
198
+ const sr = SOUND.sampleRate;
199
+ const n = Math.round((frameCount * sr) / fps);
200
+ const duration = n / sr;
201
+ const plan = treatment.sound ?? {};
202
+ const palette = PALETTES[SOUND_PALETTES.includes(plan.palette) ? plan.palette : "felt"];
203
+ const tempo = Number.isInteger(plan.tempo) ? plan.tempo : 96;
204
+ const beatSec = 60 / tempo;
205
+ const { root, minor } = keyRoot(plan.key);
206
+ const progression = PROGRESSION[minor ? "minor" : "major"];
207
+ const beats = treatment.beats ?? [{ t0: 0, t1: duration, sound: "" }];
208
+ const cutTimes = cuts ?? beats.slice(1).map((b) => b.t0);
209
+ const sections = [0, ...cutTimes].map((t0, i) => ({ t0, t1: i < cutTimes.length ? cutTimes[i] : duration, beat: Math.min(i, beats.length - 1) }));
210
+ const last = sections.length - 1;
211
+ const seed = fnv1a32(`${treatment.request ?? ""}\u0000${plan.palette}\u0000${plan.key}\u0000${tempo}`);
212
+ const random = mulberry32(seed);
213
+ const L = new Float64Array(n);
214
+ const R = new Float64Array(n);
215
+ const cues = [];
216
+
217
+ // Pad: the section's chord, crossfaded over 0.25 s at each cut; the last section resolves home.
218
+ const chordAt = (s) => (s === last && last > 0 ? progression[0] : progression[s % progression.length]);
219
+ let noiseState = 0;
220
+ for (let s = 0; s < sections.length; s++) {
221
+ const { t0, t1 } = sections[s];
222
+ const chord = chordAt(s);
223
+ const drop = accentsFor(beats[sections[s].beat]?.sound).includes("drop");
224
+ const a = Math.max(0, Math.round((t0 - 0.125) * sr));
225
+ const b = Math.min(n, Math.round((t1 + 0.125) * sr));
226
+ if (s > 0) cues.push({ kind: "chord", t: t0, beat: sections[s].beat, cutT: t0, delta: 0 });
227
+ for (let i = a; i < b; i++) {
228
+ const t = i / sr;
229
+ const fadeIn = s === 0 ? Math.min(1, t / 0.12) : Math.min(1, Math.max(0, (t - (t0 - 0.125)) / 0.25));
230
+ const fadeOut = s === last ? 1 : Math.min(1, Math.max(0, (t1 + 0.125 - t) / 0.25));
231
+ const gain = palette.padGain * fadeIn * fadeOut * (drop ? 0.35 : 1);
232
+ let left = 0;
233
+ let right = 0;
234
+ chord.forEach((offset, v) => {
235
+ const f = hz(root + 12 + offset);
236
+ const vib = 1 + 0.002 * Math.sin(2 * Math.PI * (0.3 + v * 0.07) * t);
237
+ palette.padHarmonics.forEach((amp, h) => {
238
+ if (!amp) return;
239
+ const phase = 2 * Math.PI * f * (h + 1) * vib * t;
240
+ left += amp * Math.sin(phase + v);
241
+ right += amp * Math.sin(phase * 1.0015 + v * 1.7);
242
+ });
243
+ });
244
+ if (palette.padNoise) {
245
+ noiseState = 0.985 * noiseState + 0.015 * (random() * 2 - 1);
246
+ left += palette.padNoise * 6 * noiseState;
247
+ right += palette.padNoise * 6 * noiseState;
248
+ }
249
+ const bass = 0.6 * Math.sin(2 * Math.PI * hz(root + chord[0] - 12) * t);
250
+ L[i] += gain * (left / (chord.length * 1.6) + bass * 0.5);
251
+ R[i] += gain * (right / (chord.length * 1.6) + bass * 0.5);
252
+ }
253
+ }
254
+
255
+ // Pulse: one event on every beat of the tempo grid, a softer offbeat for the busier palettes.
256
+ for (let k = 0; k * beatSec < duration; k++) {
257
+ const start = k * beatSec;
258
+ const section = sections.findLast((s) => s.t0 <= start + 1e-9) ?? sections[0];
259
+ const drop = accentsFor(beats[section.beat]?.sound).includes("drop");
260
+ const level = (k % 4 === 0 ? 1 : 0.7) * (drop ? 0.3 : 1);
261
+ const a = Math.round(start * sr);
262
+ const len = Math.min(n - a, Math.round(0.45 * sr));
263
+ for (let i = 0; i < len; i++) {
264
+ const t = i / sr;
265
+ let v = 0;
266
+ if (palette.pulse === "kick") v = 0.9 * Math.sin(2 * Math.PI * (50 + 70 * Math.exp(-t / 0.03)) * t) * envelope(t, 0.002, 0.12);
267
+ else if (palette.pulse === "thump") v = 0.6 * Math.sin(2 * Math.PI * 62 * t) * envelope(t, 0.004, 0.09) + 0.18 * Math.sin(2 * Math.PI * hz(root + 24) * t) * envelope(t, 0.003, 0.08);
268
+ else if (palette.pulse === "tick") v = 0.22 * Math.sin(2 * Math.PI * 2093 * t + 2 * Math.sin(2 * Math.PI * 4186 * t) * envelope(t, 0, 0.02)) * envelope(t, 0.001, 0.05) + 0.3 * Math.sin(2 * Math.PI * 70 * t) * envelope(t, 0.003, 0.07);
269
+ else v = 0.35 * (random() * 2 - 1) * envelope(t, 0.01, 0.06) + 0.35 * Math.sin(2 * Math.PI * 55 * t) * envelope(t, 0.01, 0.1);
270
+ L[a + i] += level * v * palette.brightness * 1.6;
271
+ R[a + i] += level * v * palette.brightness * 1.6;
272
+ }
273
+ if (palette.pulse === "kick" || palette.pulse === "tick") {
274
+ const off = Math.round((start + beatSec / 2) * sr);
275
+ for (let i = 0; i < Math.min(n - off, Math.round(0.05 * sr)); i++) {
276
+ const v = 0.08 * (random() * 2 - 1) * envelope(i / sr, 0.001, 0.015) * (drop ? 0.3 : 1);
277
+ L[off + i] += v * 0.8;
278
+ R[off + i] += v;
279
+ }
280
+ }
281
+ }
282
+
283
+ // Accents, only where a beat's sound field asks. Each is placed on its cut (or its beat's end).
284
+ sections.forEach((section, s) => {
285
+ const kinds = accentsFor(beats[section.beat]?.sound);
286
+ const add = (kind, t, cutT, render) => {
287
+ cues.push({ kind, t, beat: section.beat, cutT, delta: Math.round((t - cutT) * 1e6) / 1e6 });
288
+ const a = Math.max(0, Math.round(t * sr));
289
+ render(a);
290
+ };
291
+ if (kinds.includes("hit"))
292
+ add("hit", section.t0, section.t0, (a) => {
293
+ for (let i = 0; i < Math.min(n - a, Math.round(0.6 * sr)); i++) {
294
+ const t = i / sr;
295
+ const v = 0.9 * Math.sin(2 * Math.PI * (40 + 60 * Math.exp(-t / 0.05)) * t) * envelope(t, 0.002, 0.2) + 0.25 * (random() * 2 - 1) * envelope(t, 0.001, 0.02);
296
+ L[a + i] += v;
297
+ R[a + i] += v;
298
+ }
299
+ });
300
+ if (kinds.includes("rise")) {
301
+ const end = section.t1;
302
+ const start = Math.max(section.t0, end - 1.6);
303
+ cues.push({ kind: "rise", t: end, beat: section.beat, cutT: end, delta: 0 });
304
+ let state = 0;
305
+ for (let i = Math.round(start * sr); i < Math.min(n, Math.round(end * sr)); i++) {
306
+ const p = (i / sr - start) / Math.max(1e-6, end - start);
307
+ state = (1 - (0.02 + 0.3 * p)) * state + (0.02 + 0.3 * p) * (random() * 2 - 1);
308
+ const v = (0.25 * state * 3 + 0.12 * Math.sin(2 * Math.PI * (200 + 600 * p * p) * (i / sr))) * p * p;
309
+ L[i] += v;
310
+ R[i] += v * 0.9;
311
+ }
312
+ }
313
+ if (kinds.includes("chime"))
314
+ add("chime", (section.t0 + section.t1) / 2, (section.t0 + section.t1) / 2, (a) => {
315
+ chordAt(s).forEach((offset, v) => {
316
+ const at = a + Math.round(v * 0.09 * sr);
317
+ for (let i = 0; i < Math.min(n - at, Math.round(1.2 * sr)); i++) {
318
+ const t = i / sr;
319
+ const f = hz(root + 24 + offset);
320
+ const tone = 0.16 * Math.sin(2 * Math.PI * f * t + 1.5 * Math.sin(2 * Math.PI * f * 3.5 * t) * envelope(t, 0, 0.1)) * envelope(t, 0.002, 0.35);
321
+ L[at + i] += tone * (v % 2 ? 0.6 : 1);
322
+ R[at + i] += tone * (v % 2 ? 1 : 0.6);
323
+ }
324
+ });
325
+ });
326
+ if (kinds.includes("cadence"))
327
+ add("cadence", section.t0, section.t0, (a) => {
328
+ for (let i = 0; i < n - a; i++) {
329
+ const t = i / sr;
330
+ let v = 0;
331
+ for (const offset of progression[0]) v += Math.sin(2 * Math.PI * hz(root + 24 + offset) * t) * 0.09;
332
+ v += 0.3 * Math.sin(2 * Math.PI * hz(root) * t);
333
+ const e = envelope(t, 0.01, 1.4);
334
+ L[a + i] += v * e;
335
+ R[a + i] += v * e;
336
+ }
337
+ });
338
+ });
339
+
340
+ // Ends: a short fade in at 0 and a 50 ms fade out at the last sample, so no click lands on a cut.
341
+ const fade = Math.round(SOUND.fadeSec * sr);
342
+ for (let i = 0; i < Math.min(fade, n); i++) {
343
+ const g = i / fade;
344
+ L[n - 1 - i] *= g;
345
+ R[n - 1 - i] *= g;
346
+ }
347
+
348
+ const channels = normalize([L, R]);
349
+ const quantized = readWav(writeWav(channels, sr)).channels;
350
+ const stats = { ...soundStats(quantized, sr), lufs: Math.round(integratedLoudness(quantized, sr) * 100) / 100, samples: n, palette: plan.palette, key: plan.key, tempo };
351
+ cues.sort((x, y) => x.t - y.t || x.beat - y.beat || x.kind.localeCompare(y.kind));
352
+ return { wav: writeWav(channels, sr), cues: { palette: plan.palette, key: plan.key, tempo, beatSec, cues }, stats };
353
+ }
354
+
355
+ /** Gain to -16 LUFS, then a soft knee that keeps the sample peak at or under -2 dBFS. */
356
+ function normalize(channels) {
357
+ const ceiling = 10 ** (SOUND.bedPeakDb / 20) * 0.995;
358
+ const knee = ceiling * 0.6;
359
+ let out = channels;
360
+ for (let pass = 0; pass < 4; pass++) {
361
+ const lufs = integratedLoudness(out);
362
+ if (!Number.isFinite(lufs)) return out;
363
+ const gain = 10 ** ((SOUND.targetLufs - lufs) / 20);
364
+ out = out.map((ch) =>
365
+ ch.map((x) => {
366
+ const y = x * gain;
367
+ const m = Math.abs(y);
368
+ if (m <= knee) return y;
369
+ return Math.sign(y) * (knee + (m - knee) / (1 + (m - knee) / (ceiling - knee)));
370
+ }),
371
+ );
372
+ if (Math.abs(integratedLoudness(out) - SOUND.targetLufs) < 0.1) break;
373
+ }
374
+ return out;
375
+ }
376
+
377
+ // ------------------------------------------------------------------------------ tracks for a render
378
+
379
+ /** Where a supplied or authored track lives: absolute, or relative to the output dir. */
380
+ export const trackPath = (outDir, file) => (isAbsolute(file) ? file : resolve(outDir, file));
381
+
382
+ /**
383
+ * The WAV to mux for a render, exactly the picture's length: the generated bed (default), or the
384
+ * supplied/authored track padded or trimmed with a 50 ms fade. Writes <out>/sound/ and
385
+ * <out>/sound-cues.json. Returns { wav, mode, notes } with wav null when the mode is none.
386
+ */
387
+ export function prepareTrack({ outDir, treatment, frameCount, fps, cuts = null, supplied = null }) {
388
+ const mode = supplied ? "supplied" : (treatment.sound?.mode ?? "generated");
389
+ const dir = join(outDir, "sound");
390
+ mkdirSync(dir, { recursive: true });
391
+ const duration = frameCount / fps;
392
+ if (mode === "none") return { wav: null, mode, notes: ["sound: none (the user asked for silence or the channel plays muted)"] };
393
+ if (mode === "generated") {
394
+ const bed = buildBed({ treatment, frameCount, fps, cuts });
395
+ const wav = join(dir, "bed.wav");
396
+ writeFileSync(wav, bed.wav);
397
+ writeFileSync(join(outDir, "sound-cues.json"), `${JSON.stringify({ mode, ...bed.cues, stats: bed.stats }, null, 2)}\n`);
398
+ return { wav, mode, stats: bed.stats, notes: [`sound: generated bed, palette ${bed.stats.palette}, ${bed.stats.key}, ${bed.stats.tempo} BPM, ${bed.stats.lufs} LUFS, peak ${bed.stats.peakDb.toFixed(2)} dBFS`] };
399
+ }
400
+ const source = supplied ?? trackPath(outDir, treatment.sound.file);
401
+ if (!existsSync(source)) throw new Exit(EXIT.SOUND_INVALID, `SOUND_INVALID: the ${mode} track ${source} does not exist`);
402
+ const ffmpeg = ffmpegProbe();
403
+ if (!ffmpeg.ok) throw new Exit(EXIT.BLOCKED_NO_FFMPEG_FOR_VIDEO, "BLOCKED_NO_FFMPEG_FOR_VIDEO: ffmpeg is needed to fit the track to the picture");
404
+ const fitted = join(dir, "track.wav");
405
+ const fade = Math.max(0, duration - SOUND.fadeSec).toFixed(6);
406
+ const result = spawnSync(ffmpeg.path, ["-hide_banner", "-loglevel", "error", "-y", "-i", source, "-vn", "-ac", "2", "-ar", String(SOUND.sampleRate), "-af", `apad,atrim=0:${duration.toFixed(6)},afade=t=out:st=${fade}:d=${SOUND.fadeSec}`, "-c:a", "pcm_s16le", fitted], { encoding: "utf8" });
407
+ if (result.status !== 0) throw new Exit(EXIT.SOUND_INVALID, `SOUND_INVALID: could not read the ${mode} track (${firstLine(result.stderr || "ffmpeg failed")})`);
408
+ const decoded = readWav(readFileSync(fitted));
409
+ const notes = [`sound: ${mode} track ${source}, fitted to ${duration.toFixed(2)} s (padded or trimmed, 50 ms fade)`];
410
+ const stats = soundStats(decoded.channels);
411
+ if (stats.peakDb > -1) {
412
+ const gain = 10 ** ((-1 - stats.peakDb) / 20);
413
+ writeFileSync(fitted, writeWav(decoded.channels.map((ch) => ch.map((x) => x * gain))));
414
+ notes.push(`sound: peak lowered by ${(stats.peakDb + 1).toFixed(2)} dB to leave headroom`);
415
+ }
416
+ const final = readWav(readFileSync(fitted)).channels;
417
+ const cutList = cuts ?? (treatment.beats ?? []).slice(1).map((b) => b.t0);
418
+ writeFileSync(join(outDir, "sound-cues.json"), `${JSON.stringify({ mode, source, cues: cutList.map((t, i) => ({ kind: "cut", t, beat: i + 1, cutT: t, delta: 0 })), stats: { ...soundStats(final), lufs: Math.round(integratedLoudness(final) * 100) / 100 } }, null, 2)}\n`);
419
+ return { wav: fitted, mode, notes };
420
+ }
421
+
422
+ // ------------------------------------------------------------------------------ the sound gate
423
+
424
+ /** Decode the muxed audio of a film (48 kHz stereo) and measure it; null when there is no stream. */
425
+ export function measureMuxed(mp4) {
426
+ const ffmpeg = ffmpegProbe();
427
+ if (!ffmpeg.ok || !existsSync(mp4)) return null;
428
+ const probe = spawnSync(ffmpeg.ffprobe, ["-v", "error", "-select_streams", "a", "-show_entries", "stream=index", "-of", "csv=p=0", mp4], { encoding: "utf8" });
429
+ if (!probe.stdout.trim()) return { present: false };
430
+ const decoded = spawnSync(ffmpeg.path, ["-hide_banner", "-loglevel", "error", "-i", mp4, "-map", "0:a:0", "-ac", "2", "-ar", String(SOUND.sampleRate), "-f", "s16le", "pipe:1"], { maxBuffer: 1 << 30 });
431
+ if (decoded.status !== 0) return { present: true, error: firstLine(String(decoded.stderr ?? "decode failed")) };
432
+ const pcm = decoded.stdout;
433
+ const n = Math.floor(pcm.length / 4);
434
+ const channels = [new Float64Array(n), new Float64Array(n)];
435
+ for (let i = 0; i < n; i++) {
436
+ channels[0][i] = pcm.readInt16LE(i * 4) / 32768;
437
+ channels[1][i] = pcm.readInt16LE(i * 4 + 2) / 32768;
438
+ }
439
+ return { present: true, ...soundStats(channels), lufs: Math.round(integratedLoudness(channels) * 100) / 100 };
440
+ }
441
+
442
+ /**
443
+ * Sound rules over the decoded muxed stream when the treatment plans sound: a stream is present,
444
+ * its length matches the video within 0.1 s, its sample peak is at or under -0.5 dBFS, and (for a
445
+ * generated bed only) the first 3 s never sit under -50 dBFS for more than 1.5 s. A failed sound
446
+ * rule makes the render exit 20; the lead check is only a WARN for supplied or authored tracks.
447
+ */
448
+ export function soundRules(measured, { mode, videoDuration }) {
449
+ if (!mode || mode === "none") return [{ id: "SOUND-STREAM", name: "sound stream", status: "PASS", detail: "sound mode none (asked for silence or a muted channel)" }];
450
+ const rules = [];
451
+ if (!measured?.present) return [{ id: "SOUND-STREAM", name: "sound stream", status: "FAIL", detail: `the treatment plans ${mode} sound but the film has no audio stream`, sound: true }];
452
+ if (measured.error) return [{ id: "SOUND-STREAM", name: "sound stream", status: "FAIL", detail: `the audio stream does not decode: ${measured.error}`, sound: true }];
453
+ rules.push({ id: "SOUND-STREAM", name: "sound stream", status: "PASS", detail: `${mode} track muxed, ${measured.lufs} LUFS integrated` });
454
+ const off = Math.abs(measured.durationSec - videoDuration);
455
+ rules.push({ id: "SOUND-LENGTH", name: "sound length", status: off <= SOUND.durationToleranceSec + 1e-6 ? "PASS" : "FAIL", detail: `${measured.durationSec.toFixed(3)} s against the video's ${videoDuration.toFixed(3)} s (tolerance 0.1 s)`, sound: true });
456
+ rules.push({ id: "SOUND-PEAK", name: "sound sample peak", status: measured.peakDb <= SOUND.muxPeakDb + 1e-9 ? "PASS" : "FAIL", detail: `${measured.peakDb.toFixed(2)} dBFS (limit -0.5)`, sound: true });
457
+ const quiet = measured.leadSilenceSec > SOUND.maxLeadSilenceSec + 1e-9;
458
+ rules.push({ id: "SOUND-LEAD", name: "no silent opening", status: quiet ? (mode === "generated" ? "FAIL" : "WARN") : "PASS", detail: `longest stretch under -50 dBFS in the first 3 s: ${measured.leadSilenceSec.toFixed(2)} s (limit 1.5 s)`, sound: mode === "generated" });
459
+ return rules;
460
+ }
461
+
462
+ export const soundFailed = (rules) => rules.some((r) => r.sound && r.status === "FAIL");
463
+
@@ -0,0 +1,155 @@
1
+ // The stage path's gate. It reads recorded data only (the frame log with the flash records taken on
2
+ // the exact encoder bytes, the preview records, ffprobe, export sizes and the determinism replay)
3
+ // and applies the Wave 1 rules that carry over to a captured page (director brief 6h): flash,
4
+ // format, duration against the treatment, sizes, the reduced-motion still, near-black runs and
5
+ // determinism. Rules that only make sense for the type engine are listed as not applicable.
6
+ import { existsSync, readFileSync, statSync } from "node:fs";
7
+ import { join } from "node:path";
8
+ import { FULL_FRAME_STEP, MAX_ROUNDS, NEAR_BLACK, OUTPUT, STAGE_FORMATS, TIMING } from "./constants.mjs";
9
+ import { exportPaths, ffprobeSafe, locate } from "./encode.mjs";
10
+ import { countFlashes } from "./flash.mjs";
11
+ import { isSoftwareRenderer } from "./gate.mjs";
12
+ import { stageFlags } from "./runtime.mjs";
13
+ import { measureMuxed, soundRules } from "./sound.mjs";
14
+
15
+ const PASS = "PASS";
16
+ const FAIL = "FAIL";
17
+ const WARN = "WARN";
18
+ const rule = (id, name, status, detail, extra = {}) => ({ id, name, status, detail, ...extra });
19
+ export const STAGE_NOT_APPLICABLE = Object.freeze(["MO-C-01 GLSL look pass", "MO-C-02 unless the page uses WebGL", "MO-C-14 glyph-mask method", "MO-D-02 frame-time p95"]);
20
+
21
+ const readJsonl = (path) =>
22
+ existsSync(path)
23
+ ? readFileSync(path, "utf8")
24
+ .split("\n")
25
+ .filter(Boolean)
26
+ .map((line) => JSON.parse(line))
27
+ : [];
28
+
29
+ /** Everything the stage gate reads, from the run folder only. */
30
+ export function loadStageData(outDir) {
31
+ const manifest = JSON.parse(readFileSync(join(outDir, "manifest.json"), "utf8"));
32
+ const run = join(outDir, ".run");
33
+ const log = readJsonl(existsSync(join(outDir, "render.jsonl")) ? join(outDir, "render.jsonl") : join(run, "render.jsonl"));
34
+ const read = (name) => (existsSync(join(run, name)) ? JSON.parse(readFileSync(join(run, name), "utf8")) : null);
35
+ const exportsInfo = {};
36
+ for (const [key, name] of Object.entries(exportPaths(outDir, manifest))) {
37
+ const path = locate(outDir, name);
38
+ exportsInfo[key] = { present: Boolean(path), path, bytes: path ? statSync(path).size : null };
39
+ }
40
+ const exportsLog = read("exports.json");
41
+ return {
42
+ manifest,
43
+ frames: log.filter((line) => line.previewFrame === undefined),
44
+ preview: { records: log.filter((line) => line.previewFrame !== undefined).map((line) => ({ f: line.previewFrame, g: line.flash.g, r: line.flash.r })), fps: exportsLog?.preview?.fps ?? 30 },
45
+ exports: exportsInfo,
46
+ probe: exportsInfo.mp4.path ? ffprobeSafe(exportsInfo.mp4.path) : null,
47
+ determinism: read("determinism.json"),
48
+ sound: exportsInfo.mp4.path ? measureMuxed(exportsInfo.mp4.path) : null,
49
+ qa: read("qa.json"),
50
+ treatment: read("treatment.json")?.treatment ?? null,
51
+ exportsLog,
52
+ };
53
+ }
54
+
55
+ /** Evaluate the stage gate over loaded data; returns ordered rule results. */
56
+ export function evaluateStage(data) {
57
+ const { manifest } = data;
58
+ const rules = [];
59
+ const frames = data.frames ?? [];
60
+ const fps = manifest.fps;
61
+ const [width, height] = [manifest.width, manifest.height];
62
+
63
+ const master = countFlashes(frames.map((line) => ({ f: line.frame, g: line.flash?.g ?? [0, 0], r: line.flash?.r ?? [0, 0] })), fps, false);
64
+ const preview = data.preview?.records?.length ? countFlashes(data.preview.records, data.preview.fps, true) : null;
65
+ const flashPass = master.pass && preview?.pass === true;
66
+ const worst = !master.pass || !preview ? master : preview;
67
+ rules.push(rule("MO-C-03", "flash audit", flashPass ? PASS : FAIL, `worst window ${Math.max(master.general.flashes, preview?.general.flashes ?? 0)} general / ${Math.max(master.red.flashes, preview?.red.flashes ?? 0)} red (limit 3 / 3; ${width > height ? "320x180" : "180x320"} cells)${preview ? "" : "; preview frames not audited"}${flashPass ? "" : `; worst at frame ${worst.general.startFrame} (${(worst.general.startFrame / fps).toFixed(2)} s)`}`, { master, preview }));
68
+ const step = frames.find((line) => (line.flash?.step ?? 0) > FULL_FRAME_STEP.areaFraction);
69
+ rules.push(rule("MO-SH-04a", "no full-frame luminance step", step ? FAIL : PASS, step ? `frame ${step.frame}: ${(step.flash.step * 100).toFixed(1)}% of the frame stepped >= 0.1` : "no frame pair steps more than 25% of the frame"));
70
+
71
+ const probe = data.probe;
72
+ const want = STAGE_FORMATS[manifest.format];
73
+ const target = manifest.targetDurationSec;
74
+ const faults = [];
75
+ if (!probe) faults.push("ffprobe result missing");
76
+ else {
77
+ if (!want || probe.width !== want.width || probe.height !== want.height) faults.push(`resolution ${probe.width}x${probe.height}, format ${manifest.format} needs ${want?.width}x${want?.height}`);
78
+ if (probe.fps < OUTPUT.minFps || Math.abs(probe.fps - fps) > 0.01) faults.push(`fps ${probe.fps}, page declared ${fps}`);
79
+ if (target > 0 && Math.abs(probe.videoDuration - target) > 0.1 * target + 1e-6) faults.push(`duration ${probe.videoDuration.toFixed(2)} s is outside ±10 % of the treatment's ${target} s`);
80
+ if (probe.pixFmt !== OUTPUT.pixFmt || probe.colorSpace !== OUTPUT.colorSpace || probe.colorRange !== OUTPUT.colorRange) faults.push(`tags ${probe.pixFmt}/${probe.colorSpace}/${probe.colorRange}`);
81
+ }
82
+ rules.push(rule("MO-C-10/11/12", "format/fps/duration", faults.length ? FAIL : PASS, `${probe ? `${probe.videoDuration.toFixed(2)} s @ ${probe.fps} fps, ${probe.width}x${probe.height}` : "no probe"} (treatment ${target} s, ${manifest.format})${faults.length ? `; ${faults.join("; ")}` : ""}`));
83
+
84
+ const ex = data.exports ?? {};
85
+ const sizeFaults = [];
86
+ if (ex.preview?.bytes > OUTPUT.previewMaxBytes) sizeFaults.push(`preview ${ex.preview.bytes} B over 3 MB`);
87
+ if (ex.poster?.bytes > OUTPUT.posterMaxBytes) sizeFaults.push(`poster ${ex.poster.bytes} B over 1 MB`);
88
+ const mp4Warn = ex.mp4?.bytes && manifest.durationSec > 0 && ex.mp4.bytes / (manifest.durationSec / 10) > OUTPUT.mp4WarnBytesPer10s;
89
+ rules.push(rule("MO-C-13", "file sizes", sizeFaults.length ? FAIL : mp4Warn ? WARN : PASS, `mp4 ${ex.mp4?.bytes ?? "missing"}, preview ${ex.preview?.bytes ?? "missing"} (cap 3 MB), poster ${ex.poster?.bytes ?? "missing"} (cap 1 MB)${sizeFaults.length ? `; ${sizeFaults.join("; ")}` : ""}`));
90
+ const missing = ["mp4", "preview", "poster", "still"].filter((key) => !ex[key]?.present);
91
+ rules.push(rule("MO-A-37..41", "four artifacts + manifest", missing.length ? FAIL : PASS, missing.length ? `missing ${missing.join(", ")}` : "film, preview, poster, reduced-motion still and manifest present"));
92
+ rules.push(rule("MO-C-14", "reduced-motion still", ex.still?.present ? PASS : FAIL, ex.still?.present ? `final beat midpoint, frame ${data.exportsLog?.still?.frame ?? "?"}` : "reduced-motion.png missing"));
93
+
94
+ const det = data.determinism;
95
+ let detStatus = FAIL;
96
+ let detDetail = "no determinism replay recorded";
97
+ if (det?.frames?.length) {
98
+ const bad = det.frames.find((f) => f.master !== f.replay);
99
+ detStatus = bad ? FAIL : PASS;
100
+ detDetail = bad ? `decoded RGBA differs at frame ${bad.frame}${det.region ? ` in region ${det.region.join(",")}` : ""}; a clock-free source leaks into the page` : `rgbaSha256 match Y on ${det.frames.length} frames re-captured sequentially in a fresh Chrome (${det.frames.map((f) => f.frame).join(", ")})`;
101
+ }
102
+ rules.push(rule("MO-C-09", "determinism", detStatus, detDetail));
103
+
104
+ if (manifest.webgl?.requested) rules.push(rule("MO-C-02", "WebGL tier", manifest.webgl.ok && isSoftwareRenderer(manifest.webgl.renderer) ? PASS : FAIL, `page requested WebGL: ${manifest.webgl.renderer ?? "no context"} (software rung, labelled)`));
105
+
106
+ const beat = 60 / (data.treatment?.sound?.tempo ?? TIMING.defaultBpm);
107
+ const limit = NEAR_BLACK.runFactor * TIMING.minSceneBeats * beat;
108
+ let blackFault = null;
109
+ let runStart = null;
110
+ const total = frames.length;
111
+ for (let i = 0; i <= total && !blackFault; i++) {
112
+ const dark = i < total && typeof frames[i].p995 === "number" && frames[i].p995 < NEAR_BLACK.luminance;
113
+ if (dark && runStart === null) runStart = i;
114
+ if (!dark && runStart !== null) {
115
+ const length = (i - runStart) / fps;
116
+ const edge = runStart === 0 || i === total ? NEAR_BLACK.edgeAllowanceSec : 0;
117
+ if (length > limit + edge) blackFault = `${i - runStart} near-black frames from ${runStart} (limit ${(limit + edge).toFixed(2)} s)`;
118
+ runStart = null;
119
+ }
120
+ }
121
+ rules.push(rule("MO-D-03", "near-black run cap", blackFault ? FAIL : PASS, blackFault ?? "no near-black run longer than 2x the 2-beat hold floor"));
122
+
123
+ const flags = (manifest.chromeFlags ?? []).join(" ");
124
+ rules.push(rule("MO-A-51", "stage flag set recorded", flags === stageFlags(width, height).join(" ") ? PASS : FAIL, `chromeFlags ${flags}`));
125
+ if (data.qa?.rules) rules.push(...data.qa.rules);
126
+ else rules.push(rule("QA-TEXT", "DOM text QA", FAIL, "no text QA replay recorded"));
127
+ rules.push(...soundRules(data.sound, { mode: data.treatment?.sound?.mode ?? manifest.sound?.mode, videoDuration: probe?.videoDuration ?? manifest.durationSec }));
128
+ const pageErrors = manifest.pageErrors ?? [];
129
+ if (pageErrors.length) rules.push(rule("STAGE-ERRORS", "page script errors", WARN, `${pageErrors.length} error(s), first: ${pageErrors[0]}`));
130
+ const missingFiles = manifest.missingFiles ?? [];
131
+ if (missingFiles.length) rules.push(rule("STAGE-MISSING", "missing local files", WARN, `the page asked for ${missingFiles.join(", ")}`));
132
+ return rules;
133
+ }
134
+
135
+ export const stagePassed = (rules) => rules.every((r) => r.status !== FAIL);
136
+
137
+ /** The stage render report. "QA gate: PASS|FAIL" is the line the done-check reads. */
138
+ export function renderStageReport({ manifest, rules, outputs, round, framesViewed = 0, withheld = false, notes = [], stage = "full" }) {
139
+ const lines = ["lit-typographic-motion — stage render report"];
140
+ lines.push(`outputs: ${outputs.mp4} · ${outputs.preview} (encoder: ${manifest.previewEncoder ?? "none"}) · ${outputs.poster} · ${outputs.still}`);
141
+ lines.push(`path: stage · format ${manifest.format} ${manifest.width}x${manifest.height} @ ${manifest.fps} fps · ${manifest.durationSec} s (treatment ${manifest.targetDurationSec} s)`);
142
+ lines.push(`capture: software rung ${manifest.renderer ?? "(no WebGL requested)"} · per frame p50 ${manifest.timing?.p50Ms ?? "?"} ms, p95 ${manifest.timing?.p95Ms ?? "?"} ms · master ${manifest.timing?.masterSec ?? "?"} s, determinism and text QA replays ${manifest.timing?.replaysSec ?? "?"} s, total ${manifest.timing?.totalSec ?? "?"} s`);
143
+ lines.push("");
144
+ const failed = rules.some((r) => r.status === "FAIL");
145
+ lines.push(`QA gate: ${failed ? "FAIL" : "PASS"}${stage === "stills" ? " (stills only; nothing encoded)" : ""}${withheld ? " (render withheld: exports moved to withheld/ as diagnostics, not deliverables)" : ""}`);
146
+ for (const r of rules) lines.push(` ${`${r.id} ${r.name}:`.padEnd(40)}${r.status} ${r.detail}`);
147
+ lines.push(` not applicable on the stage path: ${STAGE_NOT_APPLICABLE.join("; ")}`);
148
+ lines.push("");
149
+ lines.push(`craft rounds run: ${round} / ${MAX_ROUNDS} max`);
150
+ lines.push(`frames actually viewed this run: ${framesViewed} (confirmed looked, not just rendered)`);
151
+ lines.push("");
152
+ lines.push("notes:");
153
+ for (const note of notes) lines.push(` ${note}`);
154
+ return `${lines.join("\n")}\n`;
155
+ }