@nodaro/shared 3.33.0 → 3.36.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/{chunk-CK3GK34R.js → chunk-2HIDE3QV.js} +9 -3
- package/dist/chunk-2HIDE3QV.js.map +1 -0
- package/dist/{chunk-WDIBOWAA.js → chunk-2HVFF5SS.js} +6 -6
- package/dist/chunk-2HVFF5SS.js.map +1 -0
- package/dist/{chunk-PVJBAPYJ.js → chunk-56VQ7V3V.js} +8 -5
- package/dist/chunk-56VQ7V3V.js.map +1 -0
- package/dist/{chunk-Z2OL5AJD.cjs → chunk-6F6GGX2W.cjs} +4 -3
- package/dist/chunk-6F6GGX2W.cjs.map +1 -0
- package/dist/{chunk-HKFMXNVQ.cjs → chunk-75ZMA34U.cjs} +11 -11
- package/dist/{chunk-HKFMXNVQ.cjs.map → chunk-75ZMA34U.cjs.map} +1 -1
- package/dist/{chunk-6WZ2VN7V.js → chunk-7AB3AE5L.js} +6 -6
- package/dist/{chunk-6WZ2VN7V.js.map → chunk-7AB3AE5L.js.map} +1 -1
- package/dist/{chunk-VXPLKQWY.cjs → chunk-7VQPHLZ5.cjs} +30 -40
- package/dist/chunk-7VQPHLZ5.cjs.map +1 -0
- package/dist/{chunk-BG5D5CZ6.js → chunk-ANOQWAMU.js} +23 -6
- package/dist/chunk-ANOQWAMU.js.map +1 -0
- package/dist/{chunk-PRYE7AZQ.cjs → chunk-AWWOQH46.cjs} +7 -7
- package/dist/chunk-AWWOQH46.cjs.map +1 -0
- package/dist/{chunk-PXFQVLBX.js → chunk-AXUW64ZY.js} +26 -36
- package/dist/chunk-AXUW64ZY.js.map +1 -0
- package/dist/{chunk-FT5CF6IA.js → chunk-AZBIXGM5.js} +3 -3
- package/dist/{chunk-FT5CF6IA.js.map → chunk-AZBIXGM5.js.map} +1 -1
- package/dist/{chunk-D6GNRSCV.cjs → chunk-BBLE4UTG.cjs} +23 -6
- package/dist/chunk-BBLE4UTG.cjs.map +1 -0
- package/dist/{chunk-HUR6ZJ7S.cjs → chunk-BSQCKTXH.cjs} +6 -6
- package/dist/{chunk-HUR6ZJ7S.cjs.map → chunk-BSQCKTXH.cjs.map} +1 -1
- package/dist/{chunk-HGC5JNVA.cjs → chunk-BVVKMQKR.cjs} +9 -2
- package/dist/chunk-BVVKMQKR.cjs.map +1 -0
- package/dist/{chunk-SAW5OK36.cjs → chunk-BYP62B7F.cjs} +6 -6
- package/dist/{chunk-SAW5OK36.cjs.map → chunk-BYP62B7F.cjs.map} +1 -1
- package/dist/{chunk-YYV35XOS.js → chunk-C4R7BTBQ.js} +4 -3
- package/dist/chunk-C4R7BTBQ.js.map +1 -0
- package/dist/{chunk-UCFWI6D4.js → chunk-CMH2ACOX.js} +3 -3
- package/dist/{chunk-UCFWI6D4.js.map → chunk-CMH2ACOX.js.map} +1 -1
- package/dist/{chunk-WD6HJRBG.cjs → chunk-DE3PEIIP.cjs} +21 -21
- package/dist/{chunk-WD6HJRBG.cjs.map → chunk-DE3PEIIP.cjs.map} +1 -1
- package/dist/{chunk-SFW3UB2P.js → chunk-DKTRVOU5.js} +4 -4
- package/dist/{chunk-SFW3UB2P.js.map → chunk-DKTRVOU5.js.map} +1 -1
- package/dist/{chunk-YBPBK5KI.js → chunk-FKQJYMCO.js} +97 -23
- package/dist/chunk-FKQJYMCO.js.map +1 -0
- package/dist/{chunk-ZDFHA2EC.js → chunk-FVKCNAEQ.js} +51 -7
- package/dist/chunk-FVKCNAEQ.js.map +1 -0
- package/dist/{chunk-OZSACQ2V.js → chunk-GW54ANCH.js} +3 -3
- package/dist/{chunk-OZSACQ2V.js.map → chunk-GW54ANCH.js.map} +1 -1
- package/dist/chunk-GZH2SIOF.cjs +99 -0
- package/dist/chunk-GZH2SIOF.cjs.map +1 -0
- package/dist/{chunk-M7GQBRZU.cjs → chunk-HABDAHZR.cjs} +153 -24
- package/dist/chunk-HABDAHZR.cjs.map +1 -0
- package/dist/{chunk-CUH22J4D.js → chunk-IIGKJYWL.js} +3 -3
- package/dist/{chunk-CUH22J4D.js.map → chunk-IIGKJYWL.js.map} +1 -1
- package/dist/{chunk-JL4C5VJ7.cjs → chunk-J65CAOUV.cjs} +14 -2
- package/dist/chunk-J65CAOUV.cjs.map +1 -0
- package/dist/{chunk-HRXEZ3SX.cjs → chunk-JABZNRXL.cjs} +4 -4
- package/dist/{chunk-HRXEZ3SX.cjs.map → chunk-JABZNRXL.cjs.map} +1 -1
- package/dist/{chunk-5RYLK3MQ.js → chunk-JMUHMLJP.js} +11 -6
- package/dist/chunk-JMUHMLJP.js.map +1 -0
- package/dist/{chunk-K3LLGRK7.cjs → chunk-KOP7UTQR.cjs} +72 -15
- package/dist/chunk-KOP7UTQR.cjs.map +1 -0
- package/dist/{chunk-HC7VKIV5.cjs → chunk-LT5IJO4Y.cjs} +49 -46
- package/dist/chunk-LT5IJO4Y.cjs.map +1 -0
- package/dist/{chunk-VA42637J.cjs → chunk-MSDECC3A.cjs} +46 -41
- package/dist/chunk-MSDECC3A.cjs.map +1 -0
- package/dist/{chunk-JFS3NWZ5.cjs → chunk-MSIIC6MY.cjs} +7 -4
- package/dist/chunk-MSIIC6MY.cjs.map +1 -0
- package/dist/{chunk-D26ENTN2.cjs → chunk-NITAUX3A.cjs} +80 -52
- package/dist/chunk-NITAUX3A.cjs.map +1 -0
- package/dist/{chunk-23FJQTEA.js → chunk-NTHRTRQK.js} +38 -15
- package/dist/chunk-NTHRTRQK.js.map +1 -0
- package/dist/{chunk-OTATNBMD.js → chunk-NYMOHNYV.js} +3 -3
- package/dist/{chunk-OTATNBMD.js.map → chunk-NYMOHNYV.js.map} +1 -1
- package/dist/{chunk-PQHS255G.js → chunk-OHSIVNJO.js} +3 -3
- package/dist/chunk-OHSIVNJO.js.map +1 -0
- package/dist/{chunk-7Z5LUTGU.js → chunk-QXTCIJP5.js} +6 -3
- package/dist/{chunk-JFS3NWZ5.cjs.map → chunk-QXTCIJP5.js.map} +1 -1
- package/dist/{chunk-5PC6JBGJ.cjs → chunk-R2VF5NQG.cjs} +3 -3
- package/dist/chunk-R2VF5NQG.cjs.map +1 -0
- package/dist/{chunk-UTQSSKSG.js → chunk-SPP6HQMM.js} +4 -4
- package/dist/{chunk-UTQSSKSG.js.map → chunk-SPP6HQMM.js.map} +1 -1
- package/dist/chunk-TCBHVIMD.js +89 -0
- package/dist/chunk-TCBHVIMD.js.map +1 -0
- package/dist/{chunk-SES6GDBQ.cjs → chunk-UJJUX6NW.cjs} +59 -8
- package/dist/chunk-UJJUX6NW.cjs.map +1 -0
- package/dist/{chunk-ZRL2UFTH.cjs → chunk-V3N56Z2S.cjs} +101 -22
- package/dist/chunk-V3N56Z2S.cjs.map +1 -0
- package/dist/{chunk-PHZ23DP3.js → chunk-VRLRPGO7.js} +125 -12
- package/dist/chunk-VRLRPGO7.js.map +1 -0
- package/dist/{chunk-WKOIGLQX.cjs → chunk-VRUN5TG2.cjs} +8 -8
- package/dist/{chunk-WKOIGLQX.cjs.map → chunk-VRUN5TG2.cjs.map} +1 -1
- package/dist/{chunk-QA3MVQ32.js → chunk-W4GABGRD.js} +6 -6
- package/dist/chunk-W4GABGRD.js.map +1 -0
- package/dist/{chunk-M36G6SRP.js → chunk-WXNQMJ67.js} +14 -3
- package/dist/chunk-WXNQMJ67.js.map +1 -0
- package/dist/chunk-XJ3HJSO5.cjs +25 -0
- package/dist/chunk-XJ3HJSO5.cjs.map +1 -0
- package/dist/{chunk-XGFTL5XY.js → chunk-YHCG3HOR.js} +3 -3
- package/dist/{chunk-XGFTL5XY.js.map → chunk-YHCG3HOR.js.map} +1 -1
- package/dist/{chunk-VNQRI2RO.cjs → chunk-YN6AXDN5.cjs} +16 -16
- package/dist/{chunk-VNQRI2RO.cjs.map → chunk-YN6AXDN5.cjs.map} +1 -1
- package/dist/{chunk-2NQLSLSN.cjs → chunk-YNJ44IAL.cjs} +5 -5
- package/dist/{chunk-2NQLSLSN.cjs.map → chunk-YNJ44IAL.cjs.map} +1 -1
- package/dist/{chunk-ZL7UM6PU.cjs → chunk-YSEM7JDE.cjs} +4 -4
- package/dist/{chunk-ZL7UM6PU.cjs.map → chunk-YSEM7JDE.cjs.map} +1 -1
- package/dist/{chunk-ZO5PBBFX.js → chunk-ZG4XSEZV.js} +72 -15
- package/dist/chunk-ZG4XSEZV.js.map +1 -0
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.d.cts +2 -2
- package/dist/entries/apps.d.ts +2 -2
- package/dist/entries/apps.js +8 -7
- package/dist/entries/catalogs.d.cts +1 -1
- package/dist/entries/catalogs.d.ts +1 -1
- package/dist/entries/credits.cjs +153 -153
- package/dist/entries/credits.d.cts +1 -1
- package/dist/entries/credits.d.ts +1 -1
- package/dist/entries/credits.js +8 -8
- package/dist/entries/edl.cjs +130 -102
- package/dist/entries/edl.d.cts +74 -3
- package/dist/entries/edl.d.ts +74 -3
- package/dist/entries/edl.js +2 -2
- package/dist/entries/entities.cjs +126 -122
- package/dist/entries/entities.d.cts +2 -2
- package/dist/entries/entities.d.ts +2 -2
- package/dist/entries/entities.js +1 -1
- package/dist/entries/i18n.cjs +11 -11
- package/dist/entries/i18n.d.cts +2 -2
- package/dist/entries/i18n.d.ts +2 -2
- package/dist/entries/i18n.js +1 -1
- package/dist/entries/llm-models.cjs +63 -43
- package/dist/entries/llm-models.d.cts +71 -4
- package/dist/entries/llm-models.d.ts +71 -4
- package/dist/entries/llm-models.js +1 -1
- package/dist/entries/media.cjs +45 -41
- package/dist/entries/media.d.cts +39 -1
- package/dist/entries/media.d.ts +39 -1
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +66 -66
- package/dist/entries/model-catalog.d.cts +2 -2
- package/dist/entries/model-catalog.d.ts +2 -2
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +274 -210
- package/dist/entries/models.d.cts +3 -3
- package/dist/entries/models.d.ts +3 -3
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +222 -201
- package/dist/entries/nodes.d.cts +48 -8
- package/dist/entries/nodes.d.ts +48 -8
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.d.cts +8 -4
- package/dist/entries/pipeline.d.ts +8 -4
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +174 -174
- package/dist/entries/social.d.cts +13 -5
- package/dist/entries/social.d.ts +13 -5
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +1 -1
- package/dist/entries/types.d.ts +1 -1
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +115 -115
- package/dist/entries/video.d.cts +4 -3
- package/dist/entries/video.d.ts +4 -3
- package/dist/entries/video.js +4 -4
- package/dist/entries/workflow.cjs +96 -95
- package/dist/entries/workflow.d.cts +7 -18
- package/dist/entries/workflow.d.ts +7 -18
- package/dist/entries/workflow.js +2 -1
- package/dist/index.cjs +1708 -1567
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +26 -25
- package/dist/{model-catalog-V-ZNzRSd.d.ts → model-catalog-I48SvalA.d.cts} +25 -0
- package/dist/{model-catalog-V-ZNzRSd.d.cts → model-catalog-I48SvalA.d.ts} +25 -0
- package/dist/{presentation-utils-D0kxsWf9.d.cts → presentation-utils-A4i92SYo.d.cts} +1 -1
- package/dist/{presentation-utils-pZwlEAzo.d.ts → presentation-utils-DjdPtM9k.d.ts} +1 -1
- package/dist/{scene-node-types-C3kl_zyK.d.ts → scene-node-types-Cvbtf-0a.d.cts} +147 -6
- package/dist/{scene-node-types-C3kl_zyK.d.cts → scene-node-types-Cvbtf-0a.d.ts} +147 -6
- package/dist/{types-DffyGSy5.d.cts → types-CU6SQnMS.d.cts} +0 -5
- package/dist/{types-DffyGSy5.d.ts → types-CU6SQnMS.d.ts} +0 -5
- package/dist/{types-BRlFPEru.d.ts → types-DzUBR7yr.d.cts} +8 -1
- package/dist/{types-BRlFPEru.d.cts → types-DzUBR7yr.d.ts} +8 -1
- package/package.json +1 -1
- package/src/__tests__/camera-switch-contract.test.ts +33 -1
- package/src/__tests__/character-mention-slug.test.ts +0 -8
- package/src/__tests__/effective-tier.test.ts +3 -14
- package/src/__tests__/fixtures/camera-switch-speaker-map-parity.json +178 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +21 -0
- package/src/__tests__/fixtures/speaker-map-camera-ids.json +26 -0
- package/src/__tests__/gvp-supported-providers.test.ts +1 -0
- package/src/__tests__/i18n-locale-completeness.test.ts +38 -3
- package/src/__tests__/llm-models.test.ts +200 -20
- package/src/__tests__/node-preset-extract.test.ts +10 -0
- package/src/__tests__/preview-gate-use-case.test.ts +16 -1
- package/src/__tests__/producer-types.test.ts +19 -0
- package/src/__tests__/run-continuation.test.ts +4 -1
- package/src/__tests__/speaker-map-contract.test.ts +48 -0
- package/src/__tests__/unit-contract-compose.test.ts +129 -0
- package/src/__tests__/unit-contracts.test.ts +134 -0
- package/src/__tests__/use-case-types.test.ts +33 -0
- package/src/__tests__/video-catalog-totality.test.ts +15 -1
- package/src/__tests__/video-collapse-parity.test.ts +10 -0
- package/src/__tests__/video-frame-slot.test.ts +85 -0
- package/src/__tests__/video-mode-aliases.test.ts +1 -0
- package/src/__tests__/video-reference-only.test.ts +117 -0
- package/src/__tests__/vidu-q4-catalog.test.ts +230 -0
- package/src/camera-switch-contract.ts +36 -2
- package/src/credit-identifiers.ts +19 -6
- package/src/entity-asset-types.ts +13 -0
- package/src/entries/edl.ts +2 -0
- package/src/entries/llm-models.ts +5 -0
- package/src/entries/media.ts +1 -0
- package/src/entries/models.ts +25 -0
- package/src/entries/nodes.ts +5 -1
- package/src/fan-out-rows.ts +36 -3
- package/src/generate-mask.ts +40 -0
- package/src/generated/unit-contracts.ts +58 -0
- package/src/i18n/types.ts +13 -2
- package/src/json-kinds.ts +24 -4
- package/src/llm-models.ts +184 -31
- package/src/meta-ads-scrape.ts +16 -8
- package/src/model-catalog.ts +91 -13
- package/src/model-constants.ts +260 -5
- package/src/node-default-mappings.ts +3 -0
- package/src/node-preset-extract.ts +8 -0
- package/src/pipeline-types.ts +3 -0
- package/src/presentation-utils.ts +12 -12
- package/src/preview-gate.ts +4 -2
- package/src/producer-types.ts +19 -19
- package/src/run-continuation.ts +26 -4
- package/src/speaker-layouts.ts +8 -3
- package/src/speaker-map-contract.ts +77 -0
- package/src/unit-contract-compose.ts +55 -0
- package/src/use-case-types.ts +19 -0
- package/src/video-ui-defaults.ts +7 -5
- package/dist/chunk-23FJQTEA.js.map +0 -1
- package/dist/chunk-5PC6JBGJ.cjs.map +0 -1
- package/dist/chunk-5RYLK3MQ.js.map +0 -1
- package/dist/chunk-7Z5LUTGU.js.map +0 -1
- package/dist/chunk-BG5D5CZ6.js.map +0 -1
- package/dist/chunk-CK3GK34R.js.map +0 -1
- package/dist/chunk-D26ENTN2.cjs.map +0 -1
- package/dist/chunk-D6GNRSCV.cjs.map +0 -1
- package/dist/chunk-HC7VKIV5.cjs.map +0 -1
- package/dist/chunk-HGC5JNVA.cjs.map +0 -1
- package/dist/chunk-JL4C5VJ7.cjs.map +0 -1
- package/dist/chunk-K3LLGRK7.cjs.map +0 -1
- package/dist/chunk-M36G6SRP.js.map +0 -1
- package/dist/chunk-M7GQBRZU.cjs.map +0 -1
- package/dist/chunk-PHZ23DP3.js.map +0 -1
- package/dist/chunk-PQHS255G.js.map +0 -1
- package/dist/chunk-PRYE7AZQ.cjs.map +0 -1
- package/dist/chunk-PVJBAPYJ.js.map +0 -1
- package/dist/chunk-PXFQVLBX.js.map +0 -1
- package/dist/chunk-QA3MVQ32.js.map +0 -1
- package/dist/chunk-SES6GDBQ.cjs.map +0 -1
- package/dist/chunk-TU33KYKW.cjs +0 -25
- package/dist/chunk-TU33KYKW.cjs.map +0 -1
- package/dist/chunk-VA42637J.cjs.map +0 -1
- package/dist/chunk-VXPLKQWY.cjs.map +0 -1
- package/dist/chunk-WDIBOWAA.js.map +0 -1
- package/dist/chunk-YBPBK5KI.js.map +0 -1
- package/dist/chunk-YYV35XOS.js.map +0 -1
- package/dist/chunk-Z2OL5AJD.cjs.map +0 -1
- package/dist/chunk-ZDFHA2EC.js.map +0 -1
- package/dist/chunk-ZO5PBBFX.js.map +0 -1
- package/dist/chunk-ZRL2UFTH.cjs.map +0 -1
- package/src/__tests__/__snapshots__/prompt-builder-segments.test.ts.snap +0 -65
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* and pre-fill the speaker table. Pure, no I/O.
|
|
6
6
|
*/
|
|
7
7
|
import { normalizeTranscript } from "./edl.js"
|
|
8
|
+
import { speakerMapByOrdinal, speakerMapResultOf } from "./speaker-map-contract.js"
|
|
8
9
|
|
|
9
10
|
/** The settings and their decided defaults (the plugin holds its own copy, D13). */
|
|
10
11
|
export const CAMERA_SWITCH_DEFAULTS = Object.freeze({
|
|
@@ -135,6 +136,10 @@ export function defaultSpeakerMap(
|
|
|
135
136
|
* settings and the same pre-filled speaker table. */
|
|
136
137
|
export interface CameraSwitchNodeSettings {
|
|
137
138
|
readonly speakerMap?: Readonly<Record<string, string>>
|
|
139
|
+
/** Who is on which camera by ordinal — "1" the first voice heard → a camera
|
|
140
|
+
* SOURCE id, "" none; what a use-case node's override writes (decided
|
|
141
|
+
* 2026-10-17). A label in `speakerMap` beats it. */
|
|
142
|
+
readonly speakerMapByOrder?: Readonly<Record<string, string>>
|
|
138
143
|
readonly speakerNames?: Readonly<Record<string, string>>
|
|
139
144
|
readonly minShotMs?: number
|
|
140
145
|
readonly leadMs?: number
|
|
@@ -142,10 +147,40 @@ export interface CameraSwitchNodeSettings {
|
|
|
142
147
|
readonly wideEvery?: number
|
|
143
148
|
readonly layoutHints?: boolean
|
|
144
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Who is on which camera — the ONE merge of the speaker table's layers
|
|
152
|
+
* (decided 2026-10-17). Per speaker, the first that names them wins: an
|
|
153
|
+
* explicit label in `speakerMap`, the ordinal override `speakerMapByOrder`, a
|
|
154
|
+
* wired Speaker Map result, then the order default (`defaultSpeakerMap`).
|
|
155
|
+
* Each layer above the default is passed as `existing`, so its "" (no camera
|
|
156
|
+
* of their own) is SENT as "" and is never re-filled by the order default; an
|
|
157
|
+
* explicit entry that is not a string is ignored, so it never hides a layer
|
|
158
|
+
* below it. `cameraSwitchSettingsPayload` sends this; the config panel's
|
|
159
|
+
* "What the run will use" shows this — never a second copy of the order.
|
|
160
|
+
*/
|
|
161
|
+
export function cameraSwitchSpeakerMap(
|
|
162
|
+
data: Pick<CameraSwitchNodeSettings, "speakerMap" | "speakerMapByOrder">,
|
|
163
|
+
edl: unknown,
|
|
164
|
+
transcript: unknown,
|
|
165
|
+
wired?: { readonly speakerMap?: unknown },
|
|
166
|
+
): Record<string, string> {
|
|
167
|
+
const labels = transcriptSpeakerLabels(transcript)
|
|
168
|
+
const explicit = data.speakerMap && typeof data.speakerMap === "object" && !Array.isArray(data.speakerMap)
|
|
169
|
+
? Object.fromEntries(Object.entries(data.speakerMap).filter(([, camera]) => typeof camera === "string"))
|
|
170
|
+
: {}
|
|
171
|
+
const existing = {
|
|
172
|
+
...(speakerMapResultOf(wired?.speakerMap)?.speakerMap ?? {}),
|
|
173
|
+
...speakerMapByOrdinal(labels, data.speakerMapByOrder),
|
|
174
|
+
...explicit,
|
|
175
|
+
}
|
|
176
|
+
return defaultSpeakerMap(labels, cameraSwitchCameras(edl).map((c) => c.id), existing)
|
|
177
|
+
}
|
|
178
|
+
|
|
145
179
|
export function cameraSwitchSettingsPayload(
|
|
146
180
|
data: CameraSwitchNodeSettings,
|
|
147
181
|
edl: unknown,
|
|
148
182
|
transcript: unknown,
|
|
183
|
+
wired?: { readonly speakerMap?: unknown },
|
|
149
184
|
): {
|
|
150
185
|
speakerMap: Record<string, string>
|
|
151
186
|
speakerNames: Record<string, string>
|
|
@@ -155,9 +190,8 @@ export function cameraSwitchSettingsPayload(
|
|
|
155
190
|
wideEvery?: number
|
|
156
191
|
layoutHints: boolean
|
|
157
192
|
} {
|
|
158
|
-
const existing = data.speakerMap && typeof data.speakerMap === "object" ? data.speakerMap : {}
|
|
159
193
|
const out: ReturnType<typeof cameraSwitchSettingsPayload> = {
|
|
160
|
-
speakerMap:
|
|
194
|
+
speakerMap: cameraSwitchSpeakerMap(data, edl, transcript, wired),
|
|
161
195
|
speakerNames: cleanSpeakerNames(data.speakerNames),
|
|
162
196
|
layoutHints: data.layoutHints === true,
|
|
163
197
|
}
|
|
@@ -24,8 +24,10 @@ import {
|
|
|
24
24
|
isMinimaxH3Provider,
|
|
25
25
|
isGeminiOmniProvider,
|
|
26
26
|
isWan3Provider,
|
|
27
|
+
isViduQ4Provider,
|
|
27
28
|
normalizeMinimaxH3Resolution,
|
|
28
29
|
normalizeWan3Resolution,
|
|
30
|
+
normalizeViduQ4Resolution,
|
|
29
31
|
getVideoAudioCapability,
|
|
30
32
|
} from "./model-constants.js"
|
|
31
33
|
import { isFlux2Model, FLUX2_RES_MP, type Flux2Model } from "./flux2-pricing.js"
|
|
@@ -335,6 +337,18 @@ function ltxPricedTier(
|
|
|
335
337
|
return { band, duration: dur }
|
|
336
338
|
}
|
|
337
339
|
|
|
340
|
+
/**
|
|
341
|
+
* The resolution a provider whose runner NORMALIZES the lever actually renders,
|
|
342
|
+
* in the lowercase spelling of its credit composites — billing collapses
|
|
343
|
+
* through the very normalizer the runner sends, so render == billed for every
|
|
344
|
+
* spelling. `undefined` passes through untouched for every other provider.
|
|
345
|
+
*/
|
|
346
|
+
function wireNormalizedResolution(provider: string, resolution: string | undefined): string | undefined {
|
|
347
|
+
if (isWan3Provider(provider)) return normalizeWan3Resolution(resolution).toLowerCase()
|
|
348
|
+
if (isViduQ4Provider(provider)) return normalizeViduQ4Resolution(resolution)
|
|
349
|
+
return resolution
|
|
350
|
+
}
|
|
351
|
+
|
|
338
352
|
export function buildVideoCreditModelIdentifier(
|
|
339
353
|
provider: string,
|
|
340
354
|
duration?: number | string,
|
|
@@ -476,12 +490,11 @@ export function buildVideoCreditModelIdentifier(
|
|
|
476
490
|
// the 720p row, a shortfall `commit_credits` (refund-only) can never collect.
|
|
477
491
|
// Collapsing through the SAME normalizer the runner uses makes render == billed
|
|
478
492
|
// by construction for every spelling, including garbage (→ the declared 720p).
|
|
479
|
-
// Scoped to the
|
|
480
|
-
// members pass `resolution` to
|
|
481
|
-
//
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
: resolution
|
|
493
|
+
// Scoped to the families whose runner normalizes on purpose (Wan 3.0, Vidu
|
|
494
|
+
// Q4): the other RESOLUTION_DURATION_PRICING members pass `resolution` to
|
|
495
|
+
// their wire verbatim, so case-folding their billing without probing their
|
|
496
|
+
// wire would reprice live models.
|
|
497
|
+
const requested = wireNormalizedResolution(effectiveProvider, resolution)
|
|
485
498
|
const res = requested && resTiers.includes(requested) ? requested : fallback
|
|
486
499
|
identifier += `:${res}`
|
|
487
500
|
}
|
|
@@ -74,6 +74,19 @@ export const CHARACTER_ATTACH_COLUMNS = [
|
|
|
74
74
|
] as const
|
|
75
75
|
export type CharacterAttachColumn = (typeof CHARACTER_ATTACH_COLUMNS)[number]
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* The narrower set `/v1/image-to-image`'s `attachToColumn` accepts (Character
|
|
79
|
+
* Studio refining an existing asset): the four refinable buckets. A subset of
|
|
80
|
+
* {@link CHARACTER_ATTACH_COLUMNS}, checked at compile time.
|
|
81
|
+
*/
|
|
82
|
+
export const IMAGE_TO_IMAGE_ATTACH_COLUMNS = [
|
|
83
|
+
"expressions",
|
|
84
|
+
"poses",
|
|
85
|
+
"angles",
|
|
86
|
+
"lighting_variations",
|
|
87
|
+
] as const satisfies readonly CharacterAttachColumn[]
|
|
88
|
+
export type ImageToImageAttachColumn = (typeof IMAGE_TO_IMAGE_ATTACH_COLUMNS)[number]
|
|
89
|
+
|
|
77
90
|
/**
|
|
78
91
|
* Canonical variant presets per character asset type — the SINGLE source of
|
|
79
92
|
* truth shared by the `generate-character-asset` route (Zod validation rejects a
|
package/src/entries/edl.ts
CHANGED
|
@@ -37,6 +37,8 @@ export * from "../edl-multicam.js"
|
|
|
37
37
|
// Speaker tracks: the face-tracking result (box body + the node's descriptor) and its validators.
|
|
38
38
|
export * from "../speaker-tracks.js"
|
|
39
39
|
export * from "../camera-switch-contract.js"
|
|
40
|
+
// Speaker Map's result contract (which camera each speaker is on) and the override's ordinal keys.
|
|
41
|
+
export * from "../speaker-map-contract.js"
|
|
40
42
|
export * from "../edit-plan-contract.js"
|
|
41
43
|
// A person's review of an Edit Plan (`editedEdl`) and the one resolver that applies it.
|
|
42
44
|
export * from "../edit-plan-review.js"
|
|
@@ -13,6 +13,9 @@ export {
|
|
|
13
13
|
LLM_VENDOR_LABELS,
|
|
14
14
|
groupLlmModelsByVendor,
|
|
15
15
|
orderedLlmModels,
|
|
16
|
+
PICKABLE_LLM_MODELS,
|
|
17
|
+
pickableLlmModels,
|
|
18
|
+
isLlmModelRetired,
|
|
16
19
|
type LlmVendor,
|
|
17
20
|
type LlmModelGroup,
|
|
18
21
|
VIDEO_ANALYSIS_LLM_MODELS,
|
|
@@ -30,6 +33,7 @@ export {
|
|
|
30
33
|
isVideoAnalysisMixedTier,
|
|
31
34
|
resolveVideoAnalysisModel,
|
|
32
35
|
LLM_FEATURE_DEFAULTS,
|
|
36
|
+
DESCRIBE_TO_PICKER_FALLBACK_MODEL,
|
|
33
37
|
LLM_FEATURE_DEFAULT_EFFORTS,
|
|
34
38
|
defaultReasoningEffort,
|
|
35
39
|
LLM_MODALITY_CAPS,
|
|
@@ -39,6 +43,7 @@ export {
|
|
|
39
43
|
getLlmTier,
|
|
40
44
|
getLlmModalityCaps,
|
|
41
45
|
buildLlmCreditIdentifier,
|
|
46
|
+
llmCreditRung,
|
|
42
47
|
resolveLlmCreditId,
|
|
43
48
|
supportsAdvancedMode,
|
|
44
49
|
llmServesDirect,
|
package/src/entries/media.ts
CHANGED
|
@@ -31,6 +31,7 @@ export type { LottieOverlayCatalogEntry } from "../lottie-overlay-catalog.js"
|
|
|
31
31
|
export * from "../audio-fx-presets.js"
|
|
32
32
|
export * from "../image-overlay-layers.js"
|
|
33
33
|
export * from "../video-mask.js"
|
|
34
|
+
export * from "../generate-mask.js"
|
|
34
35
|
export * from "../mask-composite.js"
|
|
35
36
|
export * from "../image-overlay-shapes.js"
|
|
36
37
|
export * from "../image-overlay-platforms.js"
|
package/src/entries/models.ts
CHANGED
|
@@ -9,6 +9,10 @@ export {
|
|
|
9
9
|
CREDIT_BASE_USD,
|
|
10
10
|
IMAGE_PROMPT_MAX,
|
|
11
11
|
IMAGE_ASPECT_RATIO_VALUES,
|
|
12
|
+
IMAGE_RESOLUTION_VALUES,
|
|
13
|
+
IMAGE_QUALITY_VALUES,
|
|
14
|
+
IMAGE_RENDERING_SPEED_VALUES,
|
|
15
|
+
IMAGE_EDIT_TARGET_RESOLUTION_VALUES,
|
|
12
16
|
MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER,
|
|
13
17
|
getMaxImagePromptChars,
|
|
14
18
|
PROMPT_HARD_CEILING,
|
|
@@ -56,6 +60,7 @@ export {
|
|
|
56
60
|
IMAGE_I2I_PROVIDERS,
|
|
57
61
|
IMAGE_EDIT_PROVIDERS,
|
|
58
62
|
TASK_CHAINED_EDIT_PROVIDERS,
|
|
63
|
+
TASK_CHAINED_EDIT_PROVIDER_IDS,
|
|
59
64
|
IMAGE_TO_VIDEO_PROVIDERS,
|
|
60
65
|
TEXT_TO_VIDEO_PROVIDERS,
|
|
61
66
|
VIDEO_GEN_PROVIDERS,
|
|
@@ -131,6 +136,11 @@ export {
|
|
|
131
136
|
VIDEO_GEN_COLLAPSED_T2V_IDS,
|
|
132
137
|
resolveVideoProviderForMode,
|
|
133
138
|
resolveVideoModeForInputs,
|
|
139
|
+
videoProviderRunsFromReferences,
|
|
140
|
+
videoProviderReferenceSyntax,
|
|
141
|
+
videoProviderAppendsFrames,
|
|
142
|
+
videoProviderRefModeFrameSeats,
|
|
143
|
+
VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL,
|
|
134
144
|
isSeedance2Provider,
|
|
135
145
|
MINIMAX_H3_PROVIDERS,
|
|
136
146
|
isMinimaxH3Provider,
|
|
@@ -140,6 +150,10 @@ export {
|
|
|
140
150
|
isWan3Provider,
|
|
141
151
|
WAN_3_DEFAULT_RESOLUTION,
|
|
142
152
|
normalizeWan3Resolution,
|
|
153
|
+
VIDU_Q4_PROVIDERS,
|
|
154
|
+
isViduQ4Provider,
|
|
155
|
+
VIDU_Q4_DEFAULT_RESOLUTION,
|
|
156
|
+
normalizeViduQ4Resolution,
|
|
143
157
|
GEMINI_OMNI_PROVIDERS,
|
|
144
158
|
isGeminiOmniProvider,
|
|
145
159
|
VIDEO_PROVIDERS_WITHOUT_DISPATCH,
|
|
@@ -170,6 +184,8 @@ export {
|
|
|
170
184
|
SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER,
|
|
171
185
|
seedance2AudioLimitSec,
|
|
172
186
|
findSeedance2AudioOverLimit,
|
|
187
|
+
VIDEO_REF_AUDIO_RULES,
|
|
188
|
+
checkRefAudioRules,
|
|
173
189
|
DEFAULT_VIDEO_PROVIDER,
|
|
174
190
|
DEFAULT_VIDEO_DURATION_SEC,
|
|
175
191
|
applyDefaultVideoSelection,
|
|
@@ -183,6 +199,11 @@ export {
|
|
|
183
199
|
} from "../model-constants.js"
|
|
184
200
|
export type {
|
|
185
201
|
ImageAspectRatio,
|
|
202
|
+
ImageResolution,
|
|
203
|
+
ImageQuality,
|
|
204
|
+
ImageRenderingSpeed,
|
|
205
|
+
ImageEditTargetResolution,
|
|
206
|
+
TaskChainedEditProvider,
|
|
186
207
|
ImageGenProvider,
|
|
187
208
|
ImageMaskMode,
|
|
188
209
|
ImageI2IProvider,
|
|
@@ -224,6 +245,10 @@ export type {
|
|
|
224
245
|
GvpAnchorChoice,
|
|
225
246
|
GvpAnchorWireMode,
|
|
226
247
|
RefVideoDurationLimit,
|
|
248
|
+
RefAudioRule,
|
|
249
|
+
RefAudioProbe,
|
|
250
|
+
RefAudioCheck,
|
|
251
|
+
VideoReferenceSyntax,
|
|
227
252
|
} from "../model-constants.js"
|
|
228
253
|
export { GEMINI_OMNI_VOICE_PRESETS, GEMINI_OMNI_VOICE_PRESET_IDS } from "../gemini-omni-voices.js"
|
|
229
254
|
export type { GeminiOmniVoicePreset, GeminiOmniVoicePresetId } from "../gemini-omni-voices.js"
|
package/src/entries/nodes.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@nodaro/shared/nodes` — Per-node-type rules: producer types, handle aliases, render nodes, JSON kinds, preview/render-final, settings inputs, node presets, collections.
|
|
2
|
+
* `@nodaro/shared/nodes` — Per-node-type rules: producer types, use-case node types, handle aliases, render nodes, JSON kinds, preview/render-final, settings inputs, node presets, collections.
|
|
3
3
|
*
|
|
4
4
|
* One of the package's subpath entries (see `src/index.ts`). The root
|
|
5
5
|
* re-exports every entry, so each name here is also importable from
|
|
@@ -99,6 +99,7 @@ export {
|
|
|
99
99
|
type SavedRenderQualityStamp,
|
|
100
100
|
type SavedRenderStampReader,
|
|
101
101
|
} from "../preview-gate.js"
|
|
102
|
+
export { USE_CASE_NODE_TYPES, isUseCaseNodeType, type UseCaseNodeType } from "../use-case-types.js"
|
|
102
103
|
export {
|
|
103
104
|
CONTINUATION_NOT_FOUND,
|
|
104
105
|
CONTINUATION_WORKFLOW_MISMATCH,
|
|
@@ -107,9 +108,12 @@ export {
|
|
|
107
108
|
CONTINUATION_SUBSET_REQUIRED,
|
|
108
109
|
CONTINUATION_NOT_FAILED,
|
|
109
110
|
CONTINUATION_SUPERSEDED,
|
|
111
|
+
CONTINUATION_PREVIEW_PENDING,
|
|
110
112
|
CONTINUATION_SETTLING,
|
|
111
113
|
RENDER_FINAL_ALREADY_RENDERED,
|
|
112
114
|
RENDER_FINAL_ALREADY_RENDERED_MESSAGE,
|
|
115
|
+
USE_CASE_NOTHING_KEPT,
|
|
116
|
+
USE_CASE_NOTHING_KEPT_MESSAGE,
|
|
113
117
|
RUN_CONTINUATION_CODES,
|
|
114
118
|
type RunContinuationCode,
|
|
115
119
|
} from "../run-continuation.js"
|
package/src/fan-out-rows.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { evaluateJsonPath, stringifyPathResults } from "./json-path.js"
|
|
19
19
|
import { expandItemsWithRepeat } from "./repeat-types.js"
|
|
20
20
|
import { isDefaultSelectorConfig, resolveIndex, selectListItems, type SelectorFields } from "./selector.js"
|
|
21
|
+
import { unitNonPromptInputs } from "./unit-contract-compose.js"
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* The text LANES the input resolvers route somewhere OTHER than the prompt slot
|
|
@@ -37,7 +38,7 @@ import { isDefaultSelectorConfig, resolveIndex, selectListItems, type SelectorFi
|
|
|
37
38
|
* unlisted lane keeps the old behavior (the item is the prompt), so a miss can
|
|
38
39
|
* only ever reproduce the old bug on that one lane, never a new one.
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
const LEGACY_NON_PROMPT_TEXT_LANES: Readonly<Record<string, "*" | readonly string[]>> = {
|
|
41
42
|
negative: "*",
|
|
42
43
|
"system-prompt": "*",
|
|
43
44
|
script: ["ai-avatar"],
|
|
@@ -47,6 +48,8 @@ export const NON_PROMPT_TEXT_LANES: Readonly<Record<string, "*" | readonly strin
|
|
|
47
48
|
tracks: ["speaker-view"],
|
|
48
49
|
silence: ["edit-plan"],
|
|
49
50
|
offsets: ["edit-plan"],
|
|
51
|
+
// Camera Switch's speaker map (a Speaker Map result): who is on which camera, never a prompt.
|
|
52
|
+
speakerMap: ["camera-switch"],
|
|
50
53
|
qrText: ["image-overlay"],
|
|
51
54
|
layerPlan: ["video-overlay"],
|
|
52
55
|
captionPlan: ["add-captions"],
|
|
@@ -55,8 +58,38 @@ export const NON_PROMPT_TEXT_LANES: Readonly<Record<string, "*" | readonly strin
|
|
|
55
58
|
// the material it analyzes — a list of links fanned through it must not be
|
|
56
59
|
// written into the material too.
|
|
57
60
|
link: ["content-recipe"],
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The hand-written lanes ∪ the node units' `contract.nonPromptInputs` rows
|
|
65
|
+
* (generated/unit-contracts.ts): each unit type joins the list of every handle
|
|
66
|
+
* it names (a handle no list names yet gets one). A `"*"` lane already covers
|
|
67
|
+
* every type, so it stays as it is. A type listed twice for one handle throws
|
|
68
|
+
* at load — a type is hand-written or a node unit, never both.
|
|
69
|
+
*/
|
|
70
|
+
export const NON_PROMPT_TEXT_LANES: Readonly<Record<string, "*" | readonly string[]>> = composeNonPromptLanes(LEGACY_NON_PROMPT_TEXT_LANES, unitNonPromptInputs())
|
|
71
|
+
|
|
72
|
+
function composeNonPromptLanes(
|
|
73
|
+
legacy: Readonly<Record<string, "*" | readonly string[]>>,
|
|
74
|
+
rows: ReadonlyArray<readonly [string, ReadonlyArray<string>]>,
|
|
75
|
+
): Record<string, "*" | readonly string[]> {
|
|
76
|
+
const out: Record<string, "*" | readonly string[]> = { ...legacy }
|
|
77
|
+
for (const [type, handles] of rows) {
|
|
78
|
+
const own = new Set<string>()
|
|
79
|
+
for (const handle of handles) {
|
|
80
|
+
// A unit naming one handle twice in its own row is its own mistake, not a clash with the hand-written lanes.
|
|
81
|
+
if (own.has(handle)) throw new Error(`NON_PROMPT_TEXT_LANES: node unit ${type} lists "${handle}" twice in its contract.nonPromptInputs`)
|
|
82
|
+
own.add(handle)
|
|
83
|
+
const scope = Object.hasOwn(out, handle) ? out[handle] : []
|
|
84
|
+
if (scope === "*") continue
|
|
85
|
+
// Only the same handle clashes here: a unit hand-listed under a DIFFERENT
|
|
86
|
+
// handle is a string literal of a unit's id outside its folders, which
|
|
87
|
+
// G2 fails (frontend/src/__tests__/node-units-structure.test.ts).
|
|
88
|
+
if (scope.includes(type)) throw new Error(`NON_PROMPT_TEXT_LANES: ${type} is listed for "${handle}" both by hand and as a node unit — a type lives in one place`)
|
|
89
|
+
out[handle] = [...scope, type]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return out
|
|
60
93
|
}
|
|
61
94
|
|
|
62
95
|
/** Does a TEXT list wired to `targetHandle` of a `nodeType` node feed its prompt slot? */
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate Mask — text-prompted IMAGE segmentation (Grounded SAM). The wire
|
|
3
|
+
* contract of `POST /v1/generate-mask`, the `generate_mask` MCP verb, the SDK's
|
|
4
|
+
* `nodes.run("generate-mask", …)` and `nodaro media generate-mask`, defined ONCE:
|
|
5
|
+
* every bound the route schema and the SDK/CLI read.
|
|
6
|
+
*
|
|
7
|
+
* The finished job's output is `{ maskUrl, imageUrl }`: `maskUrl` is the
|
|
8
|
+
* black-and-white mask PNG (white = the subject), `imageUrl` is the SOURCE
|
|
9
|
+
* image passed through unchanged, so an inpainting step can take the pair.
|
|
10
|
+
*
|
|
11
|
+
* Wire contract only — no I/O.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const GENERATE_MASK_LIMITS = {
|
|
15
|
+
/** Subject description length cap. */
|
|
16
|
+
PROMPT_MAX_LENGTH: 500,
|
|
17
|
+
/** Segmentation confidence bounds. */
|
|
18
|
+
THRESHOLD_MIN: 0,
|
|
19
|
+
THRESHOLD_MAX: 1,
|
|
20
|
+
/** Default segmentation confidence. Lower selects more (and less precise) regions. */
|
|
21
|
+
THRESHOLD_DEFAULT: 0.3,
|
|
22
|
+
} as const
|
|
23
|
+
|
|
24
|
+
/** `POST /v1/generate-mask` request body. */
|
|
25
|
+
export interface GenerateMaskRequest {
|
|
26
|
+
/** The image to segment. */
|
|
27
|
+
readonly imageUrl: string
|
|
28
|
+
/** What to select, in plain words (e.g. "the person", "sky and clouds"). 1–500 characters. */
|
|
29
|
+
readonly prompt: string
|
|
30
|
+
/** Segmentation confidence, `GENERATE_MASK_LIMITS.THRESHOLD_MIN`–`THRESHOLD_MAX` (default 0.3). */
|
|
31
|
+
readonly threshold?: number
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** A completed Generate Mask job's `output_data`. */
|
|
35
|
+
export interface GenerateMaskOutput {
|
|
36
|
+
/** The mask: a black-and-white PNG, white = the subject. */
|
|
37
|
+
readonly maskUrl: string
|
|
38
|
+
/** The source image, passed through unchanged. */
|
|
39
|
+
readonly imageUrl: string
|
|
40
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// GENERATED by tools/units/gen.mjs — do not edit; run npm run gen:units
|
|
2
|
+
// The unit contract published in @nodaro/shared (decided 2026-10-16, widened 2026-10-18): node type
|
|
3
|
+
// ids with closed vocabularies — each unit's producer kind, the use-case types, what each JSON pip
|
|
4
|
+
// carries, the input pips that are never a prompt lane, the review holds, how a published app
|
|
5
|
+
// presents the result and which outputs fan out item by item. Never a price, credit id, number,
|
|
6
|
+
// prompt or doctrine string. Each block feeds a published table that composes its rows with the
|
|
7
|
+
// hand-written ones (unit-contract-compose.ts); every row is an irrevocable Apache grant.
|
|
8
|
+
|
|
9
|
+
export const UNIT_CONTRACTS: ReadonlyArray<readonly [type: string, producer: "audio" | "video" | "image" | "dynamic"]> = [
|
|
10
|
+
["tighten-episode", "dynamic"], // unit:tighten-episode
|
|
11
|
+
["episode-trailer", "video"], // unit:episode-trailer
|
|
12
|
+
["clip-pack", "dynamic"], // unit:clip-pack
|
|
13
|
+
["remove-audio", "video"], // unit:remove-audio
|
|
14
|
+
["gif-to-video", "video"], // unit:gif-to-video
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
// The use-case node units (execution.kind "use-case"), in position order — each a route POST /v1/<type> (+ /estimate, /continue).
|
|
18
|
+
export const UNIT_USE_CASE_TYPES = [
|
|
19
|
+
"tighten-episode", // unit:tighten-episode
|
|
20
|
+
"episode-chapters", // unit:episode-chapters
|
|
21
|
+
"episode-trailer", // unit:episode-trailer
|
|
22
|
+
"clip-pack", // unit:clip-pack
|
|
23
|
+
] as const
|
|
24
|
+
|
|
25
|
+
// What each JSON (look) output pip carries (contract.jsonPips) — json-kinds.ts composes these.
|
|
26
|
+
export const UNIT_JSON_PIPS: ReadonlyArray<readonly [type: string, pips: Readonly<Record<string, "transcript" | "edl" | "other">>]> = [
|
|
27
|
+
["tighten-episode", { "json": "edl" }], // unit:tighten-episode
|
|
28
|
+
["episode-chapters", { "json": "other" }], // unit:episode-chapters
|
|
29
|
+
["episode-trailer", { "json": "edl" }], // unit:episode-trailer
|
|
30
|
+
["clip-pack", { "json": "edl" }], // unit:clip-pack
|
|
31
|
+
["speaker-map", { "edl": "edl", "json": "other" }], // unit:speaker-map
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
// Input pips that are never a prompt lane (contract.nonPromptInputs) — fan-out-rows.ts composes these.
|
|
35
|
+
export const UNIT_NON_PROMPT_INPUTS: ReadonlyArray<readonly [type: string, handles: ReadonlyArray<string>]> = [
|
|
36
|
+
["tighten-episode", ["music"]], // unit:tighten-episode
|
|
37
|
+
["episode-trailer", ["introCard"]], // unit:episode-trailer
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
// Use-case units whose review-on run ends at a Preview that holds what follows (contract.reviewHold) — preview-gate.ts.
|
|
41
|
+
export const UNIT_REVIEW_HOLDS: ReadonlyArray<string> = [
|
|
42
|
+
"tighten-episode", // unit:tighten-episode
|
|
43
|
+
"episode-trailer", // unit:episode-trailer
|
|
44
|
+
"clip-pack", // unit:clip-pack
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
// How a published app shows each unit's result where the producer sets do not decide it (contract.presents) — presentation-utils.ts.
|
|
48
|
+
export const UNIT_PRESENTS: ReadonlyArray<readonly [type: string, presents: "image" | "video" | "audio" | "text"]> = [
|
|
49
|
+
["tighten-episode", "video"], // unit:tighten-episode
|
|
50
|
+
["episode-chapters", "text"], // unit:episode-chapters
|
|
51
|
+
["clip-pack", "video"], // unit:clip-pack
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
// The outputs an "each" edge reads item by item when the unit ran once per item, and the pip an edge naming none reads (contract.fanOutEach) — producer-types.ts.
|
|
55
|
+
export const UNIT_FAN_OUT_EACH: ReadonlyArray<readonly [type: string, handles: { readonly each: ReadonlyArray<string>; readonly primary: string }]> = [
|
|
56
|
+
["episode-trailer", { "each": ["media"], "primary": "media" }], // unit:episode-trailer
|
|
57
|
+
["clip-pack", { "each": ["clips"], "primary": "clips" }], // unit:clip-pack
|
|
58
|
+
]
|
package/src/i18n/types.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface LanguageDefinition {
|
|
|
59
59
|
* dropdown. English first as canonical default, then mainstream LTR
|
|
60
60
|
* languages, then RTL languages last.
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
const LANGUAGE_TABLE = [
|
|
63
63
|
{ id: "en", englishName: "English", nativeName: "English", shortCode: "EN", dir: "ltr" },
|
|
64
64
|
{ id: "es", englishName: "Spanish", nativeName: "Español", shortCode: "ES", dir: "ltr" },
|
|
65
65
|
{ id: "fr", englishName: "French", nativeName: "Français", shortCode: "FR", dir: "ltr" },
|
|
@@ -72,7 +72,18 @@ export const LANGUAGES: ReadonlyArray<LanguageDefinition> = [
|
|
|
72
72
|
{ id: "zh-CN", englishName: "Chinese (Simplified)", nativeName: "简体中文", shortCode: "ZH", dir: "ltr" },
|
|
73
73
|
{ id: "he", englishName: "Hebrew", nativeName: "עברית", shortCode: "HE", dir: "rtl" },
|
|
74
74
|
{ id: "ar", englishName: "Arabic", nativeName: "العربية", shortCode: "AR", dir: "rtl" },
|
|
75
|
-
] as const
|
|
75
|
+
] as const satisfies ReadonlyArray<LanguageDefinition>
|
|
76
|
+
|
|
77
|
+
export const LANGUAGES: ReadonlyArray<LanguageDefinition> = LANGUAGE_TABLE
|
|
78
|
+
|
|
79
|
+
// Compile-time: the registry's ids are exactly the LocaleId union. `satisfies`
|
|
80
|
+
// above rejects an id that is not a LocaleId; this rejects a LocaleId with no
|
|
81
|
+
// LANGUAGES entry (the error names the missing ids). Types only: nothing is
|
|
82
|
+
// emitted or exported.
|
|
83
|
+
type LocaleIdsWithoutALanguage = Exclude<LocaleId, (typeof LANGUAGE_TABLE)[number]["id"]>
|
|
84
|
+
type MustBeNever<T extends never> = T
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
86
|
+
type EveryLocaleIdHasALanguage = MustBeNever<LocaleIdsWithoutALanguage>
|
|
76
87
|
|
|
77
88
|
export const LOCALE_IDS: ReadonlyArray<LocaleId> = LANGUAGES.map((l) => l.id)
|
|
78
89
|
export const NON_EN_LOCALE_IDS: ReadonlyArray<Exclude<LocaleId, "en">> = LANGUAGES
|
package/src/json-kinds.ts
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import { RENDER_JSON_HANDLE, RENDER_NODE_TYPES, type RenderNodeDescriptor } from "./render-nodes.js"
|
|
31
31
|
import { UGC_PRIMARY_HANDLE } from "./ugc-node-wires.js"
|
|
32
|
+
import { unitJsonPips } from "./unit-contract-compose.js"
|
|
32
33
|
|
|
33
34
|
/** The two JSON shapes the platform's handle vocabulary tells apart. */
|
|
34
35
|
export type JsonKind = "transcript" | "edl"
|
|
@@ -46,8 +47,8 @@ interface JsonOutputs {
|
|
|
46
47
|
readonly pips: Readonly<Record<string, JsonOutputDeclaration>>
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
/** JSON outputs of the nodes that are not renders: pip id → what it carries. */
|
|
50
|
-
const
|
|
50
|
+
/** JSON outputs of the hand-written nodes that are not renders: pip id → what it carries. */
|
|
51
|
+
const LEGACY_JSON_OUTPUT_KINDS: Readonly<Record<string, JsonOutputs>> = Object.freeze({
|
|
51
52
|
// Edit Plan: the plan on `edl` — a Tighten EDL, a clip set (`Edl[]`) or a chapter list.
|
|
52
53
|
"edit-plan": { primary: "edl", pips: { edl: "edl" } },
|
|
53
54
|
// Transcribe: its json is the normalized Transcript (its `text` pip is plain text, no kind).
|
|
@@ -59,8 +60,6 @@ const JSON_OUTPUT_KINDS: Readonly<Record<string, JsonOutputs>> = Object.freeze({
|
|
|
59
60
|
"speaker-frames": { primary: "tracks", pips: { tracks: "other" } },
|
|
60
61
|
// Text to Dialogue: the Transcript built from the model's own word timings (its default read is the audio).
|
|
61
62
|
"text-to-dialogue": { pips: { json: "transcript" } },
|
|
62
|
-
// Tighten Episode: its json is the plan's EDL (dropped[] included); its default read is the media.
|
|
63
|
-
"tighten-episode": { pips: { json: "edl" } },
|
|
64
63
|
|
|
65
64
|
// ── JSON that is neither a Transcript nor an EDL (decided 2026-10-08) ──
|
|
66
65
|
// Forced Alignment: `{ alignment: [{ word, start, end }] }` in seconds — a word list, not a Transcript.
|
|
@@ -98,6 +97,27 @@ const JSON_OUTPUT_KINDS: Readonly<Record<string, JsonOutputs>> = Object.freeze({
|
|
|
98
97
|
"ugc-cards": { primary: UGC_PRIMARY_HANDLE["ugc-cards"], pips: { layerPlan: "other", captionPlan: "other" } },
|
|
99
98
|
})
|
|
100
99
|
|
|
100
|
+
/**
|
|
101
|
+
* The JSON outputs of the nodes that are not renders: the hand-written table ∪
|
|
102
|
+
* the node units' `contract.jsonPips` rows (generated/unit-contracts.ts). A unit
|
|
103
|
+
* declares every one of its JSON pips (the validator's twin of the guard test)
|
|
104
|
+
* and has no `primary`: an edge with no `sourceHandle` from a unit reads no JSON.
|
|
105
|
+
*/
|
|
106
|
+
const JSON_OUTPUT_KINDS: Readonly<Record<string, JsonOutputs>> = Object.freeze(composeJsonOutputs(LEGACY_JSON_OUTPUT_KINDS, unitJsonPips()))
|
|
107
|
+
|
|
108
|
+
/** `legacy` with each unit row added as `{ pips }`, refusing a type that is in both (throws at load). */
|
|
109
|
+
function composeJsonOutputs(
|
|
110
|
+
legacy: Readonly<Record<string, JsonOutputs>>,
|
|
111
|
+
rows: ReadonlyArray<readonly [string, Readonly<Record<string, JsonOutputDeclaration>>]>,
|
|
112
|
+
): Record<string, JsonOutputs> {
|
|
113
|
+
const out: Record<string, JsonOutputs> = { ...legacy }
|
|
114
|
+
for (const [type, pips] of rows) {
|
|
115
|
+
if (Object.hasOwn(out, type)) throw new Error(`JSON_OUTPUT_KINDS: ${type} is both a legacy entry and a node unit`)
|
|
116
|
+
out[type] = { pips }
|
|
117
|
+
}
|
|
118
|
+
return out
|
|
119
|
+
}
|
|
120
|
+
|
|
101
121
|
/** The input pips whose kind is fixed by the handle vocabulary. */
|
|
102
122
|
const JSON_INPUT_KINDS: Readonly<Record<string, JsonKind>> = Object.freeze({
|
|
103
123
|
transcript: "transcript",
|