@nodaro/shared 2.8.0 → 2.10.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 +198 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +474 -94
- package/dist/index.d.ts +474 -94
- package/dist/index.js +178 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/llm-models.test.ts +3 -2
- package/src/__tests__/organizations-types.test.ts +61 -0
- package/src/__tests__/producer-types.test.ts +11 -0
- package/src/__tests__/prompt-length-limits.test.ts +7 -3
- package/src/__tests__/seedance2-continuation-ref.test.ts +2 -3
- package/src/__tests__/video-analysis-catalog-sync.test.ts +1 -1
- package/src/__tests__/video-analysis-pricing.test.ts +2 -2
- package/src/__tests__/video-mode-for-inputs.test.ts +74 -0
- package/src/combine-transitions.ts +38 -0
- package/src/credit-estimators/video-utils.ts +1 -1
- package/src/featured-entities.ts +1 -1
- package/src/i18n/types.ts +12 -14
- package/src/index.ts +11 -1
- package/src/llm-models.ts +4 -0
- package/src/model-catalog.ts +19 -0
- package/src/model-constants.ts +52 -7
- package/src/organizations/index.ts +2 -0
- package/src/organizations/types.ts +152 -0
- package/src/organizations/views.ts +220 -0
- package/src/producer-types.ts +6 -0
- package/src/smart-cut-windows.ts +8 -17
- package/src/suno-track-sources.ts +23 -0
- package/src/surround.ts +10 -90
- package/src/video-analysis-pricing.ts +25 -36
- package/src/workflow-export.ts +41 -0
|
@@ -9,14 +9,12 @@
|
|
|
9
9
|
* `buildVideoAnalysisCreditId` + `/v1/credits/model-cost`) all derive from
|
|
10
10
|
* these.
|
|
11
11
|
*
|
|
12
|
-
* The
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* node. A cross-check test in that private package guards this table so the
|
|
19
|
-
* public numbers can't silently drift from the formula.
|
|
12
|
+
* The rate constants and the formula that GENERATE these numbers live
|
|
13
|
+
* PRIVATELY in the `@nodaroai/cloud-plugins` package — never in this public
|
|
14
|
+
* repo. They were first moved out of this package (published Apache-2.0 on
|
|
15
|
+
* npm), then out of the app repo entirely alongside the rest of the
|
|
16
|
+
* video-analysis node. A cross-check test in that private package guards
|
|
17
|
+
* this table so the public numbers can't silently drift from the formula.
|
|
20
18
|
*
|
|
21
19
|
* `VIDEO_ANALYSIS_BUCKET_CREDITS` below is the precomputed OUTPUT of that
|
|
22
20
|
* private formula for every (model × bucket) combination — a plain credit
|
|
@@ -24,9 +22,8 @@
|
|
|
24
22
|
* `VIDEO_CLIP_CREDITS` uses in `film-pricing.ts`. It is what the frontend's
|
|
25
23
|
* client-side cost preview (`estimateNodeCredits` in
|
|
26
24
|
* workflow-editor/types.ts) reads instead of calling the formula directly.
|
|
27
|
-
* The formula's own test in `@nodaroai/cloud-plugins`
|
|
28
|
-
*
|
|
29
|
-
* against it and fails on drift. There is deliberately NO app-side formula to
|
|
25
|
+
* The formula's own test in `@nodaroai/cloud-plugins` cross-checks this
|
|
26
|
+
* table against it and fails on drift. There is deliberately NO app-side formula to
|
|
30
27
|
* check against — it was moved private in 2026-07 and the old backend test
|
|
31
28
|
* went with it.
|
|
32
29
|
*
|
|
@@ -65,27 +62,20 @@ export const VIDEO_ANALYSIS_WINDOW = { LEN: WINDOW_LEN, STRIDE: WINDOW_STRIDE, O
|
|
|
65
62
|
// not 110). The plugin's cost test now covers sentinels as well, so this class
|
|
66
63
|
// of drift fails CI instead of shipping.
|
|
67
64
|
// REGENERATED 2026-07-31 with the smart-tier re-base (formula inputs moved in
|
|
68
|
-
// the plugin: sampling 24→6 fps
|
|
69
|
-
//
|
|
70
|
-
// per
|
|
71
|
-
// Net effect: smart drops 27–47% per bucket — the 24 fps token spend was also
|
|
72
|
-
// partly paying for media tokens the provider clamped and never counted — and
|
|
73
|
-
// the economy rows tick up 3–6% from the prompt-token true-up.
|
|
65
|
+
// the plugin: sampling 24→6 fps, which proved equal on content and better on
|
|
66
|
+
// cast stability; system-prompt and per-window output-token constants updated).
|
|
67
|
+
// Net effect: smart drops 27–47% per bucket, and the economy rows tick up 3–6%.
|
|
74
68
|
//
|
|
75
|
-
// REGENERATED 2026-08-03 — V1 hybrid-smart reprice
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
// judge/refine terms instead of an implicit share of a single-pass budget.
|
|
86
|
-
// This is the full, honest reprice Tal approved, including the economy tiers
|
|
87
|
-
// (fast 33->185 @180s ends a below-cost combine exposure that existed at the
|
|
88
|
-
// old price). Net effect, per bucket (every row rises):
|
|
69
|
+
// REGENERATED 2026-08-03 — V1 hybrid-smart reprice, from the plugin's own
|
|
70
|
+
// generator. This is the V1 true-up of the earlier provisional
|
|
71
|
+
// judge/refine/frame-judge constants (the constants themselves, like the rest
|
|
72
|
+
// of the formula, stay private in the plugin repo — never in this public
|
|
73
|
+
// package). `smart` is now a multi-roll plan that always refines its merged
|
|
74
|
+
// result (`selectionMode` does not apply to it), and every multi-roll tier
|
|
75
|
+
// now carries its own explicit judge/refine terms instead of an implicit
|
|
76
|
+
// share of a single-pass budget.
|
|
77
|
+
// The economy tiers rise too (fast 33->185 @180s).
|
|
78
|
+
// Net effect, per bucket (every row rises):
|
|
89
79
|
//
|
|
90
80
|
// gemini-3-flash 60s 24->180 180s 33->185 360s 86-> 514 600s 143-> 846
|
|
91
81
|
// gemini-3.6-flash 60s 65->203 180s 92->218 360s 237-> 598 600s 395-> 986
|
|
@@ -119,9 +109,8 @@ export const VIDEO_ANALYSIS_BUCKET_CREDITS: Record<string, number> = {
|
|
|
119
109
|
"video-analysis:mixed:180s": 289,
|
|
120
110
|
"video-analysis:mixed:360s": 724,
|
|
121
111
|
"video-analysis:mixed:600s": 1169,
|
|
122
|
-
// SMART — the accuracy tier, and since the 2026-08-03
|
|
123
|
-
//
|
|
124
|
-
// fast + 2 pro donor rolls, always refined (`selectionMode` does not apply
|
|
112
|
+
// SMART — the accuracy tier, and since the 2026-08-03 re-plan a multi-roll
|
|
113
|
+
// plan like the others, always refined (`selectionMode` does not apply
|
|
125
114
|
// here — smart always refines; it never offers a cheaper "choose" path).
|
|
126
115
|
// Priced above the economy tiers because it genuinely costs more to run;
|
|
127
116
|
// the only tier whose accuracy is validated against a hand-counted edit
|
|
@@ -168,7 +157,7 @@ export function videoAnalysisNumWindows(bucketSec: number): number {
|
|
|
168
157
|
* Precomputed credit cost for the `video-audit` node ("AI Audit") — the same
|
|
169
158
|
* pattern as `VIDEO_ANALYSIS_BUCKET_CREDITS` above: the OUTPUT of the private
|
|
170
159
|
* `videoAuditBucketCredits` formula in `@nodaroai/cloud-plugins`
|
|
171
|
-
* (
|
|
160
|
+
* (in the plugin repo), a plain lookup table never a
|
|
172
161
|
* formula, cross-checked against that package's own cost test. Shares the
|
|
173
162
|
* SAME duration-bucket ladder as video-analysis (`VIDEO_ANALYSIS_DURATION_BUCKETS`
|
|
174
163
|
* / `pickVideoAnalysisBucket`) — the audit re-watches the same clip, so it
|
|
@@ -195,7 +184,7 @@ export function videoAnalysisNumWindows(bucketSec: number): number {
|
|
|
195
184
|
* `buildVideoAnalysisCreditId`.
|
|
196
185
|
*
|
|
197
186
|
* Values pasted verbatim from the plugin generator's output
|
|
198
|
-
* (
|
|
187
|
+
* (the plugin repo's bucket generator) —
|
|
199
188
|
* never hand computed. The plugin's cost test cross-checks every row.
|
|
200
189
|
*/
|
|
201
190
|
export const VIDEO_AUDIT_BUCKET_CREDITS: Record<string, number> = {
|
package/src/workflow-export.ts
CHANGED
|
@@ -74,6 +74,45 @@ export interface WorkflowExportLocation {
|
|
|
74
74
|
styleLock?: boolean | null
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/** A media URL referenced from a node's data, located by node + field path. */
|
|
78
|
+
export interface WorkflowMediaRef {
|
|
79
|
+
nodeId: string
|
|
80
|
+
nodeLabel?: string
|
|
81
|
+
/** Dot/bracket path inside `node.data`, e.g. `imageUrl` or `referenceImageUrls[1]`. */
|
|
82
|
+
field: string
|
|
83
|
+
url: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Export-time portability analysis (#866). A bundle exported from a private
|
|
88
|
+
* host carries media URLs only that host can serve (`http://localhost:3000/
|
|
89
|
+
* storage/…`, a LAN address, a `.internal` name); imported anywhere else, the
|
|
90
|
+
* nodes fail at Run time with an opaque provider fetch error. The exporter
|
|
91
|
+
* lists those URLs here so the person exporting is told BEFORE sharing, and
|
|
92
|
+
* an importer can explain what will not load. Absent when every media URL is
|
|
93
|
+
* publicly routable.
|
|
94
|
+
*/
|
|
95
|
+
export interface WorkflowPortability {
|
|
96
|
+
unreachableMedia: WorkflowMediaRef[]
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* What the importer did about the bundle's media (#866). Publicly reachable
|
|
101
|
+
* media that is not already on the importing instance's own storage is
|
|
102
|
+
* copied there (`rehosted`) so the workflow runs from local copies; media on
|
|
103
|
+
* a host the importer cannot reach is left as-is and listed (`unreachable`);
|
|
104
|
+
* anything declined for another reason (too large, not a media type, over
|
|
105
|
+
* the per-import cap, upload failed) is listed with the reason (`skipped`).
|
|
106
|
+
*/
|
|
107
|
+
export interface WorkflowImportReport {
|
|
108
|
+
rehosted: number
|
|
109
|
+
unreachable: WorkflowMediaRef[]
|
|
110
|
+
skipped: Array<WorkflowMediaRef & { reason: string }>
|
|
111
|
+
/** Anything else the importer should know, e.g. copies were made but the
|
|
112
|
+
* workflow could not be updated to use them. */
|
|
113
|
+
notes?: string[]
|
|
114
|
+
}
|
|
115
|
+
|
|
77
116
|
export interface WorkflowExport {
|
|
78
117
|
version: 1
|
|
79
118
|
exportedAt: string
|
|
@@ -87,6 +126,8 @@ export interface WorkflowExport {
|
|
|
87
126
|
creatures?: WorkflowExportCreature[]
|
|
88
127
|
locations: WorkflowExportLocation[]
|
|
89
128
|
}
|
|
129
|
+
/** Present only when the bundle references media another instance cannot fetch. */
|
|
130
|
+
portability?: WorkflowPortability
|
|
90
131
|
}
|
|
91
132
|
|
|
92
133
|
/**
|