@nodaro/shared 1.24.1 → 2.0.2
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 +309 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +307 -291
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/credit-conversion.test.ts +53 -0
- package/src/__tests__/video-analysis-catalog-sync.test.ts +5 -3
- package/src/credit-conversion.ts +39 -0
- package/src/index.ts +2 -0
- package/src/model-catalog.ts +269 -269
- package/src/model-constants.ts +1 -1
- package/src/video-analysis-pricing.ts +32 -20
package/src/model-constants.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { z } from "zod"
|
|
|
6
6
|
import { MODEL_CATALOG } from "./model-catalog.js"
|
|
7
7
|
|
|
8
8
|
/** Base USD cost per 1 Nodaro credit, at cost. Used for cost→credit conversion. */
|
|
9
|
-
export const CREDIT_BASE_USD = 0.
|
|
9
|
+
export const CREDIT_BASE_USD = 0.002
|
|
10
10
|
|
|
11
11
|
/** Max characters for the (assembled) prompt accepted by the image-generation routes
|
|
12
12
|
* (generate-image, image-to-image, edit-image). Single source of truth — the route Zod
|
|
@@ -48,37 +48,49 @@ export const VIDEO_ANALYSIS_WINDOW = { LEN: WINDOW_LEN, STRIDE: WINDOW_STRIDE, O
|
|
|
48
48
|
* Keep in sync with
|
|
49
49
|
* `docs/nodes/processing-video/video-analysis.md`.
|
|
50
50
|
*/
|
|
51
|
+
// EVERY row here is RE-DERIVED from the cloud-plugins formula at the current
|
|
52
|
+
// credit base — never a mechanical x10 of an older table. The formula ceils USD
|
|
53
|
+
// into credits, so a 10x finer base rounds LESS: the 60s flash bucket is 23,
|
|
54
|
+
// where x10 of the old 3 would have been 30 (a ~30% over-charge).
|
|
55
|
+
//
|
|
56
|
+
// That applies to the SENTINEL rows (`mixed:*`, `smart:*`) exactly as much as to
|
|
57
|
+
// the per-model rows. They were briefly shipped as a x10 on the reasoning that
|
|
58
|
+
// they sit outside the plugin's cross-check loop — but being outside the loop
|
|
59
|
+
// makes a row UNGUARDED, not exempt: `videoAnalysisBucketCredits` computes them
|
|
60
|
+
// from the same roll plan, so they are formula-derived too (mixed:60s is 104,
|
|
61
|
+
// not 110). The plugin's cost test now covers sentinels as well, so this class
|
|
62
|
+
// of drift fails CI instead of shipping.
|
|
51
63
|
export const VIDEO_ANALYSIS_BUCKET_CREDITS: Record<string, number> = {
|
|
52
64
|
// Legacy fast-tier model (pre-2026-07) — kept for stored raw-id configs.
|
|
53
|
-
"video-analysis:gemini-3-flash:60s":
|
|
54
|
-
"video-analysis:gemini-3-flash:180s":
|
|
55
|
-
"video-analysis:gemini-3-flash:360s":
|
|
56
|
-
"video-analysis:gemini-3-flash:600s":
|
|
65
|
+
"video-analysis:gemini-3-flash:60s": 23,
|
|
66
|
+
"video-analysis:gemini-3-flash:180s": 32,
|
|
67
|
+
"video-analysis:gemini-3-flash:360s": 81,
|
|
68
|
+
"video-analysis:gemini-3-flash:600s": 136,
|
|
57
69
|
// Current fast tier — regenerated from the private formula for its backing
|
|
58
70
|
// model; higher than the legacy fast schedule but still ≤ pro per bucket.
|
|
59
|
-
"video-analysis:gemini-3.6-flash:60s":
|
|
60
|
-
"video-analysis:gemini-3.6-flash:180s":
|
|
61
|
-
"video-analysis:gemini-3.6-flash:360s":
|
|
62
|
-
"video-analysis:gemini-3.6-flash:600s":
|
|
63
|
-
"video-analysis:gemini-3.1-pro:60s":
|
|
64
|
-
"video-analysis:gemini-3.1-pro:180s":
|
|
65
|
-
"video-analysis:gemini-3.1-pro:360s":
|
|
66
|
-
"video-analysis:gemini-3.1-pro:600s":
|
|
71
|
+
"video-analysis:gemini-3.6-flash:60s": 61,
|
|
72
|
+
"video-analysis:gemini-3.6-flash:180s": 88,
|
|
73
|
+
"video-analysis:gemini-3.6-flash:360s": 224,
|
|
74
|
+
"video-analysis:gemini-3.6-flash:600s": 374,
|
|
75
|
+
"video-analysis:gemini-3.1-pro:60s": 82,
|
|
76
|
+
"video-analysis:gemini-3.1-pro:180s": 111,
|
|
77
|
+
"video-analysis:gemini-3.1-pro:360s": 291,
|
|
78
|
+
"video-analysis:gemini-3.1-pro:600s": 486,
|
|
67
79
|
// Mixed tiers (`mixed` + `mixed-fast`) share ONE credit family — they are
|
|
68
80
|
// variants of the same engine plan (plan internals live in the private
|
|
69
81
|
// analysis plugin). Admin-tunable via model_pricing like every other row.
|
|
70
|
-
"video-analysis:mixed:60s":
|
|
71
|
-
"video-analysis:mixed:180s":
|
|
72
|
-
"video-analysis:mixed:360s":
|
|
73
|
-
"video-analysis:mixed:600s":
|
|
82
|
+
"video-analysis:mixed:60s": 104,
|
|
83
|
+
"video-analysis:mixed:180s": 142,
|
|
84
|
+
"video-analysis:mixed:360s": 372,
|
|
85
|
+
"video-analysis:mixed:600s": 621,
|
|
74
86
|
// SMART — the one native-transport plan: a single pass with reasoning and
|
|
75
87
|
// frame sampling turned all the way up. Priced well above the economy tiers
|
|
76
88
|
// because it genuinely costs more to run, and it is the only tier whose
|
|
77
89
|
// accuracy was measured against a hand-counted edit list.
|
|
78
|
-
"video-analysis:smart:60s":
|
|
79
|
-
"video-analysis:smart:180s":
|
|
80
|
-
"video-analysis:smart:360s":
|
|
81
|
-
"video-analysis:smart:600s":
|
|
90
|
+
"video-analysis:smart:60s": 454,
|
|
91
|
+
"video-analysis:smart:180s": 975,
|
|
92
|
+
"video-analysis:smart:360s": 2105,
|
|
93
|
+
"video-analysis:smart:600s": 3496,
|
|
82
94
|
}
|
|
83
95
|
|
|
84
96
|
/**
|