@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,807 @@
1
+ #!/usr/bin/env node
2
+ // lit-typographic-motion render CLI for LitCodex. One end-to-end command (`film`) runs a craft
3
+ // round: timeline -> pre-flight gate -> stills -> cut sheet -> (stop with --stills-only) -> master,
4
+ // preview, poster and reduced-motion still under .run/ -> full gate -> promote or withhold.
5
+ // Single modes: stills, sheet, video, perf, gate. Exit codes follow MO-A-45.
6
+ import { spawn, spawnSync } from "node:child_process";
7
+ import { closeSync, createWriteStream, existsSync, mkdirSync, openSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
8
+ import { dirname, join, resolve } from "node:path";
9
+ import { fileURLToPath, pathToFileURL } from "node:url";
10
+ import { evaluateCompletion } from "../engine/completion.mjs";
11
+ import { Composer } from "../engine/compose.mjs";
12
+ import { CREDIT_LINE, ENGINE_CREDIT, EXIT, Exit, FRAME, INSTALL_COMMAND, MAX_ROUNDS, NEAR_BLACK, PERF, PREVIEW, SAMPLING } from "../engine/constants.mjs";
13
+ import { buildPreview, encoderArgs, exportPaths, ffprobeSafe, locate, promote, requireFfmpeg } from "../engine/encode.mjs";
14
+
15
+ export { promote };
16
+ import { Blocked, close, launch, openEgress, perfFrame, renderFrame } from "../engine/driver.mjs";
17
+ import { FlashDetector } from "../engine/flash.mjs";
18
+ import { FONTS, fontEntry, fontPath, verifyFonts, verifyStrokeFonts } from "../engine/fonts.mjs";
19
+ import { evaluate, flashFailed, gatePassed, isSoftwareRenderer, timelineRules } from "../engine/gate.mjs";
20
+ import { contactSheet, decodePng, downscale, encodePng, luminancePercentile, rgbaSha256 } from "../engine/image.mjs";
21
+ import { passRanges, planPasses } from "../engine/passes.mjs";
22
+ import { PRESETS, pickPreset, presetFontKeys } from "../engine/presets.mjs";
23
+ import { renderReport } from "../engine/report.mjs";
24
+ import { audioState, ffmpegProbe, firstLine, resolveRuntime, venvPython, wordTimingState } from "../engine/runtime.mjs";
25
+ import { accentShot, buildTimeline, normalizeBrief } from "../engine/timeline.mjs";
26
+ import { loadTreatment, normalizeText, TreatmentError } from "../engine/treatment.mjs";
27
+ import { gateStage, runStage, stillsEntry, writeStills } from "../engine/stage-render.mjs";
28
+ import { recordLook, viewedFor } from "../engine/look.mjs";
29
+ import { measureMuxed, prepareTrack, soundFailed, trackPath } from "../engine/sound.mjs";
30
+ import { loadStrokeFont, strokeText } from "../engine/stroke.mjs";
31
+ import { FontBook, missingGlyphs } from "../engine/type.mjs";
32
+
33
+ const SELF = fileURLToPath(import.meta.url);
34
+ const MODES = ["stage", "sound", "look", "film", "stills", "sheet", "video", "perf", "gate", "completion", "determinism"];
35
+
36
+ export const USAGE = `lit-typographic-motion render CLI (LitCodex)
37
+ Every render reads <dir>/treatment.json first (or --treatment <file>); references/treatment.md.
38
+ Usage:
39
+ node render.mjs stage --out <dir> [--round N] [--stills-only] [--detach]
40
+ (renders <dir>/stage/index.html; references/stage.md)
41
+ node render.mjs sound --out <dir> (builds <dir>/sound/bed.wav and sound-cues.json from the treatment)
42
+ node render.mjs film --out <dir> [--round N] [--stills-only] [--viewed N] [--brief <staging.json>]
43
+ [--preset swiss-signal|terminalcore|tidal] [--audio <file>] [--word-timing]
44
+ node render.mjs stills --out <dir> [--t 1.2,3.4]
45
+ node render.mjs sheet --out <dir> --cuts
46
+ node render.mjs video --out <dir>
47
+ node render.mjs perf --out <dir>
48
+ node render.mjs gate --out <dir> [--viewed N]
49
+ node render.mjs completion --out <dir> (prints whether the film turn is complete)
50
+ Options (type path): --samples N (master 4), --shutter S (0.5), --scale 1..4, --seed N
51
+ Outputs in <dir>: film.mp4, preview.webp|preview.gif, poster.png, reduced-motion.png, manifest.json,
52
+ render.jsonl, gate-report.txt, stills/ (with manifest.json), .run/ (staging), withheld/ (after a flash FAIL)
53
+ Exit: 0 OK, 10 BLOCKED_NO_CHROME, 11 BLOCKED_NO_WEBGL2, 12 BLOCKED_NO_FFMPEG_FOR_VIDEO,
54
+ 13 GATE_FAIL_QA, 14 BLOCKED_DEPS_NOT_PREWARMED, 15 BLOCKED_FONT_FETCH, 16 BLOCKED_TREATMENT_INVALID,
55
+ 17 STAGE_CONTRACT_ERROR, 18 STAGE_NONDETERMINISTIC, 19 STAGE_NETWORK_REQUEST, 20 SOUND_INVALID
56
+ Pre-warm outside any sandboxed session: ${INSTALL_COMMAND} [--audio] [--word-timing]
57
+ ${CREDIT_LINE}`;
58
+
59
+ export function parseArgs(argv) {
60
+ const [mode, ...rest] = argv;
61
+ const args = { mode, flags: new Set() };
62
+ for (let i = 0; i < rest.length; i++) {
63
+ const token = rest[i];
64
+ if (!token.startsWith("--")) throw new Error(`unexpected argument: ${token}`);
65
+ const key = token.slice(2);
66
+ if (["stills-only", "cuts", "word-timing", "help", "detach"].includes(key)) args.flags.add(key);
67
+ else {
68
+ const value = rest[i + 1];
69
+ if (value === undefined || value.startsWith("--")) throw new Error(`--${key} needs a value`);
70
+ args[key] = value;
71
+ i++;
72
+ }
73
+ }
74
+ return args;
75
+ }
76
+
77
+ const out = (text) => process.stdout.write(`${text}\n`);
78
+ const err = (text) => process.stderr.write(`${text}\n`);
79
+ const jsonl = (records) => `${records.map((r) => JSON.stringify(r)).join("\n")}\n`;
80
+
81
+ // ------------------------------------------------------------------------------ preparation
82
+
83
+ /**
84
+ * Resolve and validate the run's treatment (default `<out>/treatment.json`) before any render. The
85
+ * first valid treatment is kept in .run/treatment-first.json for the done-check's downgrade test.
86
+ */
87
+ export function resolveTreatment(args, expectPath) {
88
+ if (!args.out) throw new Exit(EXIT.USAGE, "--out <dir> is required");
89
+ const outDir = resolve(args.out);
90
+ const file = resolve(args.treatment ?? join(outDir, "treatment.json"));
91
+ let treatment;
92
+ try {
93
+ treatment = loadTreatment(file);
94
+ if (expectPath && treatment.path !== expectPath) throw new TreatmentError("path", `this treatment takes the ${treatment.path} path; run \`${treatment.path === "stage" ? "stage" : "film"}\` for it`);
95
+ } catch (error) {
96
+ if (error instanceof TreatmentError) throw new Exit(EXIT.BLOCKED_TREATMENT_INVALID, `BLOCKED_TREATMENT_INVALID: ${error.message}`);
97
+ throw error;
98
+ }
99
+ mkdirSync(join(outDir, ".run"), { recursive: true });
100
+ const first = join(outDir, ".run", "treatment-first.json");
101
+ if (!existsSync(first)) writeFileSync(first, `${JSON.stringify(treatment, null, 2)}\n`);
102
+ writeFileSync(join(outDir, ".run", "treatment.json"), `${JSON.stringify({ file, treatment }, null, 2)}\n`);
103
+ return { file, treatment };
104
+ }
105
+
106
+ /** The type engine's brief from the treatment; an explicit --brief may only add per-line staging. */
107
+ function typeBrief(args, treatment) {
108
+ const plan = treatment.typePlan ?? {};
109
+ const brief = {
110
+ lines: treatment.copy.lines,
111
+ durationSec: treatment.durationSec,
112
+ ...(plan.preset ? { preset: plan.preset, presetSource: plan.presetSource === "user" ? "user" : "agent" } : {}),
113
+ ...(plan.filmName ? { filmName: plan.filmName } : {}),
114
+ showIndex: plan.showIndex === true,
115
+ ...(treatment.sound?.mode === "generated" ? { bpm: treatment.sound.tempo } : {}),
116
+ };
117
+ if (!args.brief) return brief;
118
+ let extra;
119
+ try {
120
+ extra = JSON.parse(readFileSync(resolve(args.brief), "utf8"));
121
+ } catch (error) {
122
+ throw new Exit(EXIT.USAGE, `brief unreadable: ${error.message}`);
123
+ }
124
+ const texts = (Array.isArray(extra.lines) ? extra.lines : []).map((l) => normalizeText(typeof l === "string" ? l : (l?.text ?? "")));
125
+ if (texts.length !== brief.lines.length || texts.some((text, i) => text !== normalizeText(brief.lines[i]))) throw new Exit(EXIT.BLOCKED_TREATMENT_INVALID, "BLOCKED_TREATMENT_INVALID: copy.lines: --brief lines must be the treatment's copy lines, in order; the brief only adds scene, accent and font per line");
126
+ return { ...extra, ...brief, lines: extra.lines, ...(extra.preset ? { preset: extra.preset, presetSource: extra.presetSource === "user" ? "user" : "agent" } : {}) };
127
+ }
128
+
129
+ async function prepare(args, { record = true, rawBrief = null } = {}) {
130
+ if (!args.out) throw new Exit(EXIT.USAGE, "--out <dir> is required");
131
+ if (!rawBrief && !args.brief) throw new Exit(EXIT.USAGE, "--brief <brief.json> is required");
132
+ const outDir = resolve(args.out);
133
+ mkdirSync(join(outDir, ".run"), { recursive: true });
134
+ let raw;
135
+ try {
136
+ raw = rawBrief ? structuredClone(rawBrief) : JSON.parse(readFileSync(resolve(args.brief), "utf8"));
137
+ } catch (error) {
138
+ throw new Exit(EXIT.USAGE, `brief unreadable: ${error.message}`);
139
+ }
140
+ if (args.preset) {
141
+ raw.preset = args.preset;
142
+ raw.presetSource = "agent";
143
+ }
144
+ if (args.seed) raw.seed = Number(args.seed);
145
+ let brief;
146
+ try {
147
+ brief = normalizeBrief(raw);
148
+ } catch (error) {
149
+ throw new Exit(EXIT.USAGE, `brief invalid: ${error.message}`);
150
+ }
151
+ const pick = pickPreset(brief);
152
+ const preset = PRESETS[pick.id];
153
+ const runtime = resolveRuntime();
154
+ if (!runtime.deps.ready) throw new Exit(EXIT.BLOCKED_DEPS_NOT_PREWARMED, `BLOCKED_DEPS_NOT_PREWARMED: ${runtime.deps.missing.join("; ")}. Run \`${INSTALL_COMMAND}\` outside the sandboxed session, then rerun.`);
155
+ if (args.flags.has("word-timing")) {
156
+ const words = wordTimingState(runtime.dir);
157
+ if (!words.ready) throw new Exit(EXIT.BLOCKED_DEPS_NOT_PREWARMED, `BLOCKED_DEPS_NOT_PREWARMED: ${words.detail}. Run \`${INSTALL_COMMAND} --word-timing\` outside the sandboxed session.`);
158
+ }
159
+ const keys = presetFontKeys(preset);
160
+ const faults = [...verifyFonts(keys, runtime.dir), ...(brief.lines.some((l) => l.scene === "stroke-signature") ? verifyStrokeFonts() : [])];
161
+ if (faults.length) throw new Exit(EXIT.BLOCKED_FONT_FETCH, `BLOCKED_FONT_FETCH: ${faults.map((f) => `${f.key} ${f.fault}${f.path ? ` (${f.path})` : ""}`).join("; ")}. Run \`${INSTALL_COMMAND}\` outside the sandboxed session; a mismatched font is never re-fetched mid-render.`);
162
+ const opentypeModule = await import(pathToFileURL(runtime.opentype).href);
163
+ const opentype = opentypeModule.parse ? opentypeModule : opentypeModule.default;
164
+ const files = Object.fromEntries(keys.map((key) => [key, { bytes: readFileSync(fontPath(fontEntry(key), runtime.dir)) }]));
165
+ const book = new FontBook(opentype, files);
166
+ const warnings = [];
167
+ let beatGrid = null;
168
+ let audioTier = "text-reading-time";
169
+ if (args.audio) {
170
+ const state = audioState(runtime.dir);
171
+ if (!existsSync(resolve(args.audio))) throw new Exit(EXIT.USAGE, `audio file not found: ${args.audio}`);
172
+ if (!state.ready) warnings.push(`${state.detail}; Tier 1 text reading-time timeline used instead`);
173
+ else {
174
+ const gridPath = join(outDir, ".run", "beat-grid.json");
175
+ const result = spawnSync(venvPython(runtime.dir), [join(dirname(SELF), "beat-grid.py"), resolve(args.audio), gridPath], { encoding: "utf8", timeout: 300000 });
176
+ if (result.status === 0 && existsSync(gridPath)) {
177
+ const grid = JSON.parse(readFileSync(gridPath, "utf8"));
178
+ if (grid.beats.length >= 4) {
179
+ beatGrid = grid.beats;
180
+ audioTier = "librosa-beat-grid";
181
+ } else warnings.push("audio analysis found fewer than 4 beats; Tier 1 used instead");
182
+ } else warnings.push(`audio analysis failed (${firstLine(result.stderr || result.error?.message || `exit ${result.status}`)}); Tier 1 used instead`);
183
+ }
184
+ }
185
+ const plan = buildTimeline(brief, { beatGrid });
186
+ if (brief.durationSec > 0 && plan.durationSec > brief.durationSec * 1.1) warnings.push(`the reading floors need ${plan.durationSec} s, longer than the treatment's ${brief.durationSec} s target`);
187
+ const voices = Object.values(preset.voices);
188
+ const coverageText = [...brief.lines.map((l) => l.text), ...(brief.lines.some((l) => l.scene === "number-counter") ? ["0123456789,."] : []), "0123456789/ "].join(" ");
189
+ const coverage = missingGlyphs(book, coverageText, voices).concat(strokeCoverage(brief));
190
+ const manifestBase = {
191
+ schemaVersion: 1,
192
+ engineCredit: ENGINE_CREDIT,
193
+ presetId: preset.id,
194
+ seed: brief.seed,
195
+ fps: FRAME.fps,
196
+ resolution: [FRAME.width, FRAME.height],
197
+ scale: Number(args.scale ?? 1),
198
+ samples: Number(args.samples ?? SAMPLING.masterSamples),
199
+ shutter: Number(args.shutter ?? SAMPLING.masterShutter),
200
+ renderer: null,
201
+ softwareRenderer: false,
202
+ chromeFlags: [],
203
+ previewEncoder: null,
204
+ audioTier,
205
+ ...(beatGrid ? { beatGrid } : { bpm: brief.bpm }),
206
+ durationSec: plan.durationSec,
207
+ targetDurationSec: brief.durationSec || null,
208
+ path: "type",
209
+ generatedAt: null,
210
+ passRanges: [],
211
+ timeline: plan.timeline,
212
+ warnings,
213
+ round: Number(args.round ?? 1),
214
+ };
215
+ if (!Number.isInteger(manifestBase.scale) || manifestBase.scale < 1 || manifestBase.scale > FRAME.maxScale) throw new Exit(EXIT.USAGE, "--scale must be an integer 1..4");
216
+ if (!Number.isInteger(manifestBase.round) || manifestBase.round < 1 || manifestBase.round > MAX_ROUNDS) throw new Exit(EXIT.USAGE, `--round must be 1..${MAX_ROUNDS}`);
217
+ if (record) writeFileSync(join(outDir, ".run", "brief.json"), `${JSON.stringify({ briefPath: args.brief ? resolve(args.brief) : null, brief: raw, normalized: brief, preset: preset.id, presetReason: pick.reason, audio: args.audio ? resolve(args.audio) : null }, null, 2)}\n`);
218
+ return { args, outDir, brief, pick, preset, runtime, book, plan, coverage, manifestBase, warnings, audio: args.audio ? resolve(args.audio) : null };
219
+ }
220
+
221
+ function strokeCoverage(brief) {
222
+ const missing = [];
223
+ for (const line of brief.lines.filter((l) => l.scene === "stroke-signature")) {
224
+ const key = line.font?.startsWith("ems-") ? line.font : "ems-allure";
225
+ const layout = strokeText(loadStrokeFont(key), line.text, 100);
226
+ for (const char of new Set(layout.missing)) missing.push({ char, codepoint: `U+${char.codePointAt(0).toString(16).toUpperCase().padStart(4, "0")}`, fontKey: key });
227
+ }
228
+ return missing;
229
+ }
230
+
231
+ async function startSession(ctx, { samples, rung = null } = {}) {
232
+ const session = await launch({ runtime: ctx.runtime, outDir: ctx.outDir, scale: ctx.manifestBase.scale, log: (line) => ctx.log?.push(line), rung });
233
+ const software = isSoftwareRenderer(session.renderer);
234
+ const effectiveSamples = software ? 1 : samples;
235
+ const stateful = ctx.preset.passes.some((p) => p.pass === "crt") && !software;
236
+ const accentId = accentShot(ctx.plan.shots);
237
+ const accent = ctx.plan.shots.find((s) => s.id === accentId);
238
+ const accentLength = Math.min(accent.holdSec - 0.35, 0.09 * ctx.plan.durationSec);
239
+ const accentWindow = [accent.start + 0.3, accent.start + 0.3 + Math.max(0.2, accentLength)];
240
+ const { plans, events } = planPasses({ preset: ctx.preset, shots: ctx.plan.shots, runSeed: ctx.brief.seed, softwareGL: software, fps: FRAME.fps, stateful });
241
+ const composer = () => new Composer({ book: ctx.book, preset: ctx.preset, plan: ctx.plan, passPlans: plans, runSeed: ctx.brief.seed, fps: FRAME.fps, footer: ctx.brief.filmName ?? "", showIndex: ctx.brief.showIndex, accentShotId: accentId, accentWindow, stateful });
242
+ const egress = await openEgress({ runtime: ctx.runtime, page: session.page });
243
+ if (egress.kind !== "websocket") ctx.warnings.push(`frame egress: CDP pull of the readback buffer (listen refused: ${egress.listenError})`);
244
+ return { session, egress, software, samples: effectiveSamples, plans, events, composer, stateful };
245
+ }
246
+
247
+ /** Render output frame n as a seek: stateful scenes replay their shot from its first frame (MO-A-05). */
248
+ async function renderSeeked(run, composer, n, options) {
249
+ composer.resetPostTracking();
250
+ if (run.stateful) {
251
+ const shot = composer.shotOfFrame(n);
252
+ for (let f = shot.frameStart; f < n; f++) {
253
+ const { cmd } = composer.frame(f, { ...options, countInk: false, mask: false });
254
+ await renderFrame(run.session, run.egress, { ...cmd, discard: true });
255
+ }
256
+ }
257
+ const { cmd, line } = composer.frame(n, options);
258
+ const { meta, bytes } = await renderFrame(run.session, run.egress, cmd);
259
+ return { meta, bytes, line };
260
+ }
261
+
262
+ const settledFrame = (shot) => Math.min(shot.frameEnd, Math.round((shot.start + shot.holdSec * 0.85) * FRAME.fps));
263
+ const stillFrame = (shot) => Math.min(shot.frameEnd, Math.round((shot.start + shot.holdSec * 0.6) * FRAME.fps));
264
+
265
+ // ------------------------------------------------------------------------------ modes
266
+
267
+ async function stills(ctx, run, times = null) {
268
+ const dir = join(ctx.outDir, "stills");
269
+ rmSync(dir, { recursive: true, force: true });
270
+ mkdirSync(dir, { recursive: true });
271
+ const frames = times ? times.map((t) => Math.min(ctx.plan.totalFrames - 1, Math.round(t * FRAME.fps))) : ctx.plan.shots.map(stillFrame);
272
+ const composer = run.composer();
273
+ const lines = [];
274
+ const files = [];
275
+ for (const n of frames) {
276
+ const { meta, bytes, line } = await renderSeeked(run, composer, n, { samples: SAMPLING.stillSamples, shutter: ctx.manifestBase.shutter });
277
+ const file = join(dir, `still-${String(n).padStart(5, "0")}.png`);
278
+ writeFileSync(file, encodePng(FRAME.width * ctx.manifestBase.scale, FRAME.height * ctx.manifestBase.scale, bytes, 4, 6));
279
+ lines.push({ ...line, pass: null, rgbaSha256: rgbaSha256(bytes), glyphInkPixels: meta.ink, mode: "stills" }, ...meta.log.map((l) => ({ frame: n, ...l })));
280
+ files.push(file);
281
+ }
282
+ writeFileSync(join(dir, "render.jsonl"), jsonl(lines));
283
+ return files;
284
+ }
285
+
286
+ function cutFrames(plan) {
287
+ const frames = new Set();
288
+ for (const shot of plan.shots.slice(1)) for (const d of [-6, -1, 0, 6]) frames.add(Math.max(0, Math.min(plan.totalFrames - 1, shot.frameStart + d)));
289
+ return [...frames].sort((a, b) => a - b);
290
+ }
291
+
292
+ async function sheet(ctx, run) {
293
+ const dir = join(ctx.outDir, "sheet");
294
+ rmSync(dir, { recursive: true, force: true });
295
+ mkdirSync(dir, { recursive: true });
296
+ const frames = cutFrames(ctx.plan);
297
+ if (frames.length === 0) frames.push(0, Math.floor(ctx.plan.totalFrames / 2), ctx.plan.totalFrames - 1);
298
+ const composer = run.composer();
299
+ const thumbs = [];
300
+ const labels = [];
301
+ const lines = [];
302
+ const w = FRAME.width * ctx.manifestBase.scale;
303
+ const h = FRAME.height * ctx.manifestBase.scale;
304
+ for (const n of frames) {
305
+ const { meta, bytes, line } = await renderSeeked(run, composer, n, { samples: SAMPLING.stillSamples, shutter: ctx.manifestBase.shutter });
306
+ thumbs.push(downscale(bytes, w, h, 480, 270));
307
+ labels.push(`${(n / FRAME.fps).toFixed(2)}s f${n}`);
308
+ lines.push({ ...line, pass: null, rgbaSha256: rgbaSha256(bytes), glyphInkPixels: meta.ink, mode: "sheet" }, ...meta.log.map((l) => ({ frame: n, ...l })));
309
+ }
310
+ const built = contactSheet(thumbs, 480, 270, 4, labels);
311
+ const file = join(dir, "cuts.png");
312
+ writeFileSync(file, encodePng(built.width, built.height, built.pixels, 4, 6));
313
+ writeFileSync(join(dir, "render.jsonl"), jsonl(lines));
314
+ return file;
315
+ }
316
+
317
+ /** Stream the master: every byte handed to ffmpeg is hashed, flash-audited and logged. */
318
+ async function master(ctx, run, ffmpeg, staging) {
319
+ const w = FRAME.width * ctx.manifestBase.scale;
320
+ const h = FRAME.height * ctx.manifestBase.scale;
321
+ const previewDir = join(ctx.outDir, ".run", "preview-src");
322
+ const maskDir = join(ctx.outDir, ".run", "masks");
323
+ const contrastDir = join(ctx.outDir, ".run", "contrast");
324
+ for (const dir of [previewDir, maskDir, contrastDir]) {
325
+ rmSync(dir, { recursive: true, force: true });
326
+ mkdirSync(dir, { recursive: true });
327
+ }
328
+ const encoder = spawn(ffmpeg.path, encoderArgs([w, h], FRAME.fps, staging, ctx.track?.wav ?? null), { stdio: ["pipe", "ignore", "pipe"] });
329
+ let encoderError = "";
330
+ encoder.stderr.on("data", (chunk) => {
331
+ encoderError += chunk;
332
+ });
333
+ const exited = new Promise((done) => encoder.on("close", done));
334
+ const log = createWriteStream(join(ctx.outDir, ".run", "render.jsonl"));
335
+ const detector = new FlashDetector(w, h);
336
+ const composer = run.composer();
337
+ const contrastFrames = new Set(ctx.plan.shots.map(settledFrame));
338
+ const cuts = new Set(ctx.plan.shots.map((s) => s.frameStart));
339
+ const frames = [];
340
+ let previewCount = 0;
341
+ for (let n = 0; n < ctx.plan.totalFrames; n++) {
342
+ const wantMask = contrastFrames.has(n) || cuts.has(n);
343
+ const { cmd, line } = composer.frame(n, { samples: run.samples, shutter: ctx.manifestBase.shutter, countInk: true, mask: wantMask });
344
+ const { meta, bytes } = await renderFrame(run.session, run.egress, cmd);
345
+ line.pass = null;
346
+ line.rgbaSha256 = rgbaSha256(bytes);
347
+ line.glyphInkPixels = meta.ink;
348
+ line.flash = detector.ingest(bytes);
349
+ line.p995 = meta.ink === 0 ? Math.round(luminancePercentile(bytes, NEAR_BLACK.percentile) * 1e4) / 1e4 : null;
350
+ for (const pass of meta.log) log.write(`${JSON.stringify({ frame: n, ...pass })}\n`);
351
+ log.write(`${JSON.stringify(line)}\n`);
352
+ frames.push({ frame: n, rgbaSha256: line.rgbaSha256, glyphInkPixels: meta.ink });
353
+ if (meta.mask) {
354
+ const mask = Buffer.from(meta.mask, "base64");
355
+ writeFileSync(join(maskDir, `f${String(n).padStart(5, "0")}.png`), encodePng(w, h, mask, 1, 6));
356
+ if (contrastFrames.has(n)) writeFileSync(join(contrastDir, `f${String(n).padStart(5, "0")}.png`), encodePng(w, h, bytes, 4, 3));
357
+ }
358
+ if (n % 2 === 0) {
359
+ writeFileSync(join(previewDir, `${String(previewCount).padStart(5, "0")}.png`), encodePng(PREVIEW.widths[0], (PREVIEW.widths[0] * 9) / 16, downscale(bytes, w, h, PREVIEW.widths[0], (PREVIEW.widths[0] * 9) / 16), 4, 3));
360
+ previewCount++;
361
+ }
362
+ if (!encoder.stdin.write(bytes)) await new Promise((done) => encoder.stdin.once("drain", done));
363
+ }
364
+ encoder.stdin.end();
365
+ const code = await exited;
366
+ await new Promise((done) => log.end(done));
367
+ if (code !== 0) throw new Error(`ffmpeg encode failed: ${firstLine(encoderError || `exit ${code}`)}`);
368
+ return { frames, previewCount };
369
+ }
370
+
371
+ /**
372
+ * The stills set every render writes (director brief section 9), on the type path: one still at
373
+ * each shot's midpoint, a -6/0/+6 strip around every cut, a 12-frame contact sheet and the poster,
374
+ * with a hashed manifest the look rounds and the done-check read.
375
+ */
376
+ async function stillsSet(ctx, run, kind) {
377
+ const w = FRAME.width * ctx.manifestBase.scale;
378
+ const h = FRAME.height * ctx.manifestBase.scale;
379
+ const total = ctx.plan.totalFrames;
380
+ const clampFrame = (f) => Math.max(0, Math.min(total - 1, f));
381
+ const shots = ctx.plan.shots;
382
+ const beats = shots.map((shot, i) => ({ index: i, start: shot.frameStart, mid: clampFrame(Math.round(((shot.start + shot.end) / 2) * FRAME.fps)) }));
383
+ const plan = {
384
+ beats,
385
+ cuts: beats.slice(1).map((beat) => ({ beat: beat.index, frames: [-6, 0, 6].map((d) => clampFrame(beat.start + d)) })),
386
+ sheet: Array.from({ length: 12 }, (_, i) => clampFrame(Math.round((i * (total - 1)) / 11))),
387
+ poster: beats[Math.floor(beats.length / 2)].mid,
388
+ };
389
+ const needed = new Set([...beats.map((b) => b.mid), ...plan.cuts.flatMap((c) => c.frames), ...plan.sheet, plan.poster]);
390
+ const composer = run.composer();
391
+ const frames = new Map();
392
+ for (const n of [...needed].sort((a, b) => a - b)) {
393
+ const { bytes } = await renderSeeked(run, composer, n, { samples: SAMPLING.stillSamples, shutter: ctx.manifestBase.shutter });
394
+ frames.set(n, stillsEntry(encodePng(w, h, bytes, 4, 6), bytes, w, h));
395
+ }
396
+ return writeStills({ outDir: ctx.outDir, plan, frames, width: w, height: h, fps: FRAME.fps, round: ctx.manifestBase.round, kind });
397
+ }
398
+
399
+ /** The type path's preview: the shared MO-A-38 ladder over the 960x540 preview-src frames. */
400
+ function preview(ctx, ffmpeg, previewCount) {
401
+ return buildPreview({ runDir: join(ctx.outDir, ".run"), ffmpeg, previewCount, frame: [FRAME.width, FRAME.height], minGlyph: ctx.minFontPx ?? 28 });
402
+ }
403
+
404
+ async function renderStill(ctx, run, n, file) {
405
+ const composer = run.composer();
406
+ const { meta, bytes, line } = await renderSeeked(run, composer, n, { samples: run.samples, shutter: ctx.manifestBase.shutter, still: true });
407
+ writeFileSync(file, encodePng(FRAME.width * ctx.manifestBase.scale, FRAME.height * ctx.manifestBase.scale, bytes, 4, 9));
408
+ return { frame: n, rgbaSha256: rgbaSha256(bytes), glyphInkPixels: meta.ink, textBoxes: line.textBoxes };
409
+ }
410
+
411
+ async function perf(ctx, run) {
412
+ const composer = run.composer();
413
+ const count = Math.max(PERF.minFrames, 120);
414
+ const frames = Array.from({ length: count }, (_, i) => Math.min(ctx.plan.totalFrames - 1, Math.round((i * (ctx.plan.totalFrames - 1)) / (count - 1))));
415
+ const times = [];
416
+ for (const n of frames) {
417
+ const { cmd } = composer.frame(n, { samples: 1, shutter: ctx.manifestBase.shutter, countInk: false });
418
+ times.push(await perfFrame(run.session, cmd));
419
+ }
420
+ const sorted = [...times].sort((a, b) => a - b);
421
+ const result = { frames: times.length, p50: sorted[Math.floor(sorted.length * 0.5)], p95: sorted[Math.floor(sorted.length * 0.95)], max: sorted[sorted.length - 1], samples: 1, renderer: run.session.renderer, software: run.software };
422
+ writeFileSync(join(ctx.outDir, ".run", "perf.json"), `${JSON.stringify(result, null, 2)}\n`);
423
+ return result;
424
+ }
425
+
426
+ /** MO-C-09 / MO-A-25: re-render the cut-sheet frames in fresh processes and compare hashes. */
427
+ function determinism(ctx, rungIndex, frames, videoLines) {
428
+ const runChild = (rung, tag) => {
429
+ const file = join(ctx.outDir, ".run", `determinism-${tag}.jsonl`);
430
+ const result = spawnSync(process.execPath, [SELF, "determinism", "--brief", join(ctx.outDir, ".run", "brief.json"), "--out", ctx.outDir, "--frames", frames.join(","), "--rung", String(rung), "--samples", String(ctx.effectiveSamples), "--shutter", String(ctx.manifestBase.shutter), "--scale", String(ctx.manifestBase.scale), "--record", file], { encoding: "utf8", timeout: 900000 });
431
+ if (result.status !== 0 || !existsSync(file)) return { error: firstLine(result.stderr || `exit ${result.status}`) };
432
+ return { lines: readFileSync(file, "utf8").trim().split("\n").map((l) => JSON.parse(l)) };
433
+ };
434
+ const hardware = runChild(rungIndex, "rerender");
435
+ if (hardware.error) return { frames: [], error: hardware.error };
436
+ const pairs = hardware.lines.map((l) => ({ frame: l.frame, video: videoLines.get(l.frame), rerender: l.rgbaSha256 }));
437
+ const record = { frames: pairs, rung: rungIndex };
438
+ if (pairs.some((p) => p.video !== p.rerender) && rungIndex === 0) {
439
+ const a = runChild(1, "swiftshader-a");
440
+ const b = runChild(1, "swiftshader-b");
441
+ if (!a.error && !b.error) record.swiftshader = a.lines.map((l, i) => ({ frame: l.frame, a: l.rgbaSha256, b: b.lines[i]?.rgbaSha256 }));
442
+ }
443
+ writeFileSync(join(ctx.outDir, ".run", "determinism.json"), `${JSON.stringify(record, null, 2)}\n`);
444
+ return record;
445
+ }
446
+
447
+ // ------------------------------------------------------------------------------ gate + promote
448
+
449
+ function loadRunData(outDir) {
450
+ const manifest = JSON.parse(readFileSync(join(outDir, "manifest.json"), "utf8"));
451
+ const logPath = existsSync(join(outDir, "render.jsonl")) ? join(outDir, "render.jsonl") : join(outDir, ".run", "render.jsonl");
452
+ const frames = [];
453
+ const passLog = new Map();
454
+ const previewRecords = [];
455
+ for (const text of readFileSync(logPath, "utf8").split("\n")) {
456
+ if (!text) continue;
457
+ const line = JSON.parse(text);
458
+ if (line.previewFrame !== undefined) previewRecords.push({ f: line.previewFrame, g: line.flash.g, r: line.flash.r });
459
+ else if (line.pass === null) frames.push(line);
460
+ else {
461
+ if (!passLog.has(line.frame)) passLog.set(line.frame, []);
462
+ passLog.get(line.frame).push(line);
463
+ }
464
+ }
465
+ const names = exportPaths(outDir, manifest);
466
+ const exportsInfo = {};
467
+ for (const [key, name] of Object.entries(names)) {
468
+ const path = locate(outDir, name);
469
+ exportsInfo[key] = { present: Boolean(path), path, bytes: path ? statSync(path).size : null };
470
+ }
471
+ const run = join(outDir, ".run");
472
+ const read = (name) => (existsSync(join(run, name)) ? JSON.parse(readFileSync(join(run, name), "utf8")) : null);
473
+ const exportsLog = read("exports.json");
474
+ const contrastDir = join(run, "contrast");
475
+ const contrast = existsSync(contrastDir)
476
+ ? readdirSync(contrastDir).filter((n) => n.endsWith(".png")).map((name) => {
477
+ const frame = Number(name.slice(1, 6));
478
+ const image = decodePng(readFileSync(join(contrastDir, name)));
479
+ const mask = decodePng(readFileSync(join(run, "masks", name)));
480
+ return { frame, width: image.width, height: image.height, rgba: image.pixels, mask: mask.pixels };
481
+ })
482
+ : [];
483
+ return {
484
+ manifest,
485
+ frames,
486
+ passLog,
487
+ preview: { records: previewRecords, fps: exportsLog?.preview?.fps ?? 30 },
488
+ exports: exportsInfo,
489
+ probe: exportsInfo.mp4.path ? ffprobeSafe(exportsInfo.mp4.path) : null,
490
+ sound: exportsInfo.mp4.path ? measureMuxed(exportsInfo.mp4.path) : null,
491
+ soundMode: read("treatment.json")?.treatment?.sound?.mode ?? manifest.sound?.mode ?? null,
492
+ perf: read("perf.json"),
493
+ determinism: read("determinism.json"),
494
+ coverage: read("preflight.json")?.coverage ?? [],
495
+ stillInk: exportsLog?.still?.glyphInkPixels ?? null,
496
+ contrast,
497
+ presetReason: read("brief.json")?.presetReason ?? "recorded brief missing",
498
+ exportsLog,
499
+ };
500
+ }
501
+
502
+ function writeGate(outDir, data, rules, { framesViewed, round, notes = [], stage = "full" }) {
503
+ const withheld = stage === "full" ? promote(outDir, data.manifest, rules) : false;
504
+ const names = exportPaths(outDir, data.manifest);
505
+ const where = (name) => (stage !== "full" ? `${name} (not rendered)` : join(withheld ? join(outDir, "withheld") : outDir, name));
506
+ const report = renderReport({ manifest: data.manifest, rules, outputs: { mp4: where(names.mp4), preview: where(names.preview), poster: where(names.poster), still: where(names.still) }, presetReason: data.presetReason, round, framesViewed, withheld, notes, stage });
507
+ writeFileSync(join(outDir, "gate-report.txt"), report);
508
+ const log = join(outDir, ".run", "render.jsonl");
509
+ if (stage === "full" && existsSync(log)) renameSync(log, join(outDir, "render.jsonl"));
510
+ return { report, withheld, passed: gatePassed(rules) };
511
+ }
512
+
513
+ // ------------------------------------------------------------------------------ entry
514
+
515
+ /**
516
+ * Frames viewed for the report. A render records its own count (0 until frames are looked at); a
517
+ * gate re-run without --viewed keeps the recorded count instead of resetting it.
518
+ */
519
+ export function framesViewed(outDir, args, { render = false } = {}) {
520
+ const manifestPath = join(outDir, "manifest.json");
521
+ const fromLook = !render && existsSync(manifestPath) ? viewedFor(outDir, JSON.parse(readFileSync(manifestPath, "utf8")).stillsManifestSha256) : null;
522
+ if (fromLook !== null) return fromLook;
523
+ const file = join(outDir, ".run", "viewed.json");
524
+ if (args.viewed !== undefined || render) {
525
+ const count = Number(args.viewed ?? 0);
526
+ mkdirSync(dirname(file), { recursive: true });
527
+ writeFileSync(file, `${JSON.stringify({ count })}\n`);
528
+ return count;
529
+ }
530
+ return existsSync(file) ? Number(JSON.parse(readFileSync(file, "utf8")).count ?? 0) : 0;
531
+ }
532
+
533
+ function clearVerdict(outDir) {
534
+ for (const name of ["manifest.json", "gate-report.txt", "render.jsonl", "film.mp4", "preview.webp", "preview.gif", "poster.png", "reduced-motion.png"]) rmSync(join(outDir, name), { force: true });
535
+ rmSync(join(outDir, "withheld"), { recursive: true, force: true });
536
+ }
537
+
538
+ async function runFilm(args, ctx) {
539
+ const notes = [];
540
+ clearVerdict(ctx.outDir);
541
+ const preflight = timelineRules(ctx.manifestBase, { coverage: ctx.coverage });
542
+ writeFileSync(join(ctx.outDir, ".run", "preflight.json"), `${JSON.stringify({ rules: preflight, coverage: ctx.coverage }, null, 2)}\n`);
543
+ if (!gatePassed(preflight)) {
544
+ writeFileSync(join(ctx.outDir, "manifest.json"), `${JSON.stringify({ ...ctx.manifestBase, generatedAt: new Date().toISOString() }, null, 2)}\n`);
545
+ writeGate(ctx.outDir, { manifest: ctx.manifestBase, presetReason: ctx.pick.reason }, preflight, { framesViewed: framesViewed(ctx.outDir, args, { render: true }), round: ctx.manifestBase.round, stage: "preflight", notes: ["pre-flight FAIL: fix the named unit and rerun with --round N+1"] });
546
+ throw new Exit(EXIT.GATE_FAIL_QA, `GATE_FAIL_QA (pre-flight): ${preflight.filter((r) => r.status === "FAIL").map((r) => `${r.id} ${r.detail}`).join("; ")}; report: ${join(ctx.outDir, "gate-report.txt")}`);
547
+ }
548
+ const run = await startSession(ctx, { samples: ctx.manifestBase.samples });
549
+ try {
550
+ ctx.effectiveSamples = run.samples;
551
+ const stillsOnly = args.flags.has("stills-only");
552
+ const set = await stillsSet(ctx, run, stillsOnly ? "stills-only" : "render");
553
+ out(`stills: ${set.files.map((f) => join(set.dir, f.file)).join(" ")}`);
554
+ out(`stills manifest: ${join(set.dir, "manifest.json")} (sha256 ${set.manifestSha256})`);
555
+ if (stillsOnly) {
556
+ const track = prepareTrack({ outDir: ctx.outDir, treatment: ctx.treatment, frameCount: ctx.plan.totalFrames, fps: FRAME.fps, cuts: ctx.plan.shots.slice(1).map((shot) => shot.start), supplied: ctx.audio });
557
+ for (const note of track.notes) out(note);
558
+ out("stills-only: view every still, then record the look round; this is not a finished film.");
559
+ return EXIT.OK;
560
+ }
561
+ const ffmpeg = requireFfmpeg();
562
+ const manifest = { ...ctx.manifestBase, renderer: run.session.renderer, softwareRenderer: run.software, chromeFlags: run.session.flags, samples: run.samples, previewEncoder: ffmpeg.previewEncoder, passRanges: passRanges(run.plans), stillsManifestSha256: set.manifestSha256, generatedAt: new Date().toISOString() };
563
+ if (run.software) manifest.warnings.push(`software GL detected (${run.session.renderer}); --samples lowered to 1`);
564
+ ctx.track = prepareTrack({ outDir: ctx.outDir, treatment: ctx.treatment, frameCount: ctx.plan.totalFrames, fps: FRAME.fps, cuts: ctx.plan.shots.slice(1).map((shot) => shot.start), supplied: ctx.audio });
565
+ manifest.sound = { mode: ctx.track.mode, notes: ctx.track.notes };
566
+ const { frames, previewCount } = await master(ctx, run, ffmpeg, join(ctx.outDir, ".run", "film.mp4"));
567
+ ctx.minFontPx = minFontPx(ctx);
568
+ const pv = await preview(ctx, ffmpeg, previewCount);
569
+ const log = createWriteStream(join(ctx.outDir, ".run", "render.jsonl"), { flags: "a" });
570
+ for (const record of pv.records) log.write(`${JSON.stringify({ previewFrame: record.f, rung: `${pv.rung.width}x${pv.rung.fps}`, pass: null, flash: { g: record.g, r: record.r, step: record.step } })}\n`);
571
+ await new Promise((done) => log.end(done));
572
+ if (!pv.fit) notes.push(`preview: smallest reachable size ${pv.smallest.bytes} B at ${pv.smallest.width} px / ${pv.smallest.fps} fps`);
573
+ notes.push(`preview rung: ${pv.rung.width} px @ ${pv.rung.fps} fps, ${pv.bytes} B, encoder ${pv.encoder}`);
574
+ const posterShot = ctx.plan.shots.find((s) => s.text) ?? ctx.plan.shots[0];
575
+ const poster = await renderStill(ctx, run, Math.round(((posterShot.start + posterShot.end) / 2) * FRAME.fps), join(ctx.outDir, ".run", "poster.png"));
576
+ const finalShot = [...ctx.plan.shots].reverse().find((s) => s.text) ?? ctx.plan.shots[ctx.plan.shots.length - 1];
577
+ const still = await renderStill(ctx, run, finalShot.frameEnd, join(ctx.outDir, ".run", "reduced-motion.png"));
578
+ writeFileSync(join(ctx.outDir, ".run", "exports.json"), `${JSON.stringify({ poster, still, preview: { fps: pv.rung.fps, width: pv.rung.width, bytes: pv.bytes, encoder: pv.encoder } }, null, 2)}\n`);
579
+ writeFileSync(join(ctx.outDir, "manifest.json"), `${JSON.stringify(manifest, null, 2)}\n`);
580
+ await perf(ctx, run);
581
+ await close(run.session, run.egress);
582
+ run.closed = true;
583
+ const videoLines = new Map(frames.map((f) => [f.frame, f.rgbaSha256]));
584
+ const det = determinism(ctx, run.software ? 1 : 0, cutFrames(ctx.plan).slice(0, 8), videoLines);
585
+ if (det.error) notes.push(`determinism re-render failed: ${det.error}`);
586
+ for (const warning of manifest.warnings) notes.push(`warning: ${warning}`);
587
+ notes.push(`egress: ${run.egress.kind}${run.egress.listenError ? ` (listen error: ${run.egress.listenError})` : ""}`);
588
+ notes.push(`audio tier: ${manifest.audioTier}`);
589
+ notes.push(...ctx.track.notes);
590
+ const data = loadRunData(ctx.outDir);
591
+ const rules = evaluate(data);
592
+ const { withheld, passed } = writeGate(ctx.outDir, data, rules, { framesViewed: framesViewed(ctx.outDir, args, { render: true }), round: manifest.round, notes });
593
+ out(`report: ${join(ctx.outDir, "gate-report.txt")}`);
594
+ if (soundFailed(rules)) throw new Exit(EXIT.SOUND_INVALID, `SOUND_INVALID: ${rules.filter((r) => r.sound && r.status === "FAIL").map((r) => `${r.id} ${r.detail}`).join("; ")}`);
595
+ if (passed) {
596
+ out(`GATE PASS: ${join(ctx.outDir, "film.mp4")}`);
597
+ return EXIT.OK;
598
+ }
599
+ const failed = rules.filter((r) => r.status === "FAIL").map((r) => r.id).join(", ");
600
+ if (withheld) throw new Exit(EXIT.GATE_FAIL_QA, `GATE_FAIL_QA: ${failed}. MO-C-03 flash FAIL: film, preview and poster are withheld in ${join(ctx.outDir, "withheld")} as diagnostics, not deliverables.${manifest.round >= MAX_ROUNDS ? " Round 3 of 3 reached: the render is withheld pending a fix." : ` Fix and rerun with --round ${manifest.round + 1}.`}`);
601
+ throw new Exit(EXIT.GATE_FAIL_QA, `GATE_FAIL_QA: ${failed}.${manifest.round >= MAX_ROUNDS ? " Round 3 of 3 reached: deliver the report with the render for review." : ` Fix the named rule and rerun with --round ${manifest.round + 1}.`}`);
602
+ } finally {
603
+ if (!run.closed) await close(run.session, run.egress);
604
+ }
605
+ }
606
+
607
+ function minFontPx(ctx) {
608
+ let min = Number.POSITIVE_INFINITY;
609
+ const log = join(ctx.outDir, ".run", "render.jsonl");
610
+ for (const text of readFileSync(log, "utf8").split("\n")) {
611
+ if (!text.includes('"textBoxes"')) continue;
612
+ for (const box of JSON.parse(text).textBoxes ?? []) min = Math.min(min, box.fontSizePx);
613
+ }
614
+ return Number.isFinite(min) ? min : 28;
615
+ }
616
+
617
+ async function runVideo(args, ctx) {
618
+ const ffmpeg = requireFfmpeg();
619
+ const run = await startSession(ctx, { samples: ctx.manifestBase.samples });
620
+ try {
621
+ const manifest = { ...ctx.manifestBase, renderer: run.session.renderer, softwareRenderer: run.software, chromeFlags: run.session.flags, samples: run.samples, previewEncoder: ffmpeg.previewEncoder, passRanges: passRanges(run.plans), generatedAt: new Date().toISOString() };
622
+ ctx.track = prepareTrack({ outDir: ctx.outDir, treatment: ctx.treatment, frameCount: ctx.plan.totalFrames, fps: FRAME.fps, cuts: ctx.plan.shots.slice(1).map((shot) => shot.start), supplied: ctx.audio });
623
+ manifest.sound = { mode: ctx.track.mode, notes: ctx.track.notes };
624
+ const { previewCount } = await master(ctx, run, ffmpeg, join(ctx.outDir, "film.mp4"));
625
+ ctx.minFontPx = minFontPx(ctx);
626
+ const pv = await preview(ctx, ffmpeg, previewCount);
627
+ renameSync(pv.target, join(ctx.outDir, pv.encoder === "gif" ? "preview.gif" : "preview.webp"));
628
+ const log = createWriteStream(join(ctx.outDir, ".run", "render.jsonl"), { flags: "a" });
629
+ for (const record of pv.records) log.write(`${JSON.stringify({ previewFrame: record.f, rung: `${pv.rung.width}x${pv.rung.fps}`, pass: null, flash: { g: record.g, r: record.r, step: record.step } })}\n`);
630
+ await new Promise((done) => log.end(done));
631
+ const posterShot = ctx.plan.shots.find((s) => s.text) ?? ctx.plan.shots[0];
632
+ const poster = await renderStill(ctx, run, Math.round(((posterShot.start + posterShot.end) / 2) * FRAME.fps), join(ctx.outDir, "poster.png"));
633
+ const finalShot = [...ctx.plan.shots].reverse().find((s) => s.text) ?? ctx.plan.shots[ctx.plan.shots.length - 1];
634
+ const still = await renderStill(ctx, run, finalShot.frameEnd, join(ctx.outDir, "reduced-motion.png"));
635
+ writeFileSync(join(ctx.outDir, ".run", "exports.json"), `${JSON.stringify({ poster, still, preview: { fps: pv.rung.fps, width: pv.rung.width, bytes: pv.bytes, encoder: pv.encoder } }, null, 2)}\n`);
636
+ writeFileSync(join(ctx.outDir, "manifest.json"), `${JSON.stringify(manifest, null, 2)}\n`);
637
+ renameSync(join(ctx.outDir, ".run", "render.jsonl"), join(ctx.outDir, "render.jsonl"));
638
+ out(`video: ${join(ctx.outDir, "film.mp4")} (run \`node ${SELF} gate --out ${ctx.outDir}\` for the full gate)`);
639
+ return EXIT.OK;
640
+ } finally {
641
+ await close(run.session, run.egress);
642
+ }
643
+ }
644
+
645
+ async function runDeterminismChild(args) {
646
+ const recorded = JSON.parse(readFileSync(resolve(args.brief), "utf8"));
647
+ const briefPath = join(resolve(args.out), ".run", `determinism-brief-${process.pid}.json`);
648
+ writeFileSync(briefPath, JSON.stringify({ ...recorded.brief, preset: recorded.preset }));
649
+ const ctx = await prepare({ ...args, brief: briefPath, flags: new Set() }, { record: false });
650
+ rmSync(briefPath, { force: true });
651
+ const rung = Number(args.rung ?? 0);
652
+ const session = await launch({ runtime: ctx.runtime, outDir: ctx.outDir, scale: ctx.manifestBase.scale, rung });
653
+ const egress = await openEgress({ runtime: ctx.runtime, page: session.page });
654
+ try {
655
+ const software = isSoftwareRenderer(session.renderer);
656
+ const stateful = ctx.preset.passes.some((p) => p.pass === "crt") && !software;
657
+ const accentId = accentShot(ctx.plan.shots);
658
+ const accent = ctx.plan.shots.find((s) => s.id === accentId);
659
+ const accentLength = Math.min(accent.holdSec - 0.35, 0.09 * ctx.plan.durationSec);
660
+ const accentWindow = [accent.start + 0.3, accent.start + 0.3 + Math.max(0.2, accentLength)];
661
+ const { plans } = planPasses({ preset: ctx.preset, shots: ctx.plan.shots, runSeed: ctx.brief.seed, softwareGL: software, fps: FRAME.fps, stateful });
662
+ const run = { session, egress, stateful, composer: () => new Composer({ book: ctx.book, preset: ctx.preset, plan: ctx.plan, passPlans: plans, runSeed: ctx.brief.seed, fps: FRAME.fps, footer: ctx.brief.filmName ?? "", showIndex: ctx.brief.showIndex, accentShotId: accentId, accentWindow, stateful }) };
663
+ const lines = [];
664
+ for (const n of args.frames.split(",").map(Number)) {
665
+ const { bytes } = await renderSeeked(run, run.composer(), n, { samples: Number(args.samples), shutter: Number(args.shutter), countInk: false });
666
+ lines.push({ frame: n, rgbaSha256: rgbaSha256(bytes), renderer: session.renderer, chromeFlags: session.flags });
667
+ }
668
+ writeFileSync(resolve(args.record), jsonl(lines));
669
+ return EXIT.OK;
670
+ } finally {
671
+ await close(session, egress);
672
+ }
673
+ }
674
+
675
+ /**
676
+ * Run a long stage render in the background. The child writes .run/progress.json while it works
677
+ * and .run/exit.json when it ends; its output goes to .run/render.log.
678
+ */
679
+ function detach(argv, outDir) {
680
+ const runDir = join(outDir, ".run");
681
+ mkdirSync(runDir, { recursive: true });
682
+ rmSync(join(runDir, "exit.json"), { force: true });
683
+ const logFd = openSync(join(runDir, "render.log"), "w");
684
+ const child = spawn(process.execPath, [SELF, ...argv.filter((a) => a !== "--detach")], { detached: true, stdio: ["ignore", logFd, logFd], env: { ...process.env, LITCODEX_MOTION_EXIT_FILE: join(runDir, "exit.json") } });
685
+ child.unref();
686
+ closeSync(logFd);
687
+ out(`rendering in the background (pid ${child.pid}). Progress: ${join(runDir, "progress.json")}; the exit code lands in ${join(runDir, "exit.json")}; output in ${join(runDir, "render.log")}.`);
688
+ return EXIT.OK;
689
+ }
690
+
691
+ export async function main(argv = process.argv.slice(2)) {
692
+ if (argv.length === 0 || argv.includes("--help") || argv.includes("-h") || argv[0] === "help") {
693
+ out(USAGE);
694
+ return argv.length === 0 ? EXIT.USAGE : EXIT.OK;
695
+ }
696
+ let args;
697
+ try {
698
+ args = parseArgs(argv);
699
+ if (!MODES.includes(args.mode)) throw new Error(`unknown mode "${args.mode}" (use ${MODES.filter((m) => m !== "determinism").join(", ")})`);
700
+ } catch (error) {
701
+ err(`${error.message}\n\n${USAGE}`);
702
+ return EXIT.USAGE;
703
+ }
704
+ try {
705
+ if (args.mode === "gate") {
706
+ if (!args.out) throw new Exit(EXIT.USAGE, "--out <dir> is required");
707
+ const outDir = resolve(args.out);
708
+ if (!existsSync(join(outDir, "manifest.json"))) throw new Exit(EXIT.USAGE, `no manifest.json in ${outDir}; render first`);
709
+ if (JSON.parse(readFileSync(join(outDir, "manifest.json"), "utf8")).path === "stage") {
710
+ const outcome = gateStage(outDir, { framesViewed: framesViewed(outDir, args) });
711
+ out(`report: ${join(outDir, "gate-report.txt")}`);
712
+ if (outcome.soundInvalid) {
713
+ err(`SOUND_INVALID: ${outcome.rules.filter((r) => r.sound && r.status === "FAIL").map((r) => `${r.id} ${r.detail}`).join("; ")}`);
714
+ return EXIT.SOUND_INVALID;
715
+ }
716
+ if (outcome.passed) {
717
+ out("GATE PASS");
718
+ return EXIT.OK;
719
+ }
720
+ err(`GATE_FAIL_QA: ${outcome.rules.filter((r) => r.status === "FAIL").map((r) => r.id).join(", ")}${outcome.withheld ? "; exports withheld in withheld/" : ""}`);
721
+ return EXIT.GATE_FAIL_QA;
722
+ }
723
+ const data = loadRunData(outDir);
724
+ const rules = evaluate(data);
725
+ const notes = (data.manifest.warnings ?? []).map((w) => `warning: ${w}`);
726
+ const { passed, withheld } = writeGate(outDir, data, rules, { framesViewed: framesViewed(outDir, args), round: data.manifest.round ?? 1, notes });
727
+ out(`report: ${join(outDir, "gate-report.txt")}`);
728
+ if (soundFailed(rules)) {
729
+ err(`SOUND_INVALID: ${rules.filter((r) => r.sound && r.status === "FAIL").map((r) => `${r.id} ${r.detail}`).join("; ")}`);
730
+ return EXIT.SOUND_INVALID;
731
+ }
732
+ if (passed) {
733
+ out("GATE PASS");
734
+ return EXIT.OK;
735
+ }
736
+ err(`GATE_FAIL_QA: ${rules.filter((r) => r.status === "FAIL").map((r) => r.id).join(", ")}${withheld ? "; exports withheld in withheld/" : ""}`);
737
+ return EXIT.GATE_FAIL_QA;
738
+ }
739
+ if (args.mode === "determinism") return await runDeterminismChild(args);
740
+ if (args.mode === "completion") {
741
+ if (!args.out) throw new Exit(EXIT.USAGE, "--out <dir> is required");
742
+ const verdict = evaluateCompletion(resolve(args.out));
743
+ out(`completion: ${verdict.status} - ${verdict.reason}`);
744
+ if (verdict.downgraded.length) out(`downgraded: ${verdict.downgraded.join("; ")} (say so in the reply)`);
745
+ if (verdict.openItems.length) out(`open look items: ${verdict.openItems.join(" | ")}`);
746
+ return verdict.complete ? EXIT.OK : 1;
747
+ }
748
+ if (args.mode === "look") {
749
+ if (!args.out || !args.answers) throw new Exit(EXIT.USAGE, "look needs --out <dir> --round N --answers <file>");
750
+ const entry = recordLook(resolve(args.out), Number(args.round), resolve(args.answers));
751
+ if (entry.blocked) out(`look round ${entry.round}: blocked (${entry.blocked}); the film will be reported as not viewed`);
752
+ else out(`look round ${entry.round} recorded against stills ${entry.manifestSha256.slice(0, 12)}: ${Object.keys(entry.frames).length} frames stamped${entry.needsAnotherRound ? `; another round needed: ${entry.openItems.map((item) => item.split(":")[0]).join(", ")}` : "; nothing asks for another round"}`);
753
+ return EXIT.OK;
754
+ }
755
+ if (args.mode === "sound") {
756
+ const { treatment } = resolveTreatment(args, null);
757
+ const fps = treatment.fps ?? 60;
758
+ const outDir = resolve(args.out);
759
+ const track = prepareTrack({ outDir, treatment, frameCount: Math.round(treatment.durationSec * fps), fps });
760
+ for (const note of track.notes) out(note);
761
+ if (track.wav) out(`track: ${track.wav}\ncues: ${join(outDir, "sound-cues.json")}`);
762
+ return EXIT.OK;
763
+ }
764
+ if (args.mode === "stage") {
765
+ const { treatment } = resolveTreatment(args, "stage");
766
+ if (args.flags.has("detach") && !args.flags.has("stills-only")) return detach(argv, resolve(args.out));
767
+ return await runStage({ outDir: resolve(args.out), treatment, round: Number(args.round ?? 1), stillsOnly: args.flags.has("stills-only"), log: out });
768
+ }
769
+ const { treatment } = resolveTreatment(args, "type");
770
+ if (!args.audio && ["supplied", "authored"].includes(treatment.sound.mode)) args.audio = trackPath(resolve(args.out), treatment.sound.file);
771
+ const ctx = await prepare(args, { rawBrief: typeBrief(args, treatment) });
772
+ ctx.treatment = treatment;
773
+ if (args.mode === "film") return await runFilm(args, ctx);
774
+ if (args.mode === "video") return await runVideo(args, ctx);
775
+ const run = await startSession(ctx, { samples: ctx.manifestBase.samples });
776
+ try {
777
+ if (args.mode === "stills") out((await stills(ctx, run, args.t ? args.t.split(",").map(Number) : null)).join("\n"));
778
+ else if (args.mode === "sheet") {
779
+ if (!args.flags.has("cuts")) throw new Exit(EXIT.USAGE, "sheet needs --cuts (one frame set around every cut)");
780
+ out(await sheet(ctx, run));
781
+ } else if (args.mode === "perf") {
782
+ const result = await perf(ctx, run);
783
+ out(`perf: ${result.frames} frames, p50 ${result.p50.toFixed(1)} ms, p95 ${result.p95.toFixed(1)} ms (${run.software ? "software GL" : "hardware"})`);
784
+ }
785
+ return EXIT.OK;
786
+ } finally {
787
+ await close(run.session, run.egress);
788
+ }
789
+ } catch (error) {
790
+ if (error instanceof Blocked) {
791
+ err(`${error.blockedName}: ${error.message}`);
792
+ return error.exit;
793
+ }
794
+ if (error instanceof Exit) {
795
+ err(error.message);
796
+ return error.code;
797
+ }
798
+ err(`render error: ${error.stack ?? error.message}`);
799
+ return 1;
800
+ }
801
+ }
802
+
803
+ const invoked = process.argv[1] ? realpathSync(process.argv[1]) : "";
804
+ if (invoked === realpathSync(SELF)) {
805
+ process.exitCode = await main();
806
+ if (process.env.LITCODEX_MOTION_EXIT_FILE) writeFileSync(process.env.LITCODEX_MOTION_EXIT_FILE, `${JSON.stringify({ exit: process.exitCode, at: new Date().toISOString() })}\n`);
807
+ }