@nodaro/shared 1.23.0 → 1.24.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 +116 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -4
- package/dist/index.d.ts +22 -4
- package/dist/index.js +116 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/video-analysis-catalog-sync.test.ts +14 -6
- package/src/__tests__/video-analysis-pricing.test.ts +6 -1
- package/src/llm-models.ts +37 -6
- package/src/model-catalog.ts +41 -20
- package/src/video-analysis-pricing.ts +24 -16
- package/src/video-analysis.ts +28 -0
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: 14, note: "10-min ceiling (no duration given)" },
|
|
1671
|
+
{ identifier: "video-analysis:gemini-3-flash:60s", credits: 3 },
|
|
1672
|
+
{ identifier: "video-analysis:gemini-3-flash:180s", credits: 4 },
|
|
1673
|
+
{ identifier: "video-analysis:gemini-3-flash:360s", credits: 9 },
|
|
1674
|
+
{ identifier: "video-analysis:gemini-3-flash:600s", credits: 14, 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: 38, note: "10-min ceiling (no duration given)" },
|
|
1688
|
+
{ identifier: "video-analysis:gemini-3.6-flash:60s", credits: 7 },
|
|
1689
|
+
{ identifier: "video-analysis:gemini-3.6-flash:180s", credits: 9 },
|
|
1690
|
+
{ identifier: "video-analysis:gemini-3.6-flash:360s", credits: 23 },
|
|
1691
|
+
{ identifier: "video-analysis:gemini-3.6-flash:600s", credits: 38, 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: 49, note: "10-min ceiling (no duration given)" },
|
|
1705
|
+
{ identifier: "video-analysis:gemini-3.1-pro:60s", credits: 9 },
|
|
1706
|
+
{ identifier: "video-analysis:gemini-3.1-pro:180s", credits: 12 },
|
|
1707
|
+
{ identifier: "video-analysis:gemini-3.1-pro:360s", credits: 30 },
|
|
1708
|
+
{ identifier: "video-analysis:gemini-3.1-pro:600s", credits: 49, 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,32 @@ 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: 63, note: "10-min ceiling (no duration given)" },
|
|
1725
|
+
{ identifier: "video-analysis:mixed:60s", credits: 11 },
|
|
1726
|
+
{ identifier: "video-analysis:mixed:180s", credits: 15 },
|
|
1727
|
+
{ identifier: "video-analysis:mixed:360s", credits: 38 },
|
|
1728
|
+
{ identifier: "video-analysis:mixed:600s", credits: 63, note: "10-min ceiling" }
|
|
1729
|
+
]
|
|
1730
|
+
},
|
|
1731
|
+
// SMART — the accuracy tier, and the only one that does not rely on voting.
|
|
1732
|
+
// Every other tier runs several cheap passes and has a grader pick between them;
|
|
1733
|
+
// this one runs a single pass with reasoning and frame sampling turned all the
|
|
1734
|
+
// way up. Priced well above them because it genuinely costs more to run.
|
|
1735
|
+
"smart-video-analysis": {
|
|
1736
|
+
id: "smart-video-analysis",
|
|
1737
|
+
kind: "video",
|
|
1738
|
+
modes: ["video-analysis"],
|
|
1739
|
+
family: "Nodaro",
|
|
1740
|
+
label: "Video Analysis (Smart)",
|
|
1741
|
+
series: "Video Analysis",
|
|
1742
|
+
description: "Highest-accuracy analysis \u2014 a single deep pass that reads the footage frame by frame, finds its own shot boundaries, and identifies the cast by appearance. Best choice when the shot list will drive regeneration. Billed per duration bucket.",
|
|
1743
|
+
useCases: ["video-analysis", "shot-list", "premium", "most-accurate"],
|
|
1744
|
+
pricing: [
|
|
1745
|
+
{ identifier: "video-analysis:smart", credits: 346, note: "10-min ceiling (no duration given)" },
|
|
1746
|
+
{ identifier: "video-analysis:smart:60s", credits: 42 },
|
|
1747
|
+
{ identifier: "video-analysis:smart:180s", credits: 94 },
|
|
1748
|
+
{ identifier: "video-analysis:smart:360s", credits: 207 },
|
|
1749
|
+
{ identifier: "video-analysis:smart:600s", credits: 346, note: "10-min ceiling" }
|
|
1729
1750
|
]
|
|
1730
1751
|
}
|
|
1731
1752
|
};
|
|
@@ -4373,6 +4394,17 @@ var LLM_MODELS = [
|
|
|
4373
4394
|
// Google documents low/medium/high for 3.1 Pro — no `minimal` tier, so
|
|
4374
4395
|
// this ladder is deliberately shorter than the flash models'.
|
|
4375
4396
|
directReasoningEfforts: ["low", "medium", "high"],
|
|
4397
|
+
// NO `reasoningEfforts` (the proxied ladder) ON PURPOSE, not an omission.
|
|
4398
|
+
// That endpoint accepts `reasoning_effort: low | high` and already DEFAULTS
|
|
4399
|
+
// to "high", so leaving it unset gets its deepest setting and a ladder here
|
|
4400
|
+
// would unlock nothing. The two lanes are NOT equivalent at their maxima:
|
|
4401
|
+
// verified 2026-07-29 on identical input, the proxy's ceiling produces
|
|
4402
|
+
// roughly a quarter of the reasoning tokens that the direct lane's
|
|
4403
|
+
// `thinkingLevel: HIGH` does, and it does not expose Google's deeper tiers
|
|
4404
|
+
// at all. That difference is visible in fine-detail reading (small on-screen
|
|
4405
|
+
// text such as a name badge), which is exactly what video-analysis casts
|
|
4406
|
+
// identities from — so adding an entry here would silently move analysis to
|
|
4407
|
+
// the shallower lane. Don't. Full comparison lives with the analysis engine.
|
|
4376
4408
|
// The ONE Gemini model routed direct-first. It is the premium/low-volume
|
|
4377
4409
|
// tier (video-analysis `pro`, no LLM_FEATURE_DEFAULTS entry), so the ~4×
|
|
4378
4410
|
// list-price premium lands on the smallest call volume — and it is where
|
|
@@ -4673,16 +4705,22 @@ function resolveLlmCreditId(feature, body) {
|
|
|
4673
4705
|
);
|
|
4674
4706
|
}
|
|
4675
4707
|
var VIDEO_ANALYSIS_LLM_MODELS = LLM_MODELS.filter((m) => getLlmModalityCaps(m.id).video && getLlmModalityCaps(m.id).audio).map((m) => m.id);
|
|
4676
|
-
var VIDEO_ANALYSIS_TIERS = { fast: "gemini-3
|
|
4708
|
+
var VIDEO_ANALYSIS_TIERS = { fast: "gemini-3-flash", pro: "gemini-3.1-pro" };
|
|
4677
4709
|
var VIDEO_ANALYSIS_LEGACY_MODELS = {
|
|
4678
|
-
// fast tier
|
|
4679
|
-
|
|
4710
|
+
// Backed the fast tier from 2026-07 until 2026-07-29, when the economy tiers
|
|
4711
|
+
// moved to the cheaper lane and the older, cheaper flash. It is now the engine
|
|
4712
|
+
// behind the `smart` tier — but `smart` is a SENTINEL that never exposes a model
|
|
4713
|
+
// id, so as far as this map is concerned it no longer backs a selectable tier and
|
|
4714
|
+
// belongs here: stored raw `llmModel` values keep resolving and keep pricing
|
|
4715
|
+
// under their own credit family.
|
|
4716
|
+
"gemini-3.6-flash": "fast"
|
|
4680
4717
|
};
|
|
4681
|
-
var VIDEO_ANALYSIS_MIXED_TIERS = ["mixed", "mixed-fast"];
|
|
4682
|
-
var VIDEO_ANALYSIS_TIER_ORDER = ["pro", "fast", "mixed", "mixed-fast"];
|
|
4718
|
+
var VIDEO_ANALYSIS_MIXED_TIERS = ["mixed", "mixed-fast", "smart"];
|
|
4719
|
+
var VIDEO_ANALYSIS_TIER_ORDER = ["smart", "pro", "fast", "mixed", "mixed-fast"];
|
|
4683
4720
|
var DEFAULT_VIDEO_ANALYSIS_TIER = "pro";
|
|
4684
4721
|
var DEFAULT_VIDEO_ANALYSIS_MODEL = VIDEO_ANALYSIS_TIERS[DEFAULT_VIDEO_ANALYSIS_TIER];
|
|
4685
4722
|
var VIDEO_ANALYSIS_TIER_LABELS = {
|
|
4723
|
+
smart: "Smart",
|
|
4686
4724
|
fast: "Fast",
|
|
4687
4725
|
pro: "Pro",
|
|
4688
4726
|
mixed: "Mixed",
|
|
@@ -12327,6 +12365,19 @@ var entitySlotSchema = zod.z.object({
|
|
|
12327
12365
|
* where this entity is clearly visible. Optional/additive: producers may
|
|
12328
12366
|
* omit it; consumers use it as an identity reference for recreation. */
|
|
12329
12367
|
refImageUrl: zod.z.string().url().optional(),
|
|
12368
|
+
/**
|
|
12369
|
+
* Why `refImageUrl` is ABSENT, when the analyzer's vision pass actively
|
|
12370
|
+
* refused every candidate frame rather than merely failing to produce one.
|
|
12371
|
+
*
|
|
12372
|
+
* Present only alongside a missing `refImageUrl`, and only for a real refusal
|
|
12373
|
+
* — never for a technical failure, so its presence always carries meaning. The
|
|
12374
|
+
* important case reads like "the shots bound to this slot show someone else —
|
|
12375
|
+
* cast as X, but on screen: Y", which is the analyzer telling you the casting
|
|
12376
|
+
* description and the footage disagree. A consumer should treat that as a
|
|
12377
|
+
* reason to review the slot before spending on regeneration, since a wrong
|
|
12378
|
+
* identity propagates into every regenerated shot.
|
|
12379
|
+
*/
|
|
12380
|
+
refRejectedReason: zod.z.string().optional(),
|
|
12330
12381
|
/** NON-default looks only; present only when at least one exists. */
|
|
12331
12382
|
variations: zod.z.array(slotVariationSchema).max(VIDEO_ANALYSIS_MAX_VARIATIONS).optional()
|
|
12332
12383
|
});
|
|
@@ -12430,7 +12481,22 @@ var videoAnalysisResultSchema = zod.z.object({
|
|
|
12430
12481
|
slotId: zod.z.string(),
|
|
12431
12482
|
variationId: zod.z.string(),
|
|
12432
12483
|
label: zod.z.string()
|
|
12433
|
-
})).optional()
|
|
12484
|
+
})).optional(),
|
|
12485
|
+
/**
|
|
12486
|
+
* Analyzer diagnostics for THIS result — things the analysis noticed about
|
|
12487
|
+
* itself that a reader should know before spending on regeneration.
|
|
12488
|
+
*
|
|
12489
|
+
* Added because there was previously no channel for them at all: the merge
|
|
12490
|
+
* layer has always produced a warnings list and the auto-cast pass has always
|
|
12491
|
+
* had findings, and every one of them died in a `console.warn` inside a worker
|
|
12492
|
+
* the user cannot see. So a run could quietly drop a duplicated line, fold a
|
|
12493
|
+
* cast look, or conclude a character is not the person their own description
|
|
12494
|
+
* names, and the result looked indistinguishable from a clean one.
|
|
12495
|
+
*
|
|
12496
|
+
* Prose, not codes, and deliberately so — these are read by a human deciding
|
|
12497
|
+
* whether to re-run, not branched on. Absent when there is nothing to report.
|
|
12498
|
+
*/
|
|
12499
|
+
warnings: zod.z.array(zod.z.string()).optional()
|
|
12434
12500
|
});
|
|
12435
12501
|
function deriveSlotRefs(visual) {
|
|
12436
12502
|
const out = [];
|
|
@@ -12529,27 +12595,35 @@ var WINDOW_OVERLAP = 5;
|
|
|
12529
12595
|
var VIDEO_ANALYSIS_WINDOW = { LEN: WINDOW_LEN, STRIDE: WINDOW_STRIDE, OVERLAP: WINDOW_OVERLAP, SINGLE_MAX: 180 };
|
|
12530
12596
|
var VIDEO_ANALYSIS_BUCKET_CREDITS = {
|
|
12531
12597
|
// Legacy fast-tier model (pre-2026-07) — kept for stored raw-id configs.
|
|
12532
|
-
"video-analysis:gemini-3-flash:60s":
|
|
12533
|
-
"video-analysis:gemini-3-flash:180s":
|
|
12534
|
-
"video-analysis:gemini-3-flash:360s":
|
|
12535
|
-
"video-analysis:gemini-3-flash:600s":
|
|
12598
|
+
"video-analysis:gemini-3-flash:60s": 3,
|
|
12599
|
+
"video-analysis:gemini-3-flash:180s": 4,
|
|
12600
|
+
"video-analysis:gemini-3-flash:360s": 9,
|
|
12601
|
+
"video-analysis:gemini-3-flash:600s": 14,
|
|
12536
12602
|
// Current fast tier — regenerated from the private formula for its backing
|
|
12537
12603
|
// model; higher than the legacy fast schedule but still ≤ pro per bucket.
|
|
12538
|
-
"video-analysis:gemini-3.6-flash:60s":
|
|
12539
|
-
"video-analysis:gemini-3.6-flash:180s":
|
|
12540
|
-
"video-analysis:gemini-3.6-flash:360s":
|
|
12541
|
-
"video-analysis:gemini-3.6-flash:600s":
|
|
12542
|
-
"video-analysis:gemini-3.1-pro:60s":
|
|
12543
|
-
"video-analysis:gemini-3.1-pro:180s":
|
|
12544
|
-
"video-analysis:gemini-3.1-pro:360s":
|
|
12545
|
-
"video-analysis:gemini-3.1-pro:600s":
|
|
12604
|
+
"video-analysis:gemini-3.6-flash:60s": 7,
|
|
12605
|
+
"video-analysis:gemini-3.6-flash:180s": 9,
|
|
12606
|
+
"video-analysis:gemini-3.6-flash:360s": 23,
|
|
12607
|
+
"video-analysis:gemini-3.6-flash:600s": 38,
|
|
12608
|
+
"video-analysis:gemini-3.1-pro:60s": 9,
|
|
12609
|
+
"video-analysis:gemini-3.1-pro:180s": 12,
|
|
12610
|
+
"video-analysis:gemini-3.1-pro:360s": 30,
|
|
12611
|
+
"video-analysis:gemini-3.1-pro:600s": 49,
|
|
12546
12612
|
// Mixed tiers (`mixed` + `mixed-fast`) share ONE credit family — they are
|
|
12547
12613
|
// variants of the same engine plan (plan internals live in the private
|
|
12548
12614
|
// analysis plugin). Admin-tunable via model_pricing like every other row.
|
|
12549
|
-
"video-analysis:mixed:60s":
|
|
12550
|
-
"video-analysis:mixed:180s":
|
|
12551
|
-
"video-analysis:mixed:360s":
|
|
12552
|
-
"video-analysis:mixed:600s":
|
|
12615
|
+
"video-analysis:mixed:60s": 11,
|
|
12616
|
+
"video-analysis:mixed:180s": 15,
|
|
12617
|
+
"video-analysis:mixed:360s": 38,
|
|
12618
|
+
"video-analysis:mixed:600s": 63,
|
|
12619
|
+
// SMART — the one native-transport plan: a single pass with reasoning and
|
|
12620
|
+
// frame sampling turned all the way up. Priced well above the economy tiers
|
|
12621
|
+
// because it genuinely costs more to run, and it is the only tier whose
|
|
12622
|
+
// accuracy was measured against a hand-counted edit list.
|
|
12623
|
+
"video-analysis:smart:60s": 42,
|
|
12624
|
+
"video-analysis:smart:180s": 94,
|
|
12625
|
+
"video-analysis:smart:360s": 207,
|
|
12626
|
+
"video-analysis:smart:600s": 346
|
|
12553
12627
|
};
|
|
12554
12628
|
function videoAnalysisCreditSegment(modelOrSentinel) {
|
|
12555
12629
|
return modelOrSentinel === "mixed-fast" ? "mixed" : modelOrSentinel;
|