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