@nodaro/shared 1.4.1
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/LICENSE +202 -0
- package/README.md +32 -0
- package/dist/index.cjs +12506 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12269 -0
- package/dist/index.d.ts +12269 -0
- package/dist/index.js +11831 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
- package/src/__tests__/__snapshots__/prompt-builder-segments.test.ts.snap +65 -0
- package/src/__tests__/ai-avatar-pricing.test.ts +321 -0
- package/src/__tests__/apply-video-negative-prompt.test.ts +76 -0
- package/src/__tests__/attach-columns.test.ts +28 -0
- package/src/__tests__/audio-crossfade-curves.test.ts +33 -0
- package/src/__tests__/build-model-menu.test.ts +58 -0
- package/src/__tests__/character-aspect-defaults.test.ts +142 -0
- package/src/__tests__/character-mention-slug.test.ts +199 -0
- package/src/__tests__/character-reference-photo-kinds.test.ts +32 -0
- package/src/__tests__/character-usage-mode.test.ts +147 -0
- package/src/__tests__/character-variant-assets.test.ts +142 -0
- package/src/__tests__/character-voice.test.ts +130 -0
- package/src/__tests__/cinematic-avatar-pricing.test.ts +119 -0
- package/src/__tests__/combine-transitions.test.ts +137 -0
- package/src/__tests__/component-types.test.ts +87 -0
- package/src/__tests__/condition-variables.test.ts +98 -0
- package/src/__tests__/credit-identifiers.test.ts +811 -0
- package/src/__tests__/default-video-provider.test.ts +63 -0
- package/src/__tests__/entity-image-handle.test.ts +43 -0
- package/src/__tests__/entity-variants.test.ts +33 -0
- package/src/__tests__/fal-lip-sync-sets.test.ts +31 -0
- package/src/__tests__/featured-entities.test.ts +33 -0
- package/src/__tests__/film-pricing.test.ts +64 -0
- package/src/__tests__/filter-condition.test.ts +285 -0
- package/src/__tests__/freecut-protocol.test.ts +35 -0
- package/src/__tests__/generate-text-items.test.ts +19 -0
- package/src/__tests__/generated-results.test.ts +50 -0
- package/src/__tests__/graph-utils.test.ts +618 -0
- package/src/__tests__/group-aggregation.test.ts +83 -0
- package/src/__tests__/i18n-locale-completeness.test.ts +156 -0
- package/src/__tests__/image-critic-node.test.ts +86 -0
- package/src/__tests__/image-mask-mode.test.ts +16 -0
- package/src/__tests__/image-ref-limit.test.ts +78 -0
- package/src/__tests__/inpaint-region.test.ts +24 -0
- package/src/__tests__/input-field-map-parity.test.ts +30 -0
- package/src/__tests__/json-evaluator.test.ts +289 -0
- package/src/__tests__/json-path.test.ts +64 -0
- package/src/__tests__/lip-sync-pricing.test.ts +142 -0
- package/src/__tests__/list-merge.test.ts +96 -0
- package/src/__tests__/list-sort.test.ts +134 -0
- package/src/__tests__/llm-models.test.ts +445 -0
- package/src/__tests__/location-mention-slug.test.ts +246 -0
- package/src/__tests__/locations-coverage-critic-schema.test.ts +92 -0
- package/src/__tests__/loop-delimiter.test.ts +39 -0
- package/src/__tests__/lottie-slots.test.ts +245 -0
- package/src/__tests__/model-catalog-flux2-resolutions.test.ts +21 -0
- package/src/__tests__/model-constants-location.test.ts +20 -0
- package/src/__tests__/model-constants.test.ts +122 -0
- package/src/__tests__/model-tree.test.ts +86 -0
- package/src/__tests__/no-internal-imports.test.ts +25 -0
- package/src/__tests__/node-default-mappings.test.ts +175 -0
- package/src/__tests__/node-mappable-fields.test.ts +7 -0
- package/src/__tests__/node-preset-export.test.ts +46 -0
- package/src/__tests__/node-preset-extract.test.ts +166 -0
- package/src/__tests__/node-refs-canonical.test.ts +54 -0
- package/src/__tests__/node-refs-combine.test.ts +54 -0
- package/src/__tests__/node-refs.test.ts +187 -0
- package/src/__tests__/node-runtime-keys.test.ts +99 -0
- package/src/__tests__/object-aspect-defaults.test.ts +59 -0
- package/src/__tests__/parameter-node-value.test.ts +137 -0
- package/src/__tests__/pinterest-url.test.ts +35 -0
- package/src/__tests__/pipeline-chat.test.ts +110 -0
- package/src/__tests__/pipeline-validation.test.ts +98 -0
- package/src/__tests__/presentation-utils.test.ts +1137 -0
- package/src/__tests__/producer-types.test.ts +47 -0
- package/src/__tests__/prompt-length-limits.test.ts +156 -0
- package/src/__tests__/provider-directive-defaults.test.ts +46 -0
- package/src/__tests__/reduce-strategy-registry.test.ts +43 -0
- package/src/__tests__/reference-board-templates.test.ts +33 -0
- package/src/__tests__/reference-roles.test.ts +36 -0
- package/src/__tests__/resolve-field-mappings.test.ts +110 -0
- package/src/__tests__/resolve-pipeline-model.test.ts +76 -0
- package/src/__tests__/scene-node-types.test.ts +80 -0
- package/src/__tests__/scraper-actors.test.ts +67 -0
- package/src/__tests__/seedance-2-catalog.test.ts +18 -0
- package/src/__tests__/seedance-2-credit-id.test.ts +23 -0
- package/src/__tests__/seedance-aspects.test.ts +52 -0
- package/src/__tests__/selector.test.ts +1151 -0
- package/src/__tests__/settled-with-limit.test.ts +214 -0
- package/src/__tests__/social-media-specs.test.ts +129 -0
- package/src/__tests__/sub-workflow-validation.test.ts +88 -0
- package/src/__tests__/switchx-pricing.test.ts +28 -0
- package/src/__tests__/to-connected-references.test.ts +153 -0
- package/src/__tests__/utilities.test.ts +541 -0
- package/src/__tests__/video-analysis-pricing.test.ts +58 -0
- package/src/__tests__/video-analysis.test.ts +63 -0
- package/src/__tests__/video-audio-capability.test.ts +204 -0
- package/src/__tests__/video-gen-providers.test.ts +28 -0
- package/src/__tests__/video-mode-aliases.test.ts +150 -0
- package/src/__tests__/video-ref-limits.test.ts +72 -0
- package/src/__tests__/video-utils.test.ts +303 -0
- package/src/__tests__/voice-changer-models.test.ts +33 -0
- package/src/__tests__/workflow-export-strip.test.ts +46 -0
- package/src/ai-avatar-pricing.ts +213 -0
- package/src/ancestor-refs.ts +48 -0
- package/src/animals.ts +231 -0
- package/src/audio-crossfade-curves.ts +73 -0
- package/src/audio-fx-presets.ts +64 -0
- package/src/avatar-payload-validators.ts +214 -0
- package/src/caption-styles.ts +31 -0
- package/src/character-aspect-defaults.ts +102 -0
- package/src/character-facets.ts +37 -0
- package/src/character-mention-slug.ts +166 -0
- package/src/character-usage-mode.ts +109 -0
- package/src/character-variant-assets.ts +121 -0
- package/src/character-voice.ts +151 -0
- package/src/cinematic-avatar-pricing.ts +111 -0
- package/src/clone-utils.ts +46 -0
- package/src/combine-transitions.ts +482 -0
- package/src/community.ts +112 -0
- package/src/component-types.ts +127 -0
- package/src/condition-variables.ts +65 -0
- package/src/credit-estimators/index.ts +15 -0
- package/src/credit-estimators/video-utils.ts +165 -0
- package/src/credit-identifiers.ts +304 -0
- package/src/entity-approval-types.ts +31 -0
- package/src/entity-aspect-defaults.ts +82 -0
- package/src/entity-asset-types.ts +296 -0
- package/src/entity-image-handle.ts +36 -0
- package/src/extra-refs.ts +139 -0
- package/src/featured-entities.ts +136 -0
- package/src/film-pricing.ts +117 -0
- package/src/filter-condition.ts +250 -0
- package/src/flux2-pricing.ts +18 -0
- package/src/freecut-protocol.ts +52 -0
- package/src/furniture.ts +167 -0
- package/src/generate-text-items.ts +15 -0
- package/src/generated-results.ts +63 -0
- package/src/group-aggregation.ts +75 -0
- package/src/hint-graph-types.ts +18 -0
- package/src/i18n/action-fx.ar.ts +89 -0
- package/src/i18n/action-fx.de.ts +89 -0
- package/src/i18n/action-fx.es.ts +89 -0
- package/src/i18n/action-fx.fr.ts +89 -0
- package/src/i18n/action-fx.he.ts +89 -0
- package/src/i18n/action-fx.hi.ts +89 -0
- package/src/i18n/action-fx.ja.ts +89 -0
- package/src/i18n/action-fx.ko.ts +89 -0
- package/src/i18n/action-fx.pt-BR.ts +89 -0
- package/src/i18n/action-fx.ru.ts +89 -0
- package/src/i18n/action-fx.zh-CN.ts +89 -0
- package/src/i18n/aesthetic.ar.ts +170 -0
- package/src/i18n/aesthetic.de.ts +48 -0
- package/src/i18n/aesthetic.es.ts +169 -0
- package/src/i18n/aesthetic.fr.ts +52 -0
- package/src/i18n/aesthetic.he.ts +169 -0
- package/src/i18n/aesthetic.hi.ts +55 -0
- package/src/i18n/aesthetic.ja.ts +165 -0
- package/src/i18n/aesthetic.ko.ts +169 -0
- package/src/i18n/aesthetic.pt-BR.ts +148 -0
- package/src/i18n/aesthetic.ru.ts +155 -0
- package/src/i18n/aesthetic.zh-CN.ts +172 -0
- package/src/i18n/animals.ar.ts +145 -0
- package/src/i18n/animals.de.ts +144 -0
- package/src/i18n/animals.es.ts +158 -0
- package/src/i18n/animals.fr.ts +144 -0
- package/src/i18n/animals.he.ts +155 -0
- package/src/i18n/animals.hi.ts +157 -0
- package/src/i18n/animals.ja.ts +159 -0
- package/src/i18n/animals.ko.ts +159 -0
- package/src/i18n/animals.pt-BR.ts +157 -0
- package/src/i18n/animals.ru.ts +155 -0
- package/src/i18n/animals.zh-CN.ts +155 -0
- package/src/i18n/atmosphere.ar.ts +49 -0
- package/src/i18n/atmosphere.de.ts +47 -0
- package/src/i18n/atmosphere.es.ts +50 -0
- package/src/i18n/atmosphere.fr.ts +47 -0
- package/src/i18n/atmosphere.he.ts +47 -0
- package/src/i18n/atmosphere.hi.ts +49 -0
- package/src/i18n/atmosphere.ja.ts +49 -0
- package/src/i18n/atmosphere.ko.ts +49 -0
- package/src/i18n/atmosphere.pt-BR.ts +49 -0
- package/src/i18n/atmosphere.ru.ts +47 -0
- package/src/i18n/atmosphere.zh-CN.ts +152 -0
- package/src/i18n/backdrop.ar.ts +53 -0
- package/src/i18n/backdrop.de.ts +46 -0
- package/src/i18n/backdrop.es.ts +54 -0
- package/src/i18n/backdrop.fr.ts +52 -0
- package/src/i18n/backdrop.he.ts +51 -0
- package/src/i18n/backdrop.hi.ts +59 -0
- package/src/i18n/backdrop.ja.ts +61 -0
- package/src/i18n/backdrop.ko.ts +59 -0
- package/src/i18n/backdrop.pt-BR.ts +59 -0
- package/src/i18n/backdrop.ru.ts +57 -0
- package/src/i18n/backdrop.zh-CN.ts +57 -0
- package/src/i18n/camera-format.ar.ts +40 -0
- package/src/i18n/camera-format.de.ts +37 -0
- package/src/i18n/camera-format.es.ts +41 -0
- package/src/i18n/camera-format.fr.ts +37 -0
- package/src/i18n/camera-format.he.ts +37 -0
- package/src/i18n/camera-format.hi.ts +42 -0
- package/src/i18n/camera-format.ja.ts +37 -0
- package/src/i18n/camera-format.ko.ts +37 -0
- package/src/i18n/camera-format.pt-BR.ts +46 -0
- package/src/i18n/camera-format.ru.ts +42 -0
- package/src/i18n/camera-format.zh-CN.ts +42 -0
- package/src/i18n/camera-motions.ar.ts +86 -0
- package/src/i18n/camera-motions.de.ts +74 -0
- package/src/i18n/camera-motions.es.ts +86 -0
- package/src/i18n/camera-motions.fr.ts +86 -0
- package/src/i18n/camera-motions.he.ts +86 -0
- package/src/i18n/camera-motions.hi.ts +99 -0
- package/src/i18n/camera-motions.ja.ts +99 -0
- package/src/i18n/camera-motions.ko.ts +99 -0
- package/src/i18n/camera-motions.pt-BR.ts +99 -0
- package/src/i18n/camera-motions.ru.ts +99 -0
- package/src/i18n/camera-motions.zh-CN.ts +99 -0
- package/src/i18n/character-fx.ar.ts +72 -0
- package/src/i18n/character-fx.de.ts +72 -0
- package/src/i18n/character-fx.es.ts +72 -0
- package/src/i18n/character-fx.fr.ts +72 -0
- package/src/i18n/character-fx.he.ts +72 -0
- package/src/i18n/character-fx.hi.ts +72 -0
- package/src/i18n/character-fx.ja.ts +72 -0
- package/src/i18n/character-fx.ko.ts +72 -0
- package/src/i18n/character-fx.pt-BR.ts +72 -0
- package/src/i18n/character-fx.ru.ts +72 -0
- package/src/i18n/character-fx.zh-CN.ts +72 -0
- package/src/i18n/color-look.ar.ts +50 -0
- package/src/i18n/color-look.de.ts +47 -0
- package/src/i18n/color-look.es.ts +50 -0
- package/src/i18n/color-look.fr.ts +50 -0
- package/src/i18n/color-look.he.ts +49 -0
- package/src/i18n/color-look.hi.ts +52 -0
- package/src/i18n/color-look.ja.ts +54 -0
- package/src/i18n/color-look.ko.ts +54 -0
- package/src/i18n/color-look.pt-BR.ts +54 -0
- package/src/i18n/color-look.ru.ts +52 -0
- package/src/i18n/color-look.zh-CN.ts +53 -0
- package/src/i18n/composition-effects.ar.ts +26 -0
- package/src/i18n/composition-effects.de.ts +25 -0
- package/src/i18n/composition-effects.es.ts +27 -0
- package/src/i18n/composition-effects.fr.ts +25 -0
- package/src/i18n/composition-effects.he.ts +25 -0
- package/src/i18n/composition-effects.hi.ts +27 -0
- package/src/i18n/composition-effects.ja.ts +27 -0
- package/src/i18n/composition-effects.ko.ts +27 -0
- package/src/i18n/composition-effects.pt-BR.ts +25 -0
- package/src/i18n/composition-effects.ru.ts +82 -0
- package/src/i18n/composition-effects.zh-CN.ts +25 -0
- package/src/i18n/era.ar.ts +37 -0
- package/src/i18n/era.de.ts +34 -0
- package/src/i18n/era.es.ts +37 -0
- package/src/i18n/era.fr.ts +37 -0
- package/src/i18n/era.he.ts +36 -0
- package/src/i18n/era.hi.ts +39 -0
- package/src/i18n/era.ja.ts +41 -0
- package/src/i18n/era.ko.ts +39 -0
- package/src/i18n/era.pt-BR.ts +41 -0
- package/src/i18n/era.ru.ts +121 -0
- package/src/i18n/era.zh-CN.ts +39 -0
- package/src/i18n/exposure-settings.ar.ts +28 -0
- package/src/i18n/exposure-settings.de.ts +26 -0
- package/src/i18n/exposure-settings.es.ts +28 -0
- package/src/i18n/exposure-settings.fr.ts +29 -0
- package/src/i18n/exposure-settings.he.ts +28 -0
- package/src/i18n/exposure-settings.hi.ts +31 -0
- package/src/i18n/exposure-settings.ja.ts +31 -0
- package/src/i18n/exposure-settings.ko.ts +31 -0
- package/src/i18n/exposure-settings.pt-BR.ts +31 -0
- package/src/i18n/exposure-settings.ru.ts +31 -0
- package/src/i18n/exposure-settings.zh-CN.ts +31 -0
- package/src/i18n/framing.ar.ts +78 -0
- package/src/i18n/framing.de.ts +73 -0
- package/src/i18n/framing.es.ts +78 -0
- package/src/i18n/framing.fr.ts +78 -0
- package/src/i18n/framing.he.ts +77 -0
- package/src/i18n/framing.hi.ts +82 -0
- package/src/i18n/framing.ja.ts +84 -0
- package/src/i18n/framing.ko.ts +82 -0
- package/src/i18n/framing.pt-BR.ts +84 -0
- package/src/i18n/framing.ru.ts +82 -0
- package/src/i18n/framing.zh-CN.ts +82 -0
- package/src/i18n/furniture.ar.ts +92 -0
- package/src/i18n/furniture.de.ts +93 -0
- package/src/i18n/furniture.es.ts +101 -0
- package/src/i18n/furniture.fr.ts +93 -0
- package/src/i18n/furniture.he.ts +101 -0
- package/src/i18n/furniture.hi.ts +101 -0
- package/src/i18n/furniture.ja.ts +101 -0
- package/src/i18n/furniture.ko.ts +101 -0
- package/src/i18n/furniture.pt-BR.ts +101 -0
- package/src/i18n/furniture.ru.ts +101 -0
- package/src/i18n/furniture.zh-CN.ts +101 -0
- package/src/i18n/held-prop.ar.ts +74 -0
- package/src/i18n/held-prop.de.ts +65 -0
- package/src/i18n/held-prop.es.ts +83 -0
- package/src/i18n/held-prop.fr.ts +74 -0
- package/src/i18n/held-prop.he.ts +73 -0
- package/src/i18n/held-prop.hi.ts +82 -0
- package/src/i18n/held-prop.ja.ts +84 -0
- package/src/i18n/held-prop.ko.ts +84 -0
- package/src/i18n/held-prop.pt-BR.ts +84 -0
- package/src/i18n/held-prop.ru.ts +82 -0
- package/src/i18n/held-prop.zh-CN.ts +82 -0
- package/src/i18n/index.ts +208 -0
- package/src/i18n/instrumentation.ar.ts +195 -0
- package/src/i18n/instrumentation.de.ts +195 -0
- package/src/i18n/instrumentation.es.ts +195 -0
- package/src/i18n/instrumentation.fr.ts +195 -0
- package/src/i18n/instrumentation.he.ts +195 -0
- package/src/i18n/instrumentation.hi.ts +195 -0
- package/src/i18n/instrumentation.ja.ts +195 -0
- package/src/i18n/instrumentation.ko.ts +195 -0
- package/src/i18n/instrumentation.pt-BR.ts +195 -0
- package/src/i18n/instrumentation.ru.ts +195 -0
- package/src/i18n/instrumentation.zh-CN.ts +195 -0
- package/src/i18n/lens.ar.ts +24 -0
- package/src/i18n/lens.de.ts +24 -0
- package/src/i18n/lens.es.ts +24 -0
- package/src/i18n/lens.fr.ts +24 -0
- package/src/i18n/lens.he.ts +24 -0
- package/src/i18n/lens.hi.ts +24 -0
- package/src/i18n/lens.ja.ts +24 -0
- package/src/i18n/lens.ko.ts +24 -0
- package/src/i18n/lens.pt-BR.ts +24 -0
- package/src/i18n/lens.ru.ts +25 -0
- package/src/i18n/lens.zh-CN.ts +24 -0
- package/src/i18n/lighting.ar.ts +86 -0
- package/src/i18n/lighting.de.ts +84 -0
- package/src/i18n/lighting.es.ts +89 -0
- package/src/i18n/lighting.fr.ts +84 -0
- package/src/i18n/lighting.he.ts +88 -0
- package/src/i18n/lighting.hi.ts +90 -0
- package/src/i18n/lighting.ja.ts +90 -0
- package/src/i18n/lighting.ko.ts +90 -0
- package/src/i18n/lighting.pt-BR.ts +90 -0
- package/src/i18n/lighting.ru.ts +88 -0
- package/src/i18n/lighting.zh-CN.ts +92 -0
- package/src/i18n/loop-subject.ar.ts +39 -0
- package/src/i18n/loop-subject.de.ts +39 -0
- package/src/i18n/loop-subject.es.ts +39 -0
- package/src/i18n/loop-subject.fr.ts +39 -0
- package/src/i18n/loop-subject.he.ts +39 -0
- package/src/i18n/loop-subject.hi.ts +39 -0
- package/src/i18n/loop-subject.ja.ts +39 -0
- package/src/i18n/loop-subject.ko.ts +39 -0
- package/src/i18n/loop-subject.pt-BR.ts +39 -0
- package/src/i18n/loop-subject.ru.ts +39 -0
- package/src/i18n/loop-subject.zh-CN.ts +39 -0
- package/src/i18n/materials.ar.ts +80 -0
- package/src/i18n/materials.de.ts +80 -0
- package/src/i18n/materials.es.ts +87 -0
- package/src/i18n/materials.fr.ts +80 -0
- package/src/i18n/materials.he.ts +86 -0
- package/src/i18n/materials.hi.ts +86 -0
- package/src/i18n/materials.ja.ts +88 -0
- package/src/i18n/materials.ko.ts +88 -0
- package/src/i18n/materials.pt-BR.ts +88 -0
- package/src/i18n/materials.ru.ts +86 -0
- package/src/i18n/materials.zh-CN.ts +86 -0
- package/src/i18n/mood.ar.ts +61 -0
- package/src/i18n/mood.de.ts +61 -0
- package/src/i18n/mood.es.ts +66 -0
- package/src/i18n/mood.fr.ts +61 -0
- package/src/i18n/mood.he.ts +64 -0
- package/src/i18n/mood.hi.ts +66 -0
- package/src/i18n/mood.ja.ts +66 -0
- package/src/i18n/mood.ko.ts +66 -0
- package/src/i18n/mood.pt-BR.ts +64 -0
- package/src/i18n/mood.ru.ts +64 -0
- package/src/i18n/mood.zh-CN.ts +64 -0
- package/src/i18n/music-genre.ar.ts +302 -0
- package/src/i18n/music-genre.de.ts +302 -0
- package/src/i18n/music-genre.es.ts +302 -0
- package/src/i18n/music-genre.fr.ts +302 -0
- package/src/i18n/music-genre.he.ts +302 -0
- package/src/i18n/music-genre.hi.ts +302 -0
- package/src/i18n/music-genre.ja.ts +302 -0
- package/src/i18n/music-genre.ko.ts +302 -0
- package/src/i18n/music-genre.pt-BR.ts +302 -0
- package/src/i18n/music-genre.ru.ts +302 -0
- package/src/i18n/music-genre.zh-CN.ts +302 -0
- package/src/i18n/music-mood.ar.ts +75 -0
- package/src/i18n/music-mood.de.ts +75 -0
- package/src/i18n/music-mood.es.ts +75 -0
- package/src/i18n/music-mood.fr.ts +75 -0
- package/src/i18n/music-mood.he.ts +75 -0
- package/src/i18n/music-mood.hi.ts +75 -0
- package/src/i18n/music-mood.ja.ts +75 -0
- package/src/i18n/music-mood.ko.ts +75 -0
- package/src/i18n/music-mood.pt-BR.ts +75 -0
- package/src/i18n/music-mood.ru.ts +75 -0
- package/src/i18n/music-mood.zh-CN.ts +75 -0
- package/src/i18n/person.ar.ts +638 -0
- package/src/i18n/person.de.ts +629 -0
- package/src/i18n/person.es.ts +645 -0
- package/src/i18n/person.fr.ts +621 -0
- package/src/i18n/person.he.ts +656 -0
- package/src/i18n/person.hi.ts +654 -0
- package/src/i18n/person.ja.ts +662 -0
- package/src/i18n/person.ko.ts +662 -0
- package/src/i18n/person.pt-BR.ts +656 -0
- package/src/i18n/person.ru.ts +656 -0
- package/src/i18n/person.zh-CN.ts +656 -0
- package/src/i18n/photo-genre.ar.ts +58 -0
- package/src/i18n/photo-genre.de.ts +52 -0
- package/src/i18n/photo-genre.es.ts +64 -0
- package/src/i18n/photo-genre.fr.ts +58 -0
- package/src/i18n/photo-genre.he.ts +62 -0
- package/src/i18n/photo-genre.hi.ts +63 -0
- package/src/i18n/photo-genre.ja.ts +65 -0
- package/src/i18n/photo-genre.ko.ts +63 -0
- package/src/i18n/photo-genre.pt-BR.ts +65 -0
- package/src/i18n/photo-genre.ru.ts +63 -0
- package/src/i18n/photo-genre.zh-CN.ts +63 -0
- package/src/i18n/photographer.ar.ts +75 -0
- package/src/i18n/photographer.de.ts +74 -0
- package/src/i18n/photographer.es.ts +77 -0
- package/src/i18n/photographer.fr.ts +77 -0
- package/src/i18n/photographer.he.ts +78 -0
- package/src/i18n/photographer.hi.ts +80 -0
- package/src/i18n/photographer.ja.ts +84 -0
- package/src/i18n/photographer.ko.ts +84 -0
- package/src/i18n/photographer.pt-BR.ts +83 -0
- package/src/i18n/photographer.ru.ts +78 -0
- package/src/i18n/photographer.zh-CN.ts +78 -0
- package/src/i18n/pose.ar.ts +95 -0
- package/src/i18n/pose.de.ts +96 -0
- package/src/i18n/pose.es.ts +104 -0
- package/src/i18n/pose.fr.ts +96 -0
- package/src/i18n/pose.he.ts +104 -0
- package/src/i18n/pose.hi.ts +104 -0
- package/src/i18n/pose.ja.ts +104 -0
- package/src/i18n/pose.ko.ts +104 -0
- package/src/i18n/pose.pt-BR.ts +104 -0
- package/src/i18n/pose.ru.ts +104 -0
- package/src/i18n/pose.zh-CN.ts +104 -0
- package/src/i18n/post-process-effects.ar.ts +25 -0
- package/src/i18n/post-process-effects.de.ts +24 -0
- package/src/i18n/post-process-effects.es.ts +26 -0
- package/src/i18n/post-process-effects.fr.ts +24 -0
- package/src/i18n/post-process-effects.he.ts +24 -0
- package/src/i18n/post-process-effects.hi.ts +26 -0
- package/src/i18n/post-process-effects.ja.ts +26 -0
- package/src/i18n/post-process-effects.ko.ts +26 -0
- package/src/i18n/post-process-effects.pt-BR.ts +24 -0
- package/src/i18n/post-process-effects.ru.ts +24 -0
- package/src/i18n/post-process-effects.zh-CN.ts +24 -0
- package/src/i18n/render-quality.ar.ts +34 -0
- package/src/i18n/render-quality.de.ts +30 -0
- package/src/i18n/render-quality.es.ts +35 -0
- package/src/i18n/render-quality.fr.ts +34 -0
- package/src/i18n/render-quality.he.ts +33 -0
- package/src/i18n/render-quality.hi.ts +39 -0
- package/src/i18n/render-quality.ja.ts +39 -0
- package/src/i18n/render-quality.ko.ts +39 -0
- package/src/i18n/render-quality.pt-BR.ts +37 -0
- package/src/i18n/render-quality.ru.ts +37 -0
- package/src/i18n/render-quality.zh-CN.ts +37 -0
- package/src/i18n/seasons.ar.ts +10 -0
- package/src/i18n/seasons.de.ts +10 -0
- package/src/i18n/seasons.es.ts +10 -0
- package/src/i18n/seasons.fr.ts +10 -0
- package/src/i18n/seasons.he.ts +10 -0
- package/src/i18n/seasons.hi.ts +10 -0
- package/src/i18n/seasons.ja.ts +10 -0
- package/src/i18n/seasons.ko.ts +10 -0
- package/src/i18n/seasons.pt-BR.ts +10 -0
- package/src/i18n/seasons.ru.ts +10 -0
- package/src/i18n/seasons.zh-CN.ts +10 -0
- package/src/i18n/setting.ar.ts +73 -0
- package/src/i18n/setting.de.ts +73 -0
- package/src/i18n/setting.es.ts +77 -0
- package/src/i18n/setting.fr.ts +73 -0
- package/src/i18n/setting.he.ts +76 -0
- package/src/i18n/setting.hi.ts +76 -0
- package/src/i18n/setting.ja.ts +78 -0
- package/src/i18n/setting.ko.ts +76 -0
- package/src/i18n/setting.pt-BR.ts +78 -0
- package/src/i18n/setting.ru.ts +76 -0
- package/src/i18n/setting.zh-CN.ts +76 -0
- package/src/i18n/style.ar.ts +55 -0
- package/src/i18n/style.de.ts +54 -0
- package/src/i18n/style.es.ts +54 -0
- package/src/i18n/style.fr.ts +54 -0
- package/src/i18n/style.he.ts +54 -0
- package/src/i18n/style.hi.ts +54 -0
- package/src/i18n/style.ja.ts +54 -0
- package/src/i18n/style.ko.ts +54 -0
- package/src/i18n/style.pt-BR.ts +56 -0
- package/src/i18n/style.ru.ts +54 -0
- package/src/i18n/style.zh-CN.ts +54 -0
- package/src/i18n/styling.ar.ts +295 -0
- package/src/i18n/styling.de.ts +285 -0
- package/src/i18n/styling.es.ts +317 -0
- package/src/i18n/styling.fr.ts +285 -0
- package/src/i18n/styling.he.ts +307 -0
- package/src/i18n/styling.hi.ts +323 -0
- package/src/i18n/styling.ja.ts +317 -0
- package/src/i18n/styling.ko.ts +311 -0
- package/src/i18n/styling.pt-BR.ts +301 -0
- package/src/i18n/styling.ru.ts +301 -0
- package/src/i18n/styling.zh-CN.ts +307 -0
- package/src/i18n/temporal.ar.ts +31 -0
- package/src/i18n/temporal.de.ts +24 -0
- package/src/i18n/temporal.es.ts +27 -0
- package/src/i18n/temporal.fr.ts +28 -0
- package/src/i18n/temporal.he.ts +31 -0
- package/src/i18n/temporal.hi.ts +31 -0
- package/src/i18n/temporal.ja.ts +31 -0
- package/src/i18n/temporal.ko.ts +31 -0
- package/src/i18n/temporal.pt-BR.ts +31 -0
- package/src/i18n/temporal.ru.ts +31 -0
- package/src/i18n/temporal.zh-CN.ts +31 -0
- package/src/i18n/transitions.ar.ts +97 -0
- package/src/i18n/transitions.de.ts +97 -0
- package/src/i18n/transitions.es.ts +97 -0
- package/src/i18n/transitions.fr.ts +97 -0
- package/src/i18n/transitions.he.ts +97 -0
- package/src/i18n/transitions.hi.ts +97 -0
- package/src/i18n/transitions.ja.ts +97 -0
- package/src/i18n/transitions.ko.ts +97 -0
- package/src/i18n/transitions.pt-BR.ts +97 -0
- package/src/i18n/transitions.ru.ts +97 -0
- package/src/i18n/transitions.zh-CN.ts +97 -0
- package/src/i18n/types.ts +158 -0
- package/src/i18n/vehicles.ar.ts +137 -0
- package/src/i18n/vehicles.de.ts +125 -0
- package/src/i18n/vehicles.es.ts +138 -0
- package/src/i18n/vehicles.fr.ts +125 -0
- package/src/i18n/vehicles.he.ts +136 -0
- package/src/i18n/vehicles.hi.ts +138 -0
- package/src/i18n/vehicles.ja.ts +138 -0
- package/src/i18n/vehicles.ko.ts +138 -0
- package/src/i18n/vehicles.pt-BR.ts +136 -0
- package/src/i18n/vehicles.ru.ts +136 -0
- package/src/i18n/vehicles.zh-CN.ts +136 -0
- package/src/i18n/voice-character.ar.ts +126 -0
- package/src/i18n/voice-character.de.ts +126 -0
- package/src/i18n/voice-character.es.ts +126 -0
- package/src/i18n/voice-character.fr.ts +126 -0
- package/src/i18n/voice-character.he.ts +126 -0
- package/src/i18n/voice-character.hi.ts +126 -0
- package/src/i18n/voice-character.ja.ts +126 -0
- package/src/i18n/voice-character.ko.ts +126 -0
- package/src/i18n/voice-character.pt-BR.ts +126 -0
- package/src/i18n/voice-character.ru.ts +126 -0
- package/src/i18n/voice-character.zh-CN.ts +126 -0
- package/src/i18n/voice-delivery.ar.ts +77 -0
- package/src/i18n/voice-delivery.de.ts +77 -0
- package/src/i18n/voice-delivery.es.ts +77 -0
- package/src/i18n/voice-delivery.fr.ts +77 -0
- package/src/i18n/voice-delivery.he.ts +77 -0
- package/src/i18n/voice-delivery.hi.ts +77 -0
- package/src/i18n/voice-delivery.ja.ts +77 -0
- package/src/i18n/voice-delivery.ko.ts +77 -0
- package/src/i18n/voice-delivery.pt-BR.ts +77 -0
- package/src/i18n/voice-delivery.ru.ts +77 -0
- package/src/i18n/voice-delivery.zh-CN.ts +77 -0
- package/src/i18n/weapons.ar.ts +115 -0
- package/src/i18n/weapons.de.ts +114 -0
- package/src/i18n/weapons.es.ts +116 -0
- package/src/i18n/weapons.fr.ts +103 -0
- package/src/i18n/weapons.he.ts +114 -0
- package/src/i18n/weapons.hi.ts +116 -0
- package/src/i18n/weapons.ja.ts +116 -0
- package/src/i18n/weapons.ko.ts +116 -0
- package/src/i18n/weapons.pt-BR.ts +114 -0
- package/src/i18n/weapons.ru.ts +114 -0
- package/src/i18n/weapons.zh-CN.ts +114 -0
- package/src/image-critic-node.ts +61 -0
- package/src/image-critic-types.ts +40 -0
- package/src/index.ts +866 -0
- package/src/inject-upstream.ts +15 -0
- package/src/inpaint-region.ts +51 -0
- package/src/json-evaluator.ts +732 -0
- package/src/json-path.ts +52 -0
- package/src/lip-sync-pricing.ts +90 -0
- package/src/list-merge.ts +40 -0
- package/src/list-sort.ts +122 -0
- package/src/list-source-resolver.ts +50 -0
- package/src/llm-models.ts +245 -0
- package/src/location-mention-slug.ts +291 -0
- package/src/location-preset-catalog-map.ts +128 -0
- package/src/loop-delimiter.ts +73 -0
- package/src/lora-routing.ts +95 -0
- package/src/lottie-overlay-catalog.ts +175 -0
- package/src/lottie-slots.ts +309 -0
- package/src/model-catalog.ts +2386 -0
- package/src/model-constants.ts +1910 -0
- package/src/model-tree.ts +120 -0
- package/src/monetization.ts +15 -0
- package/src/multi-pick.ts +42 -0
- package/src/node-default-mappings.ts +262 -0
- package/src/node-mappable-fields.ts +70 -0
- package/src/node-preset-export.ts +56 -0
- package/src/node-preset-extract.ts +147 -0
- package/src/node-refs.ts +253 -0
- package/src/node-runtime-keys.ts +117 -0
- package/src/object-aspect-defaults.ts +72 -0
- package/src/object-picker-types.ts +22 -0
- package/src/parameter-node-value.ts +284 -0
- package/src/pinterest-url.ts +28 -0
- package/src/pipeline-chat.ts +72 -0
- package/src/pipeline-defaults.ts +318 -0
- package/src/pipeline-events.ts +162 -0
- package/src/pipeline-state-types.ts +196 -0
- package/src/pipeline-types.ts +647 -0
- package/src/pipeline-validation.ts +87 -0
- package/src/presentation-types.ts +23 -0
- package/src/presentation-utils.ts +397 -0
- package/src/producer-types.ts +188 -0
- package/src/progress-curve.ts +99 -0
- package/src/provider-directive-defaults.ts +69 -0
- package/src/reduce-strategy-registry.ts +121 -0
- package/src/reference-board-templates.ts +81 -0
- package/src/reference-roles.ts +153 -0
- package/src/reference-sheet/__tests__/board-to-column.test.ts +20 -0
- package/src/reference-sheet/__tests__/catalog.test.ts +50 -0
- package/src/reference-sheet/__tests__/cost.test.ts +38 -0
- package/src/reference-sheet/__tests__/no-drift.test.ts +28 -0
- package/src/reference-sheet/__tests__/panel-plan.test.ts +61 -0
- package/src/reference-sheet/__tests__/panel-prompts.test.ts +17 -0
- package/src/reference-sheet/__tests__/plan-generation.test.ts +72 -0
- package/src/reference-sheet/__tests__/presets.test.ts +54 -0
- package/src/reference-sheet/__tests__/types.test.ts +24 -0
- package/src/reference-sheet/catalog.ts +144 -0
- package/src/reference-sheet/cost.ts +37 -0
- package/src/reference-sheet/credit-id.ts +7 -0
- package/src/reference-sheet/index.ts +8 -0
- package/src/reference-sheet/panel-plan.ts +65 -0
- package/src/reference-sheet/panel-prompts.ts +14 -0
- package/src/reference-sheet/plan-generation.ts +79 -0
- package/src/reference-sheet/presets.ts +77 -0
- package/src/reference-sheet/types.ts +92 -0
- package/src/repeat-types.ts +97 -0
- package/src/resolve-field-mappings.ts +119 -0
- package/src/route-filter.ts +80 -0
- package/src/scene-helper-types.ts +249 -0
- package/src/scene-node-types.ts +281 -0
- package/src/scraper-actors.ts +57 -0
- package/src/scraper-output-schemas.ts +25 -0
- package/src/seasons.ts +45 -0
- package/src/selector.ts +864 -0
- package/src/settled-with-limit.ts +42 -0
- package/src/shot-element.ts +43 -0
- package/src/social-media-specs.ts +121 -0
- package/src/social-post.ts +24 -0
- package/src/sub-workflow-validation.ts +78 -0
- package/src/supported-fonts.ts +40 -0
- package/src/surround.ts +113 -0
- package/src/switchx-pricing.ts +33 -0
- package/src/text-separators.ts +59 -0
- package/src/to-connected-references.ts +77 -0
- package/src/types.ts +272 -0
- package/src/variant-job-id.ts +17 -0
- package/src/vehicles.ts +213 -0
- package/src/video-analysis-pricing.ts +74 -0
- package/src/video-analysis.ts +127 -0
- package/src/video-duration.ts +25 -0
- package/src/voice-changer-models.ts +36 -0
- package/src/voice-matcher-types.ts +37 -0
- package/src/voices.ts +92 -0
- package/src/weapons.ts +190 -0
- package/src/workflow-export.ts +153 -0
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodaro/shared",
|
|
3
|
+
"version": "1.4.1",
|
|
4
|
+
"description": "Shared types, model catalog, wire contracts, and structural vocabularies for the Nodaro platform and SDK.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/nodaroai/app.nodaro.ai.git",
|
|
10
|
+
"directory": "packages/shared"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/nodaroai/app.nodaro.ai/tree/main/packages/shared#readme",
|
|
13
|
+
"bugs": "https://github.com/nodaroai/app.nodaro.ai/issues",
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"src",
|
|
31
|
+
"LICENSE"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"dev": "tsup --watch",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest",
|
|
38
|
+
"test:coverage": "vitest run --coverage"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"fast-json-patch": "^3.1.1",
|
|
42
|
+
"zod": "^3.24.2"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
46
|
+
"tsup": "^8.5.0",
|
|
47
|
+
"typescript": "^5.7.3",
|
|
48
|
+
"vitest": "^4.1.2",
|
|
49
|
+
"zod-to-json-schema": "^3.25.2"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`buildImagePrompt characterization (pre/post segment refactor) > produces stable output across the fixture matrix > connected references directives 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"nativeNegativePrompt": undefined,
|
|
6
|
+
"prompt": "Use these references for the output image:
|
|
7
|
+
- Image 1 (background — a stone castle) — use as the background/setting.
|
|
8
|
+
|
|
9
|
+
Compose them naturally into a single image: a knight at Image 1 (background)",
|
|
10
|
+
"referenceImageUrls": [
|
|
11
|
+
"https://example.com/castle.png",
|
|
12
|
+
],
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
exports[`buildImagePrompt characterization (pre/post segment refactor) > produces stable output across the fixture matrix > empty prompt + style 1`] = `
|
|
17
|
+
{
|
|
18
|
+
"nativeNegativePrompt": undefined,
|
|
19
|
+
"prompt": "
|
|
20
|
+
Style: film noir style, high-contrast black-and-white imagery, deep shadows, venetian-blind lighting and moody 1940s cinema feel",
|
|
21
|
+
"referenceImageUrls": undefined,
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
exports[`buildImagePrompt characterization (pre/post segment refactor) > produces stable output across the fixture matrix > negative appended as Avoid (no native field) 1`] = `
|
|
26
|
+
{
|
|
27
|
+
"nativeNegativePrompt": undefined,
|
|
28
|
+
"prompt": "a knight
|
|
29
|
+
Avoid: blurry, watermark",
|
|
30
|
+
"referenceImageUrls": undefined,
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
exports[`buildImagePrompt characterization (pre/post segment refactor) > produces stable output across the fixture matrix > negative native (imagen4) 1`] = `
|
|
35
|
+
{
|
|
36
|
+
"nativeNegativePrompt": "blurry",
|
|
37
|
+
"prompt": "a knight",
|
|
38
|
+
"referenceImageUrls": undefined,
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
exports[`buildImagePrompt characterization (pre/post segment refactor) > produces stable output across the fixture matrix > plain prompt 1`] = `
|
|
43
|
+
{
|
|
44
|
+
"nativeNegativePrompt": undefined,
|
|
45
|
+
"prompt": "a knight on a cliff",
|
|
46
|
+
"referenceImageUrls": undefined,
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
exports[`buildImagePrompt characterization (pre/post segment refactor) > produces stable output across the fixture matrix > style appended 1`] = `
|
|
51
|
+
{
|
|
52
|
+
"nativeNegativePrompt": undefined,
|
|
53
|
+
"prompt": "a knight
|
|
54
|
+
Style: cinematic film style, dramatic lighting with cinematic color grading, widescreen aesthetic and film-like depth of field",
|
|
55
|
+
"referenceImageUrls": undefined,
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`buildImagePrompt characterization (pre/post segment refactor) > produces stable output across the fixture matrix > truncation 1`] = `
|
|
60
|
+
{
|
|
61
|
+
"nativeNegativePrompt": undefined,
|
|
62
|
+
"prompt": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
63
|
+
"referenceImageUrls": undefined,
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import {
|
|
3
|
+
AI_AVATAR_MAX_DURATION_SEC,
|
|
4
|
+
AI_AVATAR_MAX_AUDIO_SEC,
|
|
5
|
+
AI_AVATAR_DURATION_BUCKETS,
|
|
6
|
+
AI_AVATAR_AUDIO_FALLBACK_SEC,
|
|
7
|
+
AI_AVATAR_RESERVE_IDS,
|
|
8
|
+
aiAvatarReserveCreditId,
|
|
9
|
+
resolveAiAvatarCreditId,
|
|
10
|
+
estimateScriptDurationSec,
|
|
11
|
+
pickAiAvatarBucket,
|
|
12
|
+
} from "../ai-avatar-pricing.js"
|
|
13
|
+
|
|
14
|
+
// The provider-$ rate table and USD/credit cost formulas (aiAvatarUsdCost,
|
|
15
|
+
// aiAvatarHoldCredits, aiAvatarReserveCeilingUsd) moved to
|
|
16
|
+
// backend/src/lib/pricing/ai-avatar-cost.ts (S5) — their tests live in
|
|
17
|
+
// backend/src/lib/pricing/__tests__/ai-avatar-cost.test.ts. This file covers
|
|
18
|
+
// only the NON-monetary duration-bucketing + credit-id-construction logic
|
|
19
|
+
// that stays in the published package.
|
|
20
|
+
|
|
21
|
+
describe("estimateScriptDurationSec", () => {
|
|
22
|
+
it("returns 1 for empty/missing script", () => {
|
|
23
|
+
expect(estimateScriptDurationSec(undefined)).toBe(1)
|
|
24
|
+
expect(estimateScriptDurationSec("")).toBe(1)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it("ceil-divides by 12 chars/sec at default speed 1", () => {
|
|
28
|
+
expect(estimateScriptDurationSec("x".repeat(360))).toBe(30)
|
|
29
|
+
expect(estimateScriptDurationSec("x".repeat(361))).toBe(31)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it("minimum is 1 even for very short scripts", () => {
|
|
33
|
+
expect(estimateScriptDurationSec("hi")).toBe(1)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it("slower voiceSpeed produces more seconds (no undercharge)", () => {
|
|
37
|
+
expect(estimateScriptDurationSec("x".repeat(1200), 1.0)).toBe(100)
|
|
38
|
+
expect(estimateScriptDurationSec("x".repeat(1200), 0.5)).toBe(200)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it("faster voiceSpeed produces fewer seconds", () => {
|
|
42
|
+
expect(estimateScriptDurationSec("x".repeat(1200), 1.5)).toBe(67)
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it("clamps voiceSpeed to [0.5, 1.5]", () => {
|
|
46
|
+
expect(estimateScriptDurationSec("x".repeat(1200), 0.1)).toBe(
|
|
47
|
+
estimateScriptDurationSec("x".repeat(1200), 0.5),
|
|
48
|
+
)
|
|
49
|
+
expect(estimateScriptDurationSec("x".repeat(1200), 2.0)).toBe(
|
|
50
|
+
estimateScriptDurationSec("x".repeat(1200), 1.5),
|
|
51
|
+
)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it("5000-char script at voiceSpeed 0.5 fits within 900s bucket", () => {
|
|
55
|
+
const duration = estimateScriptDurationSec("x".repeat(5000), 0.5)
|
|
56
|
+
expect(duration).toBeLessThanOrEqual(900)
|
|
57
|
+
expect(pickAiAvatarBucket(duration)).toBe(900)
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
describe("AI_AVATAR_DURATION_BUCKETS (fine-grained low end)", () => {
|
|
62
|
+
it("has 10 buckets: 5/10/15/30/60/120/240/360/600/900s", () => {
|
|
63
|
+
expect([...AI_AVATAR_DURATION_BUCKETS]).toEqual([5, 10, 15, 30, 60, 120, 240, 360, 600, 900])
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
describe("pickAiAvatarBucket", () => {
|
|
68
|
+
it("picks the smallest bucket >= sec (fine low end)", () => {
|
|
69
|
+
expect(pickAiAvatarBucket(1)).toBe(5)
|
|
70
|
+
expect(pickAiAvatarBucket(5)).toBe(5)
|
|
71
|
+
expect(pickAiAvatarBucket(6)).toBe(10)
|
|
72
|
+
expect(pickAiAvatarBucket(10)).toBe(10)
|
|
73
|
+
expect(pickAiAvatarBucket(11)).toBe(15)
|
|
74
|
+
expect(pickAiAvatarBucket(15)).toBe(15)
|
|
75
|
+
expect(pickAiAvatarBucket(16)).toBe(30)
|
|
76
|
+
expect(pickAiAvatarBucket(30)).toBe(30)
|
|
77
|
+
expect(pickAiAvatarBucket(31)).toBe(60)
|
|
78
|
+
expect(pickAiAvatarBucket(60)).toBe(60)
|
|
79
|
+
expect(pickAiAvatarBucket(61)).toBe(120)
|
|
80
|
+
expect(pickAiAvatarBucket(120)).toBe(120)
|
|
81
|
+
expect(pickAiAvatarBucket(121)).toBe(240)
|
|
82
|
+
expect(pickAiAvatarBucket(240)).toBe(240)
|
|
83
|
+
expect(pickAiAvatarBucket(241)).toBe(360)
|
|
84
|
+
expect(pickAiAvatarBucket(360)).toBe(360)
|
|
85
|
+
expect(pickAiAvatarBucket(361)).toBe(600)
|
|
86
|
+
expect(pickAiAvatarBucket(600)).toBe(600)
|
|
87
|
+
expect(pickAiAvatarBucket(601)).toBe(900)
|
|
88
|
+
expect(pickAiAvatarBucket(900)).toBe(900)
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it("falls back to max bucket (900) when sec exceeds all buckets", () => {
|
|
92
|
+
expect(pickAiAvatarBucket(901)).toBe(900)
|
|
93
|
+
expect(pickAiAvatarBucket(9999)).toBe(900)
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
describe("aiAvatarReserveCreditId", () => {
|
|
98
|
+
it("builds correct bucketed composite IDs", () => {
|
|
99
|
+
expect(aiAvatarReserveCreditId("avatar-iv", "720p", 5)).toBe("heygen-avatar-iv:720p:5s")
|
|
100
|
+
expect(aiAvatarReserveCreditId("avatar-iv", "720p", 15)).toBe("heygen-avatar-iv:720p:15s")
|
|
101
|
+
expect(aiAvatarReserveCreditId("avatar-iv", "720p", 900)).toBe("heygen-avatar-iv:720p:900s")
|
|
102
|
+
expect(aiAvatarReserveCreditId("avatar-iv", "1080p", 60)).toBe("heygen-avatar-iv:1080p:60s")
|
|
103
|
+
expect(aiAvatarReserveCreditId("avatar-iv", "4k", 120)).toBe("heygen-avatar-iv:4k:120s")
|
|
104
|
+
expect(aiAvatarReserveCreditId("avatar-v", "720p", 30)).toBe("heygen-avatar-v:720p:30s")
|
|
105
|
+
expect(aiAvatarReserveCreditId("avatar-v", "1080p", 240)).toBe("heygen-avatar-v:1080p:240s")
|
|
106
|
+
expect(aiAvatarReserveCreditId("avatar-v", "4k", 900)).toBe("heygen-avatar-v:4k:900s")
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
describe("resolveAiAvatarCreditId", () => {
|
|
111
|
+
it("text mode: uses script length to pick bucket", () => {
|
|
112
|
+
// 360 chars → 30s → bucket 30
|
|
113
|
+
expect(resolveAiAvatarCreditId({ speechMode: "text", script: "x".repeat(360) }))
|
|
114
|
+
.toBe("heygen-avatar-iv:720p:30s")
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it("text mode: short script lands in the fine low-end bucket", () => {
|
|
118
|
+
// 120 chars → ceil(120/12)=10s → bucket 10
|
|
119
|
+
expect(resolveAiAvatarCreditId({ speechMode: "text", script: "x".repeat(120) }))
|
|
120
|
+
.toBe("heygen-avatar-iv:720p:10s")
|
|
121
|
+
// 50 chars → ceil(50/12)=5s → bucket 5
|
|
122
|
+
expect(resolveAiAvatarCreditId({ speechMode: "text", script: "x".repeat(50) }))
|
|
123
|
+
.toBe("heygen-avatar-iv:720p:5s")
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
it("text mode with slow voiceSpeed: 1200 chars at 0.5× → 200s → bucket 240s", () => {
|
|
127
|
+
expect(
|
|
128
|
+
resolveAiAvatarCreditId({ speechMode: "text", script: "x".repeat(1200), voiceSpeed: 0.5 }),
|
|
129
|
+
).toBe("heygen-avatar-iv:720p:240s")
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it("text mode: 5000-char script at 0.5× → bucket 900s (worst-case coverage)", () => {
|
|
133
|
+
expect(
|
|
134
|
+
resolveAiAvatarCreditId({ speechMode: "text", script: "x".repeat(5000), voiceSpeed: 0.5 }),
|
|
135
|
+
).toBe("heygen-avatar-iv:720p:900s")
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
it("audio mode WITHOUT probe: modest 120s default (NOT 900s)", () => {
|
|
139
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio" }))
|
|
140
|
+
.toBe("heygen-avatar-iv:720p:120s")
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
it("audio mode WITH __probedDurationSec: buckets by the probed length", () => {
|
|
144
|
+
// 15s probed audio → bucket 15s (the user-reported scenario)
|
|
145
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: 15 }))
|
|
146
|
+
.toBe("heygen-avatar-iv:720p:15s")
|
|
147
|
+
// 7.3s probed → ceil = 8 → bucket 10s
|
|
148
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: 7.3 }))
|
|
149
|
+
.toBe("heygen-avatar-iv:720p:10s")
|
|
150
|
+
// 200s probed → bucket 240s
|
|
151
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: 200 }))
|
|
152
|
+
.toBe("heygen-avatar-iv:720p:240s")
|
|
153
|
+
// probed > 600 (the audio cap) → bucket 600s, NOT 900s. The worker trims
|
|
154
|
+
// audio to AI_AVATAR_MAX_AUDIO_SEC, so the reserve caps at the 600s bucket.
|
|
155
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: 1200 }))
|
|
156
|
+
.toBe("heygen-avatar-iv:720p:600s")
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
it("audio mode: invalid/zero probe falls back to the modest default", () => {
|
|
160
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: 0 }))
|
|
161
|
+
.toBe("heygen-avatar-iv:720p:120s")
|
|
162
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: -5 }))
|
|
163
|
+
.toBe("heygen-avatar-iv:720p:120s")
|
|
164
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: NaN }))
|
|
165
|
+
.toBe("heygen-avatar-iv:720p:120s")
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
it("missing speechMode: modest 120s default", () => {
|
|
169
|
+
expect(resolveAiAvatarCreditId({})).toBe("heygen-avatar-iv:720p:120s")
|
|
170
|
+
expect(resolveAiAvatarCreditId(undefined)).toBe("heygen-avatar-iv:720p:120s")
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
it("resolves valid engine + resolution", () => {
|
|
174
|
+
expect(resolveAiAvatarCreditId({ engine: "avatar-v", resolution: "1080p", speechMode: "audio", __probedDurationSec: 30 }))
|
|
175
|
+
.toBe("heygen-avatar-v:1080p:30s")
|
|
176
|
+
expect(resolveAiAvatarCreditId({ engine: "avatar-iv", resolution: "4k", speechMode: "audio", __probedDurationSec: 30 }))
|
|
177
|
+
.toBe("heygen-avatar-iv:4k:30s")
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it("falls back engine to avatar-iv on invalid value", () => {
|
|
181
|
+
expect(resolveAiAvatarCreditId({ engine: "bogus", speechMode: "audio" }))
|
|
182
|
+
.toBe("heygen-avatar-iv:720p:120s")
|
|
183
|
+
expect(resolveAiAvatarCreditId({ engine: "avatar-iii", speechMode: "audio" }))
|
|
184
|
+
.toBe("heygen-avatar-iv:720p:120s")
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
it("falls back resolution to 720p on invalid value", () => {
|
|
188
|
+
expect(resolveAiAvatarCreditId({ engine: "avatar-v", resolution: "360p", speechMode: "audio" }))
|
|
189
|
+
.toBe("heygen-avatar-v:720p:120s")
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
it("falls back both to defaults when both are invalid", () => {
|
|
193
|
+
expect(resolveAiAvatarCreditId({ engine: "bogus", resolution: "360p", speechMode: "audio" }))
|
|
194
|
+
.toBe("heygen-avatar-iv:720p:120s")
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
it("image source mode: bills at avatar-iv rate even when engine is avatar-v", () => {
|
|
198
|
+
expect(
|
|
199
|
+
resolveAiAvatarCreditId({
|
|
200
|
+
avatarSource: "image",
|
|
201
|
+
engine: "avatar-v",
|
|
202
|
+
resolution: "1080p",
|
|
203
|
+
speechMode: "audio",
|
|
204
|
+
__probedDurationSec: 30,
|
|
205
|
+
}),
|
|
206
|
+
).toBe("heygen-avatar-iv:1080p:30s")
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
it("image source mode: text-mode buckets by script length at the avatar-iv rate", () => {
|
|
210
|
+
expect(
|
|
211
|
+
resolveAiAvatarCreditId({
|
|
212
|
+
avatarSource: "image",
|
|
213
|
+
engine: "avatar-v",
|
|
214
|
+
speechMode: "text",
|
|
215
|
+
script: "x".repeat(360),
|
|
216
|
+
}),
|
|
217
|
+
).toBe("heygen-avatar-iv:720p:30s")
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
it("always resolves to a member of AI_AVATAR_RESERVE_IDS (no 503 trap)", () => {
|
|
221
|
+
const probes = [undefined, 0, 1, 7, 15, 30, 90, 200, 901]
|
|
222
|
+
for (const engine of ["avatar-iv", "avatar-v", "bogus"]) {
|
|
223
|
+
for (const resolution of ["720p", "1080p", "4k", "360p"]) {
|
|
224
|
+
for (const probe of probes) {
|
|
225
|
+
const audioId = resolveAiAvatarCreditId({ engine, resolution, speechMode: "audio", __probedDurationSec: probe })
|
|
226
|
+
expect(AI_AVATAR_RESERVE_IDS).toContain(audioId)
|
|
227
|
+
}
|
|
228
|
+
const textId = resolveAiAvatarCreditId({ engine, resolution, speechMode: "text", script: "x".repeat(2000) })
|
|
229
|
+
expect(AI_AVATAR_RESERVE_IDS).toContain(textId)
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
describe("AI_AVATAR_AUDIO_FALLBACK_SEC", () => {
|
|
236
|
+
it("is a modest 120s (not the 900s top bucket)", () => {
|
|
237
|
+
expect(AI_AVATAR_AUDIO_FALLBACK_SEC).toBe(120)
|
|
238
|
+
expect(AI_AVATAR_DURATION_BUCKETS).toContain(AI_AVATAR_AUDIO_FALLBACK_SEC)
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
describe("AI_AVATAR_RESERVE_IDS", () => {
|
|
243
|
+
it("contains exactly 60 unique ids (2 engines × 3 resolutions × 10 buckets)", () => {
|
|
244
|
+
expect(AI_AVATAR_RESERVE_IDS).toHaveLength(60)
|
|
245
|
+
expect(new Set(AI_AVATAR_RESERVE_IDS).size).toBe(60)
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
it("contains all expected bucket variants for avatar-iv:720p", () => {
|
|
249
|
+
for (const b of AI_AVATAR_DURATION_BUCKETS) {
|
|
250
|
+
expect(AI_AVATAR_RESERVE_IDS).toContain(`heygen-avatar-iv:720p:${b}s`)
|
|
251
|
+
}
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
it("contains all expected bucket variants for avatar-v:4k", () => {
|
|
255
|
+
for (const b of AI_AVATAR_DURATION_BUCKETS) {
|
|
256
|
+
expect(AI_AVATAR_RESERVE_IDS).toContain(`heygen-avatar-v:4k:${b}s`)
|
|
257
|
+
}
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
it("bucket set has 10 entries", () => {
|
|
261
|
+
expect(AI_AVATAR_DURATION_BUCKETS).toHaveLength(10)
|
|
262
|
+
})
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
describe("AI_AVATAR_MAX_DURATION_SEC", () => {
|
|
266
|
+
it("is 900 seconds (covers 5000-char@0.5× worst-case text)", () => {
|
|
267
|
+
expect(AI_AVATAR_MAX_DURATION_SEC).toBe(900)
|
|
268
|
+
})
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
describe("AI_AVATAR_MAX_AUDIO_SEC — audio-mode hard cap (worker trims + reserve caps)", () => {
|
|
272
|
+
it("is 600 seconds and is a real bucket", () => {
|
|
273
|
+
expect(AI_AVATAR_MAX_AUDIO_SEC).toBe(600)
|
|
274
|
+
expect(AI_AVATAR_DURATION_BUCKETS).toContain(AI_AVATAR_MAX_AUDIO_SEC)
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
it("a 1800s (30-min) probed audio reserves the 600s bucket, NOT 900s", () => {
|
|
278
|
+
expect(
|
|
279
|
+
resolveAiAvatarCreditId({
|
|
280
|
+
speechMode: "audio",
|
|
281
|
+
engine: "avatar-iv",
|
|
282
|
+
resolution: "720p",
|
|
283
|
+
__probedDurationSec: 1800,
|
|
284
|
+
}),
|
|
285
|
+
).toBe("heygen-avatar-iv:720p:600s")
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
it("a 450s probed audio reserves the 600s bucket (under the cap, normal bucket-up)", () => {
|
|
289
|
+
expect(
|
|
290
|
+
resolveAiAvatarCreditId({
|
|
291
|
+
speechMode: "audio",
|
|
292
|
+
engine: "avatar-iv",
|
|
293
|
+
resolution: "720p",
|
|
294
|
+
__probedDurationSec: 450,
|
|
295
|
+
}),
|
|
296
|
+
).toBe("heygen-avatar-iv:720p:600s")
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
it("exactly 600s probed audio stays in the 600s bucket", () => {
|
|
300
|
+
expect(resolveAiAvatarCreditId({ speechMode: "audio", __probedDurationSec: 600 }))
|
|
301
|
+
.toBe("heygen-avatar-iv:720p:600s")
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
it("clamps audio across engines/resolutions to the 600s bucket", () => {
|
|
305
|
+
expect(
|
|
306
|
+
resolveAiAvatarCreditId({
|
|
307
|
+
speechMode: "audio",
|
|
308
|
+
engine: "avatar-v",
|
|
309
|
+
resolution: "1080p",
|
|
310
|
+
__probedDurationSec: 3600,
|
|
311
|
+
}),
|
|
312
|
+
).toBe("heygen-avatar-v:1080p:600s")
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
it("does NOT affect text mode — text can still reach the 900s bucket", () => {
|
|
316
|
+
// 5000 chars at 0.5× → 834s → 900s bucket, unchanged by the audio cap.
|
|
317
|
+
expect(
|
|
318
|
+
resolveAiAvatarCreditId({ speechMode: "text", script: "x".repeat(5000), voiceSpeed: 0.5 }),
|
|
319
|
+
).toBe("heygen-avatar-iv:720p:900s")
|
|
320
|
+
})
|
|
321
|
+
})
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { applyVideoNegativePrompt, NATIVE_NEGATIVE_VIDEO_PROVIDERS } from "../model-constants.js"
|
|
3
|
+
|
|
4
|
+
describe("applyVideoNegativePrompt", () => {
|
|
5
|
+
it("returns prompt unchanged + nativeNegativePrompt when provider is native", () => {
|
|
6
|
+
const result = applyVideoNegativePrompt("a cat dancing", "blurry, distorted", "kling")
|
|
7
|
+
expect(result.prompt).toBe("a cat dancing")
|
|
8
|
+
expect(result.nativeNegativePrompt).toBe("blurry, distorted")
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it("injects 'Avoid: …' into prompt for non-native providers", () => {
|
|
12
|
+
const result = applyVideoNegativePrompt("a cat dancing", "blurry, distorted", "wan-animate-move")
|
|
13
|
+
expect(result.prompt).toBe("a cat dancing\nAvoid: blurry, distorted")
|
|
14
|
+
expect(result.nativeNegativePrompt).toBeUndefined()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it("returns 'Avoid: …' alone when prompt is empty and provider is non-native", () => {
|
|
18
|
+
const result = applyVideoNegativePrompt("", "blurry", "veo3")
|
|
19
|
+
expect(result.prompt).toBe("Avoid: blurry")
|
|
20
|
+
expect(result.nativeNegativePrompt).toBeUndefined()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it("returns 'Avoid: …' alone when prompt is undefined", () => {
|
|
24
|
+
const result = applyVideoNegativePrompt(undefined, "blurry", "veo3")
|
|
25
|
+
expect(result.prompt).toBe("Avoid: blurry")
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it("is a no-op when negativePrompt is empty", () => {
|
|
29
|
+
const result = applyVideoNegativePrompt("a cat", "", "kling")
|
|
30
|
+
expect(result.prompt).toBe("a cat")
|
|
31
|
+
expect(result.nativeNegativePrompt).toBeUndefined()
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it("is a no-op when negativePrompt is whitespace only", () => {
|
|
35
|
+
const result = applyVideoNegativePrompt("a cat", " ", "wan-animate-move")
|
|
36
|
+
expect(result.prompt).toBe("a cat")
|
|
37
|
+
expect(result.nativeNegativePrompt).toBeUndefined()
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it("is a no-op when negativePrompt is undefined", () => {
|
|
41
|
+
const result = applyVideoNegativePrompt("a cat", undefined, "wan-animate-move")
|
|
42
|
+
expect(result.prompt).toBe("a cat")
|
|
43
|
+
expect(result.nativeNegativePrompt).toBeUndefined()
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it("trims surrounding whitespace before sending native", () => {
|
|
47
|
+
const result = applyVideoNegativePrompt("a cat", " blurry ", "kling-3.0")
|
|
48
|
+
expect(result.nativeNegativePrompt).toBe("blurry")
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it("includes the Kling family in the native set", () => {
|
|
52
|
+
for (const p of ["kling", "kling-turbo", "kling-master", "kling-3.0", "kling-3-omni"]) {
|
|
53
|
+
expect(NATIVE_NEGATIVE_VIDEO_PROVIDERS.has(p)).toBe(true)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it("includes regular Wan in the native set but excludes Wan Animate", () => {
|
|
58
|
+
expect(NATIVE_NEGATIVE_VIDEO_PROVIDERS.has("wan")).toBe(true)
|
|
59
|
+
expect(NATIVE_NEGATIVE_VIDEO_PROVIDERS.has("wan-i2v")).toBe(true)
|
|
60
|
+
expect(NATIVE_NEGATIVE_VIDEO_PROVIDERS.has("wan-animate-move")).toBe(false)
|
|
61
|
+
expect(NATIVE_NEGATIVE_VIDEO_PROVIDERS.has("wan-animate-replace")).toBe(false)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it("excludes VEO / Hailuo / Sora / Bytedance / Grok families", () => {
|
|
65
|
+
for (const p of [
|
|
66
|
+
"veo3", "veo3.1", "veo3_lite",
|
|
67
|
+
"minimax", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard",
|
|
68
|
+
"sora2", "sora2-pro",
|
|
69
|
+
"bytedance-lite", "bytedance-pro",
|
|
70
|
+
"grok", "grok-i2v",
|
|
71
|
+
"seedance", "seedance-2",
|
|
72
|
+
]) {
|
|
73
|
+
expect(NATIVE_NEGATIVE_VIDEO_PROVIDERS.has(p)).toBe(false)
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { CHARACTER_ATTACH_COLUMNS, OBJECT_ATTACH_COLUMNS, LOCATION_ATTACH_COLUMNS, CREATURE_ATTACH_COLUMNS } from "../entity-asset-types.js"
|
|
3
|
+
|
|
4
|
+
describe("attach columns include the reference-sheet buckets", () => {
|
|
5
|
+
it("character gains sheets, detail_closeups, outfit_variations", () => {
|
|
6
|
+
for (const c of ["sheets", "detail_closeups", "outfit_variations"]) expect(CHARACTER_ATTACH_COLUMNS).toContain(c)
|
|
7
|
+
// originals preserved
|
|
8
|
+
for (const c of ["expressions", "poses", "angles", "body_angles", "lighting_variations"]) expect(CHARACTER_ATTACH_COLUMNS).toContain(c)
|
|
9
|
+
})
|
|
10
|
+
it("object gains sheets, detail_closeups (NOT outfit_variations)", () => {
|
|
11
|
+
for (const c of ["sheets", "detail_closeups"]) expect(OBJECT_ATTACH_COLUMNS).toContain(c)
|
|
12
|
+
expect(OBJECT_ATTACH_COLUMNS).not.toContain("outfit_variations")
|
|
13
|
+
for (const c of ["angles", "materials", "variations", "motion_clips"]) expect(OBJECT_ATTACH_COLUMNS).toContain(c)
|
|
14
|
+
})
|
|
15
|
+
it("location gains sheets, detail_closeups", () => {
|
|
16
|
+
for (const c of ["sheets", "detail_closeups"]) expect(LOCATION_ATTACH_COLUMNS).toContain(c)
|
|
17
|
+
for (const c of ["time_of_day", "weather", "seasons", "angles", "lighting", "atmosphere_motions"]) expect(LOCATION_ATTACH_COLUMNS).toContain(c)
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
describe("CREATURE_ATTACH_COLUMNS", () => {
|
|
22
|
+
it("has the worker-attachable creature asset columns (poses, not materials)", () => {
|
|
23
|
+
expect([...CREATURE_ATTACH_COLUMNS].sort()).toEqual(
|
|
24
|
+
["angles", "detail_closeups", "motion_clips", "poses", "sheets", "variations"].sort(),
|
|
25
|
+
)
|
|
26
|
+
expect(CREATURE_ATTACH_COLUMNS).not.toContain("materials")
|
|
27
|
+
})
|
|
28
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import {
|
|
3
|
+
AUDIO_CROSSFADE_CURVES,
|
|
4
|
+
AUDIO_CROSSFADE_CURVE_IDS,
|
|
5
|
+
DEFAULT_AUDIO_CROSSFADE_CURVE_ID,
|
|
6
|
+
resolveAudioCrossfadeCurve,
|
|
7
|
+
} from "../audio-crossfade-curves.js"
|
|
8
|
+
|
|
9
|
+
describe("AUDIO_CROSSFADE_CURVES catalog", () => {
|
|
10
|
+
it("has unique ids and ffmpeg names", () => {
|
|
11
|
+
const ids = AUDIO_CROSSFADE_CURVES.map((c) => c.id)
|
|
12
|
+
const ffmpeg = AUDIO_CROSSFADE_CURVES.map((c) => c.ffmpeg)
|
|
13
|
+
expect(new Set(ids).size).toBe(ids.length)
|
|
14
|
+
expect(new Set(ffmpeg).size).toBe(ffmpeg.length)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it("default id exists in the catalog", () => {
|
|
18
|
+
expect(AUDIO_CROSSFADE_CURVE_IDS).toContain(DEFAULT_AUDIO_CROSSFADE_CURVE_ID)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it("resolveAudioCrossfadeCurve maps known ids to acrossfade names", () => {
|
|
22
|
+
expect(resolveAudioCrossfadeCurve("linear")).toBe("tri")
|
|
23
|
+
expect(resolveAudioCrossfadeCurve("equal-power")).toBe("qsin")
|
|
24
|
+
expect(resolveAudioCrossfadeCurve("smooth")).toBe("hsin")
|
|
25
|
+
expect(resolveAudioCrossfadeCurve("logarithmic")).toBe("log")
|
|
26
|
+
expect(resolveAudioCrossfadeCurve("exponential")).toBe("exp")
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it("resolveAudioCrossfadeCurve falls back to `tri` for undefined or unknown", () => {
|
|
30
|
+
expect(resolveAudioCrossfadeCurve(undefined)).toBe("tri")
|
|
31
|
+
expect(resolveAudioCrossfadeCurve("not-a-curve")).toBe("tri")
|
|
32
|
+
})
|
|
33
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import {
|
|
3
|
+
buildModelMenu,
|
|
4
|
+
resolutionOptionsByKind,
|
|
5
|
+
aspectRatioOptionsByKind,
|
|
6
|
+
durationsByMode,
|
|
7
|
+
} from "../model-catalog.js"
|
|
8
|
+
|
|
9
|
+
// Real catalog ids (asserted to exist, kinds asserted) — no catalog mocking, so
|
|
10
|
+
// the test pins behavior against the live catalog and the accessor helpers it
|
|
11
|
+
// composes. Expected capabilities are DERIVED from those accessors below so the
|
|
12
|
+
// assertions track catalog changes instead of hardcoding seconds/resolutions.
|
|
13
|
+
const IMG_A = "flux-2-max"
|
|
14
|
+
const IMG_B = "nano-banana-pro"
|
|
15
|
+
const VID = "veo3"
|
|
16
|
+
|
|
17
|
+
describe("buildModelMenu", () => {
|
|
18
|
+
it("preserves allowlist order and drops ids absent from the catalog", () => {
|
|
19
|
+
const rows = buildModelMenu("image", [IMG_A, "does-not-exist", IMG_B])
|
|
20
|
+
expect(rows.map((r) => r.id)).toEqual([IMG_A, IMG_B])
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it("drops ids of the wrong kind (a video id under kind: image)", () => {
|
|
24
|
+
expect(buildModelMenu("image", [VID])).toEqual([])
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it("derives resolutions / aspectRatios from the kind-scoped accessors", () => {
|
|
28
|
+
const [row] = buildModelMenu("image", [IMG_B])
|
|
29
|
+
expect(row.resolutions).toEqual(resolutionOptionsByKind("image")[IMG_B])
|
|
30
|
+
expect(row.aspectRatios).toEqual(aspectRatioOptionsByKind("image")[IMG_B])
|
|
31
|
+
// Image models have no i2v/t2v modes → no duration lever.
|
|
32
|
+
expect(row.durations).toEqual([])
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it("derives video durations as the sorted-unique i2v+t2v union, mapped to {value,label}", () => {
|
|
36
|
+
const i2v = durationsByMode("i2v")
|
|
37
|
+
const t2v = durationsByMode("t2v")
|
|
38
|
+
const expected = Array.from(new Set([...(i2v[VID] ?? []), ...(t2v[VID] ?? [])]))
|
|
39
|
+
.sort((a, b) => a - b)
|
|
40
|
+
.map((n) => ({ value: n, label: `${n}s` }))
|
|
41
|
+
// Guard the fixture itself: VID must actually carry durations, else the
|
|
42
|
+
// assertion would pass vacuously on an empty union.
|
|
43
|
+
expect(expected.length).toBeGreaterThan(0)
|
|
44
|
+
|
|
45
|
+
const [row] = buildModelMenu("video", [VID])
|
|
46
|
+
expect(row.durations).toEqual(expected)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it("returns fresh arrays — mutating one row never affects a later call", () => {
|
|
50
|
+
const first = buildModelMenu("image", [IMG_B])
|
|
51
|
+
first[0].resolutions.push({ value: "tampered", label: "tampered" })
|
|
52
|
+
first[0].aspectRatios.push({ value: "tampered", label: "tampered" })
|
|
53
|
+
|
|
54
|
+
const second = buildModelMenu("image", [IMG_B])
|
|
55
|
+
expect(second[0].resolutions).toEqual(resolutionOptionsByKind("image")[IMG_B])
|
|
56
|
+
expect(second[0].aspectRatios).toEqual(aspectRatioOptionsByKind("image")[IMG_B])
|
|
57
|
+
})
|
|
58
|
+
})
|