@clipwright/core 0.60.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-actors.d.ts +0 -43
- package/dist/account-actors.js +0 -55
- package/dist/account.d.ts +0 -6
- package/dist/account.js +0 -18
- package/dist/actor-bounds.d.ts +0 -5
- package/dist/actor-bounds.js +0 -6
- package/dist/actor-qualities.d.ts +0 -3
- package/dist/actor-qualities.js +0 -4
- package/dist/actors.d.ts +0 -16
- package/dist/actors.js +0 -21
- package/dist/ad-guide.d.ts +27 -0
- package/dist/ad-guide.js +7 -2
- package/dist/ad-ids.d.ts +3 -0
- package/dist/ad-ids.js +4 -0
- package/dist/ad-pause-trim.d.ts +0 -5
- package/dist/ad-pause-trim.js +0 -8
- package/dist/ads.d.ts +145 -0
- package/dist/ads.js +56 -0
- package/dist/api-failure.d.ts +6 -44
- package/dist/api-failure.js +16 -67
- package/dist/aspect.d.ts +0 -29
- package/dist/aspect.js +1 -34
- package/dist/asset-identity.d.ts +0 -2
- package/dist/asset-identity.js +0 -3
- package/dist/assets.d.ts +0 -34
- package/dist/assets.js +0 -42
- package/dist/billing-terms.d.ts +0 -3
- package/dist/billing-terms.js +0 -4
- package/dist/brand-styles.d.ts +0 -6
- package/dist/brand-styles.js +0 -13
- package/dist/broll-policy.js +0 -1
- package/dist/canvas-fit.d.ts +0 -2
- package/dist/canvas-fit.js +0 -4
- package/dist/caption-funnel.d.ts +0 -2
- package/dist/caption-funnel.js +0 -15
- package/dist/caption-geometry.d.ts +0 -6
- package/dist/caption-geometry.js +0 -10
- package/dist/caption-language.d.ts +0 -3
- package/dist/caption-language.js +0 -6
- package/dist/contract-dispositions.d.ts +0 -61
- package/dist/contract-dispositions.js +3 -96
- package/dist/contracts/v1/workflow-brief.d.ts +57 -3
- package/dist/contracts/v1/workflow-brief.js +0 -13
- package/dist/contracts/v1/workflow-catalog.d.ts +114 -0
- package/dist/contracts/v1/workflow-catalog.js +0 -3
- package/dist/contracts/v1/workflow-client.d.ts +114 -0
- package/dist/contracts/v1/workflow-client.js +0 -1
- package/dist/contracts/v1/workflow-dto.js +0 -1
- package/dist/contracts/v1/workflow-evidence.js +0 -1
- package/dist/contracts/v1/workflow-execution.d.ts +0 -1
- package/dist/contracts/v1/workflow-execution.js +0 -4
- package/dist/contracts/v1/workflow-next.d.ts +0 -2
- package/dist/contracts/v1/workflow-next.js +0 -3
- package/dist/contracts/v1/workflow-plan.d.ts +171 -0
- package/dist/contracts/v1/workflow-plan.js +0 -1
- package/dist/contracts/v1/workflow-primitives.d.ts +0 -1
- package/dist/contracts/v1/workflow-primitives.js +0 -2
- package/dist/contracts/v1/workflow-run-read.d.ts +0 -1
- package/dist/contracts/v1/workflow-run-read.js +0 -3
- package/dist/creator-profile.d.ts +0 -30
- package/dist/creator-profile.js +0 -45
- package/dist/default-actor.js +0 -2
- package/dist/design.d.ts +0 -17
- package/dist/design.js +0 -18
- package/dist/diy-next.d.ts +18 -0
- package/dist/diy-next.js +13 -0
- package/dist/edit-billing.d.ts +0 -6
- package/dist/edit-billing.js +0 -10
- package/dist/edit-candidate.d.ts +0 -6
- package/dist/edit-candidate.js +0 -9
- package/dist/edit-document.d.ts +0 -12
- package/dist/edit-document.js +0 -15
- package/dist/edit-faceless.d.ts +0 -3
- package/dist/edit-faceless.js +0 -4
- package/dist/edit-long-form.d.ts +0 -13
- package/dist/edit-long-form.js +0 -17
- package/dist/edit-music.d.ts +397 -0
- package/dist/edit-music.js +77 -0
- package/dist/edit-operations.d.ts +0 -1
- package/dist/edit-operations.js +0 -2
- package/dist/edit-primitives.d.ts +0 -3
- package/dist/edit-primitives.js +0 -5
- package/dist/edit-revision.d.ts +0 -4
- package/dist/edit-revision.js +0 -6
- package/dist/edit-rules.d.ts +0 -3
- package/dist/edit-rules.js +0 -9
- package/dist/edit-shots.d.ts +45 -5
- package/dist/edit-shots.js +7 -11
- package/dist/edit-validate.d.ts +0 -10
- package/dist/edit-validate.js +0 -14
- package/dist/edit.js +0 -3
- package/dist/endpoint-notes.d.ts +0 -2
- package/dist/endpoint-notes.js +0 -3
- package/dist/endpoints.d.ts +0 -11
- package/dist/endpoints.js +11 -21
- package/dist/errors.d.ts +29 -43
- package/dist/errors.js +18 -54
- package/dist/explainer-fit.d.ts +0 -7
- package/dist/explainer-fit.js +0 -10
- package/dist/face-billing.d.ts +0 -9
- package/dist/face-billing.js +0 -23
- package/dist/face-delivery.d.ts +0 -1
- package/dist/face-delivery.js +0 -2
- package/dist/faceless-action-shots.d.ts +0 -8
- package/dist/faceless-action-shots.js +0 -8
- package/dist/faceless-customer-anchors.d.ts +0 -1
- package/dist/faceless-customer-anchors.js +0 -2
- package/dist/faceless-cut-style.js +0 -1
- package/dist/faceless-direction-summary.d.ts +0 -2
- package/dist/faceless-direction-summary.js +0 -3
- package/dist/faceless-image-placement.d.ts +0 -2
- package/dist/faceless-image-placement.js +0 -3
- package/dist/faceless-image-qualification.js +0 -2
- package/dist/faceless-media-record.d.ts +0 -6
- package/dist/faceless-media-record.js +0 -11
- package/dist/faceless-price.d.ts +0 -45
- package/dist/faceless-price.js +0 -64
- package/dist/faceless-public-plan.d.ts +0 -13
- package/dist/faceless-public-plan.js +0 -11
- package/dist/faceless-public.d.ts +0 -26
- package/dist/faceless-public.js +0 -59
- package/dist/faceless-short-61.js +0 -1
- package/dist/faceless-storyboard-timing.js +0 -1
- package/dist/faceless-storyboard-v2-plan.js +0 -1
- package/dist/faceless-storyboard-v2-timing.d.ts +0 -4
- package/dist/faceless-storyboard-v2-timing.js +0 -3
- package/dist/faceless-storyboard-v2.js +0 -1
- package/dist/faceless-storyboard.js +0 -1
- package/dist/faceless-voices.d.ts +0 -16
- package/dist/faceless-voices.js +0 -18
- package/dist/feedback.d.ts +0 -4
- package/dist/feedback.js +0 -5
- package/dist/film-directions.d.ts +0 -2
- package/dist/film-directions.js +0 -7
- package/dist/film-drafts.d.ts +0 -8
- package/dist/film-drafts.js +0 -19
- package/dist/film-guide.d.ts +0 -3
- package/dist/film-guide.js +0 -6
- package/dist/film-styles.d.ts +0 -5
- package/dist/film-styles.js +0 -8
- package/dist/generation-shot.d.ts +0 -5
- package/dist/generation-shot.js +0 -8
- package/dist/generations-output.d.ts +0 -2
- package/dist/generations-output.js +0 -5
- package/dist/generations.d.ts +0 -22
- package/dist/generations.js +21 -44
- package/dist/idempotency.d.ts +1 -21
- package/dist/idempotency.js +8 -29
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -28
- package/dist/live-shot-kinds.d.ts +16 -25
- package/dist/live-shot-kinds.js +12 -28
- package/dist/long-form-pricing.d.ts +0 -5
- package/dist/long-form-pricing.js +0 -6
- package/dist/long-form-profile.d.ts +0 -3
- package/dist/long-form-profile.js +0 -4
- package/dist/long-form-revision.d.ts +0 -9
- package/dist/long-form-revision.js +0 -11
- package/dist/markdown-quote.d.ts +0 -2
- package/dist/markdown-quote.js +0 -3
- package/dist/mascots.d.ts +0 -5
- package/dist/mascots.js +0 -10
- package/dist/max-credits.d.ts +0 -1
- package/dist/max-credits.js +0 -2
- package/dist/mcp-ugc-descriptions.d.ts +0 -2
- package/dist/mcp-ugc-descriptions.js +1 -6
- package/dist/media-timebase.d.ts +0 -2
- package/dist/media-timebase.js +0 -6
- package/dist/motion-styles.d.ts +0 -8
- package/dist/motion-styles.js +0 -11
- package/dist/moves.d.ts +0 -7
- package/dist/moves.js +0 -9
- package/dist/music.d.ts +0 -5
- package/dist/music.js +0 -8
- package/dist/naming.d.ts +0 -3
- package/dist/naming.js +0 -19
- package/dist/openapi.d.ts +0 -13
- package/dist/openapi.js +9 -11
- package/dist/output-provenance.d.ts +0 -4
- package/dist/output-provenance.js +0 -5
- package/dist/own-agent-price.d.ts +21 -22
- package/dist/own-agent-price.js +34 -25
- package/dist/own-agent-runs.d.ts +351 -11
- package/dist/own-agent-runs.js +144 -24
- package/dist/pacing.d.ts +3 -15
- package/dist/pacing.js +18 -18
- package/dist/parts-pricing.d.ts +0 -28
- package/dist/parts-pricing.js +0 -32
- package/dist/post-text.d.ts +0 -2
- package/dist/post-text.js +0 -4
- package/dist/presenter-beats.d.ts +0 -10
- package/dist/presenter-beats.js +0 -14
- package/dist/presenter-matte.d.ts +0 -7
- package/dist/presenter-matte.js +0 -9
- package/dist/presenter-takes.d.ts +0 -3
- package/dist/presenter-takes.js +0 -8
- package/dist/prices.d.ts +2 -8
- package/dist/prices.js +13 -23
- package/dist/public-endpoints.d.ts +0 -11
- package/dist/public-endpoints.js +0 -14
- package/dist/public-responses.d.ts +0 -2
- package/dist/public-responses.js +0 -3
- package/dist/rate-limit.d.ts +0 -24
- package/dist/rate-limit.js +0 -29
- package/dist/reference-analysis.d.ts +57 -34
- package/dist/reference-analysis.js +0 -69
- package/dist/reference-bring.d.ts +33 -0
- package/dist/reference-bring.js +28 -0
- package/dist/reference-display.d.ts +0 -3
- package/dist/reference-display.js +37 -4
- package/dist/reference-kinds.d.ts +0 -4
- package/dist/reference-kinds.js +0 -6
- package/dist/reference-lyrics.d.ts +0 -6
- package/dist/reference-lyrics.js +0 -6
- package/dist/reference-profile.d.ts +270 -39
- package/dist/reference-profile.js +64 -50
- package/dist/reference-staging.d.ts +0 -10
- package/dist/reference-staging.js +0 -14
- package/dist/reference-text-spans.d.ts +0 -4
- package/dist/reference-text-spans.js +0 -7
- package/dist/reference-voice-over.d.ts +0 -6
- package/dist/reference-voice-over.js +0 -7
- package/dist/reference-voice.d.ts +0 -7
- package/dist/reference-voice.js +0 -12
- package/dist/render-backend.d.ts +0 -30
- package/dist/render-backend.js +0 -5
- package/dist/resolved-timeline.d.ts +0 -4
- package/dist/resolved-timeline.js +1 -31
- package/dist/run-media.d.ts +0 -1
- package/dist/run-media.js +0 -2
- package/dist/run-preflight.d.ts +0 -4
- package/dist/run-preflight.js +0 -11
- package/dist/run-static-warnings.d.ts +0 -8
- package/dist/run-static-warnings.js +0 -38
- package/dist/runs.d.ts +0 -32
- package/dist/runs.js +0 -50
- package/dist/scene-bible.d.ts +15 -7
- package/dist/scene-bible.js +15 -10
- package/dist/scene-graph.d.ts +0 -12
- package/dist/scene-graph.js +0 -24
- package/dist/scene-place.d.ts +0 -25
- package/dist/scene-place.js +0 -24
- package/dist/scene-proposal.d.ts +0 -3
- package/dist/scene-proposal.js +0 -9
- package/dist/script-integrity.d.ts +0 -6
- package/dist/script-integrity.js +0 -8
- package/dist/script-voice.d.ts +0 -7
- package/dist/script-voice.js +0 -16
- package/dist/semantic-inserts.d.ts +0 -7
- package/dist/semantic-inserts.js +0 -10
- package/dist/skill-theme-explainer.js +0 -5
- package/dist/skill-theme.d.ts +0 -13
- package/dist/skill-theme.js +0 -25
- package/dist/skills.d.ts +22 -86
- package/dist/skills.js +21 -167
- package/dist/speech-rhythm-contract.js +0 -1
- package/dist/speech-rhythm.d.ts +0 -4
- package/dist/speech-rhythm.js +0 -2
- package/dist/templates/backdrop.d.ts +0 -3
- package/dist/templates/backdrop.js +0 -5
- package/dist/templates/callout.d.ts +0 -4
- package/dist/templates/callout.js +0 -6
- package/dist/templates/chart.d.ts +0 -4
- package/dist/templates/chart.js +0 -6
- package/dist/templates/chat-window.d.ts +0 -8
- package/dist/templates/chat-window.js +0 -10
- package/dist/templates/checklist.d.ts +0 -3
- package/dist/templates/checklist.js +0 -6
- package/dist/templates/comment-cta.d.ts +0 -14
- package/dist/templates/comment-cta.js +0 -19
- package/dist/templates/compare.d.ts +0 -6
- package/dist/templates/compare.js +0 -7
- package/dist/templates/cover-story.d.ts +0 -1
- package/dist/templates/cover-story.js +0 -3
- package/dist/templates/end-card.d.ts +0 -2
- package/dist/templates/end-card.js +0 -3
- package/dist/templates/hand-title.d.ts +0 -5
- package/dist/templates/hand-title.js +0 -9
- package/dist/templates/index.d.ts +0 -57
- package/dist/templates/index.js +0 -60
- package/dist/templates/lower-third.d.ts +0 -4
- package/dist/templates/lower-third.js +0 -5
- package/dist/templates/notification.d.ts +0 -6
- package/dist/templates/notification.js +0 -7
- package/dist/templates/phone-call.d.ts +0 -2
- package/dist/templates/phone-call.js +0 -6
- package/dist/templates/phone-screen.d.ts +0 -5
- package/dist/templates/phone-screen.js +0 -7
- package/dist/templates/pointer-chips.d.ts +0 -4
- package/dist/templates/pointer-chips.js +0 -6
- package/dist/templates/progress.d.ts +0 -3
- package/dist/templates/progress.js +0 -5
- package/dist/templates/quote.d.ts +0 -3
- package/dist/templates/quote.js +0 -4
- package/dist/templates/race.d.ts +0 -5
- package/dist/templates/race.js +0 -7
- package/dist/templates/rating.d.ts +0 -3
- package/dist/templates/rating.js +0 -5
- package/dist/templates/series-frame.d.ts +0 -16
- package/dist/templates/series-frame.js +0 -19
- package/dist/templates/size.d.ts +0 -7
- package/dist/templates/size.js +0 -8
- package/dist/templates/slot.d.ts +0 -2
- package/dist/templates/slot.js +0 -2
- package/dist/templates/sounds.d.ts +24 -12
- package/dist/templates/sounds.js +2 -16
- package/dist/templates/stat.d.ts +0 -3
- package/dist/templates/stat.js +0 -5
- package/dist/templates/tag.d.ts +0 -3
- package/dist/templates/tag.js +0 -5
- package/dist/templates/terminal.d.ts +0 -6
- package/dist/templates/terminal.js +0 -8
- package/dist/templates/theme.d.ts +0 -7
- package/dist/templates/theme.js +0 -9
- package/dist/templates/title-card.d.ts +0 -3
- package/dist/templates/title-card.js +0 -5
- package/dist/templates/video-grid.d.ts +0 -5
- package/dist/templates/video-grid.js +0 -8
- package/dist/templates/word-fill.d.ts +0 -3
- package/dist/templates/word-fill.js +0 -4
- package/dist/templates/word-title.d.ts +0 -2
- package/dist/templates/word-title.js +0 -4
- package/dist/trend-niches.d.ts +0 -11
- package/dist/trend-niches.js +0 -16
- package/dist/trend-search.d.ts +0 -66
- package/dist/trend-search.js +0 -70
- package/dist/tts-backend.d.ts +0 -19
- package/dist/tts-backend.js +0 -7
- package/dist/ugc-call.d.ts +0 -16
- package/dist/ugc-call.js +0 -21
- package/dist/ugc-delivery.d.ts +0 -2
- package/dist/ugc-delivery.js +0 -4
- package/dist/ugc-framing.d.ts +0 -4
- package/dist/ugc-framing.js +0 -6
- package/dist/ugc-interview.d.ts +0 -18
- package/dist/ugc-interview.js +0 -24
- package/dist/ugc-layers.d.ts +0 -39
- package/dist/ugc-layers.js +0 -39
- package/dist/ugc-scenes.d.ts +0 -2
- package/dist/ugc-scenes.js +0 -5
- package/dist/ugc-video-media.d.ts +0 -5
- package/dist/ugc-video-media.js +0 -7
- package/dist/uploads.d.ts +0 -14
- package/dist/uploads.js +0 -17
- package/dist/vendor-response.d.ts +0 -19
- package/dist/vendor-response.js +0 -22
- package/dist/video-size.d.ts +0 -4
- package/dist/video-size.js +0 -7
- package/dist/voice-admission.d.ts +0 -11
- package/dist/voice-admission.js +0 -13
- package/dist/voice-catalog-data.d.ts +0 -2
- package/dist/voice-catalog-data.js +0 -3
- package/dist/voice-catalog.d.ts +0 -6
- package/dist/voice-catalog.js +0 -8
- package/dist/voice-listing.d.ts +0 -6
- package/dist/voice-listing.js +0 -14
- package/dist/voice-pace.d.ts +0 -4
- package/dist/voice-pace.js +0 -7
- package/dist/voice-preview-approval.js +0 -1
- package/dist/voices.d.ts +4 -69
- package/dist/voices.js +3 -88
- package/dist/workflows/catalog.d.ts +0 -2
- package/dist/workflows/catalog.js +0 -4
- package/dist/workflows/film-directions.d.ts +0 -3
- package/dist/workflows/film-directions.js +0 -4
- package/dist/workflows/index.js +0 -1
- package/dist/workflows/methods/faceless-explainer.d.ts +31 -0
- package/dist/workflows/methods/faceless-explainer.js +0 -1
- package/dist/workflows/methods/kinetic-launch.d.ts +62 -1
- package/dist/workflows/methods/kinetic-launch.js +0 -2
- package/dist/workflows/methods/product-image-story.d.ts +31 -0
- package/dist/workflows/methods/product-image-story.js +0 -1
- package/dist/workflows/methods/reference-remake.d.ts +31 -0
- package/dist/workflows/methods/reference-remake.js +0 -1
- package/dist/workflows/methods/shared.d.ts +31 -1
- package/dist/workflows/methods/shared.js +0 -3
- package/dist/workflows/methods/ugc-faq-answer.d.ts +31 -0
- package/dist/workflows/methods/ugc-faq-answer.js +0 -1
- package/dist/workflows/methods/ugc-product-intro.d.ts +31 -0
- package/dist/workflows/methods/ugc-product-intro.js +0 -1
- package/dist/workflows/methods/website-proof-demo.d.ts +62 -1
- package/dist/workflows/methods/website-proof-demo.js +0 -2
- package/dist/workflows/motion-director.d.ts +0 -11
- package/dist/workflows/motion-director.js +0 -11
- package/dist/workflows/product-references.js +0 -1
- package/dist/workflows/reference-remake.d.ts +114 -17
- package/dist/workflows/reference-remake.js +0 -167
- package/dist/workflows/remake-chooser.d.ts +0 -6
- package/dist/workflows/remake-chooser.js +0 -4
- package/dist/workflows/remake-motion.d.ts +0 -16
- package/dist/workflows/remake-motion.js +0 -19
- package/dist/workflows/validate.d.ts +0 -1
- package/dist/workflows/validate.js +0 -5
- package/dist/workflows.js +0 -1
- package/package.json +1 -1
- package/dist/account-actors.js.map +0 -1
- package/dist/account.js.map +0 -1
- package/dist/actor-bounds.js.map +0 -1
- package/dist/actor-qualities.js.map +0 -1
- package/dist/actors.js.map +0 -1
- package/dist/ad-guide.js.map +0 -1
- package/dist/ad-pause-trim.js.map +0 -1
- package/dist/api-failure.js.map +0 -1
- package/dist/aspect.js.map +0 -1
- package/dist/asset-identity.js.map +0 -1
- package/dist/assets.js.map +0 -1
- package/dist/billing-terms.js.map +0 -1
- package/dist/brand-styles.js.map +0 -1
- package/dist/broll-policy.js.map +0 -1
- package/dist/canvas-fit.js.map +0 -1
- package/dist/caption-funnel.js.map +0 -1
- package/dist/caption-geometry.js.map +0 -1
- package/dist/caption-language.js.map +0 -1
- package/dist/contract-dispositions.js.map +0 -1
- package/dist/contracts/v1/workflow-brief.js.map +0 -1
- package/dist/contracts/v1/workflow-catalog.js.map +0 -1
- package/dist/contracts/v1/workflow-client.js.map +0 -1
- package/dist/contracts/v1/workflow-dto.js.map +0 -1
- package/dist/contracts/v1/workflow-evidence.js.map +0 -1
- package/dist/contracts/v1/workflow-execution.js.map +0 -1
- package/dist/contracts/v1/workflow-next.js.map +0 -1
- package/dist/contracts/v1/workflow-plan.js.map +0 -1
- package/dist/contracts/v1/workflow-primitives.js.map +0 -1
- package/dist/contracts/v1/workflow-run-read.js.map +0 -1
- package/dist/creator-profile.js.map +0 -1
- package/dist/default-actor.js.map +0 -1
- package/dist/design.js.map +0 -1
- package/dist/edit-billing.js.map +0 -1
- package/dist/edit-candidate.js.map +0 -1
- package/dist/edit-document.js.map +0 -1
- package/dist/edit-faceless.js.map +0 -1
- package/dist/edit-long-form.js.map +0 -1
- package/dist/edit-operations.js.map +0 -1
- package/dist/edit-primitives.js.map +0 -1
- package/dist/edit-revision.js.map +0 -1
- package/dist/edit-rules.js.map +0 -1
- package/dist/edit-shots.js.map +0 -1
- package/dist/edit-validate.js.map +0 -1
- package/dist/edit.js.map +0 -1
- package/dist/endpoint-notes.js.map +0 -1
- package/dist/endpoints.js.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/explainer-fit.js.map +0 -1
- package/dist/face-billing.js.map +0 -1
- package/dist/face-delivery.js.map +0 -1
- package/dist/faceless-action-shots.js.map +0 -1
- package/dist/faceless-customer-anchors.js.map +0 -1
- package/dist/faceless-cut-style.js.map +0 -1
- package/dist/faceless-direction-summary.js.map +0 -1
- package/dist/faceless-image-placement.js.map +0 -1
- package/dist/faceless-image-qualification.js.map +0 -1
- package/dist/faceless-media-record.js.map +0 -1
- package/dist/faceless-price.js.map +0 -1
- package/dist/faceless-public-plan.js.map +0 -1
- package/dist/faceless-public.js.map +0 -1
- package/dist/faceless-short-61.js.map +0 -1
- package/dist/faceless-storyboard-timing.js.map +0 -1
- package/dist/faceless-storyboard-v2-plan.js.map +0 -1
- package/dist/faceless-storyboard-v2-timing.js.map +0 -1
- package/dist/faceless-storyboard-v2.js.map +0 -1
- package/dist/faceless-storyboard.js.map +0 -1
- package/dist/faceless-voices.js.map +0 -1
- package/dist/feedback.js.map +0 -1
- package/dist/film-directions.js.map +0 -1
- package/dist/film-drafts.js.map +0 -1
- package/dist/film-guide.js.map +0 -1
- package/dist/film-styles.js.map +0 -1
- package/dist/generation-shot.js.map +0 -1
- package/dist/generations-output.js.map +0 -1
- package/dist/generations.js.map +0 -1
- package/dist/idempotency.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/live-shot-kinds.js.map +0 -1
- package/dist/long-form-pricing.js.map +0 -1
- package/dist/long-form-profile.js.map +0 -1
- package/dist/long-form-revision.js.map +0 -1
- package/dist/markdown-quote.js.map +0 -1
- package/dist/mascots.js.map +0 -1
- package/dist/max-credits.js.map +0 -1
- package/dist/mcp-ugc-descriptions.js.map +0 -1
- package/dist/media-timebase.js.map +0 -1
- package/dist/motion-styles.js.map +0 -1
- package/dist/moves.js.map +0 -1
- package/dist/music.js.map +0 -1
- package/dist/naming.js.map +0 -1
- package/dist/openapi.js.map +0 -1
- package/dist/output-provenance.js.map +0 -1
- package/dist/own-agent-price.js.map +0 -1
- package/dist/own-agent-runs.js.map +0 -1
- package/dist/pacing.js.map +0 -1
- package/dist/parts-pricing.js.map +0 -1
- package/dist/post-text.js.map +0 -1
- package/dist/presenter-beats.js.map +0 -1
- package/dist/presenter-matte.js.map +0 -1
- package/dist/presenter-takes.js.map +0 -1
- package/dist/prices.js.map +0 -1
- package/dist/public-endpoints.js.map +0 -1
- package/dist/public-responses.js.map +0 -1
- package/dist/rate-limit.js.map +0 -1
- package/dist/reference-analysis.js.map +0 -1
- package/dist/reference-display.js.map +0 -1
- package/dist/reference-kinds.js.map +0 -1
- package/dist/reference-lyrics.js.map +0 -1
- package/dist/reference-profile.js.map +0 -1
- package/dist/reference-staging.js.map +0 -1
- package/dist/reference-text-spans.js.map +0 -1
- package/dist/reference-voice-over.js.map +0 -1
- package/dist/reference-voice.js.map +0 -1
- package/dist/render-backend.js.map +0 -1
- package/dist/resolved-timeline.js.map +0 -1
- package/dist/run-media.js.map +0 -1
- package/dist/run-preflight.js.map +0 -1
- package/dist/run-static-warnings.js.map +0 -1
- package/dist/runs.js.map +0 -1
- package/dist/scene-bible.js.map +0 -1
- package/dist/scene-graph.js.map +0 -1
- package/dist/scene-place.js.map +0 -1
- package/dist/scene-proposal.js.map +0 -1
- package/dist/script-integrity.js.map +0 -1
- package/dist/script-voice.js.map +0 -1
- package/dist/semantic-inserts.js.map +0 -1
- package/dist/skill-theme-explainer.js.map +0 -1
- package/dist/skill-theme.js.map +0 -1
- package/dist/skills.js.map +0 -1
- package/dist/speech-rhythm-contract.js.map +0 -1
- package/dist/speech-rhythm.js.map +0 -1
- package/dist/templates/backdrop.js.map +0 -1
- package/dist/templates/callout.js.map +0 -1
- package/dist/templates/chart.js.map +0 -1
- package/dist/templates/chat-window.js.map +0 -1
- package/dist/templates/checklist.js.map +0 -1
- package/dist/templates/comment-cta.js.map +0 -1
- package/dist/templates/compare.js.map +0 -1
- package/dist/templates/cover-story.js.map +0 -1
- package/dist/templates/end-card.js.map +0 -1
- package/dist/templates/hand-title.js.map +0 -1
- package/dist/templates/index.js.map +0 -1
- package/dist/templates/lower-third.js.map +0 -1
- package/dist/templates/notification.js.map +0 -1
- package/dist/templates/phone-call.js.map +0 -1
- package/dist/templates/phone-screen.js.map +0 -1
- package/dist/templates/pointer-chips.js.map +0 -1
- package/dist/templates/progress.js.map +0 -1
- package/dist/templates/quote.js.map +0 -1
- package/dist/templates/race.js.map +0 -1
- package/dist/templates/rating.js.map +0 -1
- package/dist/templates/series-frame.js.map +0 -1
- package/dist/templates/size.js.map +0 -1
- package/dist/templates/slot.js.map +0 -1
- package/dist/templates/sounds.js.map +0 -1
- package/dist/templates/stat.js.map +0 -1
- package/dist/templates/tag.js.map +0 -1
- package/dist/templates/terminal.js.map +0 -1
- package/dist/templates/theme.js.map +0 -1
- package/dist/templates/title-card.js.map +0 -1
- package/dist/templates/video-grid.js.map +0 -1
- package/dist/templates/word-fill.js.map +0 -1
- package/dist/templates/word-title.js.map +0 -1
- package/dist/trend-niches.js.map +0 -1
- package/dist/trend-search.js.map +0 -1
- package/dist/tts-backend.js.map +0 -1
- package/dist/ugc-call.js.map +0 -1
- package/dist/ugc-delivery.js.map +0 -1
- package/dist/ugc-framing.js.map +0 -1
- package/dist/ugc-interview.js.map +0 -1
- package/dist/ugc-layers.js.map +0 -1
- package/dist/ugc-scenes.js.map +0 -1
- package/dist/ugc-video-media.js.map +0 -1
- package/dist/uploads.js.map +0 -1
- package/dist/vendor-response.js.map +0 -1
- package/dist/video-size.js.map +0 -1
- package/dist/voice-admission.js.map +0 -1
- package/dist/voice-catalog-data.js.map +0 -1
- package/dist/voice-catalog.js.map +0 -1
- package/dist/voice-listing.js.map +0 -1
- package/dist/voice-pace.js.map +0 -1
- package/dist/voice-preview-approval.js.map +0 -1
- package/dist/voices.js.map +0 -1
- package/dist/workflows/catalog.js.map +0 -1
- package/dist/workflows/film-directions.js.map +0 -1
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/methods/faceless-explainer.js.map +0 -1
- package/dist/workflows/methods/kinetic-launch.js.map +0 -1
- package/dist/workflows/methods/product-image-story.js.map +0 -1
- package/dist/workflows/methods/reference-remake.js.map +0 -1
- package/dist/workflows/methods/shared.js.map +0 -1
- package/dist/workflows/methods/ugc-faq-answer.js.map +0 -1
- package/dist/workflows/methods/ugc-product-intro.js.map +0 -1
- package/dist/workflows/methods/website-proof-demo.js.map +0 -1
- package/dist/workflows/motion-director.js.map +0 -1
- package/dist/workflows/product-references.js.map +0 -1
- package/dist/workflows/reference-remake.js.map +0 -1
- package/dist/workflows/remake-chooser.js.map +0 -1
- package/dist/workflows/remake-motion.js.map +0 -1
- package/dist/workflows/validate.js.map +0 -1
- package/dist/workflows.js.map +0 -1
package/dist/scene-place.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CAPTION_EDGES, captionEdgeAt } from "./caption-geometry.js";
|
|
3
3
|
import { faceZone, overlayRect } from "./ugc-layers.js";
|
|
4
|
-
// Free placement of a layer (#973 S1): a box on the frame, on the presenter's face, or next to the face or another layer. A placed layer is pinned.
|
|
5
4
|
export const PLACE_FITS = ["contain", "cover"];
|
|
6
5
|
export const PLACE_SIDES = ["below", "above", "left", "right", "over"];
|
|
7
6
|
export const PLACE_ALIGNS = ["start", "center", "end"];
|
|
8
|
-
/** The gap next to an anchor when none is given, as a share of the frame height. */
|
|
9
7
|
export const PLACE_DEFAULT_GAP = 0.01;
|
|
10
|
-
/** A rect in face units: origin the face centre, unit the face height in pixels, so x and y share one scale. */
|
|
11
8
|
const faceUnits = z.number().min(-20).max(20);
|
|
12
9
|
export const faceUnitsRect = z.strictObject({ left: faceUnits, top: faceUnits, width: z.number().positive().max(20), height: z.number().positive().max(20) });
|
|
13
10
|
const share = z.number().min(-0.5).max(1.5);
|
|
@@ -17,12 +14,10 @@ const options = {
|
|
|
17
14
|
fit: z.enum(PLACE_FITS).optional().describe("contain (default): the whole picture inside the box, centred; cover: it fills the box, cut to fit."),
|
|
18
15
|
allow_face: z.literal(true).optional().describe("Cover the presenter's face on purpose; without it a box on the face is refused."),
|
|
19
16
|
};
|
|
20
|
-
/** The place's forms, one text for every layer that takes a place (#1327): the MCP descriptions and the refusal of a wrong shape say it. */
|
|
21
17
|
export const PLACE_FORMS = "{relative_to:\"frame\",rect:{left,top,width,height}} in frame shares (relative_to may be omitted); " +
|
|
22
18
|
"{relative_to:\"face\",rect} with origin the face centre and unit the face height; or {relative_to:\"face\"|\"captions\"|{layer:id}," +
|
|
23
19
|
"side:below|above|left|right|over,width|height,size_unit?:frame|face,gap?,align?}; fit?:contain|cover; allow_face?:true. " +
|
|
24
20
|
"Example: {\"rect\":{\"left\":0.1,\"top\":0.62,\"width\":0.8,\"height\":0.1}}.";
|
|
25
|
-
/** A rect with no `relative_to` is on the frame: nothing else could mean it (#1327). */
|
|
26
21
|
export const placeFrame = z.strictObject({ relative_to: z.literal("frame").default("frame"),
|
|
27
22
|
rect: z.strictObject({ left: share, top: share, width: span, height: span }).describe("In shares of the frame's width and height."), ...options });
|
|
28
23
|
export const placeFace = z.strictObject({ relative_to: z.literal("face"),
|
|
@@ -38,15 +33,10 @@ export const placeNextTo = z.strictObject({
|
|
|
38
33
|
size_unit: z.enum(["frame", "face"]).optional().describe("frame (default): shares of the frame's width and height; face: face heights."),
|
|
39
34
|
...options,
|
|
40
35
|
}).refine(item => item.width !== undefined || item.height !== undefined, { message: "pass width, height or both", path: ["width"] });
|
|
41
|
-
/** Where an overlay is drawn instead of a preset position; no rule moves it. */
|
|
42
36
|
export const place = z.union([placeFrame, placeFace, placeNextTo], { error: `place takes ${PLACE_FORMS}` });
|
|
43
|
-
/** The layer a place is next to, or undefined. */
|
|
44
37
|
export const placeAnchorOf = (item) => "side" in item && typeof item.relative_to === "object" ? item.relative_to.layer : undefined;
|
|
45
|
-
/** Whether a place reads the presenter's face. */
|
|
46
38
|
export const placeReadsFace = (item) => item.relative_to === "face";
|
|
47
|
-
/** Whether a place stands next to the captions, so it follows the page drawn and never moves them. */
|
|
48
39
|
export const placeByCaptions = (item) => item !== undefined && "side" in item && item.relative_to === "captions";
|
|
49
|
-
/** The box a place resolves to, in shares of the frame; it may reach past the frame, which the rails judge. */
|
|
50
40
|
export function resolvePlace(item, ctx) {
|
|
51
41
|
const { width: W, height: H } = ctx.canvas, face = ctx.face;
|
|
52
42
|
const unitW = (face.height * H) / W;
|
|
@@ -75,13 +65,11 @@ export function resolvePlace(item, ctx) {
|
|
|
75
65
|
case "over": return { left: anchor.left + (anchor.width - width) / 2, top: anchor.top + (anchor.height - height) / 2, width, height };
|
|
76
66
|
}
|
|
77
67
|
}
|
|
78
|
-
/** The box kept whole inside the frame (#1161): shrunk about its centre to fit, keeping its shape, then moved in from any edge it crosses. */
|
|
79
68
|
export function insideFrame(box) {
|
|
80
69
|
const scale = Math.min(1, 1 / box.width, 1 / box.height), width = box.width * scale, height = box.height * scale;
|
|
81
70
|
const left = Math.min(1 - width, Math.max(0, box.left + (box.width - width) / 2)), top = Math.min(1 - height, Math.max(0, box.top + (box.height - height) / 2));
|
|
82
71
|
return { left, top, width, height };
|
|
83
72
|
}
|
|
84
|
-
/** The rect a picture takes in its box: the whole box for cover, else the picture's shape fitted and centred. */
|
|
85
73
|
export function fitPlacedRect(box, media, canvas, fit = "contain") {
|
|
86
74
|
if (fit === "cover")
|
|
87
75
|
return box;
|
|
@@ -89,47 +77,35 @@ export function fitPlacedRect(box, media, canvas, fit = "contain") {
|
|
|
89
77
|
const width = (media.width * scale) / canvas.width, height = (media.height * scale) / canvas.height;
|
|
90
78
|
return { left: box.left + (box.width - width) / 2, top: box.top + (box.height - height) / 2, width, height };
|
|
91
79
|
}
|
|
92
|
-
/** A preset position as a place: it resolves to the footprint the preset reserves, `overlayRect`. */
|
|
93
80
|
export function presetPlace(position, canvas) {
|
|
94
81
|
return { relative_to: "frame", rect: overlayRect(position, canvas) };
|
|
95
82
|
}
|
|
96
|
-
/** The presenter's usual face box, before the take shows it: two thirds of the face zone's height, centred in it, 3:4 in pixels. */
|
|
97
83
|
export function usualFace(aspectRatio, canvas, framing = "close") {
|
|
98
84
|
const zone = faceZone(aspectRatio, framing), height = (zone.height * 2) / 3, width = (0.75 * height * canvas.height) / canvas.width;
|
|
99
85
|
return { left: zone.left + (zone.width - width) / 2, top: zone.top + (zone.height - height) / 2, width, height };
|
|
100
86
|
}
|
|
101
|
-
/** Captions at a height of their own (#973 S2): pinned, so no overlay moves them. */
|
|
102
87
|
export const captionPlace = z.strictObject({
|
|
103
88
|
relative_to: z.enum(["frame", "face"]),
|
|
104
89
|
y: z.number().min(-20).max(20).describe("frame: a share of the height from the top; face: face heights from the face centre, down positive."),
|
|
105
90
|
edge: z.enum(CAPTION_EDGES).optional().describe("The edge of the caption block at y; default top at or above the middle, bottom below it."),
|
|
106
91
|
max_width: z.number().min(0.3).max(0.95).optional().describe("The widest a caption line may run, as a share of the frame's width."),
|
|
107
92
|
});
|
|
108
|
-
/** The presenter's face size and place in the frame (#973 S2b). */
|
|
109
93
|
export const presenterPlace = z.strictObject({
|
|
110
94
|
face_height: z.number().min(0.08).max(0.6).describe("The face's height as a share of the frame's height."),
|
|
111
95
|
face_centre: z.tuple([z.number().min(0).max(1), z.number().min(0).max(1)]).describe("The face centre [x, y] in shares of the frame."),
|
|
112
96
|
});
|
|
113
|
-
/** A close view's face height, measured on a delivered 9:16 close take (#973 S0, job-01 v1: 0.273–0.277); a smaller face starts from the wide view. */
|
|
114
97
|
export const CLOSE_VIEW_FACE_HEIGHT = 0.275;
|
|
115
|
-
/** Whether presenter_place starts from the actor's wide view: the crop only frames tighter, so a face smaller than the close view's needs it. */
|
|
116
98
|
export const presenterPlaceWantsWide = (item) => item !== undefined && item.face_height < CLOSE_VIEW_FACE_HEIGHT;
|
|
117
|
-
/** The tightest crop a portrait holds sharp: its pixels across fill at least this share of the frame's width (#1196). */
|
|
118
99
|
export const SHARP_PORTRAIT_SHARE = 0.65;
|
|
119
100
|
export const sharpCropOf = (portraitWidth, frameWidth) => portraitWidth / (SHARP_PORTRAIT_SHARE * frameWidth);
|
|
120
|
-
/** The face a presenter_place asks for, 3:4 in pixels as the usual face. */
|
|
121
101
|
export function presenterPlaceFace(item, canvas) {
|
|
122
102
|
const height = item.face_height, width = (0.75 * height * canvas.height) / canvas.width;
|
|
123
103
|
return { left: item.face_centre[0] - width / 2, top: item.face_centre[1] - height / 2, width, height };
|
|
124
104
|
}
|
|
125
|
-
/** The face admission plans by: the one presenter_place asks for, else the usual one of the framing. */
|
|
126
105
|
export const plannedFace = (aspectRatio, canvas, framing, item) => item ? presenterPlaceFace(item, canvas) : usualFace(aspectRatio, canvas, framing);
|
|
127
|
-
/** A caption place's height in percent of the frame and the edge it anchors by, on the face given. */
|
|
128
106
|
export function captionPlaceAt(item, face) {
|
|
129
107
|
const share = item.relative_to === "frame" ? item.y : face.top + face.height / 2 + item.y * face.height, vertical = Math.round(1e6 * share) / 1e4;
|
|
130
108
|
return { vertical, edge: captionEdgeAt(vertical, item.edge) };
|
|
131
109
|
}
|
|
132
|
-
/** The area two rects share, in squared shares of the frame. */
|
|
133
110
|
export const sharedArea = (a, b) => Math.max(0, Math.min(a.left + a.width, b.left + b.width) - Math.max(a.left, b.left)) *
|
|
134
111
|
Math.max(0, Math.min(a.top + a.height, b.top + b.height) - Math.max(a.top, b.top));
|
|
135
|
-
//# sourceMappingURL=scene-place.js.map
|
package/dist/scene-proposal.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/** The quote's scene proposal (#1491 S6): one scene for the video, the free devices it adds, and paid options each with its price. */
|
|
3
|
-
/** Shared by every quote that proposes: the person picks, and the paid call takes `proposal: { id, accept }`. */
|
|
4
2
|
export declare const SCENE_PROPOSAL_ID: RegExp;
|
|
5
3
|
export declare const MAX_PROPOSAL_OPTIONS = 12;
|
|
6
4
|
export declare const SCENE_PROPOSAL_OPTION_FIELDS: readonly ["shots", "scenes", "music", "moves"];
|
|
@@ -66,7 +64,6 @@ export declare const sceneProposalAccept: z.ZodObject<{
|
|
|
66
64
|
export type SceneProposalAccept = z.infer<typeof sceneProposalAccept>;
|
|
67
65
|
export declare const PROPOSE_DESCRIPTION: string;
|
|
68
66
|
export declare const proposeField: z.ZodOptional<z.ZodLiteral<false>>;
|
|
69
|
-
/** make_faceless takes the same block from quote_faceless (#1491). */
|
|
70
67
|
export declare const FACELESS_SCENE_PROPOSAL_DESCRIPTION: string;
|
|
71
68
|
export declare const facelessSceneProposalAccept: z.ZodObject<{
|
|
72
69
|
id: z.ZodString;
|
package/dist/scene-proposal.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { sceneBible } from "./scene-bible.js";
|
|
3
|
-
/** The quote's scene proposal (#1491 S6): one scene for the video, the free devices it adds, and paid options each with its price. */
|
|
4
|
-
/** Shared by every quote that proposes: the person picks, and the paid call takes `proposal: { id, accept }`. */
|
|
5
3
|
export const SCENE_PROPOSAL_ID = /^sp_[a-z0-9]{20}$/;
|
|
6
4
|
export const MAX_PROPOSAL_OPTIONS = 12;
|
|
7
5
|
export const SCENE_PROPOSAL_OPTION_FIELDS = ["shots", "scenes", "music", "moves"];
|
|
8
6
|
const optionId = z.string().regex(/^o[1-9][0-9]?$/);
|
|
9
7
|
export const sceneProposalOption = z.strictObject({
|
|
10
8
|
id: optionId,
|
|
11
|
-
/** One line a person reads: what the option adds and where. */
|
|
12
9
|
what: z.string().max(300),
|
|
13
10
|
field: z.enum(SCENE_PROPOSAL_OPTION_FIELDS),
|
|
14
|
-
/** What accepting it adds: the quote of the body with it, minus the quote of the body without it. */
|
|
15
11
|
credits: z.number().int().nonnegative(),
|
|
16
|
-
/** Exactly what goes into the body; read it, do not edit it. */
|
|
17
12
|
item: z.unknown(),
|
|
18
13
|
});
|
|
19
14
|
export const sceneProposal = z.discriminatedUnion("state", [
|
|
@@ -23,10 +18,8 @@ export const sceneProposal = z.discriminatedUnion("state", [
|
|
|
23
18
|
id: z.string().regex(SCENE_PROPOSAL_ID),
|
|
24
19
|
expires_at: z.string(),
|
|
25
20
|
scene: sceneBible.optional(),
|
|
26
|
-
/** Free devices that come with the scene: number cards, the template look. */
|
|
27
21
|
free: z.array(z.strictObject({ what: z.string().max(300) })).max(40),
|
|
28
22
|
options: z.array(sceneProposalOption).max(MAX_PROPOSAL_OPTIONS),
|
|
29
|
-
/** The body with the scene and the free devices, no options. */
|
|
30
23
|
base_credits: z.number().int().nonnegative(),
|
|
31
24
|
notes: z.array(z.string().max(300)).max(10),
|
|
32
25
|
}),
|
|
@@ -43,7 +36,6 @@ export const sceneProposalAccept = z.strictObject({
|
|
|
43
36
|
export const PROPOSE_DESCRIPTION = "false: quote_ugc proposes no scene, and make_ugc adds no free move of its own; the live shots still share " +
|
|
44
37
|
"one scene. Omitted, a quote with no scene proposes one, free, and make_ugc may add free moves, each named in warnings.";
|
|
45
38
|
export const proposeField = z.literal(false).optional().describe(PROPOSE_DESCRIPTION);
|
|
46
|
-
/** make_faceless takes the same block from quote_faceless (#1491). */
|
|
47
39
|
export const FACELESS_SCENE_PROPOSAL_DESCRIPTION = "An accepted scene proposal from quote_faceless: its id and the option ids the person " +
|
|
48
40
|
"picked. The server adds the proposed scene, its free devices and the picked options to this body, and the quote with it is the " +
|
|
49
41
|
"reserve. The rest of the body stays as quoted; a changed body is refused, so quote again.";
|
|
@@ -56,4 +48,3 @@ export const SCENE_PROPOSAL_EXPIRED_MESSAGE = "the scene proposal has expired; q
|
|
|
56
48
|
export const SCENE_PROPOSAL_STALE_MESSAGE = "the body changed since the quote that made this proposal; quote again";
|
|
57
49
|
export const SCENE_PROPOSAL_NOT_READY_MESSAGE = "the scene proposal is still being written; quote again";
|
|
58
50
|
export const SCENE_PROPOSAL_WITH_SCENE_MESSAGE = "pass scene or proposal, not both: the proposal brings its own scene";
|
|
59
|
-
//# sourceMappingURL=scene-proposal.js.map
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/** Integrity of submitted text: catches PROVEN byte loss, not a guess about it. */
|
|
2
|
-
/** The Unicode replacement character. Its presence means bytes are already lost. */
|
|
3
1
|
export declare const REPLACEMENT_CHAR = "\uFFFD";
|
|
4
|
-
/** A walk, not a field list: every string leaf is visited, so a new text field is */
|
|
5
|
-
/** checked automatically. */
|
|
6
2
|
export declare function damagedTextPaths(input: unknown): string[];
|
|
7
|
-
/** Replacement characters across all string leaves. The count goes into the message: one */
|
|
8
|
-
/** and a hundred are different failures for whoever fixes it. */
|
|
9
3
|
export declare function damagedCharCount(input: unknown): number;
|
package/dist/script-integrity.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/** Integrity of submitted text: catches PROVEN byte loss, not a guess about it. */
|
|
2
|
-
/** The Unicode replacement character. Its presence means bytes are already lost. */
|
|
3
1
|
export const REPLACEMENT_CHAR = "�";
|
|
4
|
-
/** Walk depth limit: the input is parsed by a zod schema, but its depth is unbounded. */
|
|
5
2
|
const MAX_DEPTH = 16;
|
|
6
3
|
function walk(value, path, depth, hits) {
|
|
7
4
|
if (depth > MAX_DEPTH)
|
|
@@ -23,15 +20,11 @@ function walk(value, path, depth, hits) {
|
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
/** A walk, not a field list: every string leaf is visited, so a new text field is */
|
|
27
|
-
/** checked automatically. */
|
|
28
23
|
export function damagedTextPaths(input) {
|
|
29
24
|
const hits = [];
|
|
30
25
|
walk(input, "", 0, hits);
|
|
31
26
|
return hits.sort();
|
|
32
27
|
}
|
|
33
|
-
/** Replacement characters across all string leaves. The count goes into the message: one */
|
|
34
|
-
/** and a hundred are different failures for whoever fixes it. */
|
|
35
28
|
export function damagedCharCount(input) {
|
|
36
29
|
const paths = damagedTextPaths(input);
|
|
37
30
|
if (paths.length === 0)
|
|
@@ -54,4 +47,3 @@ export function damagedCharCount(input) {
|
|
|
54
47
|
count(input);
|
|
55
48
|
return total;
|
|
56
49
|
}
|
|
57
|
-
//# sourceMappingURL=script-integrity.js.map
|
package/dist/script-voice.d.ts
CHANGED
|
@@ -18,9 +18,7 @@ export declare const scriptVoice: z.ZodObject<{
|
|
|
18
18
|
second_language: z.ZodOptional<z.ZodString>;
|
|
19
19
|
}, z.core.$strict>;
|
|
20
20
|
export type ScriptVoice = z.infer<typeof scriptVoice>;
|
|
21
|
-
/** The same object for tools/list, where every byte counts: its field names alone; the API checks the full `scriptVoice`. */
|
|
22
21
|
export declare const mcpScriptVoice: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
23
|
-
/** True when the script already ends on the sign-off, whatever its case and punctuation. */
|
|
24
22
|
export declare const endsOnSignOff: (script: string, signOff: string) => boolean;
|
|
25
23
|
export interface VoicedScript {
|
|
26
24
|
script: string;
|
|
@@ -28,14 +26,9 @@ export interface VoicedScript {
|
|
|
28
26
|
changed: boolean;
|
|
29
27
|
removedWords: boolean;
|
|
30
28
|
}
|
|
31
|
-
/** The script under the account's voice: each banned phrase taken out, then the sign-off added when the script lacks it. Pure, so the */
|
|
32
|
-
/** quote and the run say the same words; a script left empty gets no sign-off, and its caller refuses it. */
|
|
33
29
|
export declare function applyScriptVoice(script: string, voice: Pick<ScriptVoice, "banned_phrases" | "sign_off"> | null | undefined, options?: {
|
|
34
30
|
signOff?: boolean;
|
|
35
31
|
}): VoicedScript;
|
|
36
|
-
/** The banned phrases a text says, each once, in the voice's order. */
|
|
37
32
|
export declare const bannedPhrasesIn: (value: string, voice: Pick<ScriptVoice, "banned_phrases"> | null | undefined) => string[];
|
|
38
|
-
/** The line a plan or run says about the second-language version: the client writes it, free; its video is quoted on its own. */
|
|
39
33
|
export declare const secondLanguageLine: (language: string) => string;
|
|
40
|
-
/** The voice as words for a writer that drafts the narration from a brief; undefined when the voice says nothing a writer uses. */
|
|
41
34
|
export declare function voiceBriefNote(voice: ScriptVoice): string | undefined;
|
package/dist/script-voice.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
// The account's script voice (#1203): who speaks to whom, the tone, a closing line, banned phrases, a preferred format and a second
|
|
3
|
-
// language. It sits in the brand kit beside the design; a call's own value wins, and every change it makes to a script is named.
|
|
4
2
|
export const SCRIPT_TONES = ["friendly", "expert", "bold", "calm"];
|
|
5
3
|
export const SCRIPT_FORMATS = ["presenter", "presenter_visuals", "faceless", "screencast"];
|
|
6
4
|
export const MAX_BANNED_PHRASES = 50;
|
|
@@ -30,11 +28,9 @@ export const scriptVoice = z.strictObject(voiceShape).superRefine((voice, contex
|
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
});
|
|
33
|
-
/** The same object for tools/list, where every byte counts: its field names alone; the API checks the full `scriptVoice`. */
|
|
34
31
|
export const mcpScriptVoice = z.record(z.string(), z.unknown())
|
|
35
32
|
.describe(`The script voice to save: ${Object.keys(voiceShape).join(", ")}; {} clears it.`);
|
|
36
33
|
const literal = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
37
|
-
/** A phrase as whole words, any case, any run of spaces between its words. */
|
|
38
34
|
function phrasePattern(phrase) {
|
|
39
35
|
const words = phrase.trim().split(/\s+/u).map(literal).join("\\s+");
|
|
40
36
|
const head = /^[\p{L}\p{N}]/u.test(phrase.trim()) ? "(?<![\\p{L}\\p{N}_])" : "";
|
|
@@ -42,8 +38,6 @@ function phrasePattern(phrase) {
|
|
|
42
38
|
return new RegExp(`${head}${words}${tail}`, "iu");
|
|
43
39
|
}
|
|
44
40
|
const SENTENCE_START = /(?:^|[.!?…]["'”’)\]]*\s+|\n)\s*$/u;
|
|
45
|
-
/** Takes every whole-word occurrence of the phrase out of the text and tidies the gap: a phrase that opened a sentence hands the */
|
|
46
|
-
/** capital to the next word, one mid-sentence leaves a single space before the next word or mark. */
|
|
47
41
|
function cut(source, phrase) {
|
|
48
42
|
const pattern = phrasePattern(phrase);
|
|
49
43
|
let text = source, from = 0, count = 0;
|
|
@@ -53,7 +47,6 @@ function cut(source, phrase) {
|
|
|
53
47
|
break;
|
|
54
48
|
const start = from + match.index, end = start + match[0].length;
|
|
55
49
|
let head = text.slice(0, start), tail = text.slice(end);
|
|
56
|
-
// A mark counts as the gap's punctuation only before a space or the end: "-20" and ".5" keep their sign and point.
|
|
57
50
|
if (SENTENCE_START.test(head)) {
|
|
58
51
|
tail = tail.replace(/^[^\S\n]*(?:[,;:–—-](?=\s|$))?[^\S\n]*/u, "");
|
|
59
52
|
tail = tail.replace(/^[.!?…]+(?=\s|$)[^\S\n]*/u, "");
|
|
@@ -78,12 +71,10 @@ function cut(source, phrase) {
|
|
|
78
71
|
return { text: text.trim(), count };
|
|
79
72
|
}
|
|
80
73
|
const normalized = (value) => value.normalize("NFKC").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, " ").trim();
|
|
81
|
-
/** True when the script already ends on the sign-off, whatever its case and punctuation. */
|
|
82
74
|
export const endsOnSignOff = (script, signOff) => {
|
|
83
75
|
const end = normalized(signOff);
|
|
84
76
|
return end === "" || ` ${normalized(script)}`.endsWith(` ${end}`);
|
|
85
77
|
};
|
|
86
|
-
/** One line for every phrase taken out, held under 400 characters so a plan keeps it whole beside the sign-off line. */
|
|
87
78
|
function bannedLine(removed) {
|
|
88
79
|
const named = (entries) => entries.map(([phrase, count]) => `"${phrase}"${count > 1 ? ` ${count} times` : ""}`).join(", ");
|
|
89
80
|
let shown = removed.length;
|
|
@@ -93,13 +84,10 @@ function bannedLine(removed) {
|
|
|
93
84
|
shown -= 1;
|
|
94
85
|
return line(shown);
|
|
95
86
|
}
|
|
96
|
-
/** The script under the account's voice: each banned phrase taken out, then the sign-off added when the script lacks it. Pure, so the */
|
|
97
|
-
/** quote and the run say the same words; a script left empty gets no sign-off, and its caller refuses it. */
|
|
98
87
|
export function applyScriptVoice(script, voice, options = {}) {
|
|
99
88
|
const warnings = [];
|
|
100
89
|
const counts = new Map();
|
|
101
90
|
let text = script;
|
|
102
|
-
// Again until none is left: taking one phrase out can join the words around it into another.
|
|
103
91
|
for (let pass = 0; pass <= MAX_BANNED_PHRASES; pass += 1) {
|
|
104
92
|
let changed = false;
|
|
105
93
|
for (const phrase of voice?.banned_phrases ?? []) {
|
|
@@ -124,12 +112,9 @@ export function applyScriptVoice(script, voice, options = {}) {
|
|
|
124
112
|
}
|
|
125
113
|
return { script: text, warnings, changed: text !== script, removedWords };
|
|
126
114
|
}
|
|
127
|
-
/** The banned phrases a text says, each once, in the voice's order. */
|
|
128
115
|
export const bannedPhrasesIn = (value, voice) => (voice?.banned_phrases ?? []).filter(phrase => phrasePattern(phrase).test(value));
|
|
129
|
-
/** The line a plan or run says about the second-language version: the client writes it, free; its video is quoted on its own. */
|
|
130
116
|
export const secondLanguageLine = (language) => `the saved script voice asks for a second language (${language}): write the ` +
|
|
131
117
|
`${language} version of this script for the user beside it, free; a video of it is its own plan or run, quoted on its own`;
|
|
132
|
-
/** The voice as words for a writer that drafts the narration from a brief; undefined when the voice says nothing a writer uses. */
|
|
133
118
|
export function voiceBriefNote(voice) {
|
|
134
119
|
const parts = [
|
|
135
120
|
voice.about === undefined ? undefined : `Speaker and audience: ${voice.about}.`,
|
|
@@ -139,4 +124,3 @@ export function voiceBriefNote(voice) {
|
|
|
139
124
|
].filter((part) => part !== undefined);
|
|
140
125
|
return parts.length ? `Script voice of this account: ${parts.join(" ")}` : undefined;
|
|
141
126
|
}
|
|
142
|
-
//# sourceMappingURL=script-voice.js.map
|
|
@@ -18,8 +18,6 @@ export interface SemanticInsertAnchor {
|
|
|
18
18
|
endWord: number;
|
|
19
19
|
coverWord?: number;
|
|
20
20
|
}
|
|
21
|
-
/** The first word NOT covered by the insert. The default is read here and only here, or */
|
|
22
|
-
/** "coverage equals the anchor" would drift between readers. */
|
|
23
21
|
export declare function coverWordOf(anchor: {
|
|
24
22
|
endWord: number;
|
|
25
23
|
coverWord?: number | undefined;
|
|
@@ -42,19 +40,14 @@ export type SemanticInsertShot = {
|
|
|
42
40
|
export interface SemanticInsertResolution {
|
|
43
41
|
totalFrames: number;
|
|
44
42
|
shots: SemanticInsertShot[];
|
|
45
|
-
/** Our own adjustments no viewer sees (half a frame at most): for the log, not warnings[] (#1047). */
|
|
46
43
|
notes: string[];
|
|
47
44
|
}
|
|
48
|
-
/** The words of `text` as quotes and anchors count them. */
|
|
49
45
|
export declare function lexicalTokens(text: string): string[];
|
|
50
|
-
/** Every word range of `tokens` that `quote` matches, as an insert quote is matched. */
|
|
51
46
|
export declare function quoteOccurrences(tokens: readonly string[], quote: string): Array<{
|
|
52
47
|
startWord: number;
|
|
53
48
|
endWord: number;
|
|
54
49
|
}>;
|
|
55
50
|
export declare function planSemanticInserts(script: string, instructions: readonly SemanticInsertInstruction[]): SemanticInsertPlan;
|
|
56
|
-
/** The number of PAID actor shots, a pure function of word indexes, so input is refused */
|
|
57
|
-
/** before speech synthesis rather than in the run after payment. */
|
|
58
51
|
export declare function countActorShots(plan: SemanticInsertPlan): number;
|
|
59
52
|
export declare function resolveSemanticInserts(input: {
|
|
60
53
|
plan: SemanticInsertPlan;
|
package/dist/semantic-inserts.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** The first word NOT covered by the insert. The default is read here and only here, or */
|
|
2
|
-
/** "coverage equals the anchor" would drift between readers. */
|
|
3
1
|
export function coverWordOf(anchor) {
|
|
4
2
|
return anchor.coverWord ?? anchor.endWord;
|
|
5
3
|
}
|
|
@@ -7,14 +5,11 @@ function tokenize(text) {
|
|
|
7
5
|
const normalized = text.normalize("NFD").toLowerCase()
|
|
8
6
|
.replace(/([аеиоуыэюя]\u0308?)\u0301/gu, "$1").normalize("NFC")
|
|
9
7
|
.replace(/[’ʼ]/gu, "'");
|
|
10
|
-
// Joiners keep a site, handle, "24/7" or "9:30" one word, as the voice's timings are one per whitespace chunk (#1029).
|
|
11
8
|
return normalized.match(/[\p{L}\p{N}][\p{L}\p{N}\p{M}]*(?:[-'./_@:&+]+[\p{L}\p{N}][\p{L}\p{N}\p{M}]*|,(?<=\p{N},)\p{N}+)*/gu) ?? [];
|
|
12
9
|
}
|
|
13
|
-
/** The words of `text` as quotes and anchors count them. */
|
|
14
10
|
export function lexicalTokens(text) {
|
|
15
11
|
return tokenize(text);
|
|
16
12
|
}
|
|
17
|
-
/** Every word range of `tokens` that `quote` matches, as an insert quote is matched. */
|
|
18
13
|
export function quoteOccurrences(tokens, quote) {
|
|
19
14
|
const quoteTokens = tokenize(quote);
|
|
20
15
|
if (quoteTokens.length === 0)
|
|
@@ -89,8 +84,6 @@ export function planSemanticInserts(script, instructions) {
|
|
|
89
84
|
const plan = { sourceTokens, inserts };
|
|
90
85
|
return { sourceTokens, inserts: orderedAnchors(plan) };
|
|
91
86
|
}
|
|
92
|
-
/** The number of PAID actor shots, a pure function of word indexes, so input is refused */
|
|
93
|
-
/** before speech synthesis rather than in the run after payment. */
|
|
94
87
|
export function countActorShots(plan) {
|
|
95
88
|
const anchors = orderedAnchors(plan);
|
|
96
89
|
if (anchors.length === 0)
|
|
@@ -135,8 +128,6 @@ export function resolveSemanticInserts(input) {
|
|
|
135
128
|
let cursor = 0;
|
|
136
129
|
let rounded = Math.abs(totalFrames - durationSec * fps) > 1e-8;
|
|
137
130
|
for (const anchor of anchors) {
|
|
138
|
-
// A pause belongs to whoever covers the preceding word: the window ends at the START of
|
|
139
|
-
// the first uncovered word, or the gap would become a paid sliver.
|
|
140
131
|
const cover = coverWordOf(anchor);
|
|
141
132
|
const head = anchor.startWord === 0;
|
|
142
133
|
const tail = cover >= lexicalWords.length;
|
|
@@ -168,4 +159,3 @@ export function resolveSemanticInserts(input) {
|
|
|
168
159
|
export function selectTimelineInput(segments, planner) {
|
|
169
160
|
return segments !== undefined ? { kind: "explicit", segments } : { kind: "semantic", plan: planner() };
|
|
170
161
|
}
|
|
171
|
-
//# sourceMappingURL=semantic-inserts.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// The explainer kit's theme.json (#1291 F2): every colour of the kit's theme with the rule it takes a brand by, and its own
|
|
2
|
-
// value as the default. The kit's bundle imports no core values, so a web test holds these defaults equal to scene-kit/src/theme.ts.
|
|
3
1
|
export const EXPLAINER_THEME = {
|
|
4
2
|
version: 1,
|
|
5
|
-
// The kit's own brand: cream graph paper, near-black ink, cobalt. A brand equal to these draws the kit exactly as its author did.
|
|
6
3
|
roles: { background: "#F4EFE4", surface: "#FFFDF8", ink: "#15171E", accent: "#2346FF", accent_ink: "#FFFFFF" },
|
|
7
4
|
tokens: {
|
|
8
5
|
paper: { rule: "role(background)", default: "#F4EFE4" },
|
|
@@ -30,7 +27,6 @@ export const EXPLAINER_THEME = {
|
|
|
30
27
|
win3: { rule: "mix(ink, accent, 0.1)", default: "#353946" },
|
|
31
28
|
winText: { rule: "role(background)", default: "#E9E7E2" },
|
|
32
29
|
winMute: { rule: "mix(background, ink, 0.45)", default: "#8E8C95" },
|
|
33
|
-
// Meaning colours and the hero's rig are the style's own: a brand changes neither.
|
|
34
30
|
folder: { rule: "fixed()", default: "#F0C35A" },
|
|
35
31
|
folderDark: { rule: "fixed()", default: "#C9962A" },
|
|
36
32
|
tape: { rule: "fixed()", default: "rgba(243, 231, 184, .88)" },
|
|
@@ -61,4 +57,3 @@ export const EXPLAINER_THEME = {
|
|
|
61
57
|
locks: ["the handwritten accent face", "the monospace face", "meaning colours: good, warm, pink, folder", "the hero's rig colours"],
|
|
62
58
|
variation: { grid_step: [24, 20, 28, 32], hero_side: ["right", "left"] },
|
|
63
59
|
};
|
|
64
|
-
//# sourceMappingURL=skill-theme-explainer.js.map
|
package/dist/skill-theme.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type DesignFont, type DesignInput, type DesignPalette, type DesignPaletteRole } from "./design.js";
|
|
3
|
-
/** The closed set of rules a token may be derived by; a rule is data, never code. */
|
|
4
3
|
export declare const SKILL_THEME_FUNCTIONS: readonly ["role", "mix", "shade", "alpha", "readable", "fixed"];
|
|
5
4
|
export type SkillThemeFunction = (typeof SKILL_THEME_FUNCTIONS)[number];
|
|
6
|
-
/** One parsed rule. `a`/`b` name brand roles; `on` names another token; numbers are the rule's parameters. */
|
|
7
5
|
export type SkillThemeRule = {
|
|
8
6
|
fn: "role";
|
|
9
7
|
a: DesignPaletteRole;
|
|
@@ -27,12 +25,10 @@ export type SkillThemeRule = {
|
|
|
27
25
|
} | {
|
|
28
26
|
fn: "fixed";
|
|
29
27
|
};
|
|
30
|
-
/** `mix(ink, background, 0.15)` → the rule, or a sentence saying why it is not one. */
|
|
31
28
|
export declare function parseSkillThemeRule(text: string): SkillThemeRule | string;
|
|
32
29
|
export declare const SKILL_THEME_FONT_BINDINGS: readonly ["brand.display", "brand.body", "fixed"];
|
|
33
30
|
export declare const SKILL_THEME_LOGO_SLOTS: readonly ["end_card", "corner", "in_scene"];
|
|
34
31
|
export declare const SKILL_THEME_HERO_RIGS: readonly ["atlas_9", "vector", "none"];
|
|
35
|
-
/** A kit's theme.json. `roles` are the kit's own brand roles: a brand equal to them renders the kit exactly as its author drew it. */
|
|
36
32
|
export declare const skillThemeManifest: z.ZodObject<{
|
|
37
33
|
version: z.ZodLiteral<1>;
|
|
38
34
|
roles: z.ZodObject<{
|
|
@@ -69,9 +65,7 @@ export declare const skillThemeManifest: z.ZodObject<{
|
|
|
69
65
|
variation: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
70
66
|
}, z.core.$strict>;
|
|
71
67
|
export type SkillThemeManifest = z.infer<typeof skillThemeManifest>;
|
|
72
|
-
/** Which of our brand faces carry Cyrillic letters (the `cyrillic` subset of Google Fonts; a web test pins this to the bundled fonts). */
|
|
73
68
|
export declare const DESIGN_FONT_CYRILLIC: Readonly<Record<DesignFont, boolean>>;
|
|
74
|
-
/** The brand a skill film takes: palette roles, and fonts only where the brand chose them (a look's or its own), never our defaults. */
|
|
75
69
|
export interface SkillBrand {
|
|
76
70
|
palette?: DesignPalette;
|
|
77
71
|
fonts?: {
|
|
@@ -80,7 +74,6 @@ export interface SkillBrand {
|
|
|
80
74
|
};
|
|
81
75
|
}
|
|
82
76
|
export declare function skillBrandOf(design: DesignInput | null | undefined): SkillBrand;
|
|
83
|
-
/** What a draft's call may set over the brand: roles, fonts and variation values, each winning over the brand kit. */
|
|
84
77
|
export declare const skillThemeOverrides: z.ZodObject<{
|
|
85
78
|
palette: z.ZodOptional<z.ZodObject<{
|
|
86
79
|
accent: z.ZodOptional<z.ZodString>;
|
|
@@ -122,7 +115,6 @@ export declare const skillThemeOverrides: z.ZodObject<{
|
|
|
122
115
|
variation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
123
116
|
}, z.core.$strict>;
|
|
124
117
|
export type SkillThemeOverrides = z.infer<typeof skillThemeOverrides>;
|
|
125
|
-
/** The theme a draft freezes and every still and render of it draws with. */
|
|
126
118
|
export declare const resolvedSkillTheme: z.ZodObject<{
|
|
127
119
|
version: z.ZodLiteral<1>;
|
|
128
120
|
tokens: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -146,16 +138,11 @@ export declare const resolvedSkillTheme: z.ZodObject<{
|
|
|
146
138
|
warnings: z.ZodArray<z.ZodString>;
|
|
147
139
|
}, z.core.$strict>;
|
|
148
140
|
export type ResolvedSkillTheme = z.infer<typeof resolvedSkillTheme>;
|
|
149
|
-
/** FNV-1a, 32 bits, with murmur3's finaliser so the low bits a small modulus reads are mixed: the same account picks the same variation on
|
|
150
|
-
* every machine, and neighbouring ids pick unlike ones. */
|
|
151
141
|
export declare function themeSeedHash(text: string): number;
|
|
152
142
|
export interface ResolveSkillThemeInput {
|
|
153
143
|
brand?: SkillBrand;
|
|
154
144
|
overrides?: SkillThemeOverrides;
|
|
155
|
-
/** The account's id: its variation seed. Absent, every axis keeps the kit's own value. */
|
|
156
145
|
seed?: string;
|
|
157
|
-
/** The script's language (ISO 639-1); a Cyrillic one keeps a brand face without Cyrillic off the kit. */
|
|
158
146
|
language?: string;
|
|
159
147
|
}
|
|
160
|
-
/** The brand applied to a kit: precedence overrides → brand kit → the kit's own, then every declared text pair held to 4.5:1. */
|
|
161
148
|
export declare function resolveSkillTheme(manifest: SkillThemeManifest, input?: ResolveSkillThemeInput): ResolvedSkillTheme;
|
package/dist/skill-theme.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { DESIGN_FONT_FAMILIES, DESIGN_LOOKS, DESIGN_PALETTE_ROLES, designPalette, DESIGN_MIN_CONTRAST, hexToHsl, hslToHex, readableShade } from "./design.js";
|
|
3
3
|
import { contrastRatio } from "./templates/theme.js";
|
|
4
|
-
// A format skill's brand contract (#1291 F2): what a kit declares it takes from a brand, and the one resolver that turns the
|
|
5
|
-
// account's brand into the kit's own tokens, fonts and per-account variation. A kit with no manifest renders in its own style.
|
|
6
|
-
/** The closed set of rules a token may be derived by; a rule is data, never code. */
|
|
7
4
|
export const SKILL_THEME_FUNCTIONS = ["role", "mix", "shade", "alpha", "readable", "fixed"];
|
|
8
5
|
const HEX = /^#[0-9A-Fa-f]{6}$/;
|
|
9
6
|
const RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+|1\.0+)\s*\)$/;
|
|
@@ -12,7 +9,6 @@ const AXIS_NAME = /^[a-z][a-z_]{0,30}$/;
|
|
|
12
9
|
const colour = z.string().refine(value => HEX.test(value) || RGBA.test(value), "must be #RRGGBB or rgba(r, g, b, a)");
|
|
13
10
|
const ROLE_SET = new Set(DESIGN_PALETTE_ROLES);
|
|
14
11
|
const NUMBER = /^-?(?:\d+(?:\.\d+)?|\.\d+)$/;
|
|
15
|
-
/** `mix(ink, background, 0.15)` → the rule, or a sentence saying why it is not one. */
|
|
16
12
|
export function parseSkillThemeRule(text) {
|
|
17
13
|
const m = /^\s*([a-z]+)\s*\(\s*([^()]*)\)\s*$/.exec(text);
|
|
18
14
|
if (!m)
|
|
@@ -46,26 +42,21 @@ export function parseSkillThemeRule(text) {
|
|
|
46
42
|
export const SKILL_THEME_FONT_BINDINGS = ["brand.display", "brand.body", "fixed"];
|
|
47
43
|
export const SKILL_THEME_LOGO_SLOTS = ["end_card", "corner", "in_scene"];
|
|
48
44
|
export const SKILL_THEME_HERO_RIGS = ["atlas_9", "vector", "none"];
|
|
49
|
-
/** A kit's theme.json. `roles` are the kit's own brand roles: a brand equal to them renders the kit exactly as its author drew it. */
|
|
50
45
|
export const skillThemeManifest = z.strictObject({
|
|
51
46
|
version: z.literal(1),
|
|
52
47
|
roles: designPalette,
|
|
53
48
|
tokens: z.record(z.string().regex(TOKEN_NAME), z.strictObject({ rule: z.string().min(1).max(80), default: colour }))
|
|
54
49
|
.refine(tokens => Object.keys(tokens).length >= 1 && Object.keys(tokens).length <= 80, "a kit names 1–80 tokens"),
|
|
55
|
-
/** Text tokens over the fills they sit on, each held to 4.5:1 after the brand is applied. */
|
|
56
50
|
pairs: z.array(z.tuple([z.string().regex(TOKEN_NAME), z.string().regex(TOKEN_NAME)])).max(40),
|
|
57
51
|
fonts: z.record(z.string().regex(/^[a-z][a-z_]{0,20}$/), z.strictObject({ bind: z.enum(SKILL_THEME_FONT_BINDINGS), default: z.string().min(1).max(60) })),
|
|
58
52
|
logo: z.union([z.literal("none"), z.array(z.enum(SKILL_THEME_LOGO_SLOTS)).min(1).max(3)]),
|
|
59
53
|
hero: z.enum(SKILL_THEME_HERO_RIGS),
|
|
60
|
-
/** What a brand never changes, so the style survives it; read by people and agents. */
|
|
61
54
|
locks: z.array(z.string().min(1).max(60)).max(10),
|
|
62
|
-
/** Axes the account's seed varies; each axis's first value is the kit's own. */
|
|
63
55
|
variation: z.record(z.string().regex(AXIS_NAME), z.array(z.union([z.string().min(1).max(30), z.number()])).min(1).max(8)),
|
|
64
56
|
}).superRefine((manifest, context) => {
|
|
65
57
|
for (const problem of skillThemeManifestProblems(manifest))
|
|
66
58
|
context.addIssue({ code: z.ZodIssueCode.custom, ...problem });
|
|
67
59
|
});
|
|
68
|
-
/** Every rule parsed, every `readable` pointing at an earlier opaque token, every pair naming opaque tokens. */
|
|
69
60
|
function skillThemeManifestProblems(manifest) {
|
|
70
61
|
const problems = [], seen = new Set();
|
|
71
62
|
for (const [name, token] of Object.entries(manifest.tokens)) {
|
|
@@ -104,9 +95,7 @@ const formatColour = (c) => {
|
|
|
104
95
|
return `rgba(${[c.r, c.g, c.b].map(v => Math.round(Math.min(255, Math.max(0, v)))).join(", ")}, ${a})`;
|
|
105
96
|
};
|
|
106
97
|
const clamp01 = (v) => Math.min(1, Math.max(0, v));
|
|
107
|
-
/** Below this saturation a colour has no hue worth carrying over. */
|
|
108
98
|
const GREY = 0.06;
|
|
109
|
-
/** A rule's colour on one palette; `tokens` holds what `readable` reads. */
|
|
110
99
|
function evaluate(rule, palette, tokens) {
|
|
111
100
|
const role = (r) => parseColour(palette[r]);
|
|
112
101
|
switch (rule.fn) {
|
|
@@ -123,8 +112,6 @@ function evaluate(rule, palette, tokens) {
|
|
|
123
112
|
case "readable": return parseColour(readableShade(palette[rule.a], tokens[rule.on]));
|
|
124
113
|
}
|
|
125
114
|
}
|
|
126
|
-
/** D1: the kit's value moved by what the rule moved between the kit's roles and the brand's, in HSL. A value equal to its rule on the kit's
|
|
127
|
-
* roles is the rule's on the brand's; a rule that did not move leaves the kit's literal untouched. */
|
|
128
115
|
function carry(fallback, onKit, onBrand) {
|
|
129
116
|
const own = parseColour(fallback);
|
|
130
117
|
if (same(onKit, onBrand))
|
|
@@ -136,9 +123,7 @@ function carry(fallback, onKit, onBrand) {
|
|
|
136
123
|
const moved = parseColour(hslToHex({ h, s: clamp01(o.s + (b.s - k.s)), l: clamp01(o.l + (b.l - k.l)) }));
|
|
137
124
|
return formatColour({ ...moved, a: own.a });
|
|
138
125
|
}
|
|
139
|
-
/** Scripts that need the Cyrillic subset of a face. */
|
|
140
126
|
const CYRILLIC_LANGUAGES = new Set(["ru", "uk", "be", "bg", "sr", "mk", "kk", "ky", "tg", "mn"]);
|
|
141
|
-
/** Which of our brand faces carry Cyrillic letters (the `cyrillic` subset of Google Fonts; a web test pins this to the bundled fonts). */
|
|
142
127
|
export const DESIGN_FONT_CYRILLIC = {
|
|
143
128
|
"Plus Jakarta Sans": false, Inter: true, Montserrat: true, Roboto: true, "PT Sans": true, Oswald: true, "Bebas Neue": false, "Titan One": false,
|
|
144
129
|
Bungee: false, Bangers: false, Caveat: true, "Permanent Marker": false,
|
|
@@ -152,13 +137,11 @@ export function skillBrandOf(design) {
|
|
|
152
137
|
return { ...(palette ? { palette: { ...palette } } : {}),
|
|
153
138
|
...(display || body ? { fonts: { ...(display ? { display } : {}), ...(body ? { body } : {}) } } : {}) };
|
|
154
139
|
}
|
|
155
|
-
/** What a draft's call may set over the brand: roles, fonts and variation values, each winning over the brand kit. */
|
|
156
140
|
export const skillThemeOverrides = z.strictObject({
|
|
157
141
|
palette: designPalette.partial().optional(),
|
|
158
142
|
fonts: z.strictObject({ display: z.enum(DESIGN_FONT_FAMILIES).optional(), body: z.enum(DESIGN_FONT_FAMILIES).optional() }).optional(),
|
|
159
143
|
variation: z.record(z.string().regex(AXIS_NAME), z.union([z.string().min(1).max(30), z.number()])).optional(),
|
|
160
144
|
});
|
|
161
|
-
/** The theme a draft freezes and every still and render of it draws with. */
|
|
162
145
|
export const resolvedSkillTheme = z.strictObject({
|
|
163
146
|
version: z.literal(1),
|
|
164
147
|
tokens: z.record(z.string().regex(TOKEN_NAME), colour),
|
|
@@ -166,12 +149,9 @@ export const resolvedSkillTheme = z.strictObject({
|
|
|
166
149
|
variation: z.record(z.string().regex(AXIS_NAME), z.union([z.string(), z.number()])),
|
|
167
150
|
hero: z.enum(SKILL_THEME_HERO_RIGS),
|
|
168
151
|
logo: z.union([z.literal("none"), z.array(z.enum(SKILL_THEME_LOGO_SLOTS))]),
|
|
169
|
-
/** Where the theme came from: the call's overrides, the account's brand kit, or the kit alone. */
|
|
170
152
|
source: z.enum(["overrides", "brand_kit", "kit"]),
|
|
171
153
|
warnings: z.array(z.string()),
|
|
172
154
|
});
|
|
173
|
-
/** FNV-1a, 32 bits, with murmur3's finaliser so the low bits a small modulus reads are mixed: the same account picks the same variation on
|
|
174
|
-
* every machine, and neighbouring ids pick unlike ones. */
|
|
175
155
|
export function themeSeedHash(text) {
|
|
176
156
|
let h = 0x811c9dc5;
|
|
177
157
|
for (let i = 0; i < text.length; i++) {
|
|
@@ -185,7 +165,6 @@ export function themeSeedHash(text) {
|
|
|
185
165
|
h ^= h >>> 16;
|
|
186
166
|
return h >>> 0;
|
|
187
167
|
}
|
|
188
|
-
/** The brand applied to a kit: precedence overrides → brand kit → the kit's own, then every declared text pair held to 4.5:1. */
|
|
189
168
|
export function resolveSkillTheme(manifest, input = {}) {
|
|
190
169
|
const warnings = [];
|
|
191
170
|
const palette = { ...manifest.roles, ...input.brand?.palette, ...stripUndefined(input.overrides?.palette) };
|
|
@@ -200,7 +179,6 @@ export function resolveSkillTheme(manifest, input = {}) {
|
|
|
200
179
|
const fills = new Map();
|
|
201
180
|
for (const [text, fill] of manifest.pairs)
|
|
202
181
|
fills.set(text, [...fills.get(text) ?? [], fill]);
|
|
203
|
-
// A moved text token may be another pair's fill, so the pass repeats until nothing moves; each token keeps its last word.
|
|
204
182
|
const moved = new Map(), original = { ...tokens };
|
|
205
183
|
for (let pass = 0; pass < 3; pass++) {
|
|
206
184
|
let changed = false;
|
|
@@ -254,8 +232,6 @@ export function resolveSkillTheme(manifest, input = {}) {
|
|
|
254
232
|
return { version: 1, tokens, fonts, variation, hero: manifest.hero, logo: manifest.logo, source, warnings };
|
|
255
233
|
}
|
|
256
234
|
const worstContrast = (colour, grounds) => Math.min(...grounds.map(g => contrastRatio(colour, g)));
|
|
257
|
-
/** The nearest shade that reads on every ground; with grounds on both sides of it, the lightness of its hue (or grey) that reads best on the
|
|
258
|
-
* worst of them, which the caller names when it is still under 4.5:1. */
|
|
259
235
|
function readableAgainst(colour, grounds) {
|
|
260
236
|
let best = readableShade(colour, grounds);
|
|
261
237
|
if (worstContrast(best, grounds) >= DESIGN_MIN_CONTRAST)
|
|
@@ -271,4 +247,3 @@ function readableAgainst(colour, grounds) {
|
|
|
271
247
|
return best;
|
|
272
248
|
}
|
|
273
249
|
const stripUndefined = (value) => Object.fromEntries(Object.entries(value ?? {}).filter(([, v]) => v !== undefined));
|
|
274
|
-
//# sourceMappingURL=skill-theme.js.map
|