@nodaro/shared 1.6.0 → 1.7.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 CHANGED
@@ -63,6 +63,7 @@ var VIDEO_RATIOS_HVS = ["16:9", "9:16", "1:1"];
63
63
  var WAN_27_IMAGE_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "8:1", "1:8"];
64
64
  var VIDEO_RATIOS_HVS345 = ["16:9", "9:16", "1:1", "4:3", "3:4"];
65
65
  var VIDEO_RATIOS_SEEDANCE_2 = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "adaptive"];
66
+ var VIDEO_RATIOS_HAPPYHORSE_11 = ["16:9", "9:16", "1:1", "4:3", "3:4", "4:5", "5:4", "21:9", "9:21"];
66
67
  var IMAGE_MODELS = {
67
68
  // ── Google Nano Banana ──
68
69
  "nano-banana": {
@@ -1241,21 +1242,22 @@ var VIDEO_MODELS = {
1241
1242
  { identifier: "wan-2.7-t2v", credits: 19, note: "5s 720p default" }
1242
1243
  ]
1243
1244
  },
1244
- // ── HappyHorse ──
1245
+ // ── HappyHorse (1.1 — ids kept version-less; repointed in place when KIE
1246
+ // delisted 1.0, same param surface, so saved workflows keep working) ──
1245
1247
  "happyhorse": {
1246
1248
  id: "happyhorse",
1247
1249
  kind: "video",
1248
1250
  modes: ["t2v"],
1249
1251
  family: "HappyHorse",
1250
- label: "HappyHorse",
1252
+ label: "HappyHorse 1.1",
1251
1253
  series: "HappyHorse",
1252
- description: "HappyHorse text-to-video \u2014 3\u201315s at 720p/1080p.",
1254
+ description: "HappyHorse 1.1 text-to-video \u2014 3\u201315s at 720p/1080p, 9 aspect ratios incl. 21:9/9:21, per-second pricing.",
1253
1255
  useCases: ["motion", "creative"],
1254
- aspectRatios: VIDEO_RATIOS_HVS345,
1256
+ aspectRatios: VIDEO_RATIOS_HAPPYHORSE_11,
1255
1257
  durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
1256
1258
  resolutions: ["720p", "1080p"],
1257
1259
  pricing: [
1258
- { identifier: "happyhorse", credits: 13, note: "5s 720p default" }
1260
+ { identifier: "happyhorse", credits: 29, note: "5s 720p default \u2014 per-second: ~5.7 cr/s @720p, ~7.3 cr/s @1080p" }
1259
1261
  ]
1260
1262
  },
1261
1263
  "happyhorse-i2v": {
@@ -1263,14 +1265,14 @@ var VIDEO_MODELS = {
1263
1265
  kind: "video",
1264
1266
  modes: ["i2v"],
1265
1267
  family: "HappyHorse",
1266
- label: "HappyHorse I2V",
1268
+ label: "HappyHorse 1.1 I2V",
1267
1269
  series: "HappyHorse",
1268
- description: "HappyHorse image-to-video \u2014 3\u201315s at 720p/1080p, aspect ratio inferred from input image.",
1270
+ description: "HappyHorse 1.1 image-to-video \u2014 3\u201315s at 720p/1080p, aspect ratio inferred from input image, per-second pricing.",
1269
1271
  useCases: ["motion", "creative"],
1270
1272
  durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
1271
1273
  resolutions: ["720p", "1080p"],
1272
1274
  pricing: [
1273
- { identifier: "happyhorse-i2v", credits: 13, note: "5s 720p default" }
1275
+ { identifier: "happyhorse-i2v", credits: 29, note: "5s 720p default \u2014 per-second: ~5.7 cr/s @720p, ~7.3 cr/s @1080p" }
1274
1276
  ]
1275
1277
  },
1276
1278
  "happyhorse-ref2v": {
@@ -1278,16 +1280,16 @@ var VIDEO_MODELS = {
1278
1280
  kind: "video",
1279
1281
  modes: ["i2v"],
1280
1282
  family: "HappyHorse",
1281
- label: "HappyHorse Ref2V",
1283
+ label: "HappyHorse 1.1 Ref2V",
1282
1284
  series: "HappyHorse",
1283
- description: "HappyHorse reference-to-video \u2014 1\u20139 reference images, 3\u201315s at 720p/1080p.",
1285
+ description: "HappyHorse 1.1 reference-to-video \u2014 1\u20139 reference images, 3\u201315s at 720p/1080p, per-second pricing.",
1284
1286
  useCases: ["motion", "reference"],
1285
- aspectRatios: VIDEO_RATIOS_HVS345,
1287
+ aspectRatios: VIDEO_RATIOS_HAPPYHORSE_11,
1286
1288
  durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
1287
1289
  resolutions: ["720p", "1080p"],
1288
1290
  features: ["reference-image"],
1289
1291
  pricing: [
1290
- { identifier: "happyhorse-ref2v", credits: 15, note: "5s 720p default" }
1292
+ { identifier: "happyhorse-ref2v", credits: 29, note: "5s 720p default \u2014 per-second: ~5.7 cr/s @720p, ~7.3 cr/s @1080p" }
1291
1293
  ]
1292
1294
  },
1293
1295
  "happyhorse-edit": {
@@ -1301,7 +1303,7 @@ var VIDEO_MODELS = {
1301
1303
  useCases: ["v2v", "restyle"],
1302
1304
  resolutions: ["720p", "1080p"],
1303
1305
  pricing: [
1304
- { identifier: "happyhorse-edit", credits: 20, note: "720p default" }
1306
+ { identifier: "happyhorse-edit", credits: 35, note: "720p default (5s-equivalent flat rate)" }
1305
1307
  ]
1306
1308
  },
1307
1309
  // ── Bytedance video lite/pro ──
@@ -2753,7 +2755,10 @@ var DURATION_PRICED_PROVIDERS = /* @__PURE__ */ new Set([
2753
2755
  "seedance-2",
2754
2756
  "seedance-2-fast",
2755
2757
  "seedance-2-mini",
2756
- "grok-imagine-video-1.5"
2758
+ "grok-imagine-video-1.5",
2759
+ "happyhorse",
2760
+ "happyhorse-i2v",
2761
+ "happyhorse-ref2v"
2757
2762
  ]);
2758
2763
  var SEEDANCE_2_PROVIDERS = /* @__PURE__ */ new Set([
2759
2764
  "seedance-2",
@@ -2832,7 +2837,14 @@ var RESOLUTION_DURATION_PRICING = {
2832
2837
  "grok-imagine-video-1.5": ["480p", "720p"],
2833
2838
  // seedance-2-extend always uses a video ref, so pricing has no -ref
2834
2839
  // dimension — duration tier + ":res" only (rates = seedance-2 -ref + stitch).
2835
- "seedance-2-extend": ["480p", "720p", "1080p"]
2840
+ "seedance-2-extend": ["480p", "720p", "1080p"],
2841
+ // HappyHorse 1.1 — per-second billing at two published resolution rates
2842
+ // (kie.ai/happyhorse-1-1: 22.5 cr/s @720p, 29 cr/s @1080p, uniform across
2843
+ // t2v/i2v/ref2v). 720p first = billing default; the KIE-side default is
2844
+ // pinned to 720p via extraParams in backend kie/models.ts so render matches.
2845
+ "happyhorse": ["720p", "1080p"],
2846
+ "happyhorse-i2v": ["720p", "1080p"],
2847
+ "happyhorse-ref2v": ["720p", "1080p"]
2836
2848
  };
2837
2849
  var NATIVE_ADAPTIVE_ASPECT = {
2838
2850
  "seedance-2": "adaptive",
@@ -2908,6 +2920,10 @@ var VIDEO_VARIABLE_PRICING = {
2908
2920
  // Grok Imagine Video 1.5 — per-second billing split 480p/720p (no video-ref dimension).
2909
2921
  "grok-imagine-video-1.5": "duration+resolution"
2910
2922
  };
2923
+ var HAPPYHORSE_DURATION_TIERS = Array.from(
2924
+ { length: 13 },
2925
+ (_, i) => ({ maxSeconds: i + 3, suffix: `${i + 3}s` })
2926
+ );
2911
2927
  var VIDEO_DURATION_TIERS = {
2912
2928
  "kling-3.0": [
2913
2929
  { maxSeconds: 5, suffix: "5s" },
@@ -3001,7 +3017,15 @@ var VIDEO_DURATION_TIERS = {
3001
3017
  { maxSeconds: 13, suffix: "13s" },
3002
3018
  { maxSeconds: 14, suffix: "14s" },
3003
3019
  { maxSeconds: 15, suffix: "15s" }
3004
- ]
3020
+ ],
3021
+ // HappyHorse 1.1 (t2v / i2v / ref2v) — true per-second billing (KIE 22.5 cr/s
3022
+ // @720p, 29 cr/s @1080p, published on kie.ai/happyhorse-1-1). One tier per
3023
+ // allowed second (3–15s) so the composite identifier maps 1:1 to the seeded
3024
+ // price, combined with RESOLUTION_DURATION_PRICING for the ":720p"/":1080p"
3025
+ // suffix (e.g. "happyhorse-i2v:5s:720p").
3026
+ "happyhorse": HAPPYHORSE_DURATION_TIERS,
3027
+ "happyhorse-i2v": HAPPYHORSE_DURATION_TIERS,
3028
+ "happyhorse-ref2v": HAPPYHORSE_DURATION_TIERS
3005
3029
  };
3006
3030
  var COMPOSER_PLAN_MAP = {
3007
3031
  "video-composer": { planType: "scene-graph", planField: "sceneGraph" },