@nodaro/shared 3.33.0 → 3.35.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-2NQLSLSN.cjs → chunk-24ZKPE33.cjs} +5 -5
- package/dist/{chunk-2NQLSLSN.cjs.map → chunk-24ZKPE33.cjs.map} +1 -1
- 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-FT5CF6IA.js → chunk-2QWNPYDG.js} +3 -3
- package/dist/{chunk-FT5CF6IA.js.map → chunk-2QWNPYDG.js.map} +1 -1
- package/dist/{chunk-M7GQBRZU.cjs → chunk-3YG3MYDE.cjs} +153 -24
- package/dist/chunk-3YG3MYDE.cjs.map +1 -0
- package/dist/{chunk-VNQRI2RO.cjs → chunk-5VNBQ4QK.cjs} +16 -16
- package/dist/{chunk-VNQRI2RO.cjs.map → chunk-5VNBQ4QK.cjs.map} +1 -1
- package/dist/{chunk-K3LLGRK7.cjs → chunk-5ZCXWA7J.cjs} +59 -15
- package/dist/chunk-5ZCXWA7J.cjs.map +1 -0
- package/dist/{chunk-Z2OL5AJD.cjs → chunk-6F6GGX2W.cjs} +4 -3
- package/dist/chunk-6F6GGX2W.cjs.map +1 -0
- package/dist/{chunk-D26ENTN2.cjs → chunk-72IFMNJE.cjs} +80 -52
- package/dist/chunk-72IFMNJE.cjs.map +1 -0
- package/dist/{chunk-SAW5OK36.cjs → chunk-A5Z3IMSJ.cjs} +6 -6
- package/dist/{chunk-SAW5OK36.cjs.map → chunk-A5Z3IMSJ.cjs.map} +1 -1
- package/dist/{chunk-VA42637J.cjs → chunk-AGEZY4LL.cjs} +46 -41
- package/dist/chunk-AGEZY4LL.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-JFS3NWZ5.cjs → chunk-B7WJJHJS.cjs} +7 -4
- package/dist/chunk-B7WJJHJS.cjs.map +1 -0
- package/dist/{chunk-D6GNRSCV.cjs → chunk-BBLE4UTG.cjs} +23 -6
- package/dist/chunk-BBLE4UTG.cjs.map +1 -0
- package/dist/{chunk-HGC5JNVA.cjs → chunk-BVVKMQKR.cjs} +9 -2
- package/dist/chunk-BVVKMQKR.cjs.map +1 -0
- package/dist/{chunk-YYV35XOS.js → chunk-C4R7BTBQ.js} +4 -3
- package/dist/chunk-C4R7BTBQ.js.map +1 -0
- package/dist/{chunk-PXFQVLBX.js → chunk-ETXUOETU.js} +26 -36
- package/dist/chunk-ETXUOETU.js.map +1 -0
- package/dist/{chunk-HKFMXNVQ.cjs → chunk-F4ZT5X2S.cjs} +11 -11
- package/dist/{chunk-HKFMXNVQ.cjs.map → chunk-F4ZT5X2S.cjs.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-ZL7UM6PU.cjs → chunk-GHBXS5RT.cjs} +4 -4
- package/dist/{chunk-ZL7UM6PU.cjs.map → chunk-GHBXS5RT.cjs.map} +1 -1
- package/dist/{chunk-ZO5PBBFX.js → chunk-GKJRNIP4.js} +59 -15
- package/dist/chunk-GKJRNIP4.js.map +1 -0
- package/dist/{chunk-UCFWI6D4.js → chunk-GRIMIJJ3.js} +3 -3
- package/dist/{chunk-UCFWI6D4.js.map → chunk-GRIMIJJ3.js.map} +1 -1
- package/dist/{chunk-5RYLK3MQ.js → chunk-GVHBHUFV.js} +11 -6
- package/dist/chunk-GVHBHUFV.js.map +1 -0
- package/dist/chunk-GZH2SIOF.cjs +99 -0
- package/dist/chunk-GZH2SIOF.cjs.map +1 -0
- package/dist/{chunk-SFW3UB2P.js → chunk-IJNQYMN7.js} +4 -4
- package/dist/{chunk-SFW3UB2P.js.map → chunk-IJNQYMN7.js.map} +1 -1
- package/dist/{chunk-HC7VKIV5.cjs → chunk-IRUPCNW2.cjs} +49 -46
- package/dist/chunk-IRUPCNW2.cjs.map +1 -0
- package/dist/{chunk-JL4C5VJ7.cjs → chunk-J65CAOUV.cjs} +14 -2
- package/dist/chunk-J65CAOUV.cjs.map +1 -0
- package/dist/{chunk-23FJQTEA.js → chunk-LJMNCSDG.js} +38 -15
- package/dist/chunk-LJMNCSDG.js.map +1 -0
- package/dist/{chunk-PVJBAPYJ.js → chunk-MEN7VLQ5.js} +8 -5
- package/dist/chunk-MEN7VLQ5.js.map +1 -0
- package/dist/{chunk-PHZ23DP3.js → chunk-MUA5L25B.js} +125 -12
- package/dist/chunk-MUA5L25B.js.map +1 -0
- package/dist/{chunk-WD6HJRBG.cjs → chunk-NWXB4F6D.cjs} +21 -21
- package/dist/{chunk-WD6HJRBG.cjs.map → chunk-NWXB4F6D.cjs.map} +1 -1
- package/dist/{chunk-PQHS255G.js → chunk-OHSIVNJO.js} +3 -3
- package/dist/chunk-OHSIVNJO.js.map +1 -0
- package/dist/{chunk-XGFTL5XY.js → chunk-PVVO23LZ.js} +3 -3
- package/dist/{chunk-XGFTL5XY.js.map → chunk-PVVO23LZ.js.map} +1 -1
- package/dist/{chunk-CUH22J4D.js → chunk-Q4ZXDDWA.js} +3 -3
- package/dist/{chunk-CUH22J4D.js.map → chunk-Q4ZXDDWA.js.map} +1 -1
- package/dist/{chunk-WKOIGLQX.cjs → chunk-QIIG2QDP.cjs} +8 -8
- package/dist/{chunk-WKOIGLQX.cjs.map → chunk-QIIG2QDP.cjs.map} +1 -1
- package/dist/{chunk-QA3MVQ32.js → chunk-QXW6O56Z.js} +6 -6
- package/dist/chunk-QXW6O56Z.js.map +1 -0
- package/dist/{chunk-5PC6JBGJ.cjs → chunk-R2VF5NQG.cjs} +3 -3
- package/dist/chunk-R2VF5NQG.cjs.map +1 -0
- package/dist/{chunk-7Z5LUTGU.js → chunk-RRI5YBUK.js} +6 -3
- package/dist/{chunk-JFS3NWZ5.cjs.map → chunk-RRI5YBUK.js.map} +1 -1
- package/dist/{chunk-HUR6ZJ7S.cjs → chunk-RUKFN3LJ.cjs} +6 -6
- package/dist/{chunk-HUR6ZJ7S.cjs.map → chunk-RUKFN3LJ.cjs.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-6WZ2VN7V.js → chunk-W36WCZS2.js} +6 -6
- package/dist/{chunk-6WZ2VN7V.js.map → chunk-W36WCZS2.js.map} +1 -1
- package/dist/{chunk-M36G6SRP.js → chunk-WXNQMJ67.js} +14 -3
- package/dist/chunk-WXNQMJ67.js.map +1 -0
- package/dist/{chunk-VXPLKQWY.cjs → chunk-XE5PE54B.cjs} +30 -40
- package/dist/chunk-XE5PE54B.cjs.map +1 -0
- package/dist/{chunk-OZSACQ2V.js → chunk-XJOBMAWW.js} +3 -3
- package/dist/{chunk-OZSACQ2V.js.map → chunk-XJOBMAWW.js.map} +1 -1
- package/dist/{chunk-OTATNBMD.js → chunk-XS7FI4JA.js} +3 -3
- package/dist/{chunk-OTATNBMD.js.map → chunk-XS7FI4JA.js.map} +1 -1
- package/dist/{chunk-HRXEZ3SX.cjs → chunk-YD3JA36S.cjs} +4 -4
- package/dist/{chunk-HRXEZ3SX.cjs.map → chunk-YD3JA36S.cjs.map} +1 -1
- package/dist/chunk-YYODFQEU.cjs +25 -0
- package/dist/chunk-YYODFQEU.cjs.map +1 -0
- package/dist/{chunk-UTQSSKSG.js → chunk-ZXBSARZX.js} +4 -4
- package/dist/{chunk-UTQSSKSG.js.map → chunk-ZXBSARZX.js.map} +1 -1
- 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-VIHGmQL2.d.cts} +22 -0
- package/dist/{model-catalog-V-ZNzRSd.d.cts → model-catalog-VIHGmQL2.d.ts} +22 -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-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 +78 -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
|
@@ -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",
|
package/src/llm-models.ts
CHANGED
|
@@ -33,6 +33,24 @@ export interface LlmModelDef {
|
|
|
33
33
|
* For messages: the model id sent in the body (e.g. "claude-haiku-4-5-v1messages").
|
|
34
34
|
* For responses: the model id sent in the body (e.g. "gpt-5-4"). */
|
|
35
35
|
kieSlugOrModel: string
|
|
36
|
+
/**
|
|
37
|
+
* The registry id of the model the aggregator ACTUALLY answers this id's KIE
|
|
38
|
+
* lane with, when that is a different model. Set together with borrowing
|
|
39
|
+
* that model's `kieSlugOrModel`, so the wire names what really runs. Only
|
|
40
|
+
* the KIE lane is affected: the direct lane still serves `directGeminiModel`.
|
|
41
|
+
* The KIE lane is costed on that model's KIE rate row. A lookup by the
|
|
42
|
+
* borrowed slug ({@link getLlmModel}) always resolves to its owner, never
|
|
43
|
+
* to the borrower. Absent = KIE serves this id as itself.
|
|
44
|
+
*/
|
|
45
|
+
kieServedAs?: string
|
|
46
|
+
/**
|
|
47
|
+
* true = no longer offered: every model menu and advertised list leaves it
|
|
48
|
+
* out ({@link PICKABLE_LLM_MODELS}, {@link groupLlmModelsByVendor}), while
|
|
49
|
+
* the id stays in {@link LLM_MODEL_IDS}, so a saved node or API call that
|
|
50
|
+
* names it keeps validating, resolving and running exactly as before. No
|
|
51
|
+
* default may point at a retired model (registry test).
|
|
52
|
+
*/
|
|
53
|
+
retired?: true
|
|
36
54
|
vendor: LlmVendor
|
|
37
55
|
supportsImages: boolean
|
|
38
56
|
maxOutputTokens: number
|
|
@@ -77,6 +95,20 @@ export interface LlmModelDef {
|
|
|
77
95
|
* idea. Guarded by a registry test so the two can't both be set.
|
|
78
96
|
*/
|
|
79
97
|
preferDirect?: true
|
|
98
|
+
/**
|
|
99
|
+
* true = served ONLY on the vendor's own API (`directGeminiModel`): KIE is
|
|
100
|
+
* never called for this model — not as the primary lane, not as a failure
|
|
101
|
+
* or exhausted-account fallback, not on a pin. `kieSlugOrModel` still names
|
|
102
|
+
* the aggregator's endpoint, for the record and for a later re-enable after
|
|
103
|
+
* a re-probe; nothing sends to it.
|
|
104
|
+
*
|
|
105
|
+
* Every call therefore runs direct, so {@link llmServesDirect} is true for it
|
|
106
|
+
* and it bills on the direct rung by default, Advanced mode or not. Without a
|
|
107
|
+
* direct key the call fails as provider-unavailable rather than reaching KIE.
|
|
108
|
+
* Stronger than `preferDirect` (which keeps KIE as the fallback); the two are
|
|
109
|
+
* mutually exclusive, as are `directOnly` and `preferKie` (registry test).
|
|
110
|
+
*/
|
|
111
|
+
directOnly?: true
|
|
80
112
|
/** Effort levels this model accepts (ascending). Absent/empty = no effort lever, picker hidden. */
|
|
81
113
|
reasoningEfforts?: readonly LlmReasoningEffort[]
|
|
82
114
|
/**
|
|
@@ -265,10 +297,14 @@ export const LLM_MODELS: readonly LlmModelDef[] = [
|
|
|
265
297
|
desc: "Fast Gemini, agentic-tuned",
|
|
266
298
|
tier: "economy",
|
|
267
299
|
kieFormat: "chat-completions",
|
|
268
|
-
//
|
|
269
|
-
// (
|
|
270
|
-
//
|
|
271
|
-
|
|
300
|
+
// Retired 2026-10-19: the aggregator answers this model's own endpoint
|
|
301
|
+
// (`gemini-3-7-flash-openai`) with 3.8, so the KIE lane now names 3.8's
|
|
302
|
+
// endpoint outright and says so. The direct Google lane below still serves
|
|
303
|
+
// real 3.7, Advanced mode included. The entry leaves every picker; saved
|
|
304
|
+
// nodes and API callers that name the id keep running unchanged.
|
|
305
|
+
kieSlugOrModel: "gemini-3-8-flash-openai",
|
|
306
|
+
kieServedAs: "gemini-3.8-flash",
|
|
307
|
+
retired: true,
|
|
272
308
|
vendor: "google",
|
|
273
309
|
structuredOutputMode: "kie-response-format",
|
|
274
310
|
supportsImages: true,
|
|
@@ -462,6 +498,55 @@ export const LLM_MODELS: readonly LlmModelDef[] = [
|
|
|
462
498
|
thinkingDefaultOn: true,
|
|
463
499
|
reasoningOutputFloor: 16384,
|
|
464
500
|
},
|
|
501
|
+
{
|
|
502
|
+
id: "gemini-4-argon",
|
|
503
|
+
displayName: "Gemini 4 Argon",
|
|
504
|
+
desc: "Newest premium Gemini, 1M context",
|
|
505
|
+
tier: "premium",
|
|
506
|
+
kieFormat: "chat-completions",
|
|
507
|
+
// DIRECT-ONLY (decided 2026-10-17): KIE serves it on the OpenAI-compatible
|
|
508
|
+
// dialect under this slug (docs.kie.ai/market/gemini/gemini-4-argon-openai.md,
|
|
509
|
+
// byte-identical to the 3.8 Flash spec apart from the name), but that lane
|
|
510
|
+
// failed its probe the same day — of 15 completed calls, 6 came back HTTP 200
|
|
511
|
+
// `finish_reason: stop` with an EMPTY reply (both image calls among them,
|
|
512
|
+
// each still charged), `completion_tokens` was NEGATIVE on reasoning calls
|
|
513
|
+
// (-33, -38), replies leaked code-execution fences (```python?code_reference),
|
|
514
|
+
// `response_format` json_schema left an enum field holding prose, and an
|
|
515
|
+
// off-enum `reasoning_effort: medium` was an empty 200 rather than an error.
|
|
516
|
+
// So no call reaches KIE (`directOnly`); the slug is kept for the record.
|
|
517
|
+
// Re-enable it only after a re-probe of that lane comes back clean.
|
|
518
|
+
// KIE also flags the page "Chat only — not yet adapted for agent use", like
|
|
519
|
+
// kimi-k3 / deepseek below: it may not back a tool-loop feature. No registry
|
|
520
|
+
// gate enforces that today — the only tool loops (Workflow Copilot, the
|
|
521
|
+
// pipeline stage calls) are Claude-only by construction.
|
|
522
|
+
kieSlugOrModel: "gemini-4-argon-openai",
|
|
523
|
+
vendor: "google",
|
|
524
|
+
// The direct lane enforces `responseJsonSchema` (an enum field came back
|
|
525
|
+
// in-enum, 2026-10-17). This mode is what turns that schema on there.
|
|
526
|
+
structuredOutputMode: "kie-response-format",
|
|
527
|
+
supportsImages: true,
|
|
528
|
+
// The registry's usual 16384 default. Google's own cap is 32,768
|
|
529
|
+
// (models.list); every call is floored to that (`thinkingDefaultOn`, below).
|
|
530
|
+
maxOutputTokens: 16384,
|
|
531
|
+
directGeminiModel: "gemini-4-argon",
|
|
532
|
+
directOnly: true,
|
|
533
|
+
// The direct lane's ladder, and the only one: every call runs there.
|
|
534
|
+
// Google rejects thinkingLevel MINIMAL on this model with a 400 ("not
|
|
535
|
+
// supported for this model") and accepts LOW / MEDIUM / HIGH (probed
|
|
536
|
+
// 2026-10-17) — 3.1 Pro's shape, not the flash one. `none` maps to MINIMAL
|
|
537
|
+
// in the direct client, so it is not offered; a `none` request clamps to
|
|
538
|
+
// Auto.
|
|
539
|
+
reasoningEfforts: ["low", "medium", "high"],
|
|
540
|
+
// Gemini's documented default (dynamic thinking with no param sent). The no-param
|
|
541
|
+
// call reported no thought tokens on a two-part puzzle (HIGH reported 452),
|
|
542
|
+
// so this is the vendor default rather than a measurement — kept because it
|
|
543
|
+
// only raises the output ceiling. No `reasoningOutputFloor`: its one lane
|
|
544
|
+
// is Google's, whose cap IS the default 32768 (models.list), and calls sent
|
|
545
|
+
// maxOutputTokens 32768 / 65536 were served, not refused (2026-10-17). How
|
|
546
|
+
// much output it gives at that cap is unmeasured — both long-output probes
|
|
547
|
+
// ended early (one declined the task, one stopped on RECITATION).
|
|
548
|
+
thinkingDefaultOn: true,
|
|
549
|
+
},
|
|
465
550
|
{
|
|
466
551
|
id: "claude-opus-4.7",
|
|
467
552
|
displayName: "Claude Opus 4.7",
|
|
@@ -948,6 +1033,24 @@ export const LLM_MODELS: readonly LlmModelDef[] = [
|
|
|
948
1033
|
|
|
949
1034
|
export const LLM_MODEL_IDS = LLM_MODELS.map((m) => m.id)
|
|
950
1035
|
|
|
1036
|
+
/** True when the model is registered but retired (see `LlmModelDef.retired`). */
|
|
1037
|
+
export function isLlmModelRetired(id: string): boolean {
|
|
1038
|
+
return getLlmModel(id)?.retired === true
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/** The models a picker may OFFER: the registry minus retired entries. The
|
|
1042
|
+
* accepted set is still {@link LLM_MODEL_IDS}. */
|
|
1043
|
+
export const PICKABLE_LLM_MODELS: readonly LlmModelDef[] = LLM_MODELS.filter((m) => !m.retired)
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* {@link PICKABLE_LLM_MODELS}, plus `currentId`'s own entry when it is a
|
|
1047
|
+
* retired model — for a plain select that has to keep showing a saved node's
|
|
1048
|
+
* value as selected. Registry order either way.
|
|
1049
|
+
*/
|
|
1050
|
+
export function pickableLlmModels(currentId?: string): LlmModelDef[] {
|
|
1051
|
+
return LLM_MODELS.filter((m) => !m.retired || m.id === currentId)
|
|
1052
|
+
}
|
|
1053
|
+
|
|
951
1054
|
/** Vision models that can return GUARANTEED structured output — the
|
|
952
1055
|
* describe-to-picker analyzer forces a schema over an image, so its model
|
|
953
1056
|
* pickers AND the backend route gate offer exactly these: Anthropic (forced
|
|
@@ -991,12 +1094,14 @@ export interface LlmModelGroup {
|
|
|
991
1094
|
* A flat registry-order dump was genuinely hard to scan at 17 models — every
|
|
992
1095
|
* picker (config panel, quick strips, quick toolbar) derives from this so the
|
|
993
1096
|
* menus can't drift apart. Groups with no models (after `filter`) are omitted.
|
|
1097
|
+
* Retired models are never listed, whatever list is passed in: a menu offers
|
|
1098
|
+
* only what can be picked (a saved retired value is labelled by the caller).
|
|
994
1099
|
*/
|
|
995
1100
|
export function groupLlmModelsByVendor(models: readonly LlmModelDef[] = LLM_MODELS): LlmModelGroup[] {
|
|
996
1101
|
const groups: LlmModelGroup[] = []
|
|
997
1102
|
for (const vendor of LLM_VENDOR_ORDER) {
|
|
998
1103
|
const members = models
|
|
999
|
-
.filter((m) => m.vendor === vendor)
|
|
1104
|
+
.filter((m) => m.vendor === vendor && !m.retired)
|
|
1000
1105
|
.sort((a, b) => TIER_RANK[a.tier] - TIER_RANK[b.tier])
|
|
1001
1106
|
if (members.length > 0) groups.push({ vendor, label: LLM_VENDOR_LABELS[vendor], models: members })
|
|
1002
1107
|
}
|
|
@@ -1057,17 +1162,17 @@ export function motionGraphicsFeature(engine?: string): LlmFeature {
|
|
|
1057
1162
|
|
|
1058
1163
|
/** Feature → default model when user hasn't selected one */
|
|
1059
1164
|
export const LLM_FEATURE_DEFAULTS: Record<LlmFeature, string> = {
|
|
1060
|
-
"ai-writer": "claude-sonnet-
|
|
1165
|
+
"ai-writer": "claude-sonnet-5.5",
|
|
1061
1166
|
"llm-chat": "gemini-3.6-flash",
|
|
1062
1167
|
"prompt-helper": "gemini-3.6-flash",
|
|
1063
|
-
"scene-graph-ai": "claude-sonnet-
|
|
1064
|
-
"after-effects": "claude-sonnet-
|
|
1065
|
-
"motion-graphics": "claude-sonnet-
|
|
1066
|
-
"motion-graphics-lottie": "claude-sonnet-
|
|
1067
|
-
"lottie-overlay": "claude-sonnet-
|
|
1068
|
-
"3d-title": "claude-sonnet-
|
|
1069
|
-
"3d-scene": "claude-sonnet-
|
|
1070
|
-
"image-to-text": "claude-sonnet-
|
|
1168
|
+
"scene-graph-ai": "claude-sonnet-5.5",
|
|
1169
|
+
"after-effects": "claude-sonnet-5.5",
|
|
1170
|
+
"motion-graphics": "claude-sonnet-5.5",
|
|
1171
|
+
"motion-graphics-lottie": "claude-sonnet-5.5",
|
|
1172
|
+
"lottie-overlay": "claude-sonnet-5.5",
|
|
1173
|
+
"3d-title": "claude-sonnet-5.5",
|
|
1174
|
+
"3d-scene": "claude-sonnet-5.5",
|
|
1175
|
+
"image-to-text": "claude-sonnet-5.5",
|
|
1071
1176
|
// Economy on purpose: the analysis reads ONE frame + the copy per ad and
|
|
1072
1177
|
// runs once per returned ad — volume, not depth. Must stay an image-capable
|
|
1073
1178
|
// structured-output model (STRUCTURED_VISION_MODELS); a registry test pins it.
|
|
@@ -1078,8 +1183,8 @@ export const LLM_FEATURE_DEFAULTS: Record<LlmFeature, string> = {
|
|
|
1078
1183
|
"qa-check": "gemini-3.6-flash",
|
|
1079
1184
|
"generate-script": "gemini-3.6-flash",
|
|
1080
1185
|
"translate": "gemini-3.6-flash",
|
|
1081
|
-
"image-critic": "claude-sonnet-
|
|
1082
|
-
"pick-best-llm": "claude-sonnet-
|
|
1186
|
+
"image-critic": "claude-sonnet-5.5",
|
|
1187
|
+
"pick-best-llm": "claude-sonnet-5.5",
|
|
1083
1188
|
"workflow-copilot": "claude-sonnet-5",
|
|
1084
1189
|
// Both economy on purpose — measured: ten ideas in Hebrew took ~1 min here
|
|
1085
1190
|
// and ~3.5 min (two calls) on claude-sonnet-4.6. The private plugin keeps
|
|
@@ -1088,6 +1193,21 @@ export const LLM_FEATURE_DEFAULTS: Record<LlmFeature, string> = {
|
|
|
1088
1193
|
"content-ideas": "gemini-3.6-flash",
|
|
1089
1194
|
}
|
|
1090
1195
|
|
|
1196
|
+
/**
|
|
1197
|
+
* The model describe-to-picker re-asks ONCE when a Claude analyzer could not
|
|
1198
|
+
* answer for a platform-side reason: its direct lane down or the platform's
|
|
1199
|
+
* account refused, and the KIE retry of the same Claude model failing too,
|
|
1200
|
+
* answering with nothing valid, or answering empty. KIE's Claude endpoint
|
|
1201
|
+
* drops images when tools are sent, so that retry is the weak leg; see
|
|
1202
|
+
* backend/src/lib/llm/kie-lane.ts.
|
|
1203
|
+
*
|
|
1204
|
+
* Gemini because a Claude outage does not touch it: another vendor, on its
|
|
1205
|
+
* own lanes. Must stay an image-capable structured-output model
|
|
1206
|
+
* (STRUCTURED_VISION_MODELS — a registry test pins it); the route charges an
|
|
1207
|
+
* answer from it at this model's own credit price.
|
|
1208
|
+
*/
|
|
1209
|
+
export const DESCRIBE_TO_PICKER_FALLBACK_MODEL = "gemini-3.8-flash"
|
|
1210
|
+
|
|
1091
1211
|
/**
|
|
1092
1212
|
* Feature → the reasoning effort its DEFAULT model runs at when the caller
|
|
1093
1213
|
* sends none. Read it through {@link defaultReasoningEffort}, never directly:
|
|
@@ -1152,6 +1272,12 @@ export const LLM_MODALITY_CAPS: Record<string, { image: boolean; video: boolean;
|
|
|
1152
1272
|
// with that VA-side decision.
|
|
1153
1273
|
"gemini-3.8-flash": { image: true, video: false, audio: false },
|
|
1154
1274
|
"gemini-3.1-pro": { image: true, video: true, audio: true },
|
|
1275
|
+
// gemini-4-argon is IMAGE-ONLY by DECISION, not omission (decided 2026-10-17):
|
|
1276
|
+
// the model DOES read video and audio, but full caps would
|
|
1277
|
+
// auto-enroll it in VIDEO_ANALYSIS_LLM_MODELS (derived below) and force a
|
|
1278
|
+
// video-analysis tier + pricing decision. That waits on a Video Analysis
|
|
1279
|
+
// bake-off; flip these two flags ONLY together with its outcome.
|
|
1280
|
+
"gemini-4-argon": { image: true, video: false, audio: false },
|
|
1155
1281
|
"claude-haiku-4.5": { image: true, video: false, audio: false },
|
|
1156
1282
|
"claude-haiku-5.5": { image: true, video: false, audio: false },
|
|
1157
1283
|
"claude-sonnet-4.6": { image: true, video: false, audio: false },
|
|
@@ -1199,6 +1325,15 @@ function dashAliasToCanonical(id: string): string {
|
|
|
1199
1325
|
return id.replace(/-(\d+)-(\d+)$/, "-$1.$2")
|
|
1200
1326
|
}
|
|
1201
1327
|
|
|
1328
|
+
/**
|
|
1329
|
+
* Retired provider slugs that still name a registered model — a model whose KIE
|
|
1330
|
+
* lane moved to another model's endpoint (`kieServedAs`) no longer carries its
|
|
1331
|
+
* old slug, but stored configs and job rows may.
|
|
1332
|
+
*/
|
|
1333
|
+
const LEGACY_PROVIDER_SLUGS: Readonly<Record<string, string>> = {
|
|
1334
|
+
"gemini-3-7-flash-openai": "gemini-3.7-flash",
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1202
1337
|
export function getLlmModel(id: string): LlmModelDef | undefined {
|
|
1203
1338
|
const exact = LLM_MODELS.find((m) => m.id === id)
|
|
1204
1339
|
if (exact) return exact
|
|
@@ -1207,11 +1342,18 @@ export function getLlmModel(id: string): LlmModelDef | undefined {
|
|
|
1207
1342
|
const aliased = LLM_MODELS.find((m) => m.id === canonical)
|
|
1208
1343
|
if (aliased) return aliased
|
|
1209
1344
|
}
|
|
1345
|
+
const legacy = LEGACY_PROVIDER_SLUGS[id]
|
|
1346
|
+
if (legacy) return LLM_MODELS.find((m) => m.id === legacy)
|
|
1210
1347
|
// Last resort: provider slugs double as historical aliases (e.g. the
|
|
1211
1348
|
// dated Anthropic slugs, the `-preview`-suffixed Google ids) — accept any
|
|
1212
|
-
// model whose slug matches exactly, on either lane.
|
|
1349
|
+
// model whose slug matches exactly, on either lane. A KIE slug borrowed
|
|
1350
|
+
// through `kieServedAs` belongs to the model that answers it, so the
|
|
1351
|
+
// borrower never matches on it — whatever the registry order.
|
|
1213
1352
|
return LLM_MODELS.find(
|
|
1214
|
-
(m) =>
|
|
1353
|
+
(m) =>
|
|
1354
|
+
(m.kieSlugOrModel === id && !m.kieServedAs) ||
|
|
1355
|
+
m.directFallbackModel === id ||
|
|
1356
|
+
m.directGeminiModel === id,
|
|
1215
1357
|
)
|
|
1216
1358
|
}
|
|
1217
1359
|
|
|
@@ -1342,9 +1484,10 @@ export const ADVANCED_MODE_UNAVAILABLE_REASON =
|
|
|
1342
1484
|
* Is this call served on the vendor's own API — and therefore billed as such?
|
|
1343
1485
|
*
|
|
1344
1486
|
* The rule (decided 2026-10-08): a call is priced on the lane it runs on.
|
|
1345
|
-
* It runs direct when Advanced mode is on,
|
|
1346
|
-
*
|
|
1347
|
-
*
|
|
1487
|
+
* It runs direct when Advanced mode is on, when the model is served nowhere
|
|
1488
|
+
* else (`directOnly`), or when it carries a reasoning effort on a model whose
|
|
1489
|
+
* effort only works there (`effortRequiresDirect` — the Claude family).
|
|
1490
|
+
* Everything else runs on the aggregator at its price,
|
|
1348
1491
|
* falling back to the vendor's API only if the aggregator fails (at no extra
|
|
1349
1492
|
* charge).
|
|
1350
1493
|
*
|
|
@@ -1358,7 +1501,7 @@ export function llmServesDirect(
|
|
|
1358
1501
|
advancedMode?: boolean,
|
|
1359
1502
|
): boolean {
|
|
1360
1503
|
if (!supportsAdvancedMode(modelId)) return false
|
|
1361
|
-
if (advancedMode) return true
|
|
1504
|
+
if (advancedMode || getLlmModel(modelId!)?.directOnly) return true
|
|
1362
1505
|
return Boolean(
|
|
1363
1506
|
getLlmModel(modelId!)?.effortRequiresDirect && effectiveReasoningEffort(modelId, reasoningEffort) !== undefined,
|
|
1364
1507
|
)
|
|
@@ -1390,18 +1533,28 @@ export function buildLlmCreditIdentifier(
|
|
|
1390
1533
|
advancedMode?: boolean,
|
|
1391
1534
|
): string {
|
|
1392
1535
|
if (!modelId) return feature
|
|
1536
|
+
return llmCreditIdForRung(feature, llmCreditRung(modelId, reasoningEffort, advancedMode))
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
/**
|
|
1540
|
+
* The rung a call on `modelId` bills on — the half of
|
|
1541
|
+
* {@link buildLlmCreditIdentifier} a feature with its own id shape reads (the
|
|
1542
|
+
* social scrapers' per-post analysis), so its rung cannot drift from the LLM
|
|
1543
|
+
* features'.
|
|
1544
|
+
*/
|
|
1545
|
+
export function llmCreditRung(modelId: string, reasoningEffort?: string, advancedMode?: boolean): LlmCreditRung {
|
|
1393
1546
|
let tier = getLlmTier(modelId)
|
|
1394
1547
|
const eff = effectiveReasoningEffort(modelId, reasoningEffort)
|
|
1395
1548
|
if (eff !== undefined && EFFORT_TIER_BUMP.has(eff)) tier = bumpTier(tier)
|
|
1396
|
-
// A call served on the vendor's own API (Advanced mode,
|
|
1397
|
-
// model whose effort only works there — llmServesDirect)
|
|
1398
|
-
// more per token than the aggregator. It bumps
|
|
1399
|
-
// bump — the two are separate cost levers and
|
|
1400
|
-
// max-effort advanced economy call lands at premium —
|
|
1401
|
-
// ladder, so a premium model served direct lands at
|
|
1402
|
-
// flag on a model with no direct lane never
|
|
1403
|
-
|
|
1404
|
-
return
|
|
1549
|
+
// A call served on the vendor's own API (Advanced mode, a directOnly model,
|
|
1550
|
+
// or an effort on a model whose effort only works there — llmServesDirect)
|
|
1551
|
+
// bills materially more per token than the aggregator. It bumps
|
|
1552
|
+
// INDEPENDENTLY of the effort bump — the two are separate cost levers and
|
|
1553
|
+
// genuinely stack, so a max-effort advanced economy call lands at premium —
|
|
1554
|
+
// and on the four-rung ladder, so a premium model served direct lands at
|
|
1555
|
+
// `premium-direct`. A stale flag on a model with no direct lane never
|
|
1556
|
+
// inflates a bill.
|
|
1557
|
+
return llmServesDirect(modelId, reasoningEffort, advancedMode) ? bumpToDirectRung(tier) : tier
|
|
1405
1558
|
}
|
|
1406
1559
|
|
|
1407
1560
|
/** One rung up the four-rung ladder — the direct-lane bump. */
|
package/src/meta-ads-scrape.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* can never land outside the tier set — an identifier missing from
|
|
19
19
|
* `model_pricing` is a 503 `price_not_configured`, never a silent fallback.
|
|
20
20
|
*/
|
|
21
|
-
import { LLM_FEATURE_DEFAULTS,
|
|
21
|
+
import { LLM_CREDIT_RUNGS, LLM_FEATURE_DEFAULTS, llmCreditRung } from "./llm-models.js"
|
|
22
22
|
|
|
23
23
|
export const META_ADS_SCRAPE_NODE_TYPE = "meta-ads-scrape" as const
|
|
24
24
|
|
|
@@ -197,14 +197,22 @@ export type MetaAdsScrapeTier = (typeof META_ADS_SCRAPE_TIERS)[number]
|
|
|
197
197
|
* meta-ads-scrape:<tier>:analysis tier × (1 + 3) standard models
|
|
198
198
|
* meta-ads-scrape:<tier>:analysis:economy tier × (1 + 1)
|
|
199
199
|
* meta-ads-scrape:<tier>:analysis:premium tier × (1 + 4)
|
|
200
|
+
* meta-ads-scrape:<tier>:analysis:premium-direct tier × (1 + 10)
|
|
200
201
|
*
|
|
201
|
-
* The per-ad SKUs (`meta-ads-analysis[:economy|:premium]`)
|
|
202
|
-
* SETTLEMENT: a run commits tier + per-ad × ads actually analysed
|
|
203
|
-
* refunds the rest (an ad the model failed on, or one the deadline skipped).
|
|
202
|
+
* The per-ad SKUs (`meta-ads-analysis[:economy|:premium|:premium-direct]`)
|
|
203
|
+
* price the SETTLEMENT: a run commits tier + per-ad × ads actually analysed
|
|
204
|
+
* and refunds the rest (an ad the model failed on, or one the deadline skipped).
|
|
205
|
+
*
|
|
206
|
+
* The tiers are the LLM credit rungs, read through `llmCreditRung` exactly as
|
|
207
|
+
* the LLM features read them: a model served on its vendor's own API (today
|
|
208
|
+
* only a `directOnly` one — the routes send no effort and no Advanced flag)
|
|
209
|
+
* moves one rung up, so a premium one bills `premium-direct`. Its per-ad price
|
|
210
|
+
* is the premium one × the LLM direct multiplier, rounded up — the rule every
|
|
211
|
+
* LLM feature's direct rung follows (held to it by a backend billing test).
|
|
204
212
|
*/
|
|
205
|
-
export const META_ADS_ANALYSIS_TIERS =
|
|
213
|
+
export const META_ADS_ANALYSIS_TIERS = LLM_CREDIT_RUNGS
|
|
206
214
|
export type MetaAdsAnalysisTier = (typeof META_ADS_ANALYSIS_TIERS)[number]
|
|
207
|
-
export const META_ADS_ANALYSIS_CREDITS_PER_AD: Record<MetaAdsAnalysisTier, number> = { economy: 1, standard: 3, premium: 4 }
|
|
215
|
+
export const META_ADS_ANALYSIS_CREDITS_PER_AD: Record<MetaAdsAnalysisTier, number> = { economy: 1, standard: 3, premium: 4, "premium-direct": 10 }
|
|
208
216
|
export const META_ADS_ANALYSIS_CREDIT_ID = "meta-ads-analysis" as const
|
|
209
217
|
/** The user's optional analyst focus, appended to the fixed prompt. */
|
|
210
218
|
export const META_ADS_ANALYSIS_FOCUS_MAX = 500
|
|
@@ -214,10 +222,10 @@ export function metaAdsAnalysisCreditId(tier: MetaAdsAnalysisTier): string {
|
|
|
214
222
|
return tier === "standard" ? META_ADS_ANALYSIS_CREDIT_ID : `${META_ADS_ANALYSIS_CREDIT_ID}:${tier}`
|
|
215
223
|
}
|
|
216
224
|
|
|
217
|
-
/** The analysing model's
|
|
225
|
+
/** The analysing model's credit rung; an absent model is the feature default. */
|
|
218
226
|
export function metaAdsAnalysisTier(modelId?: unknown): MetaAdsAnalysisTier {
|
|
219
227
|
const id = typeof modelId === "string" && modelId ? modelId : LLM_FEATURE_DEFAULTS["meta-ads-analysis"]
|
|
220
|
-
return
|
|
228
|
+
return llmCreditRung(id)
|
|
221
229
|
}
|
|
222
230
|
|
|
223
231
|
/** What one analysed ad carries (`ad.analysis`); fixed fields + string lists only — never a map (Gemini via KIE drops map fields). */
|