@nodaro/shared 2.0.3 → 2.1.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 +50 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +50 -49
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/video-analysis-catalog-sync.test.ts +5 -4
- package/src/model-catalog.ts +25 -25
- package/src/video-analysis-pricing.ts +32 -24
package/package.json
CHANGED
|
@@ -88,10 +88,11 @@ describe("bare video-analysis node-type credit id", () => {
|
|
|
88
88
|
}
|
|
89
89
|
// The migration writes this number; keep them in lockstep (277 wrote 200,
|
|
90
90
|
// 279 wrote 739, 283 wrote 346, 284 wrote 350 — `smart` owns the ceiling and
|
|
91
|
-
// gained the continuity pass — 288 wrote 3500 as a x10 of that,
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
|
|
91
|
+
// gained the continuity pass — 288 wrote 3500 as a x10 of that, 293
|
|
92
|
+
// corrected it to 3496 by RE-DERIVING `smart:600s` from the plugin formula,
|
|
93
|
+
// and 294 wrote 1868: the smart re-base measured 6 fps equal-or-better than
|
|
94
|
+
// 24 and the schedule regenerated ~47% lower at the ceiling bucket).
|
|
95
|
+
expect(ceiling).toBe(1868)
|
|
95
96
|
})
|
|
96
97
|
|
|
97
98
|
it("the bare id still bounds the default tier at the ceiling bucket", () => {
|
package/src/model-catalog.ts
CHANGED
|
@@ -1818,11 +1818,11 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1818
1818
|
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.",
|
|
1819
1819
|
useCases: ["video-analysis", "shot-list", "fast"],
|
|
1820
1820
|
pricing: [
|
|
1821
|
-
{ identifier: "video-analysis:gemini-3-flash", credits:
|
|
1822
|
-
{ identifier: "video-analysis:gemini-3-flash:60s", credits:
|
|
1823
|
-
{ identifier: "video-analysis:gemini-3-flash:180s", credits:
|
|
1824
|
-
{ identifier: "video-analysis:gemini-3-flash:360s", credits:
|
|
1825
|
-
{ identifier: "video-analysis:gemini-3-flash:600s", credits:
|
|
1821
|
+
{ identifier: "video-analysis:gemini-3-flash", credits: 143, note: "10-min ceiling (no duration given)" },
|
|
1822
|
+
{ identifier: "video-analysis:gemini-3-flash:60s", credits: 24 },
|
|
1823
|
+
{ identifier: "video-analysis:gemini-3-flash:180s", credits: 33 },
|
|
1824
|
+
{ identifier: "video-analysis:gemini-3-flash:360s", credits: 86 },
|
|
1825
|
+
{ identifier: "video-analysis:gemini-3-flash:600s", credits: 143, note: "10-min ceiling" },
|
|
1826
1826
|
],
|
|
1827
1827
|
},
|
|
1828
1828
|
"gemini-3.6-flash-video-analysis": {
|
|
@@ -1835,11 +1835,11 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1835
1835
|
description: "Analyze a video into a structured shot list (scenes, camera, audio) — fast, economy tier. Billed per duration bucket.",
|
|
1836
1836
|
useCases: ["video-analysis", "shot-list", "fast"],
|
|
1837
1837
|
pricing: [
|
|
1838
|
-
{ identifier: "video-analysis:gemini-3.6-flash", credits:
|
|
1839
|
-
{ identifier: "video-analysis:gemini-3.6-flash:60s", credits:
|
|
1840
|
-
{ identifier: "video-analysis:gemini-3.6-flash:180s", credits:
|
|
1841
|
-
{ identifier: "video-analysis:gemini-3.6-flash:360s", credits:
|
|
1842
|
-
{ identifier: "video-analysis:gemini-3.6-flash:600s", credits:
|
|
1838
|
+
{ identifier: "video-analysis:gemini-3.6-flash", credits: 395, note: "10-min ceiling (no duration given)" },
|
|
1839
|
+
{ identifier: "video-analysis:gemini-3.6-flash:60s", credits: 65 },
|
|
1840
|
+
{ identifier: "video-analysis:gemini-3.6-flash:180s", credits: 92 },
|
|
1841
|
+
{ identifier: "video-analysis:gemini-3.6-flash:360s", credits: 237 },
|
|
1842
|
+
{ identifier: "video-analysis:gemini-3.6-flash:600s", credits: 395, note: "10-min ceiling" },
|
|
1843
1843
|
],
|
|
1844
1844
|
},
|
|
1845
1845
|
"gemini-3.1-pro-video-analysis": {
|
|
@@ -1852,11 +1852,11 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1852
1852
|
description: "Analyze a video into a structured shot list (scenes, camera, audio) — higher-fidelity, default tier. Billed per duration bucket.",
|
|
1853
1853
|
useCases: ["video-analysis", "shot-list", "cinematic"],
|
|
1854
1854
|
pricing: [
|
|
1855
|
-
{ identifier: "video-analysis:gemini-3.1-pro", credits:
|
|
1856
|
-
{ identifier: "video-analysis:gemini-3.1-pro:60s", credits:
|
|
1857
|
-
{ identifier: "video-analysis:gemini-3.1-pro:180s", credits:
|
|
1858
|
-
{ identifier: "video-analysis:gemini-3.1-pro:360s", credits:
|
|
1859
|
-
{ identifier: "video-analysis:gemini-3.1-pro:600s", credits:
|
|
1855
|
+
{ identifier: "video-analysis:gemini-3.1-pro", credits: 509, note: "10-min ceiling (no duration given)" },
|
|
1856
|
+
{ identifier: "video-analysis:gemini-3.1-pro:60s", credits: 87 },
|
|
1857
|
+
{ identifier: "video-analysis:gemini-3.1-pro:180s", credits: 116 },
|
|
1858
|
+
{ identifier: "video-analysis:gemini-3.1-pro:360s", credits: 305 },
|
|
1859
|
+
{ identifier: "video-analysis:gemini-3.1-pro:600s", credits: 509, note: "10-min ceiling" },
|
|
1860
1860
|
],
|
|
1861
1861
|
},
|
|
1862
1862
|
// Both mixed tiers are variants of the same advanced multi-engine analysis
|
|
@@ -1872,11 +1872,11 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1872
1872
|
description: "Our most advanced analysis tier — multiple analysis engines combined into one result for maximum completeness and accuracy. Billed per duration bucket.",
|
|
1873
1873
|
useCases: ["video-analysis", "shot-list", "premium", "most-complete"],
|
|
1874
1874
|
pricing: [
|
|
1875
|
-
{ identifier: "video-analysis:mixed", credits:
|
|
1876
|
-
{ identifier: "video-analysis:mixed:60s", credits:
|
|
1877
|
-
{ identifier: "video-analysis:mixed:180s", credits:
|
|
1878
|
-
{ identifier: "video-analysis:mixed:360s", credits:
|
|
1879
|
-
{ identifier: "video-analysis:mixed:600s", credits:
|
|
1875
|
+
{ identifier: "video-analysis:mixed", credits: 651, note: "10-min ceiling (no duration given)" },
|
|
1876
|
+
{ identifier: "video-analysis:mixed:60s", credits: 110 },
|
|
1877
|
+
{ identifier: "video-analysis:mixed:180s", credits: 149 },
|
|
1878
|
+
{ identifier: "video-analysis:mixed:360s", credits: 390 },
|
|
1879
|
+
{ identifier: "video-analysis:mixed:600s", credits: 651, note: "10-min ceiling" },
|
|
1880
1880
|
],
|
|
1881
1881
|
},
|
|
1882
1882
|
// SMART — the accuracy tier, and the only one that does not rely on voting.
|
|
@@ -1893,11 +1893,11 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1893
1893
|
description: "Highest-accuracy analysis — 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.",
|
|
1894
1894
|
useCases: ["video-analysis", "shot-list", "premium", "most-accurate"],
|
|
1895
1895
|
pricing: [
|
|
1896
|
-
{ identifier: "video-analysis:smart", credits:
|
|
1897
|
-
{ identifier: "video-analysis:smart:60s", credits:
|
|
1898
|
-
{ identifier: "video-analysis:smart:180s", credits:
|
|
1899
|
-
{ identifier: "video-analysis:smart:360s", credits:
|
|
1900
|
-
{ identifier: "video-analysis:smart:600s", credits:
|
|
1896
|
+
{ identifier: "video-analysis:smart", credits: 1868, note: "10-min ceiling (no duration given)" },
|
|
1897
|
+
{ identifier: "video-analysis:smart:60s", credits: 333 },
|
|
1898
|
+
{ identifier: "video-analysis:smart:180s", credits: 470 },
|
|
1899
|
+
{ identifier: "video-analysis:smart:360s", credits: 1135 },
|
|
1900
|
+
{ identifier: "video-analysis:smart:600s", credits: 1868, note: "10-min ceiling" },
|
|
1901
1901
|
],
|
|
1902
1902
|
},
|
|
1903
1903
|
}
|
|
@@ -60,37 +60,45 @@ export const VIDEO_ANALYSIS_WINDOW = { LEN: WINDOW_LEN, STRIDE: WINDOW_STRIDE, O
|
|
|
60
60
|
// from the same roll plan, so they are formula-derived too (mixed:60s is 104,
|
|
61
61
|
// not 110). The plugin's cost test now covers sentinels as well, so this class
|
|
62
62
|
// of drift fails CI instead of shipping.
|
|
63
|
+
// REGENERATED 2026-07-31 with the smart-tier re-base (formula inputs moved in
|
|
64
|
+
// the plugin: sampling 24→6 fps after a 43-run measurement found 6 equal on
|
|
65
|
+
// content and strictly better on cast stability; the system-prompt and
|
|
66
|
+
// per-window output-token constants trued-up to directly measured values).
|
|
67
|
+
// Net effect: smart drops 27–47% per bucket — the 24 fps token spend was also
|
|
68
|
+
// partly paying for media tokens the provider clamped and never counted — and
|
|
69
|
+
// the economy rows tick up 3–6% from the prompt-token true-up.
|
|
63
70
|
export const VIDEO_ANALYSIS_BUCKET_CREDITS: Record<string, number> = {
|
|
64
71
|
// Legacy fast-tier model (pre-2026-07) — kept for stored raw-id configs.
|
|
65
|
-
"video-analysis:gemini-3-flash:60s":
|
|
66
|
-
"video-analysis:gemini-3-flash:180s":
|
|
67
|
-
"video-analysis:gemini-3-flash:360s":
|
|
68
|
-
"video-analysis:gemini-3-flash:600s":
|
|
72
|
+
"video-analysis:gemini-3-flash:60s": 24,
|
|
73
|
+
"video-analysis:gemini-3-flash:180s": 33,
|
|
74
|
+
"video-analysis:gemini-3-flash:360s": 86,
|
|
75
|
+
"video-analysis:gemini-3-flash:600s": 143,
|
|
69
76
|
// Current fast tier — regenerated from the private formula for its backing
|
|
70
77
|
// model; higher than the legacy fast schedule but still ≤ pro per bucket.
|
|
71
|
-
"video-analysis:gemini-3.6-flash:60s":
|
|
72
|
-
"video-analysis:gemini-3.6-flash:180s":
|
|
73
|
-
"video-analysis:gemini-3.6-flash:360s":
|
|
74
|
-
"video-analysis:gemini-3.6-flash:600s":
|
|
75
|
-
"video-analysis:gemini-3.1-pro:60s":
|
|
76
|
-
"video-analysis:gemini-3.1-pro:180s":
|
|
77
|
-
"video-analysis:gemini-3.1-pro:360s":
|
|
78
|
-
"video-analysis:gemini-3.1-pro:600s":
|
|
78
|
+
"video-analysis:gemini-3.6-flash:60s": 65,
|
|
79
|
+
"video-analysis:gemini-3.6-flash:180s": 92,
|
|
80
|
+
"video-analysis:gemini-3.6-flash:360s": 237,
|
|
81
|
+
"video-analysis:gemini-3.6-flash:600s": 395,
|
|
82
|
+
"video-analysis:gemini-3.1-pro:60s": 87,
|
|
83
|
+
"video-analysis:gemini-3.1-pro:180s": 116,
|
|
84
|
+
"video-analysis:gemini-3.1-pro:360s": 305,
|
|
85
|
+
"video-analysis:gemini-3.1-pro:600s": 509,
|
|
79
86
|
// Mixed tiers (`mixed` + `mixed-fast`) share ONE credit family — they are
|
|
80
87
|
// variants of the same engine plan (plan internals live in the private
|
|
81
88
|
// analysis plugin). Admin-tunable via model_pricing like every other row.
|
|
82
|
-
"video-analysis:mixed:60s":
|
|
83
|
-
"video-analysis:mixed:180s":
|
|
84
|
-
"video-analysis:mixed:360s":
|
|
85
|
-
"video-analysis:mixed:600s":
|
|
86
|
-
// SMART — the one native-transport plan: a single pass with reasoning
|
|
87
|
-
//
|
|
88
|
-
// because it genuinely costs more to run
|
|
89
|
-
// accuracy
|
|
90
|
-
|
|
91
|
-
"video-analysis:smart:
|
|
92
|
-
"video-analysis:smart:
|
|
93
|
-
"video-analysis:smart:
|
|
89
|
+
"video-analysis:mixed:60s": 110,
|
|
90
|
+
"video-analysis:mixed:180s": 149,
|
|
91
|
+
"video-analysis:mixed:360s": 390,
|
|
92
|
+
"video-analysis:mixed:600s": 651,
|
|
93
|
+
// SMART — the one native-transport plan: a single pass with reasoning turned
|
|
94
|
+
// all the way up at a measured-optimal sampling rate. Priced above the
|
|
95
|
+
// economy tiers because it genuinely costs more to run; the only tier whose
|
|
96
|
+
// accuracy is validated against a hand-counted edit list, re-validated at
|
|
97
|
+
// the current sampling rate before this schedule shipped.
|
|
98
|
+
"video-analysis:smart:60s": 333,
|
|
99
|
+
"video-analysis:smart:180s": 470,
|
|
100
|
+
"video-analysis:smart:360s": 1135,
|
|
101
|
+
"video-analysis:smart:600s": 1868,
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
/**
|