@nodaro/shared 2.0.2 → 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 +66 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +66 -62
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/scraper-actors.test.ts +9 -6
- package/src/__tests__/video-analysis-catalog-sync.test.ts +5 -4
- package/src/model-catalog.ts +30 -27
- package/src/pipeline-defaults.ts +10 -4
- package/src/scraper-actors.ts +13 -8
- package/src/video-analysis-pricing.ts +32 -24
package/dist/index.d.cts
CHANGED
|
@@ -2280,7 +2280,12 @@ declare function evaluateConditionGroup(parsedItem: unknown, rawItem: string, co
|
|
|
2280
2280
|
declare const SCRAPER_ACTOR_IDS: readonly ["content-crawler", "google-search", "instagram", "tiktok", "rss"];
|
|
2281
2281
|
type ScraperActorId = (typeof SCRAPER_ACTOR_IDS)[number];
|
|
2282
2282
|
declare const SCRAPER_ACTOR_LABELS: Record<ScraperActorId, string>;
|
|
2283
|
-
/** Credit costs per composite SKU — must stay in sync with STATIC_CREDIT_COSTS in backend.
|
|
2283
|
+
/** Credit costs per composite SKU — must stay in sync with STATIC_CREDIT_COSTS in backend.
|
|
2284
|
+
*
|
|
2285
|
+
* "Must stay in sync" was doing no work: these were left at the pre-2026-07-30
|
|
2286
|
+
* credit base while the backend moved, so every SKU here read a tenth of the
|
|
2287
|
+
* real price. Values below are copied from `model_pricing`, which is what the
|
|
2288
|
+
* user is actually charged. */
|
|
2284
2289
|
declare const SCRAPER_CREDIT_COSTS: Record<string, number>;
|
|
2285
2290
|
declare function isScraperActor(value: unknown): value is ScraperActorId;
|
|
2286
2291
|
interface ScraperCreditInput {
|
package/dist/index.d.ts
CHANGED
|
@@ -2280,7 +2280,12 @@ declare function evaluateConditionGroup(parsedItem: unknown, rawItem: string, co
|
|
|
2280
2280
|
declare const SCRAPER_ACTOR_IDS: readonly ["content-crawler", "google-search", "instagram", "tiktok", "rss"];
|
|
2281
2281
|
type ScraperActorId = (typeof SCRAPER_ACTOR_IDS)[number];
|
|
2282
2282
|
declare const SCRAPER_ACTOR_LABELS: Record<ScraperActorId, string>;
|
|
2283
|
-
/** Credit costs per composite SKU — must stay in sync with STATIC_CREDIT_COSTS in backend.
|
|
2283
|
+
/** Credit costs per composite SKU — must stay in sync with STATIC_CREDIT_COSTS in backend.
|
|
2284
|
+
*
|
|
2285
|
+
* "Must stay in sync" was doing no work: these were left at the pre-2026-07-30
|
|
2286
|
+
* credit base while the backend moved, so every SKU here read a tenth of the
|
|
2287
|
+
* real price. Values below are copied from `model_pricing`, which is what the
|
|
2288
|
+
* user is actually charged. */
|
|
2284
2289
|
declare const SCRAPER_CREDIT_COSTS: Record<string, number>;
|
|
2285
2290
|
declare function isScraperActor(value: unknown): value is ScraperActorId;
|
|
2286
2291
|
interface ScraperCreditInput {
|
package/dist/index.js
CHANGED
|
@@ -31,11 +31,14 @@ var FREECUT_REQUEST_IMPORT = "FREECUT_REQUEST_IMPORT";
|
|
|
31
31
|
var MODEL_RECOMMENDATIONS = [
|
|
32
32
|
// image
|
|
33
33
|
{ intent: "best for typography / logos / text-heavy", modelIds: ["nano-banana-pro", "gpt-image-2"], note: "Nano Banana Pro for diagrams / complex text; GPT Image 2 for logos and short copy." },
|
|
34
|
-
|
|
34
|
+
// Notes name the RANKING, not the price — the price sits in the generated
|
|
35
|
+
// table directly below them and in `pricing`, so restating it here just
|
|
36
|
+
// creates a copy that rots (this one said "1 credit" long after it was 2).
|
|
37
|
+
{ intent: "cheapest realistic image", modelIds: ["z-image", "qwen", "imagen4-fast"], note: "Z-Image is the cheapest. Qwen / Imagen4 Fast for slightly higher quality." },
|
|
35
38
|
{ intent: "highest fidelity image", modelIds: ["nano-banana-pro", "imagen4-ultra", "flux-flex"], note: "Pick by family preference; all three are premium tiers." },
|
|
36
39
|
{ intent: "image edit / restyle", modelIds: ["flux-kontext", "ideogram-remix", "seedream-5-pro-i2i"], note: "Flux Kontext preserves identity; Ideogram Remix is character-aware; Seedream 5 Pro for instruction-based edits (5 Lite is the budget option)." },
|
|
37
40
|
{ intent: "highest-resolution image (4K / 8K)", modelIds: ["topaz-image-upscale", "nano-banana-pro", "gpt-image-2"], note: "Generate at native then Topaz upscale for 8K." },
|
|
38
|
-
{ intent: "background removal / cutout", modelIds: ["recraft-remove-bg"], note: "
|
|
41
|
+
{ intent: "background removal / cutout", modelIds: ["recraft-remove-bg"], note: "Cheap, no prompt needed." },
|
|
39
42
|
// video
|
|
40
43
|
{ intent: "best cinematic video", modelIds: ["veo3", "kling-3.0", "seedance-2"], note: "VEO 3.1 Quality for premium narrative; Kling 3.0 for music-synced motion; Seedance 2 for reference-driven consistency." },
|
|
41
44
|
{ intent: "cheap batch video clips", modelIds: ["veo3.1", "wan-turbo", "bytedance-lite"], note: "VEO 3.1 Fast is the best price/quality balance with native audio." },
|
|
@@ -1665,11 +1668,11 @@ var VIDEO_MODELS = {
|
|
|
1665
1668
|
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.",
|
|
1666
1669
|
useCases: ["video-analysis", "shot-list", "fast"],
|
|
1667
1670
|
pricing: [
|
|
1668
|
-
{ identifier: "video-analysis:gemini-3-flash", credits:
|
|
1669
|
-
{ identifier: "video-analysis:gemini-3-flash:60s", credits:
|
|
1670
|
-
{ identifier: "video-analysis:gemini-3-flash:180s", credits:
|
|
1671
|
-
{ identifier: "video-analysis:gemini-3-flash:360s", credits:
|
|
1672
|
-
{ identifier: "video-analysis:gemini-3-flash:600s", credits:
|
|
1671
|
+
{ identifier: "video-analysis:gemini-3-flash", credits: 143, note: "10-min ceiling (no duration given)" },
|
|
1672
|
+
{ identifier: "video-analysis:gemini-3-flash:60s", credits: 24 },
|
|
1673
|
+
{ identifier: "video-analysis:gemini-3-flash:180s", credits: 33 },
|
|
1674
|
+
{ identifier: "video-analysis:gemini-3-flash:360s", credits: 86 },
|
|
1675
|
+
{ identifier: "video-analysis:gemini-3-flash:600s", credits: 143, note: "10-min ceiling" }
|
|
1673
1676
|
]
|
|
1674
1677
|
},
|
|
1675
1678
|
"gemini-3.6-flash-video-analysis": {
|
|
@@ -1682,11 +1685,11 @@ var VIDEO_MODELS = {
|
|
|
1682
1685
|
description: "Analyze a video into a structured shot list (scenes, camera, audio) \u2014 fast, economy tier. Billed per duration bucket.",
|
|
1683
1686
|
useCases: ["video-analysis", "shot-list", "fast"],
|
|
1684
1687
|
pricing: [
|
|
1685
|
-
{ identifier: "video-analysis:gemini-3.6-flash", credits:
|
|
1686
|
-
{ identifier: "video-analysis:gemini-3.6-flash:60s", credits:
|
|
1687
|
-
{ identifier: "video-analysis:gemini-3.6-flash:180s", credits:
|
|
1688
|
-
{ identifier: "video-analysis:gemini-3.6-flash:360s", credits:
|
|
1689
|
-
{ identifier: "video-analysis:gemini-3.6-flash:600s", credits:
|
|
1688
|
+
{ identifier: "video-analysis:gemini-3.6-flash", credits: 395, note: "10-min ceiling (no duration given)" },
|
|
1689
|
+
{ identifier: "video-analysis:gemini-3.6-flash:60s", credits: 65 },
|
|
1690
|
+
{ identifier: "video-analysis:gemini-3.6-flash:180s", credits: 92 },
|
|
1691
|
+
{ identifier: "video-analysis:gemini-3.6-flash:360s", credits: 237 },
|
|
1692
|
+
{ identifier: "video-analysis:gemini-3.6-flash:600s", credits: 395, note: "10-min ceiling" }
|
|
1690
1693
|
]
|
|
1691
1694
|
},
|
|
1692
1695
|
"gemini-3.1-pro-video-analysis": {
|
|
@@ -1699,11 +1702,11 @@ var VIDEO_MODELS = {
|
|
|
1699
1702
|
description: "Analyze a video into a structured shot list (scenes, camera, audio) \u2014 higher-fidelity, default tier. Billed per duration bucket.",
|
|
1700
1703
|
useCases: ["video-analysis", "shot-list", "cinematic"],
|
|
1701
1704
|
pricing: [
|
|
1702
|
-
{ identifier: "video-analysis:gemini-3.1-pro", credits:
|
|
1703
|
-
{ identifier: "video-analysis:gemini-3.1-pro:60s", credits:
|
|
1704
|
-
{ identifier: "video-analysis:gemini-3.1-pro:180s", credits:
|
|
1705
|
-
{ identifier: "video-analysis:gemini-3.1-pro:360s", credits:
|
|
1706
|
-
{ identifier: "video-analysis:gemini-3.1-pro:600s", credits:
|
|
1705
|
+
{ identifier: "video-analysis:gemini-3.1-pro", credits: 509, note: "10-min ceiling (no duration given)" },
|
|
1706
|
+
{ identifier: "video-analysis:gemini-3.1-pro:60s", credits: 87 },
|
|
1707
|
+
{ identifier: "video-analysis:gemini-3.1-pro:180s", credits: 116 },
|
|
1708
|
+
{ identifier: "video-analysis:gemini-3.1-pro:360s", credits: 305 },
|
|
1709
|
+
{ identifier: "video-analysis:gemini-3.1-pro:600s", credits: 509, note: "10-min ceiling" }
|
|
1707
1710
|
]
|
|
1708
1711
|
},
|
|
1709
1712
|
// Both mixed tiers are variants of the same advanced multi-engine analysis
|
|
@@ -1719,11 +1722,11 @@ var VIDEO_MODELS = {
|
|
|
1719
1722
|
description: "Our most advanced analysis tier \u2014 multiple analysis engines combined into one result for maximum completeness and accuracy. Billed per duration bucket.",
|
|
1720
1723
|
useCases: ["video-analysis", "shot-list", "premium", "most-complete"],
|
|
1721
1724
|
pricing: [
|
|
1722
|
-
{ identifier: "video-analysis:mixed", credits:
|
|
1723
|
-
{ identifier: "video-analysis:mixed:60s", credits:
|
|
1724
|
-
{ identifier: "video-analysis:mixed:180s", credits:
|
|
1725
|
-
{ identifier: "video-analysis:mixed:360s", credits:
|
|
1726
|
-
{ identifier: "video-analysis:mixed:600s", credits:
|
|
1725
|
+
{ identifier: "video-analysis:mixed", credits: 651, note: "10-min ceiling (no duration given)" },
|
|
1726
|
+
{ identifier: "video-analysis:mixed:60s", credits: 110 },
|
|
1727
|
+
{ identifier: "video-analysis:mixed:180s", credits: 149 },
|
|
1728
|
+
{ identifier: "video-analysis:mixed:360s", credits: 390 },
|
|
1729
|
+
{ identifier: "video-analysis:mixed:600s", credits: 651, note: "10-min ceiling" }
|
|
1727
1730
|
]
|
|
1728
1731
|
},
|
|
1729
1732
|
// SMART — the accuracy tier, and the only one that does not rely on voting.
|
|
@@ -1740,11 +1743,11 @@ var VIDEO_MODELS = {
|
|
|
1740
1743
|
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.",
|
|
1741
1744
|
useCases: ["video-analysis", "shot-list", "premium", "most-accurate"],
|
|
1742
1745
|
pricing: [
|
|
1743
|
-
{ identifier: "video-analysis:smart", credits:
|
|
1744
|
-
{ identifier: "video-analysis:smart:60s", credits:
|
|
1745
|
-
{ identifier: "video-analysis:smart:180s", credits:
|
|
1746
|
-
{ identifier: "video-analysis:smart:360s", credits:
|
|
1747
|
-
{ identifier: "video-analysis:smart:600s", credits:
|
|
1746
|
+
{ identifier: "video-analysis:smart", credits: 1868, note: "10-min ceiling (no duration given)" },
|
|
1747
|
+
{ identifier: "video-analysis:smart:60s", credits: 333 },
|
|
1748
|
+
{ identifier: "video-analysis:smart:180s", credits: 470 },
|
|
1749
|
+
{ identifier: "video-analysis:smart:360s", credits: 1135 },
|
|
1750
|
+
{ identifier: "video-analysis:smart:600s", credits: 1868, note: "10-min ceiling" }
|
|
1748
1751
|
]
|
|
1749
1752
|
}
|
|
1750
1753
|
};
|
|
@@ -7469,13 +7472,13 @@ var SCRAPER_ACTOR_LABELS = {
|
|
|
7469
7472
|
"rss": "RSS Feed"
|
|
7470
7473
|
};
|
|
7471
7474
|
var SCRAPER_CREDIT_COSTS = {
|
|
7472
|
-
"web-scrape":
|
|
7473
|
-
"web-scrape:google-search":
|
|
7474
|
-
"web-scrape:content-crawler":
|
|
7475
|
-
"web-scrape:content-crawler:site":
|
|
7476
|
-
"web-scrape:instagram":
|
|
7477
|
-
"web-scrape:tiktok":
|
|
7478
|
-
"web-scrape:rss":
|
|
7475
|
+
"web-scrape": 20,
|
|
7476
|
+
"web-scrape:google-search": 30,
|
|
7477
|
+
"web-scrape:content-crawler": 10,
|
|
7478
|
+
"web-scrape:content-crawler:site": 50,
|
|
7479
|
+
"web-scrape:instagram": 10,
|
|
7480
|
+
"web-scrape:tiktok": 10,
|
|
7481
|
+
"web-scrape:rss": 10
|
|
7479
7482
|
};
|
|
7480
7483
|
function isScraperActor(value) {
|
|
7481
7484
|
return typeof value === "string" && SCRAPER_ACTOR_IDS.includes(value);
|
|
@@ -9479,10 +9482,10 @@ var TIER_PIPELINE_PARALLELISM = {
|
|
|
9479
9482
|
};
|
|
9480
9483
|
var TIER_MAX_PIPELINE_COST_CREDITS = {
|
|
9481
9484
|
free: 0,
|
|
9482
|
-
basic:
|
|
9483
|
-
standard:
|
|
9484
|
-
pro:
|
|
9485
|
-
business:
|
|
9485
|
+
basic: 3e3,
|
|
9486
|
+
standard: 8e3,
|
|
9487
|
+
pro: 2e4,
|
|
9488
|
+
business: 5e4
|
|
9486
9489
|
};
|
|
9487
9490
|
var PIPELINE_STAGE_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
9488
9491
|
var PIPELINE_HARD_TIMEOUT_MS = 4 * 60 * 60 * 1e3;
|
|
@@ -12609,35 +12612,36 @@ var WINDOW_OVERLAP = 5;
|
|
|
12609
12612
|
var VIDEO_ANALYSIS_WINDOW = { LEN: WINDOW_LEN, STRIDE: WINDOW_STRIDE, OVERLAP: WINDOW_OVERLAP, SINGLE_MAX: 180 };
|
|
12610
12613
|
var VIDEO_ANALYSIS_BUCKET_CREDITS = {
|
|
12611
12614
|
// Legacy fast-tier model (pre-2026-07) — kept for stored raw-id configs.
|
|
12612
|
-
"video-analysis:gemini-3-flash:60s":
|
|
12613
|
-
"video-analysis:gemini-3-flash:180s":
|
|
12614
|
-
"video-analysis:gemini-3-flash:360s":
|
|
12615
|
-
"video-analysis:gemini-3-flash:600s":
|
|
12615
|
+
"video-analysis:gemini-3-flash:60s": 24,
|
|
12616
|
+
"video-analysis:gemini-3-flash:180s": 33,
|
|
12617
|
+
"video-analysis:gemini-3-flash:360s": 86,
|
|
12618
|
+
"video-analysis:gemini-3-flash:600s": 143,
|
|
12616
12619
|
// Current fast tier — regenerated from the private formula for its backing
|
|
12617
12620
|
// model; higher than the legacy fast schedule but still ≤ pro per bucket.
|
|
12618
|
-
"video-analysis:gemini-3.6-flash:60s":
|
|
12619
|
-
"video-analysis:gemini-3.6-flash:180s":
|
|
12620
|
-
"video-analysis:gemini-3.6-flash:360s":
|
|
12621
|
-
"video-analysis:gemini-3.6-flash:600s":
|
|
12622
|
-
"video-analysis:gemini-3.1-pro:60s":
|
|
12623
|
-
"video-analysis:gemini-3.1-pro:180s":
|
|
12624
|
-
"video-analysis:gemini-3.1-pro:360s":
|
|
12625
|
-
"video-analysis:gemini-3.1-pro:600s":
|
|
12621
|
+
"video-analysis:gemini-3.6-flash:60s": 65,
|
|
12622
|
+
"video-analysis:gemini-3.6-flash:180s": 92,
|
|
12623
|
+
"video-analysis:gemini-3.6-flash:360s": 237,
|
|
12624
|
+
"video-analysis:gemini-3.6-flash:600s": 395,
|
|
12625
|
+
"video-analysis:gemini-3.1-pro:60s": 87,
|
|
12626
|
+
"video-analysis:gemini-3.1-pro:180s": 116,
|
|
12627
|
+
"video-analysis:gemini-3.1-pro:360s": 305,
|
|
12628
|
+
"video-analysis:gemini-3.1-pro:600s": 509,
|
|
12626
12629
|
// Mixed tiers (`mixed` + `mixed-fast`) share ONE credit family — they are
|
|
12627
12630
|
// variants of the same engine plan (plan internals live in the private
|
|
12628
12631
|
// analysis plugin). Admin-tunable via model_pricing like every other row.
|
|
12629
|
-
"video-analysis:mixed:60s":
|
|
12630
|
-
"video-analysis:mixed:180s":
|
|
12631
|
-
"video-analysis:mixed:360s":
|
|
12632
|
-
"video-analysis:mixed:600s":
|
|
12633
|
-
// SMART — the one native-transport plan: a single pass with reasoning
|
|
12634
|
-
//
|
|
12635
|
-
// because it genuinely costs more to run
|
|
12636
|
-
// accuracy
|
|
12637
|
-
|
|
12638
|
-
"video-analysis:smart:
|
|
12639
|
-
"video-analysis:smart:
|
|
12640
|
-
"video-analysis:smart:
|
|
12632
|
+
"video-analysis:mixed:60s": 110,
|
|
12633
|
+
"video-analysis:mixed:180s": 149,
|
|
12634
|
+
"video-analysis:mixed:360s": 390,
|
|
12635
|
+
"video-analysis:mixed:600s": 651,
|
|
12636
|
+
// SMART — the one native-transport plan: a single pass with reasoning turned
|
|
12637
|
+
// all the way up at a measured-optimal sampling rate. Priced above the
|
|
12638
|
+
// economy tiers because it genuinely costs more to run; the only tier whose
|
|
12639
|
+
// accuracy is validated against a hand-counted edit list, re-validated at
|
|
12640
|
+
// the current sampling rate before this schedule shipped.
|
|
12641
|
+
"video-analysis:smart:60s": 333,
|
|
12642
|
+
"video-analysis:smart:180s": 470,
|
|
12643
|
+
"video-analysis:smart:360s": 1135,
|
|
12644
|
+
"video-analysis:smart:600s": 1868
|
|
12641
12645
|
};
|
|
12642
12646
|
function videoAnalysisCreditSegment(modelOrSentinel) {
|
|
12643
12647
|
return modelOrSentinel === "mixed-fast" ? "mixed" : modelOrSentinel;
|