@nodaro/shared 1.21.0 → 1.23.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/index.cjs +240 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +343 -7
- package/dist/index.d.ts +343 -7
- package/dist/index.js +229 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/llm-models.test.ts +157 -0
- package/src/__tests__/video-analysis-catalog-sync.test.ts +102 -0
- package/src/__tests__/video-analysis-pricing.test.ts +5 -4
- package/src/__tests__/video-analysis.test.ts +133 -1
- package/src/index.ts +6 -0
- package/src/llm-models.ts +184 -11
- package/src/model-catalog.ts +20 -20
- package/src/video-analysis-pricing.ts +21 -18
- package/src/video-analysis.ts +191 -1
package/dist/index.cjs
CHANGED
|
@@ -1667,11 +1667,11 @@ var VIDEO_MODELS = {
|
|
|
1667
1667
|
description: "Legacy fast-tier analysis model (pre-2026-07). Kept so stored raw-model configs keep running and keep pricing under their own identifier; new fast-tier runs use the current fast model.",
|
|
1668
1668
|
useCases: ["video-analysis", "shot-list", "fast"],
|
|
1669
1669
|
pricing: [
|
|
1670
|
-
{ identifier: "video-analysis:gemini-3-flash", credits:
|
|
1671
|
-
{ identifier: "video-analysis:gemini-3-flash:60s", credits:
|
|
1672
|
-
{ identifier: "video-analysis:gemini-3-flash:180s", credits:
|
|
1673
|
-
{ identifier: "video-analysis:gemini-3-flash:360s", credits:
|
|
1674
|
-
{ identifier: "video-analysis:gemini-3-flash:600s", credits:
|
|
1670
|
+
{ identifier: "video-analysis:gemini-3-flash", credits: 112, note: "10-min ceiling (no duration given)" },
|
|
1671
|
+
{ identifier: "video-analysis:gemini-3-flash:60s", credits: 21 },
|
|
1672
|
+
{ identifier: "video-analysis:gemini-3-flash:180s", credits: 24 },
|
|
1673
|
+
{ identifier: "video-analysis:gemini-3-flash:360s", credits: 68 },
|
|
1674
|
+
{ identifier: "video-analysis:gemini-3-flash:600s", credits: 112, note: "10-min ceiling" }
|
|
1675
1675
|
]
|
|
1676
1676
|
},
|
|
1677
1677
|
"gemini-3.6-flash-video-analysis": {
|
|
@@ -1684,11 +1684,11 @@ var VIDEO_MODELS = {
|
|
|
1684
1684
|
description: "Analyze a video into a structured shot list (scenes, camera, audio) \u2014 fast, economy tier. Billed per duration bucket.",
|
|
1685
1685
|
useCases: ["video-analysis", "shot-list", "fast"],
|
|
1686
1686
|
pricing: [
|
|
1687
|
-
{ identifier: "video-analysis:gemini-3.6-flash", credits:
|
|
1688
|
-
{ identifier: "video-analysis:gemini-3.6-flash:60s", credits:
|
|
1689
|
-
{ identifier: "video-analysis:gemini-3.6-flash:180s", credits:
|
|
1690
|
-
{ identifier: "video-analysis:gemini-3.6-flash:360s", credits:
|
|
1691
|
-
{ identifier: "video-analysis:gemini-3.6-flash:600s", credits:
|
|
1687
|
+
{ identifier: "video-analysis:gemini-3.6-flash", credits: 291, note: "10-min ceiling (no duration given)" },
|
|
1688
|
+
{ identifier: "video-analysis:gemini-3.6-flash:60s", credits: 54 },
|
|
1689
|
+
{ identifier: "video-analysis:gemini-3.6-flash:180s", credits: 63 },
|
|
1690
|
+
{ identifier: "video-analysis:gemini-3.6-flash:360s", credits: 175 },
|
|
1691
|
+
{ identifier: "video-analysis:gemini-3.6-flash:600s", credits: 291, note: "10-min ceiling" }
|
|
1692
1692
|
]
|
|
1693
1693
|
},
|
|
1694
1694
|
"gemini-3.1-pro-video-analysis": {
|
|
@@ -1701,11 +1701,11 @@ var VIDEO_MODELS = {
|
|
|
1701
1701
|
description: "Analyze a video into a structured shot list (scenes, camera, audio) \u2014 higher-fidelity, default tier. Billed per duration bucket.",
|
|
1702
1702
|
useCases: ["video-analysis", "shot-list", "cinematic"],
|
|
1703
1703
|
pricing: [
|
|
1704
|
-
{ identifier: "video-analysis:gemini-3.1-pro", credits:
|
|
1705
|
-
{ identifier: "video-analysis:gemini-3.1-pro:60s", credits:
|
|
1706
|
-
{ identifier: "video-analysis:gemini-3.1-pro:180s", credits:
|
|
1707
|
-
{ identifier: "video-analysis:gemini-3.1-pro:360s", credits:
|
|
1708
|
-
{ identifier: "video-analysis:gemini-3.1-pro:600s", credits:
|
|
1704
|
+
{ identifier: "video-analysis:gemini-3.1-pro", credits: 448, note: "10-min ceiling (no duration given)" },
|
|
1705
|
+
{ identifier: "video-analysis:gemini-3.1-pro:60s", credits: 84 },
|
|
1706
|
+
{ identifier: "video-analysis:gemini-3.1-pro:180s", credits: 96 },
|
|
1707
|
+
{ identifier: "video-analysis:gemini-3.1-pro:360s", credits: 269 },
|
|
1708
|
+
{ identifier: "video-analysis:gemini-3.1-pro:600s", credits: 448, note: "10-min ceiling" }
|
|
1709
1709
|
]
|
|
1710
1710
|
},
|
|
1711
1711
|
// Both mixed tiers are variants of the same advanced multi-engine analysis
|
|
@@ -1721,11 +1721,11 @@ var VIDEO_MODELS = {
|
|
|
1721
1721
|
description: "Our most advanced analysis tier \u2014 multiple analysis engines combined into one result for maximum completeness and accuracy. Billed per duration bucket.",
|
|
1722
1722
|
useCases: ["video-analysis", "shot-list", "premium", "most-complete"],
|
|
1723
1723
|
pricing: [
|
|
1724
|
-
{ identifier: "video-analysis:mixed", credits:
|
|
1725
|
-
{ identifier: "video-analysis:mixed:60s", credits:
|
|
1726
|
-
{ identifier: "video-analysis:mixed:180s", credits:
|
|
1727
|
-
{ identifier: "video-analysis:mixed:360s", credits:
|
|
1728
|
-
{ identifier: "video-analysis:mixed:600s", credits:
|
|
1724
|
+
{ identifier: "video-analysis:mixed", credits: 739, note: "10-min ceiling (no duration given)" },
|
|
1725
|
+
{ identifier: "video-analysis:mixed:60s", credits: 137 },
|
|
1726
|
+
{ identifier: "video-analysis:mixed:180s", credits: 158 },
|
|
1727
|
+
{ identifier: "video-analysis:mixed:360s", credits: 443 },
|
|
1728
|
+
{ identifier: "video-analysis:mixed:600s", credits: 739, note: "10-min ceiling" }
|
|
1729
1729
|
]
|
|
1730
1730
|
}
|
|
1731
1731
|
};
|
|
@@ -4281,7 +4281,14 @@ var LLM_MODELS = [
|
|
|
4281
4281
|
vendor: "google",
|
|
4282
4282
|
structuredOutputMode: "kie-response-format",
|
|
4283
4283
|
supportsImages: true,
|
|
4284
|
-
maxOutputTokens: 8192
|
|
4284
|
+
maxOutputTokens: 8192,
|
|
4285
|
+
// KIE-first: no `preferDirect` — direct is the reliability fallback only.
|
|
4286
|
+
// (Per-lane rates are deliberately NOT in this published package; see
|
|
4287
|
+
// backend/src/lib/pricing/llm-cost.ts.)
|
|
4288
|
+
directGeminiModel: "gemini-3-flash-preview",
|
|
4289
|
+
// No `reasoningEfforts` at all on the KIE lane, but the vendor API accepts
|
|
4290
|
+
// the full minimal→high ladder (`none` maps to Google's `minimal`).
|
|
4291
|
+
directReasoningEfforts: ["none", "low", "medium", "high"]
|
|
4285
4292
|
},
|
|
4286
4293
|
{
|
|
4287
4294
|
id: "gemini-3.6-flash",
|
|
@@ -4299,7 +4306,19 @@ var LLM_MODELS = [
|
|
|
4299
4306
|
maxOutputTokens: 8192,
|
|
4300
4307
|
// KIE's 3.6 endpoint accepts `reasoning_effort: low | high` (thinking
|
|
4301
4308
|
// level) — exactly the chat-completions wire mapping deriveParams sends.
|
|
4302
|
-
|
|
4309
|
+
// Google's own API additionally accepts `minimal` and `medium` on this
|
|
4310
|
+
// model; the set stays at the KIE-safe intersection because ONE field
|
|
4311
|
+
// feeds both lanes and this model is KIE-first. Widen it only if/when
|
|
4312
|
+
// `preferDirect` is set here.
|
|
4313
|
+
reasoningEfforts: ["low", "high"],
|
|
4314
|
+
// Google's own API additionally accepts `minimal` and `medium` here —
|
|
4315
|
+
// live-verified 2026-07-28. Advanced mode unlocks them.
|
|
4316
|
+
directReasoningEfforts: ["none", "low", "medium", "high"],
|
|
4317
|
+
// KIE-first: this model backs 5 of the LLM_FEATURE_DEFAULTS plus the
|
|
4318
|
+
// video-analysis fast tier, so it carries the highest call volume of any
|
|
4319
|
+
// Gemini entry — the lane with the lower unit cost wins by default and
|
|
4320
|
+
// direct is the reliability fallback only.
|
|
4321
|
+
directGeminiModel: "gemini-3.6-flash"
|
|
4303
4322
|
},
|
|
4304
4323
|
{
|
|
4305
4324
|
id: "claude-haiku-4.5",
|
|
@@ -4349,7 +4368,19 @@ var LLM_MODELS = [
|
|
|
4349
4368
|
vendor: "google",
|
|
4350
4369
|
structuredOutputMode: "kie-response-format",
|
|
4351
4370
|
supportsImages: true,
|
|
4352
|
-
maxOutputTokens: 16384
|
|
4371
|
+
maxOutputTokens: 16384,
|
|
4372
|
+
directGeminiModel: "gemini-3.1-pro-preview",
|
|
4373
|
+
// Google documents low/medium/high for 3.1 Pro — no `minimal` tier, so
|
|
4374
|
+
// this ladder is deliberately shorter than the flash models'.
|
|
4375
|
+
directReasoningEfforts: ["low", "medium", "high"],
|
|
4376
|
+
// The ONE Gemini model routed direct-first. It is the premium/low-volume
|
|
4377
|
+
// tier (video-analysis `pro`, no LLM_FEATURE_DEFAULTS entry), so the ~4×
|
|
4378
|
+
// list-price premium lands on the smallest call volume — and it is where
|
|
4379
|
+
// the direct lane's capability wins actually matter: real `thinkingLevel`
|
|
4380
|
+
// control, native media ingestion, and a `responseJsonSchema` that honours
|
|
4381
|
+
// `additionalProperties` (KIE's `response_format` silently DROPS
|
|
4382
|
+
// record/map-shaped fields — see the z.record rule in backend/CLAUDE.md).
|
|
4383
|
+
preferDirect: true
|
|
4353
4384
|
},
|
|
4354
4385
|
{
|
|
4355
4386
|
id: "claude-opus-4.7",
|
|
@@ -4569,14 +4600,24 @@ function getLlmModel(id) {
|
|
|
4569
4600
|
const aliased = LLM_MODELS.find((m) => m.id === canonical);
|
|
4570
4601
|
if (aliased) return aliased;
|
|
4571
4602
|
}
|
|
4572
|
-
return LLM_MODELS.find(
|
|
4603
|
+
return LLM_MODELS.find(
|
|
4604
|
+
(m) => m.kieSlugOrModel === id || m.directFallbackModel === id || m.directGeminiModel === id
|
|
4605
|
+
);
|
|
4573
4606
|
}
|
|
4574
4607
|
function getLlmTier(id) {
|
|
4575
4608
|
return getLlmModel(id)?.tier ?? "standard";
|
|
4576
4609
|
}
|
|
4577
|
-
function
|
|
4610
|
+
function availableReasoningEfforts(modelId, advanced = false) {
|
|
4611
|
+
const model = getLlmModel(modelId ?? "");
|
|
4612
|
+
if (!model) return [];
|
|
4613
|
+
if (advanced && supportsAdvancedMode(modelId)) {
|
|
4614
|
+
return model.directReasoningEfforts ?? model.reasoningEfforts ?? [];
|
|
4615
|
+
}
|
|
4616
|
+
return model.reasoningEfforts ?? [];
|
|
4617
|
+
}
|
|
4618
|
+
function effectiveReasoningEffort(modelId, requested, advanced = false) {
|
|
4578
4619
|
if (!requested || !(requested in EFFORT_RANK)) return void 0;
|
|
4579
|
-
const levels =
|
|
4620
|
+
const levels = availableReasoningEfforts(modelId, advanced);
|
|
4580
4621
|
if (!levels || levels.length === 0) return void 0;
|
|
4581
4622
|
const req = requested;
|
|
4582
4623
|
let best;
|
|
@@ -4585,20 +4626,51 @@ function effectiveReasoningEffort(modelId, requested) {
|
|
|
4585
4626
|
}
|
|
4586
4627
|
return best;
|
|
4587
4628
|
}
|
|
4588
|
-
|
|
4629
|
+
var LLM_ROUTE_DEFAULTS = {
|
|
4630
|
+
"llm-chat": { temperature: 0.7, maxTokens: 8192 },
|
|
4631
|
+
"ai-writer": { temperature: 0.7, maxTokens: 8192 },
|
|
4632
|
+
"prompt-helper": { temperature: 0.7, maxTokens: 8192, structuredOutput: true },
|
|
4633
|
+
"generate-script": { maxTokens: 16384, structuredOutput: true },
|
|
4634
|
+
"qa-check": { maxTokens: 1024, structuredOutput: true },
|
|
4635
|
+
"image-critic": { maxTokens: 1024, structuredOutput: true },
|
|
4636
|
+
"image-to-text": { maxTokens: 1024 },
|
|
4637
|
+
"describe-to-picker": { structuredOutput: true },
|
|
4638
|
+
"scene-graph-ai": { temperature: 0.3, maxTokens: 4096, structuredOutput: true },
|
|
4639
|
+
"after-effects": { temperature: 0.3, maxTokens: 2048, structuredOutput: true },
|
|
4640
|
+
"lottie-overlay": { temperature: 0.3, maxTokens: 2048, structuredOutput: true },
|
|
4641
|
+
"motion-graphics": { temperature: 0.3, maxTokens: 2048, structuredOutput: true },
|
|
4642
|
+
"motion-graphics-lottie": { temperature: 0.3, maxTokens: 8192, structuredOutput: true },
|
|
4643
|
+
"3d-title": { temperature: 0.4, maxTokens: 3072, structuredOutput: true }
|
|
4644
|
+
};
|
|
4645
|
+
function llmRouteDefaults(feature) {
|
|
4646
|
+
return feature && LLM_ROUTE_DEFAULTS[feature] || {};
|
|
4647
|
+
}
|
|
4648
|
+
function bumpTier(tier) {
|
|
4649
|
+
if (tier === "economy") return "standard";
|
|
4650
|
+
if (tier === "standard") return "premium";
|
|
4651
|
+
return tier;
|
|
4652
|
+
}
|
|
4653
|
+
function supportsAdvancedMode(modelId) {
|
|
4654
|
+
return Boolean(modelId && getLlmModel(modelId)?.directGeminiModel);
|
|
4655
|
+
}
|
|
4656
|
+
var ADVANCED_MODE_UNAVAILABLE_REASON = "Advanced mode is available on Gemini models \u2014 switch the model to enable it.";
|
|
4657
|
+
function buildLlmCreditIdentifier(feature, modelId, reasoningEffort, advancedMode) {
|
|
4589
4658
|
if (!modelId) return feature;
|
|
4590
4659
|
let tier = getLlmTier(modelId);
|
|
4591
4660
|
const eff = effectiveReasoningEffort(modelId, reasoningEffort);
|
|
4592
|
-
if (eff !== void 0 && EFFORT_TIER_BUMP.has(eff))
|
|
4593
|
-
|
|
4594
|
-
else if (tier === "standard") tier = "premium";
|
|
4595
|
-
}
|
|
4661
|
+
if (eff !== void 0 && EFFORT_TIER_BUMP.has(eff)) tier = bumpTier(tier);
|
|
4662
|
+
if (advancedMode && supportsAdvancedMode(modelId)) tier = bumpTier(tier);
|
|
4596
4663
|
if (tier === "standard") return feature;
|
|
4597
4664
|
return `${feature}:${tier}`;
|
|
4598
4665
|
}
|
|
4599
4666
|
function resolveLlmCreditId(feature, body) {
|
|
4600
4667
|
const b = body;
|
|
4601
|
-
return buildLlmCreditIdentifier(
|
|
4668
|
+
return buildLlmCreditIdentifier(
|
|
4669
|
+
feature,
|
|
4670
|
+
b?.llmModel,
|
|
4671
|
+
b?.reasoningEffort,
|
|
4672
|
+
b?.advancedMode === true
|
|
4673
|
+
);
|
|
4602
4674
|
}
|
|
4603
4675
|
var VIDEO_ANALYSIS_LLM_MODELS = LLM_MODELS.filter((m) => getLlmModalityCaps(m.id).video && getLlmModalityCaps(m.id).audio).map((m) => m.id);
|
|
4604
4676
|
var VIDEO_ANALYSIS_TIERS = { fast: "gemini-3.6-flash", pro: "gemini-3.1-pro" };
|
|
@@ -12157,6 +12229,78 @@ function sanitizeRole(raw) {
|
|
|
12157
12229
|
return raw.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/^[^a-z]+/, "").slice(0, 32).replace(/-+/g, "-").replace(/-$/, "");
|
|
12158
12230
|
}
|
|
12159
12231
|
var VIDEO_ANALYSIS_MAX_SCENE_SEC = 8;
|
|
12232
|
+
var VIDEO_ANALYSIS_SHOT_ANGLES = [
|
|
12233
|
+
// Vertical placement and roll — the classical "angles".
|
|
12234
|
+
"eye-level",
|
|
12235
|
+
"low",
|
|
12236
|
+
"high",
|
|
12237
|
+
"overhead",
|
|
12238
|
+
"worms-eye",
|
|
12239
|
+
"dutch",
|
|
12240
|
+
// Relational viewpoints — where the camera sits with respect to the subject.
|
|
12241
|
+
"over-the-shoulder",
|
|
12242
|
+
"pov",
|
|
12243
|
+
"profile",
|
|
12244
|
+
"from-behind"
|
|
12245
|
+
];
|
|
12246
|
+
var VIDEO_ANALYSIS_FACELESS_ANGLES = /* @__PURE__ */ new Set(["over-the-shoulder", "from-behind"]);
|
|
12247
|
+
var VIDEO_ANALYSIS_VISUAL_EFFECTS = [
|
|
12248
|
+
"blur",
|
|
12249
|
+
"pixelate",
|
|
12250
|
+
"glitch",
|
|
12251
|
+
"grain",
|
|
12252
|
+
"vignette",
|
|
12253
|
+
"flash",
|
|
12254
|
+
"distortion",
|
|
12255
|
+
"double-exposure"
|
|
12256
|
+
];
|
|
12257
|
+
var VIDEO_ANALYSIS_TRANSITIONS = ["cut", "fade", "dissolve", "wipe", "whip"];
|
|
12258
|
+
var VIDEO_ANALYSIS_SPEED_EFFECTS = ["slow-motion", "ramp-in", "ramp-out", "timelapse", "freeze", "reverse"];
|
|
12259
|
+
var clipLookSchema = zod.z.object({
|
|
12260
|
+
/**
|
|
12261
|
+
* The rendering MEDIUM — "live-action photoreal", "2D anime", "stop-motion
|
|
12262
|
+
* claymation", "3D render", "oil painting", "pixel art".
|
|
12263
|
+
*
|
|
12264
|
+
* The most consequential field in this object, and orthogonal to every other
|
|
12265
|
+
* one: two shots with identical grade, lens, lighting and framing still look
|
|
12266
|
+
* nothing alike when one is live action and the other is an oil painting. Get
|
|
12267
|
+
* this wrong and a recreation renders the whole piece in the wrong medium,
|
|
12268
|
+
* which no amount of correct grade or lighting can rescue.
|
|
12269
|
+
*
|
|
12270
|
+
* Mirrors the product's Style picker, whose catalog defines exactly this axis
|
|
12271
|
+
* and states its independence from lighting, colour-look, atmosphere and lens.
|
|
12272
|
+
* A clip that genuinely changes medium partway (live action with an animated
|
|
12273
|
+
* insert) states the deviation in that scene's `visual`, as with `lighting`.
|
|
12274
|
+
*/
|
|
12275
|
+
style: zod.z.string().optional(),
|
|
12276
|
+
/** Colour grade / palette — "muted teal-and-orange, crushed blacks". */
|
|
12277
|
+
grade: zod.z.string().optional(),
|
|
12278
|
+
/** Camera or film FORMAT and stock — "anamorphic digital", "16mm film grain". */
|
|
12279
|
+
format: zod.z.string().optional(),
|
|
12280
|
+
/** Lens character — "wide-angle, shallow depth of field throughout". */
|
|
12281
|
+
lens: zod.z.string().optional(),
|
|
12282
|
+
/** Overall lighting style — "hard single-source daylight, deep shadow". */
|
|
12283
|
+
lighting: zod.z.string().optional(),
|
|
12284
|
+
/** What KIND of piece this is — "cinematic trailer", "talking-head vlog". */
|
|
12285
|
+
genre: zod.z.string().optional(),
|
|
12286
|
+
/**
|
|
12287
|
+
* The visual INFLUENCE the piece clearly evokes — a cinematographer, director,
|
|
12288
|
+
* photographer or named aesthetic ("shot like Deakins", "Wes Anderson
|
|
12289
|
+
* symmetry", "80s Kodachrome editorial").
|
|
12290
|
+
*
|
|
12291
|
+
* The highest-leverage field here by a distance: a couple of words transfer a
|
|
12292
|
+
* whole aesthetic that would otherwise take a paragraph of grade, lens and
|
|
12293
|
+
* lighting prose to approximate — which is exactly why the product already
|
|
12294
|
+
* exposes it as a curated picker ("Photographer / Artist") whose catalog ships
|
|
12295
|
+
* `in the style of …` prompt hints. The analyzer had no way to read it back.
|
|
12296
|
+
*
|
|
12297
|
+
* Deliberately conservative: OMIT unless the footage genuinely evokes a
|
|
12298
|
+
* well-known, nameable style. A confident misattribution is worse than silence,
|
|
12299
|
+
* because it drags an entire wrong aesthetic into every regenerated shot — so
|
|
12300
|
+
* describing the look in `grade`/`lighting` always beats guessing a name.
|
|
12301
|
+
*/
|
|
12302
|
+
influence: zod.z.string().optional()
|
|
12303
|
+
});
|
|
12160
12304
|
var VIDEO_ANALYSIS_ENTITY_SOURCES = ["wired-character", "wired-object", "wired-location", "wired-creature"];
|
|
12161
12305
|
var SLOT_TOKEN_RE = /\{slot:([a-z0-9-]+)\}/g;
|
|
12162
12306
|
var VIDEO_ANALYSIS_VARIATION_SLUGS = ["dream", "flashback", "disguise", "costume", "transformation", "era", "alt-1", "alt-2"];
|
|
@@ -12218,8 +12362,27 @@ var windowSceneBase = zod.z.object({
|
|
|
12218
12362
|
label: zod.z.string().min(1),
|
|
12219
12363
|
shotType: zod.z.string().min(1),
|
|
12220
12364
|
camera: zod.z.string(),
|
|
12365
|
+
/** Camera VIEWPOINT. Absent ⇒ eye-level. Keeps `camera` to pure MOVEMENT and
|
|
12366
|
+
* frees `shotType` to state the SIZE even on an over-the-shoulder or POV. */
|
|
12367
|
+
angle: zod.z.enum(VIDEO_ANALYSIS_SHOT_ANGLES).optional(),
|
|
12368
|
+
/** Time manipulation. Absent ⇒ normal speed. */
|
|
12369
|
+
speed: zod.z.enum(VIDEO_ANALYSIS_SPEED_EFFECTS).optional(),
|
|
12221
12370
|
visual: zod.z.string().min(1),
|
|
12222
|
-
|
|
12371
|
+
/**
|
|
12372
|
+
* Text burned into the PICTURE of this shot — titles, captions, lower-thirds,
|
|
12373
|
+
* subtitles — verbatim, in its original script. Absent when the frame carries
|
|
12374
|
+
* none.
|
|
12375
|
+
*
|
|
12376
|
+
* Doctrine already asks for on-screen text inside `visual` prose, but a
|
|
12377
|
+
* recreation needs to know discretely whether to RENDER text at all, and
|
|
12378
|
+
* `translateOnScreenTextToEnglish` had no structured field to land in. It is
|
|
12379
|
+
* also the signal the auto-cast frame judge reads: picture text belonging to an
|
|
12380
|
+
* earlier scene's speech means the shot is replayed footage under a voice-over.
|
|
12381
|
+
*/
|
|
12382
|
+
onScreenText: zod.z.string().optional(),
|
|
12383
|
+
/** Effects on this shot's PICTURE. Absent ⇒ a clean image. */
|
|
12384
|
+
effects: zod.z.array(zod.z.enum(VIDEO_ANALYSIS_VISUAL_EFFECTS)).optional(),
|
|
12385
|
+
transitionOut: zod.z.enum(VIDEO_ANALYSIS_TRANSITIONS).optional(),
|
|
12223
12386
|
// Array of concurrent layers (music + speech + sfx together); [] = silence.
|
|
12224
12387
|
audio: zod.z.array(audioLayerSchema),
|
|
12225
12388
|
/** slotId → variationId for slots wearing a NON-default look in this scene
|
|
@@ -12231,6 +12394,9 @@ var windowSceneBase = zod.z.object({
|
|
|
12231
12394
|
var windowSceneSchema = windowSceneBase.refine((s) => s.endSec > s.startSec, { message: "endSec must be > startSec" });
|
|
12232
12395
|
var windowAnalysisSchema = zod.z.object({
|
|
12233
12396
|
language: zod.z.string().optional(),
|
|
12397
|
+
/** The clip-level look as read from THIS window. Merge folds the windows
|
|
12398
|
+
* field-by-field (first non-empty wins), like `language`. */
|
|
12399
|
+
look: clipLookSchema.optional(),
|
|
12234
12400
|
slots: zod.z.array(entitySlotSchema),
|
|
12235
12401
|
scenes: zod.z.array(windowSceneSchema)
|
|
12236
12402
|
});
|
|
@@ -12249,6 +12415,10 @@ var videoAnalysisResultSchema = zod.z.object({
|
|
|
12249
12415
|
title: zod.z.string().optional(),
|
|
12250
12416
|
language: zod.z.string().optional()
|
|
12251
12417
|
}),
|
|
12418
|
+
/** Clip-level look, merged across windows. Deliberately a sibling of `meta`
|
|
12419
|
+
* rather than a member: `meta` is probed fact (ffprobe dimensions, probed
|
|
12420
|
+
* duration), while this is the model's reading of the photography. */
|
|
12421
|
+
look: clipLookSchema.optional(),
|
|
12252
12422
|
slots: zod.z.array(entitySlotSchema),
|
|
12253
12423
|
scenes: zod.z.array(analyzedSceneSchema).min(1),
|
|
12254
12424
|
/** CAST VARIATIONS (§4 cap handling): looks the analyzer's merge FOLDED into
|
|
@@ -12317,6 +12487,15 @@ function dropUnknownSpeakers(audio, validSlotIds) {
|
|
|
12317
12487
|
});
|
|
12318
12488
|
return { audio: dropped.length > 0 ? out : audio, dropped };
|
|
12319
12489
|
}
|
|
12490
|
+
function mergeClipLook(looks) {
|
|
12491
|
+
const out = {};
|
|
12492
|
+
for (const look of looks) {
|
|
12493
|
+
for (const [k, v] of Object.entries(look ?? {})) {
|
|
12494
|
+
if (typeof v === "string" && v.trim() && !out[k]) out[k] = v.trim();
|
|
12495
|
+
}
|
|
12496
|
+
}
|
|
12497
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
12498
|
+
}
|
|
12320
12499
|
function renderAnalyzedScene(scene, slots, castMap) {
|
|
12321
12500
|
const byId = new Map(slots.map((s) => [s.slotId, s]));
|
|
12322
12501
|
return scene.visual.replace(SLOT_TOKEN_RE, (_whole, id) => castMap?.[id] ?? byId.get(id)?.description ?? id);
|
|
@@ -12350,27 +12529,27 @@ var WINDOW_OVERLAP = 5;
|
|
|
12350
12529
|
var VIDEO_ANALYSIS_WINDOW = { LEN: WINDOW_LEN, STRIDE: WINDOW_STRIDE, OVERLAP: WINDOW_OVERLAP, SINGLE_MAX: 180 };
|
|
12351
12530
|
var VIDEO_ANALYSIS_BUCKET_CREDITS = {
|
|
12352
12531
|
// Legacy fast-tier model (pre-2026-07) — kept for stored raw-id configs.
|
|
12353
|
-
"video-analysis:gemini-3-flash:60s":
|
|
12354
|
-
"video-analysis:gemini-3-flash:180s":
|
|
12355
|
-
"video-analysis:gemini-3-flash:360s":
|
|
12356
|
-
"video-analysis:gemini-3-flash:600s":
|
|
12532
|
+
"video-analysis:gemini-3-flash:60s": 21,
|
|
12533
|
+
"video-analysis:gemini-3-flash:180s": 24,
|
|
12534
|
+
"video-analysis:gemini-3-flash:360s": 68,
|
|
12535
|
+
"video-analysis:gemini-3-flash:600s": 112,
|
|
12357
12536
|
// Current fast tier — regenerated from the private formula for its backing
|
|
12358
12537
|
// model; higher than the legacy fast schedule but still ≤ pro per bucket.
|
|
12359
|
-
"video-analysis:gemini-3.6-flash:60s":
|
|
12360
|
-
"video-analysis:gemini-3.6-flash:180s":
|
|
12361
|
-
"video-analysis:gemini-3.6-flash:360s":
|
|
12362
|
-
"video-analysis:gemini-3.6-flash:600s":
|
|
12363
|
-
"video-analysis:gemini-3.1-pro:60s":
|
|
12364
|
-
"video-analysis:gemini-3.1-pro:180s":
|
|
12365
|
-
"video-analysis:gemini-3.1-pro:360s":
|
|
12366
|
-
"video-analysis:gemini-3.1-pro:600s":
|
|
12538
|
+
"video-analysis:gemini-3.6-flash:60s": 54,
|
|
12539
|
+
"video-analysis:gemini-3.6-flash:180s": 63,
|
|
12540
|
+
"video-analysis:gemini-3.6-flash:360s": 175,
|
|
12541
|
+
"video-analysis:gemini-3.6-flash:600s": 291,
|
|
12542
|
+
"video-analysis:gemini-3.1-pro:60s": 84,
|
|
12543
|
+
"video-analysis:gemini-3.1-pro:180s": 96,
|
|
12544
|
+
"video-analysis:gemini-3.1-pro:360s": 269,
|
|
12545
|
+
"video-analysis:gemini-3.1-pro:600s": 448,
|
|
12367
12546
|
// Mixed tiers (`mixed` + `mixed-fast`) share ONE credit family — they are
|
|
12368
12547
|
// variants of the same engine plan (plan internals live in the private
|
|
12369
12548
|
// analysis plugin). Admin-tunable via model_pricing like every other row.
|
|
12370
|
-
"video-analysis:mixed:60s":
|
|
12371
|
-
"video-analysis:mixed:180s":
|
|
12372
|
-
"video-analysis:mixed:360s":
|
|
12373
|
-
"video-analysis:mixed:600s":
|
|
12549
|
+
"video-analysis:mixed:60s": 137,
|
|
12550
|
+
"video-analysis:mixed:180s": 158,
|
|
12551
|
+
"video-analysis:mixed:360s": 443,
|
|
12552
|
+
"video-analysis:mixed:600s": 739
|
|
12374
12553
|
};
|
|
12375
12554
|
function videoAnalysisCreditSegment(modelOrSentinel) {
|
|
12376
12555
|
return modelOrSentinel === "mixed-fast" ? "mixed" : modelOrSentinel;
|
|
@@ -12404,6 +12583,7 @@ function clampSmartCutWindow(value) {
|
|
|
12404
12583
|
}
|
|
12405
12584
|
|
|
12406
12585
|
exports.ACTIVE_SCENE_HELPERS = ACTIVE_SCENE_HELPERS;
|
|
12586
|
+
exports.ADVANCED_MODE_UNAVAILABLE_REASON = ADVANCED_MODE_UNAVAILABLE_REASON;
|
|
12407
12587
|
exports.AGGREGATEABLE_TYPES = AGGREGATEABLE_TYPES;
|
|
12408
12588
|
exports.AI_AVATAR_DURATION_BUCKETS = AI_AVATAR_DURATION_BUCKETS;
|
|
12409
12589
|
exports.AI_AVATAR_MAX_AUDIO_SEC = AI_AVATAR_MAX_AUDIO_SEC;
|
|
@@ -12583,6 +12763,7 @@ exports.LLM_MODALITY_CAPS = LLM_MODALITY_CAPS;
|
|
|
12583
12763
|
exports.LLM_MODELS = LLM_MODELS;
|
|
12584
12764
|
exports.LLM_MODEL_IDS = LLM_MODEL_IDS;
|
|
12585
12765
|
exports.LLM_REASONING_EFFORTS = LLM_REASONING_EFFORTS;
|
|
12766
|
+
exports.LLM_ROUTE_DEFAULTS = LLM_ROUTE_DEFAULTS;
|
|
12586
12767
|
exports.LLM_TEXT_INPUT_MAX = LLM_TEXT_INPUT_MAX;
|
|
12587
12768
|
exports.LOCATION_ASSET_TYPES = LOCATION_ASSET_TYPES;
|
|
12588
12769
|
exports.LOCATION_ASSET_VARIANTS = LOCATION_ASSET_VARIANTS;
|
|
@@ -12770,16 +12951,21 @@ exports.VIDEO_ANALYSIS_DEFAULT_VARIATION = VIDEO_ANALYSIS_DEFAULT_VARIATION;
|
|
|
12770
12951
|
exports.VIDEO_ANALYSIS_DURATION_BUCKETS = VIDEO_ANALYSIS_DURATION_BUCKETS;
|
|
12771
12952
|
exports.VIDEO_ANALYSIS_DURATION_TOLERANCE_SEC = VIDEO_ANALYSIS_DURATION_TOLERANCE_SEC;
|
|
12772
12953
|
exports.VIDEO_ANALYSIS_ENTITY_SOURCES = VIDEO_ANALYSIS_ENTITY_SOURCES;
|
|
12954
|
+
exports.VIDEO_ANALYSIS_FACELESS_ANGLES = VIDEO_ANALYSIS_FACELESS_ANGLES;
|
|
12773
12955
|
exports.VIDEO_ANALYSIS_LEGACY_MODELS = VIDEO_ANALYSIS_LEGACY_MODELS;
|
|
12774
12956
|
exports.VIDEO_ANALYSIS_LLM_MODELS = VIDEO_ANALYSIS_LLM_MODELS;
|
|
12775
12957
|
exports.VIDEO_ANALYSIS_MAX_DURATION_SEC = VIDEO_ANALYSIS_MAX_DURATION_SEC;
|
|
12776
12958
|
exports.VIDEO_ANALYSIS_MAX_SCENE_SEC = VIDEO_ANALYSIS_MAX_SCENE_SEC;
|
|
12777
12959
|
exports.VIDEO_ANALYSIS_MAX_VARIATIONS = VIDEO_ANALYSIS_MAX_VARIATIONS;
|
|
12778
12960
|
exports.VIDEO_ANALYSIS_MIXED_TIERS = VIDEO_ANALYSIS_MIXED_TIERS;
|
|
12961
|
+
exports.VIDEO_ANALYSIS_SHOT_ANGLES = VIDEO_ANALYSIS_SHOT_ANGLES;
|
|
12962
|
+
exports.VIDEO_ANALYSIS_SPEED_EFFECTS = VIDEO_ANALYSIS_SPEED_EFFECTS;
|
|
12779
12963
|
exports.VIDEO_ANALYSIS_TIERS = VIDEO_ANALYSIS_TIERS;
|
|
12780
12964
|
exports.VIDEO_ANALYSIS_TIER_LABELS = VIDEO_ANALYSIS_TIER_LABELS;
|
|
12781
12965
|
exports.VIDEO_ANALYSIS_TIER_ORDER = VIDEO_ANALYSIS_TIER_ORDER;
|
|
12966
|
+
exports.VIDEO_ANALYSIS_TRANSITIONS = VIDEO_ANALYSIS_TRANSITIONS;
|
|
12782
12967
|
exports.VIDEO_ANALYSIS_VARIATION_SLUGS = VIDEO_ANALYSIS_VARIATION_SLUGS;
|
|
12968
|
+
exports.VIDEO_ANALYSIS_VISUAL_EFFECTS = VIDEO_ANALYSIS_VISUAL_EFFECTS;
|
|
12783
12969
|
exports.VIDEO_ANALYSIS_WINDOW = VIDEO_ANALYSIS_WINDOW;
|
|
12784
12970
|
exports.VIDEO_AUDIO_CAPABILITY = VIDEO_AUDIO_CAPABILITY;
|
|
12785
12971
|
exports.VIDEO_CLIP_CREDITS = VIDEO_CLIP_CREDITS;
|
|
@@ -12827,6 +13013,7 @@ exports.aspectRatioFromDims = aspectRatioFromDims;
|
|
|
12827
13013
|
exports.aspectRatioOptionsByKind = aspectRatioOptionsByKind;
|
|
12828
13014
|
exports.aspectRatioToNumber = aspectRatioToNumber;
|
|
12829
13015
|
exports.assembleNarratedVideoCredits = assembleNarratedVideoCredits;
|
|
13016
|
+
exports.availableReasoningEfforts = availableReasoningEfforts;
|
|
12830
13017
|
exports.bucketSecondsFromCreditId = bucketSecondsFromCreditId;
|
|
12831
13018
|
exports.buildBoardPrompt = buildBoardPrompt;
|
|
12832
13019
|
exports.buildChildrenByParent = buildChildrenByParent;
|
|
@@ -12863,6 +13050,7 @@ exports.clampSmartCutWindow = clampSmartCutWindow;
|
|
|
12863
13050
|
exports.cleanOrphanedItems = cleanOrphanedItems;
|
|
12864
13051
|
exports.clearImageCriticMetadata = clearImageCriticMetadata;
|
|
12865
13052
|
exports.clearVideoCriticMetadata = clearVideoCriticMetadata;
|
|
13053
|
+
exports.clipLookSchema = clipLookSchema;
|
|
12866
13054
|
exports.collectAncestorRefs = collectAncestorRefs;
|
|
12867
13055
|
exports.combineSameLabelRefs = combineSameLabelRefs;
|
|
12868
13056
|
exports.countRefModalityEdges = countRefModalityEdges;
|
|
@@ -12984,6 +13172,7 @@ exports.jsonResultToList = jsonResultToList;
|
|
|
12984
13172
|
exports.listBoardTemplates = listBoardTemplates;
|
|
12985
13173
|
exports.listModels = listModels;
|
|
12986
13174
|
exports.listSlotSids = listSlotSids;
|
|
13175
|
+
exports.llmRouteDefaults = llmRouteDefaults;
|
|
12987
13176
|
exports.locationMentionSlug = locationMentionSlug;
|
|
12988
13177
|
exports.locationReferencePhotoKindLabel = locationReferencePhotoKindLabel;
|
|
12989
13178
|
exports.locationUsageModeLabel = locationUsageModeLabel;
|
|
@@ -12991,6 +13180,7 @@ exports.mapAspectRatio = mapAspectRatio;
|
|
|
12991
13180
|
exports.mapQuality = mapQuality;
|
|
12992
13181
|
exports.mapShotIntentToProviderDirectives = mapShotIntentToProviderDirectives;
|
|
12993
13182
|
exports.matchVariant = matchVariant;
|
|
13183
|
+
exports.mergeClipLook = mergeClipLook;
|
|
12994
13184
|
exports.mergeExposedSettings = mergeExposedSettings;
|
|
12995
13185
|
exports.migrateEdgeOutputMode = migrateEdgeOutputMode;
|
|
12996
13186
|
exports.migrateToItems = migrateToItems;
|
|
@@ -13088,6 +13278,7 @@ exports.stringifyPathResults = stringifyPathResults;
|
|
|
13088
13278
|
exports.stripExportContent = stripExportContent;
|
|
13089
13279
|
exports.stripTransientRuntimeData = stripTransientRuntimeData;
|
|
13090
13280
|
exports.supportedDefaultDimensions = supportedDefaultDimensions;
|
|
13281
|
+
exports.supportsAdvancedMode = supportsAdvancedMode;
|
|
13091
13282
|
exports.toConnectedReference = toConnectedReference;
|
|
13092
13283
|
exports.toConnectedReferences = toConnectedReferences;
|
|
13093
13284
|
exports.togglePick = togglePick;
|