@litfamily/litcodex 1.0.30 → 1.0.31
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.
- package/README-Ko-KR.md +11 -11
- package/README.md +11 -11
- package/dist/install/generated-skill-payload-hashes.d.ts +188 -82
- package/dist/install/generated-skill-payload-hashes.js +188 -82
- package/dist/install/skill-catalog.d.ts +1 -1
- package/dist/install/skill-catalog.js +12 -1
- package/dist/install/skill-resource-hashes.d.ts +1 -1
- package/dist/install/skill-resource-hashes.js +1 -1
- package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
- package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
- package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
- package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/directive.md +10 -4
- package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-adhd.md +191 -0
- package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-handoff.md +2 -0
- package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-hijack.md +219 -0
- package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-recap.md +2 -0
- package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-schematic.md +199 -0
- package/marketplace/plugins/litcodex/components/lit-loop/directives/litwork.md +2 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/adhd-suggest.d.ts +10 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/adhd-suggest.js +67 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-html.d.ts +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-html.js +128 -8
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-looks.d.ts +19 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-looks.js +58 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.d.ts +27 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.js +94 -7
- package/marketplace/plugins/litcodex/components/lit-loop/dist/cli.js +13 -3
- package/marketplace/plugins/litcodex/components/lit-loop/dist/codex-hook.d.ts +2 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/codex-hook.js +8 -9
- package/marketplace/plugins/litcodex/components/lit-loop/dist/control-chars.d.ts +5 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/control-chars.js +23 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.d.ts +8 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.js +118 -11
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.d.ts +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.js +29 -13
- package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-events.d.ts +13 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-events.js +85 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-state.d.ts +55 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-state.js +227 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/live-step.d.ts +5 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/live-step.js +17 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/markers.d.ts +6 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/markers.js +6 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/modes.d.ts +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/modes.js +25 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-gate.d.ts +79 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-gate.js +310 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-route.js +5 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-persistence.js +10 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/redaction.js +18 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/reentry.d.ts +15 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/reentry.js +46 -9
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-cli.d.ts +10 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-cli.js +88 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-go.d.ts +20 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-go.js +84 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-look.d.ts +6 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-look.js +41 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-redact.d.ts +3 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-redact.js +40 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-rollout.d.ts +48 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-rollout.js +292 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind.d.ts +162 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind.js +773 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/route-heads.js +44 -2
- package/marketplace/plugins/litcodex/components/lit-loop/dist/run-panel.js +1 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/schematic-route.d.ts +6 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/schematic-route.js +35 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.d.ts +3 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.js +15 -5
- package/marketplace/plugins/litcodex/components/lit-loop/dist/skill-mention-scope.js +6 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/stack-hook.d.ts +8 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/stack-hook.js +57 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/statusline.js +8 -3
- package/marketplace/plugins/litcodex/components/lit-loop/dist/threads.d.ts +50 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/threads.js +178 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/trigger.d.ts +1 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/trigger.js +29 -5
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.d.ts +10 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.js +11 -1
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-stack.d.ts +132 -0
- package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-stack.js +488 -0
- package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
- package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
- package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
- package/marketplace/plugins/litcodex/components/start-work-continuation/dist/codex-hook.d.ts +6 -0
- package/marketplace/plugins/litcodex/components/start-work-continuation/dist/codex-hook.js +65 -0
- package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
- package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
- package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
- package/marketplace/plugins/litcodex/hooks/hooks.json +24 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/SKILL.md +6 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/components.css +414 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/fonts.json +22 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/layouts/landing.html +164 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/layouts/settings.html +114 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/layouts/workspace.html +115 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +227 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/field-notes.json +205 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/graphite.json +200 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/meadow.json +199 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +222 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/ui.js +228 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/brand-and-imagery.md +1 -1
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/complete-contract.md +1 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/craft-floor.md +2 -2
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/default-editorial-pixel.json +15 -8
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/design-choice.md +19 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/house-styles.md +235 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/motion-guide.md +2 -2
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/probe-and-review.md +6 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/production-interview.md +2 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/slop-register.md +4 -4
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/design-lock.mjs +400 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/lock-probe.mjs +196 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/page-probe.mjs +22 -4
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/pixel-art.mjs +60 -0
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/probe.mjs +59 -13
- package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/rule-data.mjs +38 -4
- package/marketplace/plugins/litcodex/skills/lit-adhd/SKILL.md +181 -0
- package/marketplace/plugins/litcodex/skills/lit-adhd/agents/openai.yaml +6 -0
- package/marketplace/plugins/litcodex/skills/lit-adhd/references/card-examples.md +147 -0
- package/marketplace/plugins/litcodex/skills/lit-adhd/references/status-taxonomy.md +37 -0
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/SKILL.md +18 -7
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/style-guide.md +20 -11
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-architecture.md +3 -3
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dependency.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-swimlane.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree.md +3 -3
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-wardley.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/verifier-guide.md +1 -0
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +1 -2
- package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/visual-quality.mjs +1 -2
- package/marketplace/plugins/litcodex/skills/lit-docx/SKILL.md +12 -3
- package/marketplace/plugins/litcodex/skills/lit-docx/references/direction-step.md +6 -3
- package/marketplace/plugins/litcodex/skills/lit-hijack/SKILL.md +449 -0
- package/marketplace/plugins/litcodex/skills/lit-hijack/agents/openai.yaml +6 -0
- package/marketplace/plugins/litcodex/skills/lit-hijack/references/capture-and-provenance.md +100 -0
- package/marketplace/plugins/litcodex/skills/lit-hijack/references/clean-room-build.md +111 -0
- package/marketplace/plugins/litcodex/skills/lit-hijack/references/distil-and-licence.md +102 -0
- package/marketplace/plugins/litcodex/skills/lit-hijack/references/gap-and-port-design.md +125 -0
- package/marketplace/plugins/litcodex/skills/lit-hijack/references/parity-and-report.md +108 -0
- package/marketplace/plugins/litcodex/skills/lit-hijack/scripts/hijack.mjs +1050 -0
- package/marketplace/plugins/litcodex/skills/lit-loop/SKILL.md +13 -4
- package/marketplace/plugins/litcodex/skills/lit-plan/SKILL.md +6 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/NOTICE +1 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/SKILL.md +35 -8
- package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +93 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/SOURCE.md +21 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/anti-slop-checklist.md +5 -2
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/authoring-guide.md +3 -4
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/density-and-fill.md +20 -6
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/direction-step.md +26 -8
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/14-engineering-review-computational-brutalism-ko.md +173 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/15-launch-pitch-neo-brutalism-ko.md +154 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/16-design-lecture-bauhaus-ko.md +139 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/17-community-programme-riso-ko.md +158 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/18-public-data-briefing-newsroom-ko.md +179 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/layout-families.md +42 -27
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/title-treatments.md +31 -27
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/bauhaus.md +136 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/chalk.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/computational-brutalism.md +145 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/neo-brutalism.md +155 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/newsroom.md +141 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/riso.md +133 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/signal.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/studio.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/compile-deck.js +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/craft_extras.py +136 -94
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/embed_fonts.py +13 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/grid-resolver.js +101 -110
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/layout-resolver.js +9 -15
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-pack.js +386 -579
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/slide-grid.js +104 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/template-registry.js +57 -6
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/office-run.mjs +2 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/qa_deck.py +7 -13
- package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/render_pages.py +124 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +98 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +100 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +107 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +99 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/night/pack.yaml +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/paper/pack.yaml +1 -1
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/riso/pack.yaml +99 -0
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/signal/pack.yaml +2 -2
- package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/studio/pack.yaml +1 -1
- package/marketplace/plugins/litcodex/skills/lit-recap/SKILL.md +2 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/SKILL.md +198 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/agents/openai.yaml +6 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +38 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +133 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +87 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +85 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/cutaway-outputs.md +70 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/isometric-craft.md +101 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/journal-figures.md +72 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/kit-api.md +134 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/pfd-and-layout.md +53 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/pid-drafting.md +103 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/pid-symbols.md +163 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/references/verification.md +100 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/doctor.mjs +57 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/figure.mjs +81 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/fonts.mjs +28 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/geom.mjs +113 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/interactive.mjs +292 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/isa.mjs +115 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/iso.mjs +719 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/legend-sheet.mjs +162 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/pid.mjs +937 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/png.mjs +132 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/qa-core.mjs +658 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/route.mjs +218 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/sheet.mjs +890 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/svg.mjs +82 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/theme.mjs +115 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/motion.mjs +129 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/qa.mjs +92 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/render.mjs +233 -0
- package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/scaffold.mjs +60 -0
- package/marketplace/plugins/litcodex/skills/lit-scientific-visualization/SKILL.md +34 -8
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/SKILL.md +18 -14
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +12 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/assets.mjs +388 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/blender/runner.py +221 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/blender.mjs +132 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/board.mjs +142 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/constants.mjs +6 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-assets.mjs +7 -4
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-capture.mjs +8 -7
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-init.js +14 -2
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-treatment.mjs +38 -3
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover.mjs +19 -4
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/driver.mjs +8 -8
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/gallery.mjs +147 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/house.mjs +45 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/image.mjs +89 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/look.mjs +58 -25
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/runtime.mjs +59 -14
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/safe-read.mjs +32 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/scaffold.mjs +208 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/score.mjs +668 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/sound.mjs +174 -31
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-gate.mjs +45 -3
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-kit.js +99 -1
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.js +8 -1
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.mjs +180 -11
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-render.mjs +42 -12
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-worker.mjs +7 -4
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage.mjs +96 -10
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/styles.mjs +233 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/treatment.mjs +291 -14
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/LICENSE +21 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +144 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +155 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/three.module.js +54571 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/recipes/hero-3d/expected.json +33 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/recipes/hero-3d/index.html +139 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/cover.md +44 -7
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/depth.md +156 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/design-choice.md +22 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/quality-gate.md +29 -7
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/runtime.md +1 -1
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/sound.md +87 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/stage.md +19 -7
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/studio.md +246 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/style-bibles.md +2 -2
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/treatment.md +41 -21
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/render.mjs +51 -4
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/paper.json +185 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/swiss-signal.json +188 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/terminalcore.json +182 -0
- package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/tidal.json +187 -0
- package/marketplace/plugins/litcodex/skills/litresearch/SKILL.md +7 -0
- package/marketplace/plugins/litcodex/skills/litwork/SKILL.md +2 -1
- package/marketplace/plugins/litcodex/skills/readme-studio/SKILL.md +10 -0
- package/marketplace/plugins/litcodex/skills/review-work/SKILL.md +7 -1
- package/marketplace/plugins/litcodex/skills/start-work/SKILL.md +10 -0
- package/node_modules/@litcodex/lit-loop/directive.md +10 -4
- package/node_modules/@litcodex/lit-loop/directives/lit-adhd.md +191 -0
- package/node_modules/@litcodex/lit-loop/directives/lit-handoff.md +2 -0
- package/node_modules/@litcodex/lit-loop/directives/lit-hijack.md +219 -0
- package/node_modules/@litcodex/lit-loop/directives/lit-recap.md +2 -0
- package/node_modules/@litcodex/lit-loop/directives/lit-schematic.md +199 -0
- package/node_modules/@litcodex/lit-loop/directives/litwork.md +2 -1
- package/node_modules/@litcodex/lit-loop/dist/adhd-suggest.d.ts +10 -0
- package/node_modules/@litcodex/lit-loop/dist/adhd-suggest.js +67 -0
- package/node_modules/@litcodex/lit-loop/dist/card-html.d.ts +1 -1
- package/node_modules/@litcodex/lit-loop/dist/card-html.js +128 -8
- package/node_modules/@litcodex/lit-loop/dist/card-looks.d.ts +19 -0
- package/node_modules/@litcodex/lit-loop/dist/card-looks.js +58 -0
- package/node_modules/@litcodex/lit-loop/dist/card-status.d.ts +27 -0
- package/node_modules/@litcodex/lit-loop/dist/card-status.js +94 -7
- package/node_modules/@litcodex/lit-loop/dist/cli.js +13 -3
- package/node_modules/@litcodex/lit-loop/dist/codex-hook.d.ts +2 -0
- package/node_modules/@litcodex/lit-loop/dist/codex-hook.js +8 -9
- package/node_modules/@litcodex/lit-loop/dist/control-chars.d.ts +5 -0
- package/node_modules/@litcodex/lit-loop/dist/control-chars.js +23 -0
- package/node_modules/@litcodex/lit-loop/dist/hook-cli.d.ts +8 -0
- package/node_modules/@litcodex/lit-loop/dist/hook-cli.js +118 -11
- package/node_modules/@litcodex/lit-loop/dist/hud.d.ts +1 -1
- package/node_modules/@litcodex/lit-loop/dist/hud.js +29 -13
- package/node_modules/@litcodex/lit-loop/dist/lane-events.d.ts +13 -0
- package/node_modules/@litcodex/lit-loop/dist/lane-events.js +85 -0
- package/node_modules/@litcodex/lit-loop/dist/lane-state.d.ts +55 -0
- package/node_modules/@litcodex/lit-loop/dist/lane-state.js +227 -0
- package/node_modules/@litcodex/lit-loop/dist/live-step.d.ts +5 -1
- package/node_modules/@litcodex/lit-loop/dist/live-step.js +17 -1
- package/node_modules/@litcodex/lit-loop/dist/markers.d.ts +6 -0
- package/node_modules/@litcodex/lit-loop/dist/markers.js +6 -0
- package/node_modules/@litcodex/lit-loop/dist/modes.d.ts +1 -1
- package/node_modules/@litcodex/lit-loop/dist/modes.js +25 -1
- package/node_modules/@litcodex/lit-loop/dist/motion-gate.d.ts +79 -0
- package/node_modules/@litcodex/lit-loop/dist/motion-gate.js +310 -0
- package/node_modules/@litcodex/lit-loop/dist/motion-route.js +5 -1
- package/node_modules/@litcodex/lit-loop/dist/plan-persistence.js +10 -0
- package/node_modules/@litcodex/lit-loop/dist/redaction.js +18 -0
- package/node_modules/@litcodex/lit-loop/dist/reentry.d.ts +15 -0
- package/node_modules/@litcodex/lit-loop/dist/reentry.js +46 -9
- package/node_modules/@litcodex/lit-loop/dist/rewind-cli.d.ts +10 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-cli.js +88 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-go.d.ts +20 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-go.js +84 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-look.d.ts +6 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-look.js +41 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-redact.d.ts +3 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-redact.js +40 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-rollout.d.ts +48 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind-rollout.js +292 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind.d.ts +162 -0
- package/node_modules/@litcodex/lit-loop/dist/rewind.js +773 -0
- package/node_modules/@litcodex/lit-loop/dist/route-heads.js +44 -2
- package/node_modules/@litcodex/lit-loop/dist/run-panel.js +1 -0
- package/node_modules/@litcodex/lit-loop/dist/schematic-route.d.ts +6 -0
- package/node_modules/@litcodex/lit-loop/dist/schematic-route.js +35 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-card.d.ts +3 -0
- package/node_modules/@litcodex/lit-loop/dist/screen-card.js +15 -5
- package/node_modules/@litcodex/lit-loop/dist/skill-mention-scope.js +6 -0
- package/node_modules/@litcodex/lit-loop/dist/stack-hook.d.ts +8 -0
- package/node_modules/@litcodex/lit-loop/dist/stack-hook.js +57 -0
- package/node_modules/@litcodex/lit-loop/dist/statusline.js +8 -3
- package/node_modules/@litcodex/lit-loop/dist/threads.d.ts +50 -0
- package/node_modules/@litcodex/lit-loop/dist/threads.js +178 -0
- package/node_modules/@litcodex/lit-loop/dist/trigger.d.ts +1 -1
- package/node_modules/@litcodex/lit-loop/dist/trigger.js +29 -5
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.d.ts +10 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-map.js +11 -1
- package/node_modules/@litcodex/lit-loop/dist/workflow-stack.d.ts +132 -0
- package/node_modules/@litcodex/lit-loop/dist/workflow-stack.js +488 -0
- package/node_modules/@litcodex/lit-loop/package.json +1 -1
- package/node_modules/@litcodex/lit-loop/skills/lit-adhd/SKILL.md +181 -0
- package/node_modules/@litcodex/lit-loop/skills/lit-hijack/SKILL.md +449 -0
- package/node_modules/@litcodex/lit-loop/skills/lit-loop/SKILL.md +13 -4
- package/node_modules/@litcodex/lit-loop/skills/lit-plan/SKILL.md +6 -0
- package/node_modules/@litcodex/lit-loop/skills/lit-recap/SKILL.md +2 -0
- package/node_modules/@litcodex/lit-loop/skills/lit-schematic/SKILL.md +198 -0
- package/node_modules/@litcodex/lit-loop/skills/lit-scientific-visualization/SKILL.md +34 -8
- package/node_modules/@litcodex/lit-loop/skills/litresearch/SKILL.md +7 -0
- package/node_modules/@litcodex/lit-loop/skills/litwork/SKILL.md +2 -1
- package/node_modules/@litcodex/lit-loop/skills/review-work/SKILL.md +7 -1
- package/node_modules/@litcodex/lit-loop/skills/start-work/SKILL.md +10 -0
- package/package.json +2 -2
- package/readme-assets/badge-version.svg +1 -1
- package/readme-assets/skills/lit-adhd.webp +0 -0
- package/readme-assets/skills/lit-hijack.webp +0 -0
- package/readme-assets/skills/lit-schematic.webp +0 -0
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
// before every render (stills-only too). Any fault throws TreatmentError with the field name; the
|
|
3
3
|
// CLI turns it into exit 16 BLOCKED_TREATMENT_INVALID. It checks structure and the anti-restatement
|
|
4
4
|
// rules, never taste: taste is the look rounds' job.
|
|
5
|
+
//
|
|
6
|
+
// The forks that used to be the model's to flip on every run are rules here: the house style (named,
|
|
7
|
+
// then the project's house file, then a keyword, then the genre), the register (rich unless the request
|
|
8
|
+
// asks for calm), the format (9:16 only for a vertical request), the length (the genre's band unless the
|
|
9
|
+
// user names one) and the genre (a genre word in the request fixes it). Concept fields stay free.
|
|
5
10
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
6
|
-
import { join } from "node:path";
|
|
7
|
-
import { SOUND_PALETTES } from "./constants.mjs";
|
|
11
|
+
import { dirname, join } from "node:path";
|
|
12
|
+
import { EVENT_SOUNDS, SCORE_GENRES, SOUND_PALETTES } from "./constants.mjs";
|
|
8
13
|
import { FONTS, SKILL_ROOT } from "./fonts.mjs";
|
|
14
|
+
import { readHouse } from "./house.mjs";
|
|
15
|
+
import { readBoundedText } from "./safe-read.mjs";
|
|
16
|
+
import { LAYOUT_IDS, pickStyle, readStyle, STYLE_IDS, sameBed, styleBeds, styleColors, styleFamilies } from "./styles.mjs";
|
|
9
17
|
|
|
10
18
|
export class TreatmentError extends Error {
|
|
11
19
|
constructor(field, message) {
|
|
@@ -17,16 +25,45 @@ export class TreatmentError extends Error {
|
|
|
17
25
|
export const GENRES = Object.freeze(["announcement", "brand-mood", "event", "explainer", "motion-graphics", "type-led", "other"]);
|
|
18
26
|
// Minimum beat count per genre: the stage count of its arc (references/treatment.md).
|
|
19
27
|
export const ARC_STAGES = Object.freeze({ announcement: 5, "brand-mood": 4, event: 4, explainer: 4, "motion-graphics": 5, other: 3 });
|
|
20
|
-
|
|
21
|
-
export const
|
|
28
|
+
/** Length bands in seconds when the user names no length; `type-led` scales with its lines. */
|
|
29
|
+
export const GENRE_BANDS = Object.freeze({ announcement: [12, 18], "brand-mood": [10, 15], event: [10, 15], explainer: [16, 24], "motion-graphics": [12, 18], other: [10, 15] });
|
|
30
|
+
export const typeLedBand = (lines) => [Math.max(4, 2 * lines), Math.max(8, 6 * lines)];
|
|
31
|
+
export const DEVICE_KINDS = Object.freeze(["illustration", "diagram", "chart", "icon", "shape", "path", "mask", "depth3d", "screen", "particles", "grid", "gradient", "photo-texture"]);
|
|
22
32
|
const TEXTURE_KINDS = new Set(["grid", "gradient", "particles", "photo-texture"]);
|
|
23
33
|
export const FACES = Object.freeze([...new Set(FONTS.map((font) => font.family))]);
|
|
34
|
+
export const PROTAGONIST_KINDS = Object.freeze(["character", "object"]);
|
|
35
|
+
/** What a product asset is; `screen` devices need one of the last three. */
|
|
36
|
+
export const ASSET_ROLES = Object.freeze(["logo", "wordmark", "icon", "photo", "screenshot", "ui", "readme-image"]);
|
|
37
|
+
const SCREEN_ROLES = new Set(["screenshot", "ui", "readme-image"]);
|
|
38
|
+
/** An event counts as off the cut when it is at least this far from every cut. */
|
|
39
|
+
export const EVENT_OFF_CUT_SEC = 0.1;
|
|
40
|
+
/** How dense a film is. Rich is the default; minimal only when the request asks for calm or minimal. */
|
|
41
|
+
export const REGISTERS = Object.freeze(["rich", "minimal"]);
|
|
42
|
+
/** What a rich stage film's world plans at least: depth layers, labelled parts, a share of moving shots. */
|
|
43
|
+
export const RICH_WORLD = Object.freeze({ layers: 3, labels: 6, labelWords: 4, cameraShare: 0.5 });
|
|
44
|
+
const LOCKED_CAMERA = /^\s*(?:none|locked|static|still|hold|fixed|no move)\s*\.?\s*$/iu;
|
|
24
45
|
const MIN_BEAT_SEC = 1.2;
|
|
25
46
|
const MAX_GAP_SEC = 0.25;
|
|
26
47
|
|
|
27
|
-
const LENGTH_ASKED = /\d+(?:\.\d+)?\s*(?:초|분|s\b|secs?\b|seconds?\b|min(?:ute)?s?\b)/iu;
|
|
28
48
|
const SILENCE_ASKED = /무음|소리\s*없|음악\s*없|\bsilent\b|\bsilence\b|\bno\s+(?:sound|audio|music)\b|\bwithout\s+(?:sound|audio|music)\b|\bmuted?\b/iu;
|
|
29
49
|
const MUTED_CHANNEL = /무음|소리\s*없|\bmuted?\b|\bsilent\b|\bsound\s*off\b/iu;
|
|
50
|
+
const LENGTH_VALUE = /(\d+(?:\.\d+)?)\s*(초|분|s\b|secs?\b|seconds?\b|min(?:ute)?s?\b)/iu;
|
|
51
|
+
const VERTICAL = /세로|숏폼|쇼츠|릴스|틱톡|인스타(?:그램)?\s?스토리|\bvertical\b|\bportrait\s+(?:format|mode|video|orientation)\b|9\s?:\s?16|\bshorts\b|\breels?\b|\btiktok\b|\binsta(?:gram)?\s+stor(?:y|ies)\b/iu;
|
|
52
|
+
const MINIMAL_ASKED = /미니멀|잔잔|차분|조용|심플|절제|단순하게|고요|\bminimal(?:ist|ism)?\b|\bcalm\b|\bquiet\b|\bsimple\b|\bunderstated\b|\brestrained\b|\bsparse\b|\bserene\b/iu;
|
|
53
|
+
const PREVIEW_ASKED = /미리\s?보기|스토리보드|콘티|\bpreview\b|\bstoryboard\b/iu;
|
|
54
|
+
const FPS30_ASKED = /30\s?(?:fps|프레임|frames?\s+(?:a|per)\s+second)|\b30\s?p\b/iu;
|
|
55
|
+
// High-quality, cinematic or photoreal 3D: the words that send a 3D film to the Blender rung when
|
|
56
|
+
// Blender is installed (references/depth.md).
|
|
57
|
+
const PATH_TRACED_ASKED = /고퀄|고품질|하이엔드|시네마틱|실사|포토리얼|레이\s?트레이싱|블렌더|\b(?:high[- ]?(?:quality|end)|cinematic|photo-?real(?:istic)?|path[- ]?trac\w*|ray[- ]?trac\w*|blender|cycles)\b/iu;
|
|
58
|
+
// A link in the request names a real product, repository or site: the film uses its real assets.
|
|
59
|
+
const URL_IN_REQUEST = /\bhttps?:\/\/[^\s"'<>)\]]+/giu;
|
|
60
|
+
// A genre word in the request fixes the genre; checked in order, first hit wins.
|
|
61
|
+
const GENRE_CUES = Object.freeze([
|
|
62
|
+
["explainer", /설명|원리|\bexplain(?:er|s|ing)?\b/iu],
|
|
63
|
+
["announcement", /출시|런칭|론칭|티저|신제품|\blaunch(?:es|ing)?\b|\bteaser\b|\bannounce(?:ment|s)?\b|\bintroducing\b/iu],
|
|
64
|
+
["event", /행사|공연|축제|모집|세미나|콘서트|음악회|전시회|\bevent\b|\bfestival\b|\bconcert\b|\bmeetup\b|\bconference\b|\bexhibition\b/iu],
|
|
65
|
+
["explainer", /어떻게|과정|\bhow\s+(?:it|they|a|an|the|to|\w+\s+works?)\b/iu],
|
|
66
|
+
]);
|
|
30
67
|
const PLACEHOLDER = /<[^<>\n]{1,80}>/u;
|
|
31
68
|
const QUOTED = /"[^"\n]*"|“[^”\n]*”|'[^'\n]*'|「[^」\n]*」/gu;
|
|
32
69
|
const TYPE_CUE = /\bkinetic[\s-]+type(?:graphy)?\b|\btypographic[\s-]+motion\b|\blyrics?\b|\blyric[\s-]+videos?\b|\btitle[\s-]+sequences?\b|\bopening[\s-]+titles?\b|키네틱\s*타이포|타이포|가사|오프닝\s*타이틀|타이틀\s*시퀀스/iu;
|
|
@@ -47,6 +84,37 @@ export function typeLedCue(request) {
|
|
|
47
84
|
return null;
|
|
48
85
|
}
|
|
49
86
|
|
|
87
|
+
/** The length the request asks for, in seconds, or null. */
|
|
88
|
+
export function askedSeconds(request) {
|
|
89
|
+
const m = LENGTH_VALUE.exec(String(request ?? ""));
|
|
90
|
+
if (!m) return null;
|
|
91
|
+
const value = Number(m[1]);
|
|
92
|
+
return /^(?:분|min(?:ute)?s?)$/iu.test(m[2]) ? value * 60 : value;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The genre a request's own words fix, or null when it names none. */
|
|
96
|
+
export function cuedGenre(request) {
|
|
97
|
+
const text = String(request ?? "");
|
|
98
|
+
const compound = TYPE_CUE.exec(text);
|
|
99
|
+
if (compound) return { genre: "type-led", word: compound[0] };
|
|
100
|
+
for (const [genre, re] of GENRE_CUES) {
|
|
101
|
+
const m = re.exec(text);
|
|
102
|
+
if (m) return { genre, word: m[0] };
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
export const asksVertical = (request) => VERTICAL.test(String(request ?? ""));
|
|
107
|
+
/** The request asks for a calm, quiet or minimal film: the one case the minimal register is for. */
|
|
108
|
+
export const asksMinimal = (request) => MINIMAL_ASKED.test(String(request ?? ""));
|
|
109
|
+
export const asksPreview = (request) => PREVIEW_ASKED.test(String(request ?? ""));
|
|
110
|
+
/** The request asks for path-traced quality in its 3D. */
|
|
111
|
+
export const asksPathTraced = (request) => PATH_TRACED_ASKED.test(String(request ?? ""));
|
|
112
|
+
export const asks30fps = (request) => FPS30_ASKED.test(String(request ?? ""));
|
|
113
|
+
/** A link as the treatment compares it: no trailing punctuation, slash or .git, lower case. */
|
|
114
|
+
export const normUrl = (u) => String(u ?? "").trim().replace(/[.,;:!?]+$/u, "").replace(/\/+$/u, "").replace(/\.git$/u, "").toLowerCase();
|
|
115
|
+
/** Every link in the request, normalized. */
|
|
116
|
+
export const requestUrls = (request) => [...String(request ?? "").matchAll(URL_IN_REQUEST)].map((m) => normUrl(m[0]));
|
|
117
|
+
|
|
50
118
|
/** True when `candidate` shares a normalized substring of `limit` characters with `against`. */
|
|
51
119
|
export function sharesRun(candidate, against, limit) {
|
|
52
120
|
if (limit < 1) return false;
|
|
@@ -94,7 +162,10 @@ export function freeTextLeaves(t) {
|
|
|
94
162
|
put("audience", t?.audience);
|
|
95
163
|
put("channel", t?.channel);
|
|
96
164
|
put("ambition", t?.ambition);
|
|
97
|
-
for (const beat of Array.isArray(t?.beats) ? t.beats : []) for (const key of ["purpose", "onScreen", "motion", "sound"]) put(`beats[].${key}`, beat?.[key]);
|
|
165
|
+
for (const beat of Array.isArray(t?.beats) ? t.beats : []) for (const key of ["purpose", "onScreen", "motion", "sound", "hero"]) put(`beats[].${key}`, beat?.[key]);
|
|
166
|
+
for (const key of ["expect", "turn", "payoff"]) put(`story.${key}`, t?.story?.[key]);
|
|
167
|
+
put("protagonist.look", t?.protagonist?.look);
|
|
168
|
+
for (const act of Array.isArray(t?.protagonist?.acts) ? t.protagonist.acts : []) put("protagonist.acts[].action", act?.action);
|
|
98
169
|
for (const line of Array.isArray(t?.copy?.lines) ? t.copy.lines : []) put("copy.lines[]", line);
|
|
99
170
|
for (const entry of Array.isArray(t?.palette) ? t.palette : []) put("palette[].role", entry?.role);
|
|
100
171
|
return leaves;
|
|
@@ -142,11 +213,181 @@ function beatCoverage(beats, indices) {
|
|
|
142
213
|
return total;
|
|
143
214
|
}
|
|
144
215
|
|
|
216
|
+
function checkStyle(t, house) {
|
|
217
|
+
if (!("style" in t)) throw new TreatmentError("style", `missing: one of ${STYLE_IDS.join(", ")} (references/studio.md)`);
|
|
218
|
+
if (!STYLE_IDS.includes(t.style)) throw new TreatmentError("style", `must be one of ${STYLE_IDS.join(", ")}`);
|
|
219
|
+
const pick = pickStyle({ request: t.request, copy: Array.isArray(t.copy?.lines) ? t.copy.lines : [], path: t.path, house, genre: t.genre });
|
|
220
|
+
if (t.style !== pick.id) throw new TreatmentError("style", `${pick.reason}; this film takes the ${pick.id} style`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Rich is the default: a film is rich unless the request asks for calm or minimal, and then it is
|
|
224
|
+
// minimal. The register is the request's, like the format, never a choice the model makes alone.
|
|
225
|
+
function checkRegister(t) {
|
|
226
|
+
const register = t.register ?? "rich";
|
|
227
|
+
if (!REGISTERS.includes(register)) throw new TreatmentError("register", "rich (the default) or minimal");
|
|
228
|
+
const calm = asksMinimal(t.request);
|
|
229
|
+
if (register === "minimal" && !calm) throw new TreatmentError("register", "minimal only when the request asks for a calm, quiet or minimal film; the default is rich (references/studio.md, Register)");
|
|
230
|
+
if (register === "rich" && calm) throw new TreatmentError("register", "the request asks for a calm or minimal film: register minimal");
|
|
231
|
+
return register;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function checkLength(t, request) {
|
|
235
|
+
const asked = askedSeconds(request);
|
|
236
|
+
if (asked !== null) {
|
|
237
|
+
if (Math.abs(t.durationSec - asked) > Math.max(1, asked * 0.1)) throw new TreatmentError("durationSec", `the request asks for ${asked} s; keep the film within 10 % of it`);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const lines = Array.isArray(t.copy?.lines) ? t.copy.lines.length : 1;
|
|
241
|
+
const [lo, hi] = t.genre === "type-led" ? typeLedBand(lines) : GENRE_BANDS[t.genre];
|
|
242
|
+
if (t.durationSec < lo - 1e-9 || t.durationSec > hi + 1e-9) throw new TreatmentError("durationSec", `a ${t.genre} film runs ${lo}-${hi} s unless the user names a length (${t.durationSec} s)`);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Composition changes with the story: two adjacent shots never share a layout, and a film of four or
|
|
246
|
+
// more shots uses at least three, so the eye is not parked on one split for the whole film.
|
|
247
|
+
function checkVariety(t) {
|
|
248
|
+
for (let i = 1; i < t.beats.length; i++) {
|
|
249
|
+
if (t.beats[i].layout === t.beats[i - 1].layout) throw new TreatmentError(`beats[${i}].layout`, `shots ${i} and ${i + 1} both use ${t.beats[i].layout}; adjacent shots change layout (references/studio.md, Shots and layouts)`);
|
|
250
|
+
}
|
|
251
|
+
const used = new Set(t.beats.map((b) => b.layout));
|
|
252
|
+
if (t.beats.length >= 4 && used.size < 3) throw new TreatmentError("beats", `${t.beats.length} shots use only ${[...used].join(" and ")}; a film of four or more shots uses at least three layouts`);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// A stage shot: which layout its type and subject take, the one move the eye follows, and how it hands
|
|
256
|
+
// off to the next shot (a word from the style's transitions; the last shot ends).
|
|
257
|
+
function checkShot(t, beat, i, field) {
|
|
258
|
+
const style = readStyle(t.style);
|
|
259
|
+
if (!LAYOUT_IDS.includes(beat.layout)) throw new TreatmentError(`${field}.layout`, `must be one of ${LAYOUT_IDS.join(", ")}`);
|
|
260
|
+
if (!isText(beat.hero) || PLACEHOLDER.test(beat.hero)) throw new TreatmentError(`${field}.hero`, "name the one move the eye follows in this shot");
|
|
261
|
+
const last = i === t.beats.length - 1;
|
|
262
|
+
if (last && beat.transition !== "end") throw new TreatmentError(`${field}.transition`, "the last shot's transition is end");
|
|
263
|
+
if (!last && !style.transitions.includes(beat.transition)) throw new TreatmentError(`${field}.transition`, `the ${style.id} style hands off with ${style.transitions.join(", ")}`);
|
|
264
|
+
if ("lines" in beat) {
|
|
265
|
+
const n = Array.isArray(t.copy?.lines) ? t.copy.lines.length : 0;
|
|
266
|
+
if (!Array.isArray(beat.lines) || beat.lines.some((k) => !Number.isInteger(k) || k < 0 || k >= n)) throw new TreatmentError(`${field}.lines`, "the indices of the copy lines this shot shows");
|
|
267
|
+
if (beat.layout === "full" && beat.lines.length) throw new TreatmentError(`${field}.lines`, "a full shot has no type zone, so it shows no copy");
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// The story: what the viewer expects, the turn they do not, the shot where it lands, and the payoff.
|
|
272
|
+
// A genre arc alone is an information order, not a story.
|
|
273
|
+
function checkStory(t) {
|
|
274
|
+
if (!("story" in t)) throw new TreatmentError("story", "missing: { expect, turn, beat, payoff }: what the viewer expects, what happens instead, the shot where it lands, what the ending gives (references/treatment.md, Story)");
|
|
275
|
+
const s = t.story;
|
|
276
|
+
if (!s || typeof s !== "object") throw new TreatmentError("story", "must be an object { expect, turn, beat, payoff }");
|
|
277
|
+
for (const key of ["expect", "turn", "payoff"]) {
|
|
278
|
+
if (!isText(s[key])) throw new TreatmentError(`story.${key}`, "must be a non-empty string");
|
|
279
|
+
if (PLACEHOLDER.test(s[key])) throw new TreatmentError(`story.${key}`, `placeholder value ${JSON.stringify(s[key])}`);
|
|
280
|
+
if (sentences(s[key]) > 2) throw new TreatmentError(`story.${key}`, "at most 2 sentences");
|
|
281
|
+
}
|
|
282
|
+
if (normalizeText(s.turn) === normalizeText(s.expect)) throw new TreatmentError("story.turn", "the turn is what the viewer does not expect; it cannot equal story.expect");
|
|
283
|
+
const first = t.beats.length > 1 ? 1 : 0;
|
|
284
|
+
if (!Number.isInteger(s.beat) || s.beat < first || s.beat >= Math.max(t.beats.length, 1)) throw new TreatmentError("story.beat", `the index of the shot where the turn lands: after the opening, before the end (${first}-${t.beats.length - 1})`);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// The protagonist: one drawn character or hero object that acts across the film (stage path).
|
|
288
|
+
function checkProtagonist(t) {
|
|
289
|
+
if (t.path !== "stage") return;
|
|
290
|
+
if (!("protagonist" in t)) throw new TreatmentError("protagonist", "missing: { name, kind, look, acts[] }: the character or hero object that acts across the film (references/treatment.md, Protagonist)");
|
|
291
|
+
const p = t.protagonist;
|
|
292
|
+
if (!p || typeof p !== "object") throw new TreatmentError("protagonist", "must be an object { name, kind, look, acts }");
|
|
293
|
+
if (!isText(p.name) || PLACEHOLDER.test(p.name)) throw new TreatmentError("protagonist.name", "must name it");
|
|
294
|
+
if (!PROTAGONIST_KINDS.includes(p.kind)) throw new TreatmentError("protagonist.kind", `must be ${PROTAGONIST_KINDS.join(" or ")}`);
|
|
295
|
+
if (!isText(p.look) || PLACEHOLDER.test(p.look)) throw new TreatmentError("protagonist.look", "say what it looks like on screen: shape, material, colour role, scale in the frame");
|
|
296
|
+
if (!Array.isArray(p.acts) || p.acts.length === 0) throw new TreatmentError("protagonist.acts", "list what it does, shot by shot: [{ beat, action }]");
|
|
297
|
+
const seen = new Set();
|
|
298
|
+
p.acts.forEach((act, i) => {
|
|
299
|
+
if (!Number.isInteger(act?.beat) || act.beat < 0 || act.beat >= t.beats.length) throw new TreatmentError(`protagonist.acts[${i}].beat`, "must be a beat index");
|
|
300
|
+
if (seen.has(act.beat)) throw new TreatmentError(`protagonist.acts[${i}].beat`, "one act per shot");
|
|
301
|
+
seen.add(act.beat);
|
|
302
|
+
if (!isText(act.action) || PLACEHOLDER.test(act.action)) throw new TreatmentError(`protagonist.acts[${i}].action`, "say what it does in this shot, as a viewer would see it");
|
|
303
|
+
});
|
|
304
|
+
const covered = beatCoverage(t.beats, [...seen]);
|
|
305
|
+
if (covered < 0.5 * t.durationSec - 1e-9) throw new TreatmentError("protagonist.acts", `it acts for ${covered.toFixed(1)} s, under half the film; it carries the film, not one shot`);
|
|
306
|
+
if (!seen.has(t.story.beat)) throw new TreatmentError("protagonist.acts", `the turn lands at shot ${t.story.beat + 1}, and the protagonist has no act there`);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// A named product, repository or site: its real logo, images, UI and words, never invented ones. The
|
|
310
|
+
// request's link makes it required; `render.mjs assets` fetches what it can reach.
|
|
311
|
+
function checkProduct(t) {
|
|
312
|
+
const urls = requestUrls(t.request);
|
|
313
|
+
if (!("product" in t)) {
|
|
314
|
+
if (urls.length) throw new TreatmentError("product", `missing: the request links ${urls[0]}; fetch its real assets with render.mjs assets --out <dir> --url <link> and list them (references/treatment.md, Named products)`);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const p = t.product;
|
|
318
|
+
if (!p || typeof p !== "object") throw new TreatmentError("product", "must be an object { name, url, assets }");
|
|
319
|
+
if (!isText(p.name) || PLACEHOLDER.test(p.name)) throw new TreatmentError("product.name", "must name the product");
|
|
320
|
+
if (urls.length && !urls.includes(normUrl(p.url))) throw new TreatmentError("product.url", `must be the link the request gives (${urls.join(", ")})`);
|
|
321
|
+
if ("unreachable" in p) {
|
|
322
|
+
if (!isText(p.unreachable)) throw new TreatmentError("product.unreachable", "say what could not be reached and why");
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (!Array.isArray(p.assets) || p.assets.length === 0) throw new TreatmentError("product.assets", "list the real assets the film uses: [{ path, role, source, sha256 }]; when none can be reached set unreachable and ask the user");
|
|
326
|
+
p.assets.forEach((a, i) => {
|
|
327
|
+
const field = `product.assets[${i}]`;
|
|
328
|
+
if (typeof a?.path !== "string" || !/^(?:stage|cover)\/assets\//u.test(a.path) || a.path.split("/").includes("..")) throw new TreatmentError(`${field}.path`, "must be a file under stage/assets/, relative to the output directory");
|
|
329
|
+
if (!ASSET_ROLES.includes(a.role)) throw new TreatmentError(`${field}.role`, `must be one of ${ASSET_ROLES.join(", ")}`);
|
|
330
|
+
if (!["fetched", "user"].includes(a.source)) throw new TreatmentError(`${field}.source`, "must be fetched (by render.mjs assets) or user (supplied)");
|
|
331
|
+
if (!/^[0-9a-f]{64}$/u.test(a.sha256 ?? "")) throw new TreatmentError(`${field}.sha256`, "must be the file's SHA-256");
|
|
332
|
+
});
|
|
333
|
+
if (t.subject?.source === "invented") throw new TreatmentError("subject.source", "the product is real: the subject is the product (source user), its specifics from its own words");
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// The 3D route: a depth3d subject is drawn with the pinned three.js on the GPU rung (references/depth.md).
|
|
337
|
+
function checkDepth(t) {
|
|
338
|
+
if ("depth" in t && !["2d", "3d"].includes(t.depth)) throw new TreatmentError("depth", "2d (the default) or 3d");
|
|
339
|
+
const solid = t.visualDevices.some((d) => d.kind === "depth3d" && d.role === "subject");
|
|
340
|
+
if (t.path !== "stage") {
|
|
341
|
+
if (t.depth === "3d") throw new TreatmentError("depth", "3d is a stage-path route");
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
if (solid && t.depth !== "3d") throw new TreatmentError("depth", "the subject is a depth3d device: set depth to 3d, so the film takes the 3D route (references/depth.md)");
|
|
345
|
+
if (t.depth === "3d" && !solid) throw new TreatmentError("depth", "3d needs the subject drawn as a depth3d device (role subject)");
|
|
346
|
+
if ("render3d" in t && !["three", "blender"].includes(t.render3d)) throw new TreatmentError("render3d", "three (the GPU rung, the default) or blender (the offline Cycles rung)");
|
|
347
|
+
if (t.render3d === "blender" && t.depth !== "3d") throw new TreatmentError("render3d", "the Blender rung renders a 3D world: set depth to 3d with a depth3d subject");
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// A rich stage film plans its density before any page exists: the depth layers of its world, the
|
|
351
|
+
// labelled parts the viewer reads in it and the shots where the camera moves (references/studio.md).
|
|
352
|
+
function checkWorld(t, register) {
|
|
353
|
+
if (t.path !== "stage" || register !== "rich") return;
|
|
354
|
+
const w = t.world;
|
|
355
|
+
if (!w || typeof w !== "object") throw new TreatmentError("world", "missing: { layers, labels, camera }: a rich film plans its layered world, its labelled parts and its camera moves (references/studio.md, Register)");
|
|
356
|
+
if (!Array.isArray(w.layers) || w.layers.filter(isText).length < RICH_WORLD.layers) throw new TreatmentError("world.layers", `at least ${RICH_WORLD.layers} depth layers, back to front, each saying what lives there`);
|
|
357
|
+
if (!Array.isArray(w.labels) || w.labels.length < RICH_WORLD.labels) throw new TreatmentError("world.labels", `at least ${RICH_WORLD.labels} labelled parts the viewer reads on screen (real names from the product when there is one)`);
|
|
358
|
+
w.labels.forEach((label, i) => {
|
|
359
|
+
if (!isText(label) || PLACEHOLDER.test(label)) throw new TreatmentError(`world.labels[${i}]`, "the label as it appears on screen");
|
|
360
|
+
if (label.trim().split(/\s+/u).length > RICH_WORLD.labelWords) throw new TreatmentError(`world.labels[${i}]`, `a label is at most ${RICH_WORLD.labelWords} words; longer text is copy`);
|
|
361
|
+
});
|
|
362
|
+
if (!Array.isArray(w.camera)) throw new TreatmentError("world.camera", "list the camera moves: [{ beat, move }]");
|
|
363
|
+
const moving = new Set();
|
|
364
|
+
w.camera.forEach((c, i) => {
|
|
365
|
+
if (!Number.isInteger(c?.beat) || c.beat < 0 || c.beat >= t.beats.length) throw new TreatmentError(`world.camera[${i}].beat`, "must be a beat index");
|
|
366
|
+
if (!isText(c.move) || PLACEHOLDER.test(c.move) || LOCKED_CAMERA.test(c.move)) throw new TreatmentError(`world.camera[${i}].move`, "name the move (push-in, truck, crane, orbit, rack focus); a locked shot is not listed");
|
|
367
|
+
moving.add(c.beat);
|
|
368
|
+
});
|
|
369
|
+
if (moving.size < RICH_WORLD.cameraShare * t.beats.length - 1e-9) throw new TreatmentError("world.camera", `the camera moves in ${moving.size} of ${t.beats.length} shots; a rich film moves it in at least half (keep the flash audit with slow light changes, not a locked camera)`);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function checkEvents(t, events) {
|
|
373
|
+
if (!Array.isArray(events) || events.length < 2) throw new TreatmentError("sound.events", "at least 2 on-screen events that make a sound: [{ t, on, kind }]");
|
|
374
|
+
const cuts = t.beats.slice(1).map((b) => b.t0);
|
|
375
|
+
let offCut = 0;
|
|
376
|
+
events.forEach((e, i) => {
|
|
377
|
+
const field = `sound.events[${i}]`;
|
|
378
|
+
if (typeof e?.t !== "number" || !(e.t > 0 && e.t < t.durationSec)) throw new TreatmentError(`${field}.t`, `the second the event happens on screen, inside the film (0-${t.durationSec})`);
|
|
379
|
+
if (!isText(e.on) || PLACEHOLDER.test(e.on)) throw new TreatmentError(`${field}.on`, "what happens on screen at that moment, as a viewer would see it");
|
|
380
|
+
if (!EVENT_SOUNDS.includes(e.kind)) throw new TreatmentError(`${field}.kind`, `must be one of ${EVENT_SOUNDS.join(", ")}`);
|
|
381
|
+
if (cuts.every((c) => Math.abs(c - e.t) >= EVENT_OFF_CUT_SEC - 1e-9)) offCut += 1;
|
|
382
|
+
});
|
|
383
|
+
if (offCut * 2 < events.length) throw new TreatmentError("sound.events", `${events.length - offCut} of ${events.length} events sit on a cut; at least half sync to something moving inside a shot`);
|
|
384
|
+
}
|
|
385
|
+
|
|
145
386
|
/**
|
|
146
387
|
* Validate a parsed treatment. Returns it unchanged when valid; throws TreatmentError otherwise.
|
|
147
388
|
* Field order follows references/treatment.md so the first reported field is the first to fix.
|
|
148
389
|
*/
|
|
149
|
-
export function validateTreatment(t, { examples = shippedExamples() } = {}) {
|
|
390
|
+
export function validateTreatment(t, { examples = shippedExamples(), house = null } = {}) {
|
|
150
391
|
if (!t || typeof t !== "object" || Array.isArray(t)) throw new TreatmentError("treatment", "must be a JSON object");
|
|
151
392
|
if (t.mode === "cover") throw new TreatmentError("mode", "this is a cover treatment: render it with `render.mjs cover --out <dir>` (references/cover.md)");
|
|
152
393
|
const placeholder = findPlaceholder(t, "");
|
|
@@ -157,6 +398,8 @@ export function validateTreatment(t, { examples = shippedExamples() } = {}) {
|
|
|
157
398
|
const unquoted = normalizeText(stripQuoted(request));
|
|
158
399
|
const limit = Math.min(10, Math.floor(Array.from(unquoted).length / 2));
|
|
159
400
|
if (!GENRES.includes(t.genre)) throw new TreatmentError("genre", t.genre === undefined ? "missing" : `must be one of ${GENRES.join(", ")}`);
|
|
401
|
+
const cue = cuedGenre(request);
|
|
402
|
+
if (cue && cue.genre !== t.genre) throw new TreatmentError("genre", `the request says "${cue.word}", which makes this a ${cue.genre} film`);
|
|
160
403
|
if (!["type", "stage"].includes(t.path)) throw new TreatmentError("path", t.path === undefined ? "missing" : "must be type or stage");
|
|
161
404
|
requireText(t, "pathReason");
|
|
162
405
|
const idea = requireText(t, "idea");
|
|
@@ -164,12 +407,16 @@ export function validateTreatment(t, { examples = shippedExamples() } = {}) {
|
|
|
164
407
|
if (sharesRun(idea, stripQuoted(request), limit)) throw new TreatmentError("idea", `restates the request (shares ${limit}+ normalized characters with it); say what the film shows instead`);
|
|
165
408
|
requireText(t, "audience");
|
|
166
409
|
requireText(t, "channel");
|
|
410
|
+
checkStyle(t, house);
|
|
411
|
+
const register = checkRegister(t);
|
|
167
412
|
if (!["16:9", "9:16"].includes(t.format)) throw new TreatmentError("format", t.format === undefined ? "missing" : "must be 16:9 or 9:16");
|
|
168
413
|
requireText(t, "formatReason");
|
|
414
|
+
if (asksVertical(request) && t.format !== "9:16") throw new TreatmentError("format", "the request asks for a vertical film: 9:16");
|
|
415
|
+
if (!asksVertical(request) && t.format === "9:16") throw new TreatmentError("format", "9:16 only when the request asks for a vertical film (vertical, 세로, shorts, reels); otherwise 16:9");
|
|
169
416
|
|
|
170
417
|
if (t.durationSec === undefined) throw new TreatmentError("durationSec", "missing");
|
|
171
418
|
if (typeof t.durationSec !== "number" || !Number.isFinite(t.durationSec) || t.durationSec < 4 || t.durationSec > 90) throw new TreatmentError("durationSec", "must be a number of seconds from 4 to 90");
|
|
172
|
-
|
|
419
|
+
checkLength(t, request);
|
|
173
420
|
|
|
174
421
|
if (t.subject === undefined) throw new TreatmentError("subject", "missing");
|
|
175
422
|
if (!t.subject || typeof t.subject !== "object") throw new TreatmentError("subject", "must be {name, source, specifics[]}");
|
|
@@ -200,11 +447,17 @@ export function validateTreatment(t, { examples = shippedExamples() } = {}) {
|
|
|
200
447
|
const previousEnd = i === 0 ? 0 : t.beats[i - 1].t1;
|
|
201
448
|
if (beat.t0 - previousEnd > MAX_GAP_SEC + 1e-9) throw new TreatmentError(field, `starts ${(beat.t0 - previousEnd).toFixed(2)} s after the previous beat ends; gaps are at most ${MAX_GAP_SEC} s`);
|
|
202
449
|
if (i > 0 && beat.t0 < t.beats[i - 1].t0) throw new TreatmentError(field, "beats must be in time order");
|
|
450
|
+
if (t.path === "stage") checkShot(t, beat, i, field);
|
|
203
451
|
});
|
|
452
|
+
if (t.path === "stage") checkVariety(t);
|
|
204
453
|
if (t.durationSec - t.beats[t.beats.length - 1].t1 > MAX_GAP_SEC + 1e-9) throw new TreatmentError(`beats[${t.beats.length - 1}]`, `ends before durationSec; beats cover 0 to ${t.durationSec} s`);
|
|
205
454
|
const needed = t.genre === "type-led" ? t.copy.lines.length : ARC_STAGES[t.genre];
|
|
206
455
|
if (t.beats.length < needed) throw new TreatmentError("beats", `a ${t.genre} film needs at least ${needed} beats (${t.genre === "type-led" ? "one per supplied line" : "one per arc stage"}); it has ${t.beats.length}`);
|
|
207
456
|
|
|
457
|
+
checkStory(t);
|
|
458
|
+
checkProtagonist(t);
|
|
459
|
+
checkProduct(t);
|
|
460
|
+
|
|
208
461
|
if (t.path === "type") {
|
|
209
462
|
if (t.format !== "16:9") throw new TreatmentError("path", "the type path renders 16:9 only; a 9:16 film takes the stage path");
|
|
210
463
|
if (t.copy.source !== "user" && !typeLedCue(request)) throw new TreatmentError("path", "the type path needs the user's own words or a type-led cue in the request");
|
|
@@ -218,7 +471,14 @@ export function validateTreatment(t, { examples = shippedExamples() } = {}) {
|
|
|
218
471
|
if (!["subject", "support", "texture"].includes(device.role)) throw new TreatmentError(`${field}.role`, "must be subject, support or texture");
|
|
219
472
|
if (TEXTURE_KINDS.has(device.kind) && device.role !== "texture") throw new TreatmentError(`${field}.role`, `${device.kind} is always texture`);
|
|
220
473
|
if (!Array.isArray(device.beats) || device.beats.some((b) => !Number.isInteger(b) || b < 0 || b >= t.beats.length)) throw new TreatmentError(`${field}.beats`, "must list beat indices");
|
|
474
|
+
if (device.kind === "screen") {
|
|
475
|
+
const assets = Array.isArray(t.product?.assets) ? t.product.assets : [];
|
|
476
|
+
const real = assets.find((a) => a.path === device.asset);
|
|
477
|
+
if (!real || !SCREEN_ROLES.has(real.role)) throw new TreatmentError(`${field}.asset`, "a product screen shows the product's real screenshot, UI or README image: name one listed in product.assets; never draw an invented one");
|
|
478
|
+
}
|
|
221
479
|
});
|
|
480
|
+
checkDepth(t);
|
|
481
|
+
checkWorld(t, register);
|
|
222
482
|
if (t.path === "stage") {
|
|
223
483
|
const subject = t.visualDevices.filter((d) => d.role === "subject");
|
|
224
484
|
if (subject.length === 0) throw new TreatmentError("visualDevices", "the stage path needs a role: subject device, a drawn depiction of what the film is about");
|
|
@@ -232,25 +492,39 @@ export function validateTreatment(t, { examples = shippedExamples() } = {}) {
|
|
|
232
492
|
if (!t.typePlan || typeof t.typePlan !== "object") throw new TreatmentError("typePlan", "must be {faces, hierarchy, maxWordsOnScreen}");
|
|
233
493
|
if (!Array.isArray(t.typePlan.faces) || t.typePlan.faces.length === 0) throw new TreatmentError("typePlan.faces", `must list faces from ${FACES.join(", ")}`);
|
|
234
494
|
for (const face of t.typePlan.faces) if (!FACES.some((f) => f.toLowerCase() === String(face).toLowerCase())) throw new TreatmentError("typePlan.faces", `${face} is not one of this product's verified faces (${FACES.join(", ")})`);
|
|
495
|
+
if (t.path === "stage") {
|
|
496
|
+
const families = styleFamilies(readStyle(t.style));
|
|
497
|
+
const off = t.typePlan.faces.find((f) => ![...families].some((x) => x.toLowerCase() === String(f).toLowerCase()));
|
|
498
|
+
if (off) throw new TreatmentError("typePlan.faces", `${off} is not a face of the ${t.style} style (${[...families].join(", ")})`);
|
|
499
|
+
}
|
|
235
500
|
requireText(t, "typePlan.hierarchy", t.typePlan.hierarchy);
|
|
236
501
|
if (!Number.isInteger(t.typePlan.maxWordsOnScreen) || t.typePlan.maxWordsOnScreen < 1) throw new TreatmentError("typePlan.maxWordsOnScreen", "must be a positive integer");
|
|
237
502
|
|
|
238
503
|
if (t.palette === undefined) throw new TreatmentError("palette", "missing");
|
|
239
|
-
|
|
504
|
+
const maxColours = t.path === "stage" && register === "rich" ? 10 : 6;
|
|
505
|
+
if (!Array.isArray(t.palette) || t.palette.length < 3 || t.palette.length > maxColours) throw new TreatmentError("palette", `must list 3 to ${maxColours} colours`);
|
|
506
|
+
const allowedColours = t.path === "stage" ? new Set(styleColors(readStyle(t.style), { rich: register === "rich" })) : null;
|
|
240
507
|
t.palette.forEach((entry, i) => {
|
|
241
508
|
if (!/^#[0-9a-f]{6}$/iu.test(entry?.hex ?? "")) throw new TreatmentError(`palette[${i}].hex`, "must be #RRGGBB");
|
|
509
|
+
if (allowedColours && !allowedColours.has(entry.hex.toLowerCase())) throw new TreatmentError(`palette[${i}].hex`, `${entry.hex} is not a colour of the ${t.style} style${register === "rich" ? " or one of its role accents" : " (a minimal film keeps to the core palette)"}; the stage palette comes from the style`);
|
|
242
510
|
requireText(t, `palette[${i}].role`, entry.role);
|
|
243
511
|
});
|
|
244
512
|
|
|
245
513
|
if (t.sound === undefined) throw new TreatmentError("sound", "missing");
|
|
246
|
-
if (!t.sound || !["generated", "supplied", "authored", "none"].includes(t.sound.mode)) throw new TreatmentError("sound.mode", "must be generated, supplied, authored or none");
|
|
247
|
-
if (t.sound.mode === "none" && !SILENCE_ASKED.test(request) && !MUTED_CHANNEL.test(t.channel)) throw new TreatmentError("sound.mode", "none only when the user asked for silence or the channel plays muted by design; the default is
|
|
514
|
+
if (!t.sound || !["score", "generated", "supplied", "authored", "none"].includes(t.sound.mode)) throw new TreatmentError("sound.mode", "must be score, generated, supplied, authored or none");
|
|
515
|
+
if (t.sound.mode === "none" && !SILENCE_ASKED.test(request) && !MUTED_CHANNEL.test(t.channel)) throw new TreatmentError("sound.mode", "none only when the user asked for silence or the channel plays muted by design; the default is a score");
|
|
516
|
+
if (t.sound.mode === "generated" && register === "rich") throw new TreatmentError("sound.mode", "a rich film scores its own music (mode score); the style's preset beds are for minimal films (references/sound.md)");
|
|
517
|
+
if ("genre" in t.sound && !SCORE_GENRES.includes(t.sound.genre)) throw new TreatmentError("sound.genre", `must be one of ${SCORE_GENRES.join(", ")}`);
|
|
248
518
|
if (t.sound.mode !== "none") requireText(t, "sound.plan", t.sound.plan);
|
|
249
519
|
if (t.sound.mode === "generated") {
|
|
250
520
|
if (!SOUND_PALETTES.includes(t.sound.palette)) throw new TreatmentError("sound.palette", `must be one of ${SOUND_PALETTES.join(", ")}`);
|
|
251
521
|
if (!/^[A-G](?:#|b)? (?:major|minor)$/u.test(t.sound.key ?? "")) throw new TreatmentError("sound.key", 'must look like "D minor" or "F# major"');
|
|
252
522
|
if (!Number.isInteger(t.sound.tempo) || t.sound.tempo < 60 || t.sound.tempo > 160) throw new TreatmentError("sound.tempo", "must be an integer BPM from 60 to 160");
|
|
523
|
+
const beds = styleBeds(readStyle(t.style));
|
|
524
|
+
if (!beds.some((bed) => sameBed(bed, t.sound))) throw new TreatmentError("sound.palette", `pick one of the ${t.style} style's beds: ${beds.map((b) => `${b.palette} ${b.key} ${b.tempo} BPM`).join("; ")}`);
|
|
253
525
|
}
|
|
526
|
+
if ((t.sound.mode === "generated" || t.sound.mode === "score") && t.path === "stage" && !("events" in t.sound)) throw new TreatmentError("sound.events", "list the on-screen events that make a sound: [{ t, on, kind }], at least 2, half of them away from the cuts (references/sound.md, Events)");
|
|
527
|
+
if ("events" in t.sound) checkEvents(t, t.sound.events);
|
|
254
528
|
if (t.sound.mode === "supplied" || t.sound.mode === "authored") requireText(t, "sound.file", t.sound.file);
|
|
255
529
|
|
|
256
530
|
const invented = t.copy.source === "invented" || t.subject.source === "invented";
|
|
@@ -262,10 +536,13 @@ export function validateTreatment(t, { examples = shippedExamples() } = {}) {
|
|
|
262
536
|
if (t.inventions === undefined) throw new TreatmentError("inventions", "missing (use [] when nothing is invented)");
|
|
263
537
|
|
|
264
538
|
if (t.fps !== undefined && t.fps !== 30 && t.fps !== 60) throw new TreatmentError("fps", "optional; 60 by default, or 30");
|
|
539
|
+
if (t.fps === 30 && !asks30fps(request)) throw new TreatmentError("fps", "60; 30 only when the request asks for 30 fps");
|
|
540
|
+
if ("preview" in t && typeof t.preview !== "boolean") throw new TreatmentError("preview", "true or false");
|
|
541
|
+
if (t.preview === true && !asksPreview(request)) throw new TreatmentError("preview", "true only when the request asks for a preview or storyboard first");
|
|
265
542
|
if (t.seed !== undefined && (!Number.isInteger(t.seed) || t.seed < 0 || t.seed > 0xffffffff)) throw new TreatmentError("seed", "optional; an unsigned 32-bit integer");
|
|
266
543
|
const ambition = requireText(t, "ambition");
|
|
267
544
|
if (sentences(ambition) > 2) throw new TreatmentError("ambition", "must be 1 or 2 sentences");
|
|
268
|
-
return t;
|
|
545
|
+
return t.register === register ? t : { ...t, register };
|
|
269
546
|
}
|
|
270
547
|
|
|
271
548
|
/** Read and validate `<file>`; a missing or unparsable file is a treatment fault too. */
|
|
@@ -273,9 +550,9 @@ export function loadTreatment(file) {
|
|
|
273
550
|
if (!existsSync(file)) throw new TreatmentError("treatment", `no treatment.json at ${file}; write it before any render (references/treatment.md)`);
|
|
274
551
|
let parsed;
|
|
275
552
|
try {
|
|
276
|
-
parsed = JSON.parse(
|
|
553
|
+
parsed = JSON.parse(readBoundedText(file));
|
|
277
554
|
} catch (error) {
|
|
278
555
|
throw new TreatmentError("treatment", `not valid JSON (${error.message})`);
|
|
279
556
|
}
|
|
280
|
-
return validateTreatment(parsed);
|
|
557
|
+
return validateTreatment(parsed, { house: readHouse(dirname(file)) });
|
|
281
558
|
}
|
package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2010-2024 three.js authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
BackSide,
|
|
7
|
+
BoxGeometry,
|
|
8
|
+
Mesh,
|
|
9
|
+
MeshBasicMaterial,
|
|
10
|
+
MeshStandardMaterial,
|
|
11
|
+
PointLight,
|
|
12
|
+
Scene,
|
|
13
|
+
} from 'three';
|
|
14
|
+
|
|
15
|
+
class RoomEnvironment extends Scene {
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
|
|
19
|
+
super();
|
|
20
|
+
|
|
21
|
+
const geometry = new BoxGeometry();
|
|
22
|
+
geometry.deleteAttribute( 'uv' );
|
|
23
|
+
|
|
24
|
+
const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
|
|
25
|
+
const boxMaterial = new MeshStandardMaterial();
|
|
26
|
+
|
|
27
|
+
const mainLight = new PointLight( 0xffffff, 900, 28, 2 );
|
|
28
|
+
mainLight.position.set( 0.418, 16.199, 0.300 );
|
|
29
|
+
this.add( mainLight );
|
|
30
|
+
|
|
31
|
+
const room = new Mesh( geometry, roomMaterial );
|
|
32
|
+
room.position.set( - 0.757, 13.219, 0.717 );
|
|
33
|
+
room.scale.set( 31.713, 28.305, 28.591 );
|
|
34
|
+
this.add( room );
|
|
35
|
+
|
|
36
|
+
const box1 = new Mesh( geometry, boxMaterial );
|
|
37
|
+
box1.position.set( - 10.906, 2.009, 1.846 );
|
|
38
|
+
box1.rotation.set( 0, - 0.195, 0 );
|
|
39
|
+
box1.scale.set( 2.328, 7.905, 4.651 );
|
|
40
|
+
this.add( box1 );
|
|
41
|
+
|
|
42
|
+
const box2 = new Mesh( geometry, boxMaterial );
|
|
43
|
+
box2.position.set( - 5.607, - 0.754, - 0.758 );
|
|
44
|
+
box2.rotation.set( 0, 0.994, 0 );
|
|
45
|
+
box2.scale.set( 1.970, 1.534, 3.955 );
|
|
46
|
+
this.add( box2 );
|
|
47
|
+
|
|
48
|
+
const box3 = new Mesh( geometry, boxMaterial );
|
|
49
|
+
box3.position.set( 6.167, 0.857, 7.803 );
|
|
50
|
+
box3.rotation.set( 0, 0.561, 0 );
|
|
51
|
+
box3.scale.set( 3.927, 6.285, 3.687 );
|
|
52
|
+
this.add( box3 );
|
|
53
|
+
|
|
54
|
+
const box4 = new Mesh( geometry, boxMaterial );
|
|
55
|
+
box4.position.set( - 2.017, 0.018, 6.124 );
|
|
56
|
+
box4.rotation.set( 0, 0.333, 0 );
|
|
57
|
+
box4.scale.set( 2.002, 4.566, 2.064 );
|
|
58
|
+
this.add( box4 );
|
|
59
|
+
|
|
60
|
+
const box5 = new Mesh( geometry, boxMaterial );
|
|
61
|
+
box5.position.set( 2.291, - 0.756, - 2.621 );
|
|
62
|
+
box5.rotation.set( 0, - 0.286, 0 );
|
|
63
|
+
box5.scale.set( 1.546, 1.552, 1.496 );
|
|
64
|
+
this.add( box5 );
|
|
65
|
+
|
|
66
|
+
const box6 = new Mesh( geometry, boxMaterial );
|
|
67
|
+
box6.position.set( - 2.193, - 0.369, - 5.547 );
|
|
68
|
+
box6.rotation.set( 0, 0.516, 0 );
|
|
69
|
+
box6.scale.set( 3.875, 3.487, 2.986 );
|
|
70
|
+
this.add( box6 );
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
// -x right
|
|
74
|
+
const light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
|
|
75
|
+
light1.position.set( - 16.116, 14.37, 8.208 );
|
|
76
|
+
light1.scale.set( 0.1, 2.428, 2.739 );
|
|
77
|
+
this.add( light1 );
|
|
78
|
+
|
|
79
|
+
// -x left
|
|
80
|
+
const light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
|
|
81
|
+
light2.position.set( - 16.109, 18.021, - 8.207 );
|
|
82
|
+
light2.scale.set( 0.1, 2.425, 2.751 );
|
|
83
|
+
this.add( light2 );
|
|
84
|
+
|
|
85
|
+
// +x
|
|
86
|
+
const light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );
|
|
87
|
+
light3.position.set( 14.904, 12.198, - 1.832 );
|
|
88
|
+
light3.scale.set( 0.15, 4.265, 6.331 );
|
|
89
|
+
this.add( light3 );
|
|
90
|
+
|
|
91
|
+
// +z
|
|
92
|
+
const light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );
|
|
93
|
+
light4.position.set( - 0.462, 8.89, 14.520 );
|
|
94
|
+
light4.scale.set( 4.38, 5.441, 0.088 );
|
|
95
|
+
this.add( light4 );
|
|
96
|
+
|
|
97
|
+
// -z
|
|
98
|
+
const light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );
|
|
99
|
+
light5.position.set( 3.235, 11.486, - 12.541 );
|
|
100
|
+
light5.scale.set( 2.5, 2.0, 0.1 );
|
|
101
|
+
this.add( light5 );
|
|
102
|
+
|
|
103
|
+
// +y
|
|
104
|
+
const light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );
|
|
105
|
+
light6.position.set( 0.0, 20.0, 0.0 );
|
|
106
|
+
light6.scale.set( 1.0, 0.1, 1.0 );
|
|
107
|
+
this.add( light6 );
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
dispose() {
|
|
112
|
+
|
|
113
|
+
const resources = new Set();
|
|
114
|
+
|
|
115
|
+
this.traverse( ( object ) => {
|
|
116
|
+
|
|
117
|
+
if ( object.isMesh ) {
|
|
118
|
+
|
|
119
|
+
resources.add( object.geometry );
|
|
120
|
+
resources.add( object.material );
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
} );
|
|
125
|
+
|
|
126
|
+
for ( const resource of resources ) {
|
|
127
|
+
|
|
128
|
+
resource.dispose();
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function createAreaLightMaterial( intensity ) {
|
|
137
|
+
|
|
138
|
+
const material = new MeshBasicMaterial();
|
|
139
|
+
material.color.setScalar( intensity );
|
|
140
|
+
return material;
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { RoomEnvironment };
|