@nodaro/shared 3.70.0 → 3.71.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.
Files changed (136) hide show
  1. package/dist/{chunk-FMQ43SJP.cjs → chunk-4A3ITJJB.cjs} +6 -6
  2. package/dist/{chunk-FMQ43SJP.cjs.map → chunk-4A3ITJJB.cjs.map} +1 -1
  3. package/dist/{chunk-XBHDXURR.cjs → chunk-4HV3LY4A.cjs} +78 -78
  4. package/dist/chunk-4HV3LY4A.cjs.map +1 -0
  5. package/dist/{chunk-52JNQG4K.js → chunk-6FUVGATF.js} +3 -3
  6. package/dist/{chunk-52JNQG4K.js.map → chunk-6FUVGATF.js.map} +1 -1
  7. package/dist/{chunk-GC77W57T.cjs → chunk-6PEWM2B3.cjs} +9 -9
  8. package/dist/{chunk-GC77W57T.cjs.map → chunk-6PEWM2B3.cjs.map} +1 -1
  9. package/dist/{chunk-BIQ7COJP.js → chunk-BO6IKV24.js} +5 -5
  10. package/dist/{chunk-BIQ7COJP.js.map → chunk-BO6IKV24.js.map} +1 -1
  11. package/dist/{chunk-IKN54UGB.js → chunk-BQV6NV7E.js} +3 -3
  12. package/dist/{chunk-IKN54UGB.js.map → chunk-BQV6NV7E.js.map} +1 -1
  13. package/dist/{chunk-LTBM2KMY.js → chunk-BVP4M5AK.js} +235 -9
  14. package/dist/chunk-BVP4M5AK.js.map +1 -0
  15. package/dist/{chunk-OW5AXH2Y.js → chunk-CL7ECTK2.js} +5 -4
  16. package/dist/chunk-CL7ECTK2.js.map +1 -0
  17. package/dist/{chunk-R22UHRR6.js → chunk-COA2OJIH.js} +39 -23
  18. package/dist/chunk-COA2OJIH.js.map +1 -0
  19. package/dist/{chunk-HW6TLOK4.cjs → chunk-DRPHRE4J.cjs} +2 -2
  20. package/dist/{chunk-HW6TLOK4.cjs.map → chunk-DRPHRE4J.cjs.map} +1 -1
  21. package/dist/{chunk-EWNDK4FV.js → chunk-F3XG5J5V.js} +3 -3
  22. package/dist/{chunk-EWNDK4FV.js.map → chunk-F3XG5J5V.js.map} +1 -1
  23. package/dist/{chunk-4U7QAUV3.cjs → chunk-H52P7DD2.cjs} +61 -61
  24. package/dist/{chunk-4U7QAUV3.cjs.map → chunk-H52P7DD2.cjs.map} +1 -1
  25. package/dist/{chunk-MZ772ZXA.cjs → chunk-HUCGHMOI.cjs} +17 -17
  26. package/dist/{chunk-MZ772ZXA.cjs.map → chunk-HUCGHMOI.cjs.map} +1 -1
  27. package/dist/{chunk-PYYYBINP.cjs → chunk-I4C6ZYU4.cjs} +6 -6
  28. package/dist/{chunk-PYYYBINP.cjs.map → chunk-I4C6ZYU4.cjs.map} +1 -1
  29. package/dist/{chunk-QCVQVKCI.js → chunk-JPSKVBYB.js} +3 -3
  30. package/dist/{chunk-QCVQVKCI.js.map → chunk-JPSKVBYB.js.map} +1 -1
  31. package/dist/{chunk-QVAUBB2T.js → chunk-K2P7KOIT.js} +9 -9
  32. package/dist/{chunk-QVAUBB2T.js.map → chunk-K2P7KOIT.js.map} +1 -1
  33. package/dist/{chunk-QV32JI4L.cjs → chunk-K5WRF2F3.cjs} +4 -4
  34. package/dist/{chunk-QV32JI4L.cjs.map → chunk-K5WRF2F3.cjs.map} +1 -1
  35. package/dist/{chunk-YLDY23N2.js → chunk-KD4UUCMW.js} +5 -5
  36. package/dist/{chunk-YLDY23N2.js.map → chunk-KD4UUCMW.js.map} +1 -1
  37. package/dist/{chunk-OZHE77T3.cjs → chunk-LBKMQAXD.cjs} +9 -9
  38. package/dist/{chunk-OZHE77T3.cjs.map → chunk-LBKMQAXD.cjs.map} +1 -1
  39. package/dist/{chunk-HBRDKHIW.cjs → chunk-MI4WEFJ4.cjs} +21 -21
  40. package/dist/{chunk-HBRDKHIW.cjs.map → chunk-MI4WEFJ4.cjs.map} +1 -1
  41. package/dist/{chunk-DOY47F7S.cjs → chunk-MN7BUGXF.cjs} +7 -7
  42. package/dist/{chunk-DOY47F7S.cjs.map → chunk-MN7BUGXF.cjs.map} +1 -1
  43. package/dist/{chunk-BLGZW3UF.cjs → chunk-NNCHSLFD.cjs} +291 -20
  44. package/dist/chunk-NNCHSLFD.cjs.map +1 -0
  45. package/dist/{chunk-NS34PZ2S.js → chunk-PPXUSZJU.js} +3 -3
  46. package/dist/{chunk-NS34PZ2S.js.map → chunk-PPXUSZJU.js.map} +1 -1
  47. package/dist/{chunk-PKWRAMVB.js → chunk-QME5O4NG.js} +7 -5
  48. package/dist/chunk-QME5O4NG.js.map +1 -0
  49. package/dist/{chunk-42ICEVUN.js → chunk-SAOIGWA2.js} +3 -3
  50. package/dist/{chunk-42ICEVUN.js.map → chunk-SAOIGWA2.js.map} +1 -1
  51. package/dist/{chunk-V6TC2NDG.js → chunk-SHSDGAI4.js} +4 -4
  52. package/dist/{chunk-V6TC2NDG.js.map → chunk-SHSDGAI4.js.map} +1 -1
  53. package/dist/{chunk-JEUZNHLL.cjs → chunk-SR7WH4FX.cjs} +33 -33
  54. package/dist/{chunk-JEUZNHLL.cjs.map → chunk-SR7WH4FX.cjs.map} +1 -1
  55. package/dist/{chunk-2VOXSVIE.js → chunk-SZ7ALYPK.js} +3 -3
  56. package/dist/{chunk-2VOXSVIE.js.map → chunk-SZ7ALYPK.js.map} +1 -1
  57. package/dist/{chunk-O53P2D4V.js → chunk-T4YYUI5Q.js} +3 -3
  58. package/dist/{chunk-O53P2D4V.js.map → chunk-T4YYUI5Q.js.map} +1 -1
  59. package/dist/{chunk-HWBLZSM3.cjs → chunk-TOYWEF6E.cjs} +39 -23
  60. package/dist/chunk-TOYWEF6E.cjs.map +1 -0
  61. package/dist/{chunk-FWPGRC4X.cjs → chunk-U6APV2PO.cjs} +5 -5
  62. package/dist/{chunk-FWPGRC4X.cjs.map → chunk-U6APV2PO.cjs.map} +1 -1
  63. package/dist/{chunk-QCZYYAPZ.cjs → chunk-UJIPIVTB.cjs} +48 -48
  64. package/dist/{chunk-QCZYYAPZ.cjs.map → chunk-UJIPIVTB.cjs.map} +1 -1
  65. package/dist/{chunk-KKFFQUMM.js → chunk-VZIMLPDC.js} +5 -5
  66. package/dist/chunk-VZIMLPDC.js.map +1 -0
  67. package/dist/{chunk-PWIKUOLB.cjs → chunk-W4CJ2P3F.cjs} +8 -8
  68. package/dist/{chunk-PWIKUOLB.cjs.map → chunk-W4CJ2P3F.cjs.map} +1 -1
  69. package/dist/{chunk-HP3YIWNJ.js → chunk-WARGPM7P.js} +2 -2
  70. package/dist/{chunk-HP3YIWNJ.js.map → chunk-WARGPM7P.js.map} +1 -1
  71. package/dist/{chunk-POZBRZUM.cjs → chunk-WHK3HTFY.cjs} +41 -41
  72. package/dist/{chunk-POZBRZUM.cjs.map → chunk-WHK3HTFY.cjs.map} +1 -1
  73. package/dist/{chunk-H2E4QXEZ.js → chunk-X3YRSRHP.js} +3 -3
  74. package/dist/{chunk-H2E4QXEZ.js.map → chunk-X3YRSRHP.js.map} +1 -1
  75. package/dist/{chunk-HA2PVTER.js → chunk-XK75VOEH.js} +4 -4
  76. package/dist/{chunk-HA2PVTER.js.map → chunk-XK75VOEH.js.map} +1 -1
  77. package/dist/{chunk-5DRSENY3.cjs → chunk-YHZUTPZL.cjs} +14 -12
  78. package/dist/{chunk-PKWRAMVB.js.map → chunk-YHZUTPZL.cjs.map} +1 -1
  79. package/dist/{chunk-WHV7MDNC.cjs → chunk-ZJQ2L3MI.cjs} +5 -3
  80. package/dist/chunk-ZJQ2L3MI.cjs.map +1 -0
  81. package/dist/entries/apps.cjs +42 -42
  82. package/dist/entries/apps.js +7 -7
  83. package/dist/entries/credits.cjs +418 -238
  84. package/dist/entries/credits.d.cts +262 -1
  85. package/dist/entries/credits.d.ts +262 -1
  86. package/dist/entries/credits.js +9 -9
  87. package/dist/entries/edl.cjs +60 -60
  88. package/dist/entries/edl.d.cts +96 -1
  89. package/dist/entries/edl.d.ts +96 -1
  90. package/dist/entries/edl.js +1 -1
  91. package/dist/entries/model-catalog.cjs +133 -133
  92. package/dist/entries/model-catalog.js +4 -4
  93. package/dist/entries/models.cjs +404 -404
  94. package/dist/entries/models.js +5 -5
  95. package/dist/entries/nodes.cjs +212 -212
  96. package/dist/entries/nodes.js +8 -8
  97. package/dist/entries/pipeline.cjs +153 -153
  98. package/dist/entries/pipeline.js +3 -3
  99. package/dist/entries/social.cjs +195 -191
  100. package/dist/entries/social.d.cts +9 -3
  101. package/dist/entries/social.d.ts +9 -3
  102. package/dist/entries/social.js +1 -1
  103. package/dist/entries/ugc.cjs +71 -71
  104. package/dist/entries/ugc.js +4 -4
  105. package/dist/entries/video.cjs +152 -152
  106. package/dist/entries/video.js +6 -6
  107. package/dist/index.cjs +1812 -1628
  108. package/dist/index.d.cts +3 -3
  109. package/dist/index.d.ts +3 -3
  110. package/dist/index.js +20 -20
  111. package/package.json +1 -1
  112. package/src/__tests__/audio-isolation-pricing.test.ts +49 -0
  113. package/src/__tests__/competitors.test.ts +6 -1
  114. package/src/__tests__/credit-identifiers.test.ts +9 -10
  115. package/src/__tests__/motion-transfer-pricing.test.ts +252 -0
  116. package/src/__tests__/video-to-video-pricing.test.ts +151 -0
  117. package/src/audio-isolation-pricing.ts +80 -0
  118. package/src/competitors.ts +8 -2
  119. package/src/credit-identifiers.ts +6 -0
  120. package/src/entries/credits.ts +54 -0
  121. package/src/entries/edl.ts +2 -0
  122. package/src/entries/social.ts +1 -0
  123. package/src/model-catalog.ts +34 -18
  124. package/src/motion-transfer-pricing.ts +239 -0
  125. package/src/producer-types.ts +2 -0
  126. package/src/use-case-output.ts +102 -0
  127. package/src/video-to-video-pricing.ts +248 -0
  128. package/dist/chunk-5DRSENY3.cjs.map +0 -1
  129. package/dist/chunk-BLGZW3UF.cjs.map +0 -1
  130. package/dist/chunk-HWBLZSM3.cjs.map +0 -1
  131. package/dist/chunk-KKFFQUMM.js.map +0 -1
  132. package/dist/chunk-LTBM2KMY.js.map +0 -1
  133. package/dist/chunk-OW5AXH2Y.js.map +0 -1
  134. package/dist/chunk-R22UHRR6.js.map +0 -1
  135. package/dist/chunk-WHV7MDNC.cjs.map +0 -1
  136. package/dist/chunk-XBHDXURR.cjs.map +0 -1
@@ -120,6 +120,60 @@ export {
120
120
  LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS,
121
121
  } from "../lip-sync-pricing.js"
122
122
  export type { LipSyncDurationBucket, LipSyncAudioRate } from "../lip-sync-pricing.js"
123
+ export {
124
+ MOTION_TRANSFER_MIN_SEC,
125
+ MOTION_TRANSFER_IMAGE_ORIENTATION_MAX_SEC,
126
+ MOTION_TRANSFER_MAX_SEC,
127
+ MOTION_TRANSFER_SECOND_RATES,
128
+ MOTION_TRANSFER_RATE_IDS,
129
+ MOTION_TRANSFER_FLOOR_IDS,
130
+ motionTransferOrientation,
131
+ motionTransferMaxSec,
132
+ motionTransferRateOf,
133
+ motionTransferBilledSeconds,
134
+ motionTransferPrice,
135
+ motionTransferChargedPrice,
136
+ motionTransferBaseCharge,
137
+ checkMotionTransferLength,
138
+ motionTransferEstimateSeconds,
139
+ motionTransferEstimatePrice,
140
+ } from "../motion-transfer-pricing.js"
141
+ export type { MotionTransferSecondRate, MotionTransferPrice, MotionTransferLengthCheck } from "../motion-transfer-pricing.js"
142
+ export {
143
+ CLIP_PRICED_V2V_PROVIDERS,
144
+ HAPPYHORSE_EDIT_MIN_SEC,
145
+ HAPPYHORSE_EDIT_MAX_SEC,
146
+ WAN_VIDEOEDIT_MIN_SEC,
147
+ WAN_VIDEOEDIT_MAX_SEC,
148
+ WAN_VIDEOEDIT_FLOOR_CREDIT_ID,
149
+ V2V_CLIP_RATES,
150
+ V2V_CLIP_RATE_IDS,
151
+ isClipPricedV2vProvider,
152
+ v2vSeededRowCredits,
153
+ videoToVideoClipMinSec,
154
+ videoToVideoClipMaxSec,
155
+ videoToVideoSentResolution,
156
+ videoToVideoClipRateOf,
157
+ videoToVideoBilledSeconds,
158
+ checkVideoToVideoClipLength,
159
+ videoToVideoClipPrice,
160
+ wanVideoEditRateFromSeconds,
161
+ videoToVideoEstimateSeconds,
162
+ videoToVideoEstimatePrice,
163
+ } from "../video-to-video-pricing.js"
164
+ export type { ClipPricedV2vProvider, V2vClipRate, V2vClipLengthCheck, V2vClipPrice } from "../video-to-video-pricing.js"
165
+ export {
166
+ AUDIO_ISOLATION_RATE_ID,
167
+ AUDIO_ISOLATION_RATE_SECONDS,
168
+ AUDIO_ISOLATION_MAX_SEC,
169
+ AUDIO_ISOLATION_MAX_BYTES,
170
+ AUDIO_ISOLATION_MAX_UNITS,
171
+ audioIsolationUnits,
172
+ audioIsolationTooLongMessage,
173
+ checkAudioIsolationLength,
174
+ audioIsolationEstimateUnits,
175
+ } from "../audio-isolation-pricing.js"
176
+ export type { AudioIsolationLengthCheck } from "../audio-isolation-pricing.js"
123
177
  export {
124
178
  SEEDANCE_LIP_SYNC_SECONDS,
125
179
  isSeedanceLipSyncProvider,
@@ -42,3 +42,5 @@ export * from "../speaker-map-contract.js"
42
42
  export * from "../edit-plan-contract.js"
43
43
  // A person's review of an Edit Plan (`editedEdl`) and the one resolver that applies it.
44
44
  export * from "../edit-plan-review.js"
45
+ // What a podcast use-case run reports on its job's output_data (clip spans, trailer moments, speakers).
46
+ export * from "../use-case-output.js"
@@ -230,6 +230,7 @@ export {
230
230
  BRAND_LESSON_KINDS,
231
231
  COMPETITOR_SCAN_CREDIT_COSTS,
232
232
  COMPETITOR_SEARCH_TERMS_MAX,
233
+ COMPETITOR_SCAN_SEARCH_LIMIT,
233
234
  COMPETITOR_SEARCH_TERM_MAX_LENGTH,
234
235
  COMPETITOR_SCAN_PAGE_CREDIT_ID,
235
236
  normalizeSearchTerms,
@@ -3195,8 +3195,8 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
3195
3195
  maker: "alibaba",
3196
3196
  label: "Wan 2.6",
3197
3197
  series: "Wan",
3198
- description: "Wan 2.6 — text-to-video and video-to-video under a single id.",
3199
- useCases: ["v2v", "t2v", "restyle"],
3198
+ description: "Wan 2.6 — text-to-video and video-to-video under a single id. Its video-to-video makes a new clip featuring the subject of the input video, in the scene the prompt describes; it does not edit or restyle the clip.",
3199
+ useCases: ["v2v", "t2v", "reference"],
3200
3200
  durations: [5],
3201
3201
  defaultDuration: 5,
3202
3202
  resolutions: ["720p", "1080p"],
@@ -3213,7 +3213,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
3213
3213
  maker: "alibaba",
3214
3214
  label: "Wan Flash V2V",
3215
3215
  series: "Wan",
3216
- description: "Faster Wan V2V variant.",
3216
+ description: "Faster Wan 2.6 video-to-video: a new clip featuring the subject of the input video, in the scene the prompt describes (not an edit or restyle of the clip); optional audio and multi-shot.",
3217
3217
  useCases: ["v2v", "fast"],
3218
3218
  pricing: [{ identifier: "wan-flash", credits: 100 }],
3219
3219
  },
@@ -3225,10 +3225,13 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
3225
3225
  maker: "alibaba",
3226
3226
  label: "Wan 2.7 VideoEdit",
3227
3227
  series: "Wan",
3228
- description: "Guided video editing with optional reference image, audio control, and prompt expansion.",
3228
+ description: "Guided video editing of a 2-10s clip with optional reference image, audio control, and prompt expansion; priced per second of the clip it delivers, never below the listed price.",
3229
3229
  useCases: ["v2v", "restyle", "reference"],
3230
3230
  resolutions: ["720p", "1080p"],
3231
- pricing: [{ identifier: "wan-videoedit", credits: 320 }],
3231
+ pricing: [
3232
+ { identifier: "wan-videoedit", credits: 320, note: "the least a run costs" },
3233
+ { identifier: "wan-videoedit:1080p:per-4s", credits: 240, note: "per 4 seconds of the clip it delivers (720p at this row too); charged per whole second, never below the flat row" },
3234
+ ],
3232
3235
  },
3233
3236
  // ── Wan 2.7 ──
3234
3237
  "wan-2.7": {
@@ -3446,11 +3449,13 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
3446
3449
  maker: "alibaba",
3447
3450
  label: "HappyHorse Edit",
3448
3451
  series: "HappyHorse",
3449
- description: "HappyHorse video-edit — video-to-video transformation, up to 60s input, 720p/1080p output.",
3452
+ description: "HappyHorse video-edit — video-to-video transformation of a 3-60s clip, 720p/1080p output; priced per started half-second of the clip, above the listed flat price.",
3450
3453
  useCases: ["v2v", "restyle"],
3451
3454
  resolutions: ["720p", "1080p"],
3452
3455
  pricing: [
3453
- { identifier: "happyhorse-edit", credits: 350, note: "720p default (5s-equivalent flat rate)" },
3456
+ { identifier: "happyhorse-edit", credits: 350, note: "flat row of runs priced before per-clip-second pricing" },
3457
+ { identifier: "happyhorse-edit:720p:per-4s", credits: 560, note: "720p (default): per 4 seconds of the clip; charged per started half-second" },
3458
+ { identifier: "happyhorse-edit:1080p:per-4s", credits: 960, note: "1080p: per 4 seconds of the clip; charged per started half-second" },
3454
3459
  ],
3455
3460
  },
3456
3461
  // ── Vidu (ShengShu Technology) ──
@@ -3953,6 +3958,8 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
3953
3958
  { identifier: "motion-transfer:15s", credits: 230 },
3954
3959
  { identifier: "motion-transfer:30s", credits: 450 },
3955
3960
  { identifier: "motion-transfer:1080p:10s", credits: 230 },
3961
+ { identifier: "motion-transfer:720p:per-4s", credits: 126, note: "720p: per 4 seconds of the driving video; charged per whole second" },
3962
+ { identifier: "motion-transfer:1080p:per-4s", credits: 203, note: "1080p: per 4 seconds of the driving video; charged per whole second" },
3956
3963
  ],
3957
3964
  },
3958
3965
  "kling-3.0-motion": {
@@ -3972,16 +3979,20 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
3972
3979
  { identifier: "kling-3.0-motion:5s", credits: 150 },
3973
3980
  { identifier: "kling-3.0-motion:10s", credits: 300 },
3974
3981
  { identifier: "kling-3.0-motion:1080p:10s", credits: 500 },
3982
+ { identifier: "kling-3.0-motion:720p:per-4s", credits: 228, note: "720p: per 4 seconds of the driving video; charged per whole second" },
3983
+ { identifier: "kling-3.0-motion:1080p:per-4s", credits: 302, note: "1080p: per 4 seconds of the driving video; charged per whole second" },
3975
3984
  ],
3976
3985
  },
3977
3986
  // Wan Animate (decided 2026-11-12): catalog entries so a deployment's model
3978
3987
  // restriction can name them. Before, `models.allow` could not withhold them
3979
3988
  // while the Motion Transfer node and /v1/motion-transfer kept running them
3980
- // beside the Kling models. The sizes are the three each runs at and is priced
3981
- // on today (one flat row per size, any clip length); a size it does not have
3982
- // (the route's 1080p) runs, and is charged, as 720p — `defaultResolution`, the
3983
- // size `normalizeModelInput` moves it to (`motionTransferResolution`), and
3984
- // the size a request naming none has always run at.
3989
+ // beside the Kling models. Replace runs at three sizes; Move at 720p only (the
3990
+ // one size the provider takes for it). A size a model does not have (Move's
3991
+ // 480p / 580p, the route's 1080p) runs, and is charged, as 720p —
3992
+ // `defaultResolution`, the size `normalizeModelInput` moves it to
3993
+ // (`motionTransferResolution`), and the size a request naming none has always
3994
+ // run at. Each is charged per second of the driving video at its `:per-4s`
3995
+ // row, never below its flat row for the size it runs at.
3985
3996
  "wan-animate-move": {
3986
3997
  id: "wan-animate-move",
3987
3998
  kind: "video",
@@ -3992,12 +4003,14 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
3992
4003
  series: "Wan",
3993
4004
  description: "Wan 2.2 Animate: moves the subject of a still image with the motion of a driving video.",
3994
4005
  useCases: ["motion-transfer", "cheap"],
3995
- resolutions: ["480p", "580p", "720p"],
4006
+ resolutions: ["720p"],
3996
4007
  defaultResolution: "720p",
3997
4008
  pricing: [
3998
- { identifier: "wan-animate-move", credits: 255, note: "480p" },
3999
- { identifier: "wan-animate-move:580p", credits: 330, note: "580p" },
4000
- { identifier: "wan-animate-move:720p", credits: 410, note: "720p" },
4009
+ // 720p first: the size Move runs at, so its default variant's price.
4010
+ { identifier: "wan-animate-move:720p", credits: 410, note: "720p, the only size it runs at" },
4011
+ { identifier: "wan-animate-move", credits: 255, note: "480p (runs, and is charged, as 720p)" },
4012
+ { identifier: "wan-animate-move:580p", credits: 330, note: "580p (runs, and is charged, as 720p)" },
4013
+ { identifier: "wan-animate-move:720p:per-4s", credits: 125, note: "per 4 seconds of the driving video, never below the 720p row; charged per whole second" },
4001
4014
  ],
4002
4015
  },
4003
4016
  "wan-animate-replace": {
@@ -4016,6 +4029,9 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
4016
4029
  { identifier: "wan-animate-replace", credits: 255, note: "480p" },
4017
4030
  { identifier: "wan-animate-replace:580p", credits: 330, note: "580p" },
4018
4031
  { identifier: "wan-animate-replace:720p", credits: 410, note: "720p" },
4032
+ { identifier: "wan-animate-replace:480p:per-4s", credits: 60, note: "480p: per 4 seconds of the driving video, never below the 480p row; charged per whole second" },
4033
+ { identifier: "wan-animate-replace:580p:per-4s", credits: 95, note: "580p: per 4 seconds of the driving video, never below the 580p row; charged per whole second" },
4034
+ { identifier: "wan-animate-replace:720p:per-4s", credits: 125, note: "720p: per 4 seconds of the driving video, never below the 720p row; charged per whole second" },
4019
4035
  ],
4020
4036
  },
4021
4037
 
@@ -4934,9 +4950,9 @@ const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
4934
4950
  maker: "elevenlabs",
4935
4951
  label: "ElevenLabs Voice Isolation",
4936
4952
  series: "ElevenLabs",
4937
- description: "Strip background noise / music from a vocal track.",
4953
+ description: "Strip background noise / music from a vocal track. Audio up to 30 minutes; priced per started 10 seconds of the audio.",
4938
4954
  useCases: ["cleanup", "isolation"],
4939
- pricing: [{ identifier: "elevenlabs-isolation", credits: 74, note: "variable per second" }],
4955
+ pricing: [{ identifier: "elevenlabs-isolation:per-10s", credits: 10, note: "per started 10 seconds of the audio, up to 30 minutes" }],
4940
4956
  },
4941
4957
  "elevenlabs-dubbing": {
4942
4958
  id: "elevenlabs-dubbing",
@@ -0,0 +1,239 @@
1
+ /**
2
+ * How a Motion Transfer run is priced (decided 2026-11-18): from the length of
3
+ * its DRIVING video as the server reads it, never a length the caller
4
+ * declares.
5
+ *
6
+ * - Every model is refused below {@link MOTION_TRANSFER_MIN_SEC} and past its
7
+ * limit ({@link motionTransferMaxSec}: Kling 2.6 and Kling 3.0 take 10
8
+ * seconds while the character keeps the image's orientation — the default —
9
+ * and 30 while it follows the video's; Wan Animate takes 30). A clip up to
10
+ * `CLIP_PRICE_GRACE_SEC` past a limit is accepted and priced at it.
11
+ * - Every model and size is charged per second of that video
12
+ * ({@link MOTION_TRANSFER_SECOND_RATES}): its rate row × the billed seconds
13
+ * ÷ the seconds the row prices, rounded up once, marked up once — the hold
14
+ * IS the charge.
15
+ * - Wan Animate keeps its flat price by size as a FLOOR: a run is charged the
16
+ * larger of its rate's figure and its floor row, compared as base credits
17
+ * ({@link motionTransferChargedPrice}), and the run is
18
+ * charged at the row that won — the floor row once, or the rate row × its
19
+ * units — so the usage log, the whole-run quote id (`<rate>:<N>u`) and the
20
+ * flat row's own price each name exactly what was charged.
21
+ *
22
+ * Billed seconds are the length rounded up to a whole second after the house
23
+ * grace ({@link motionTransferBilledSeconds}). The route, the workflow run,
24
+ * the MCP verb (which calls the route) and both estimates read this one
25
+ * module. The old length-tier rows (`buildMotionCreditModelIdentifier`) are no
26
+ * run's price any more; they stay for older code and saved quotes.
27
+ */
28
+ import { motionTransferResolution } from "./credit-identifiers.js"
29
+ import { CLIP_PRICE_GRACE_SEC, gracedMeasuredSec } from "./priced-clip-seconds.js"
30
+
31
+ /** Float noise: a length that is arithmetic can land a hair past a limit, and must not be refused for it. */
32
+ const FLOAT_NOISE_SEC = 1e-9
33
+
34
+ /** The shortest driving video any Motion Transfer model takes. */
35
+ export const MOTION_TRANSFER_MIN_SEC = 3
36
+
37
+ /** The longest driving video Kling 2.6 / Kling 3.0 take while the character keeps the image's orientation. */
38
+ export const MOTION_TRANSFER_IMAGE_ORIENTATION_MAX_SEC = 10
39
+
40
+ /** The longest driving video any Motion Transfer model takes (Kling following the video's orientation, Wan Animate). */
41
+ export const MOTION_TRANSFER_MAX_SEC = 30
42
+
43
+ /** The orientation a run uses: `"video"` only when it says so; anything else (absent included) is the default, `"image"`. */
44
+ export function motionTransferOrientation(characterOrientation: unknown): "image" | "video" {
45
+ return characterOrientation === "video" ? "video" : "image"
46
+ }
47
+
48
+ const isWanAnimate = (provider: string): boolean => provider === "wan-animate-move" || provider === "wan-animate-replace"
49
+
50
+ /** The longest driving video a run of `provider` at `characterOrientation` takes. */
51
+ export function motionTransferMaxSec(provider: string, characterOrientation: unknown): number {
52
+ if (isWanAnimate(provider)) return MOTION_TRANSFER_MAX_SEC
53
+ return motionTransferOrientation(characterOrientation) === "video" ? MOTION_TRANSFER_MAX_SEC : MOTION_TRANSFER_IMAGE_ORIENTATION_MAX_SEC
54
+ }
55
+
56
+ /** A per-second rate: the row that prices `rateSeconds` seconds of driving video, and the floor a run of it never goes below. */
57
+ export interface MotionTransferSecondRate {
58
+ readonly rateId: string
59
+ readonly rateSeconds: number
60
+ /**
61
+ * The row a run of this model and size is never charged below (Wan Animate:
62
+ * its flat price for the size the request names); absent when the rate
63
+ * alone prices the run (Kling).
64
+ */
65
+ readonly floorId?: string
66
+ }
67
+
68
+ /** Every rate row prices four seconds, so its value stays a whole credit and dividing by 4 is exact in floating point. */
69
+ const PER_4S = 4
70
+
71
+ /**
72
+ * The rate of every model and size, keyed `<provider>:<charged size>`.
73
+ * Wan Animate Move runs at 720p only (its catalog entry lists that one size,
74
+ * so `motionTransferResolution` sends and charges any size it names as 720p).
75
+ */
76
+ export const MOTION_TRANSFER_SECOND_RATES: Readonly<Record<string, MotionTransferSecondRate>> = {
77
+ "kling:720p": { rateId: "motion-transfer:720p:per-4s", rateSeconds: PER_4S },
78
+ "kling:1080p": { rateId: "motion-transfer:1080p:per-4s", rateSeconds: PER_4S },
79
+ "kling-3.0:720p": { rateId: "kling-3.0-motion:720p:per-4s", rateSeconds: PER_4S },
80
+ "kling-3.0:1080p": { rateId: "kling-3.0-motion:1080p:per-4s", rateSeconds: PER_4S },
81
+ "wan-animate-replace:480p": { rateId: "wan-animate-replace:480p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-replace" },
82
+ "wan-animate-replace:580p": { rateId: "wan-animate-replace:580p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-replace:580p" },
83
+ "wan-animate-replace:720p": { rateId: "wan-animate-replace:720p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-replace:720p" },
84
+ "wan-animate-move:720p": { rateId: "wan-animate-move:720p:per-4s", rateSeconds: PER_4S, floorId: "wan-animate-move:720p" },
85
+ }
86
+
87
+ /** Every per-second rate row, once each. */
88
+ export const MOTION_TRANSFER_RATE_IDS: readonly string[] = [...new Set(Object.values(MOTION_TRANSFER_SECOND_RATES).map((r) => r.rateId))]
89
+
90
+ /** Every floor row a per-second rate names, once each. */
91
+ export const MOTION_TRANSFER_FLOOR_IDS: readonly string[] = [
92
+ ...new Set(Object.values(MOTION_TRANSFER_SECOND_RATES).flatMap((r) => (r.floorId === undefined ? [] : [r.floorId]))),
93
+ ]
94
+
95
+ /** The model a run of `provider` runs: a model Motion Transfer has, else its default (Kling 2.6), as the route and the workflow run resolve it. */
96
+ function runProvider(provider: unknown): string {
97
+ return typeof provider === "string" && Object.keys(MOTION_TRANSFER_SECOND_RATES).some((k) => k.startsWith(`${provider}:`)) ? provider : "kling"
98
+ }
99
+
100
+ /**
101
+ * The size a run is CHARGED at: the size it runs at (`motionTransferResolution`),
102
+ * and for Kling any size but 1080p is charged as 720p (its rows have no other).
103
+ */
104
+ function chargedSize(provider: string, resolution: unknown): string {
105
+ const sized = motionTransferResolution(provider, typeof resolution === "string" && resolution !== "" ? resolution : "720p").resolution
106
+ if (isWanAnimate(provider)) return sized
107
+ return sized === "1080p" ? "1080p" : "720p"
108
+ }
109
+
110
+ /** The per-second rate a run of `provider` at `resolution` is charged at; a model Motion Transfer does not have is priced as its default (Kling 2.6). */
111
+ export function motionTransferRateOf(provider: unknown, resolution: unknown): MotionTransferSecondRate {
112
+ const model = runProvider(provider)
113
+ const key = `${model}:${chargedSize(model, resolution)}`
114
+ // Every size `motionTransferResolution` answers has an entry (motion-transfer-pricing.test.ts); a size it does not is priced at the model's 720p.
115
+ return MOTION_TRANSFER_SECOND_RATES[key] ?? MOTION_TRANSFER_SECOND_RATES[`${model}:720p`]!
116
+ }
117
+
118
+ /**
119
+ * The whole seconds a driving video read at `measuredSec` is billed for:
120
+ * rounded up after forgiving `CLIP_PRICE_GRACE_SEC` past a whole second, at
121
+ * least one. THE one rounding every lane reads.
122
+ */
123
+ export function motionTransferBilledSeconds(measuredSec: number): number {
124
+ return Math.max(1, Math.ceil(gracedMeasuredSec(measuredSec)))
125
+ }
126
+
127
+ /** A Motion Transfer run's price: the row it is charged at and, for a rate row, the units of it. */
128
+ export interface MotionTransferPrice {
129
+ /** The row the run reserves: a per-second rate row, or (once {@link motionTransferChargedPrice} chose it) a floor row. */
130
+ readonly creditId: string
131
+ /** Units of the rate row the run is charged (billed seconds ÷ the rate's seconds); undefined for a floor row, charged once. */
132
+ readonly units?: number
133
+ /** The floor row the rate is compared with (Wan Animate) before the run is charged; undefined once chosen, and for Kling. */
134
+ readonly floorId?: string
135
+ }
136
+
137
+ /**
138
+ * The rate price of a run of `provider` at `resolution` whose driving video is
139
+ * billed for `billedSeconds` whole seconds: the rate row and its units, and
140
+ * the floor row it is compared with ({@link motionTransferChargedPrice}).
141
+ */
142
+ export function motionTransferPrice(provider: string, resolution: unknown, billedSeconds: number): MotionTransferPrice {
143
+ const rate = motionTransferRateOf(provider, resolution)
144
+ return { creditId: rate.rateId, units: billedSeconds / rate.rateSeconds, ...(rate.floorId !== undefined ? { floorId: rate.floorId } : {}) }
145
+ }
146
+
147
+ /**
148
+ * The row a run is CHARGED at — THE floor rule every lane reads: a price with
149
+ * no floor is its rate; one with a floor is charged its floor row when the
150
+ * floor's figure is at least the rate's figure for the run (a tie goes to the
151
+ * floor: the same credits, at today's row), else its rate row × the units.
152
+ * `perSecond` and `floor` must be figures of the same kind — both base credits
153
+ * (the server: the rate row × the units rounded up once, and the floor row)
154
+ * or both charged credits (the editor, from the server's quotes). A figure
155
+ * that is not known leaves the rate (whose own lookup refuses an unpriced
156
+ * row).
157
+ */
158
+ export function motionTransferChargedPrice(
159
+ price: MotionTransferPrice,
160
+ figures: { readonly perSecond: number | undefined; readonly floor: number | undefined },
161
+ ): MotionTransferPrice {
162
+ const rate: MotionTransferPrice = { creditId: price.creditId, ...(price.units !== undefined ? { units: price.units } : {}) }
163
+ if (price.floorId === undefined || figures.perSecond === undefined || figures.floor === undefined) return rate
164
+ return figures.floor >= figures.perSecond ? { creditId: price.floorId } : rate
165
+ }
166
+
167
+ /**
168
+ * {@link motionTransferChargedPrice} from base rows (`baseOf`: a row's base
169
+ * credits, undefined when it is priced nowhere), with the base credits the
170
+ * run is charged, as base credits: the rate row × the units rounded up once,
171
+ * or the floor row.
172
+ */
173
+ export function motionTransferBaseCharge(
174
+ price: MotionTransferPrice,
175
+ baseOf: (creditId: string) => number | undefined,
176
+ ): MotionTransferPrice & { readonly baseCredits: number | undefined } {
177
+ const rateBase = baseOf(price.creditId)
178
+ const perSecond = rateBase === undefined ? undefined : Math.ceil(rateBase * (price.units ?? 1))
179
+ const floor = price.floorId === undefined ? undefined : baseOf(price.floorId)
180
+ const charged = motionTransferChargedPrice(price, { perSecond, floor })
181
+ return { ...charged, baseCredits: charged.units === undefined ? floor : perSecond }
182
+ }
183
+
184
+ /** What the length check answers for a measured driving video. */
185
+ export type MotionTransferLengthCheck =
186
+ | { readonly ok: true; readonly billedSeconds: number }
187
+ | { readonly ok: false; readonly code: "video_too_short" | "video_too_long"; readonly message: string }
188
+
189
+ /**
190
+ * Whether a driving video measured at `measuredSec` can run on `provider` at
191
+ * `characterOrientation`, and the seconds it is billed for. Shorter than
192
+ * {@link MOTION_TRANSFER_MIN_SEC} is refused; past the limit by more than
193
+ * `CLIP_PRICE_GRACE_SEC` is refused; a clip within that grace is billed at the
194
+ * limit.
195
+ */
196
+ export function checkMotionTransferLength(provider: string, characterOrientation: unknown, measuredSec: number): MotionTransferLengthCheck {
197
+ if (measuredSec < MOTION_TRANSFER_MIN_SEC) {
198
+ return {
199
+ ok: false,
200
+ code: "video_too_short",
201
+ message: `The motion video is ${measuredSec.toFixed(1)} seconds. Motion Transfer needs a motion video of at least ${MOTION_TRANSFER_MIN_SEC} seconds.`,
202
+ }
203
+ }
204
+ const max = motionTransferMaxSec(provider, characterOrientation)
205
+ if (measuredSec > max + CLIP_PRICE_GRACE_SEC + FLOAT_NOISE_SEC) {
206
+ const followVideo = !isWanAnimate(provider) && motionTransferOrientation(characterOrientation) === "image"
207
+ ? ` (or ${MOTION_TRANSFER_MAX_SEC} seconds with the character following the video's orientation)`
208
+ : ""
209
+ return {
210
+ ok: false,
211
+ code: "video_too_long",
212
+ message: `The motion video is ${measuredSec.toFixed(1)} seconds. This model takes at most ${max} seconds${followVideo}. Trim the video first.`,
213
+ }
214
+ }
215
+ return { ok: true, billedSeconds: Math.min(max, motionTransferBilledSeconds(measuredSec)) }
216
+ }
217
+
218
+ /**
219
+ * The billed seconds an ESTIMATE quotes before the video is measured: the
220
+ * length the graph gives, at most the limit, billed as a run bills it; a
221
+ * length it does not know quotes the limit — the most the run can be charged
222
+ * (decided 2026-11-18), marked as an estimate by the caller.
223
+ */
224
+ export function motionTransferEstimateSeconds(provider: string, characterOrientation: unknown, knownSec?: number | null): number {
225
+ const max = motionTransferMaxSec(provider, characterOrientation)
226
+ if (knownSec == null || !Number.isFinite(knownSec) || knownSec <= 0) return max
227
+ return Math.min(max, motionTransferBilledSeconds(Math.max(MOTION_TRANSFER_MIN_SEC, knownSec)))
228
+ }
229
+
230
+ /** The price an estimate quotes ({@link motionTransferEstimateSeconds}), and whether it stood in for an unknown length. */
231
+ export function motionTransferEstimatePrice(
232
+ provider: string,
233
+ resolution: unknown,
234
+ characterOrientation: unknown,
235
+ knownSec?: number | null,
236
+ ): MotionTransferPrice & { readonly lengthKnown: boolean } {
237
+ const lengthKnown = knownSec != null && Number.isFinite(knownSec) && knownSec > 0
238
+ return { ...motionTransferPrice(provider, resolution, motionTransferEstimateSeconds(provider, characterOrientation, knownSec)), lengthKnown }
239
+ }
@@ -71,6 +71,8 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet("VIDEO_P
71
71
  "video-sfx",
72
72
  "suno-music-video",
73
73
  "merge-video-audio",
74
+ // Replace Audio (Nodaro Cloud plugin): the video with its sound replaced → video.
75
+ "replace-audio",
74
76
  "add-captions",
75
77
  "resize-video",
76
78
  "social-media-format",
@@ -0,0 +1,102 @@
1
+ /**
2
+ * What a podcast use-case run (Tighten Episode, Clip Pack, Speaker Layout)
3
+ * reports on its job's `output_data`: the wire shapes an app reads
4
+ * (`client.jobs.getStatus(jobId).data.output_data`). The server writes them
5
+ * (the use-case wrapper's output); the SDK re-exports them. Every field is
6
+ * optional: a run that finished before a field shipped has none of it, and a
7
+ * reader must treat an absent field as "not reported", never as zero.
8
+ *
9
+ * Times are integer milliseconds on the RECORDING's clock — the clock of the
10
+ * run's sound, which its plan is written on and every recording is lined up
11
+ * to: the recording itself for a run of one recording; with several
12
+ * recordings, the Master audio, else the sound-only recording, else the wide
13
+ * camera's own sound (else Camera 1's). Structural only, no I/O.
14
+ */
15
+
16
+ /** A stretch of the recording, `[inMs, outMs)` in ms on the recording's clock. */
17
+ export interface UseCaseSourceSpan {
18
+ readonly inMs: number
19
+ readonly outMs: number
20
+ }
21
+
22
+ /** One delivered clip of a Clip Pack run (`output_data.clips[]`), in plan order. */
23
+ export interface ClipPackClip {
24
+ readonly url: string
25
+ readonly quality: "proxy" | "final"
26
+ /** The plan clip it renders: `"<first inMs>-<last outMs>"` of that clip, the same two numbers as `sourceStartMs` and `sourceEndMs`. */
27
+ readonly clipKey?: string
28
+ readonly planBasis?: string
29
+ readonly renderBasis?: string
30
+ readonly title?: string
31
+ readonly hook?: string
32
+ /** The still of the file it delivers (none for an audio clip). */
33
+ readonly thumbnailUrl?: string
34
+ /** Its captions could not be added: the clip is its render, uncaptioned. */
35
+ readonly captionsFailed?: true
36
+ /** Where the clip starts in the recording: the earliest kept stretch's start. */
37
+ readonly sourceStartMs?: number
38
+ /** Where the clip ends in the recording: the latest kept stretch's end. */
39
+ readonly sourceEndMs?: number
40
+ /**
41
+ * The stretches of the recording the clip is made of, sorted by `inMs`,
42
+ * touching or overlapping stretches merged. Present only when there are two
43
+ * or more (a clip cut from one stretch is `sourceStartMs`–`sourceEndMs`).
44
+ */
45
+ readonly sourceSpans?: readonly UseCaseSourceSpan[]
46
+ }
47
+
48
+ /**
49
+ * A planned clip of a Clip Pack run that could not be rendered
50
+ * (`output_data.failedClipList[]`), in plan order: the clips `failedClips`
51
+ * counts, by name. Rendered again with Edit Plan's clip set (`json`) and its
52
+ * `clipKey`.
53
+ */
54
+ export interface ClipPackFailedClip {
55
+ readonly clipKey: string
56
+ readonly title?: string
57
+ readonly hook?: string
58
+ readonly sourceStartMs?: number
59
+ readonly sourceEndMs?: number
60
+ readonly sourceSpans?: readonly UseCaseSourceSpan[]
61
+ }
62
+
63
+ /** One speaker of a run (`output_data.speakers[]`), in the order they are first heard. */
64
+ export interface UseCaseSpeaker {
65
+ /** The speaker's label in the transcript (e.g. `speaker_0`). */
66
+ readonly label: string
67
+ /** The name the request's `speakerNames` gave this label. Never guessed. */
68
+ readonly name?: string
69
+ /** How long they talk across the whole recording, in ms (see the node docs for how it is counted). */
70
+ readonly talkMs: number
71
+ }
72
+
73
+ /** The part of a use-case run's `output_data` every podcast run may carry. */
74
+ export interface UseCaseOutputData {
75
+ readonly videoUrl?: string
76
+ readonly audioUrl?: string
77
+ /** `"proxy"` for a review-on run's preview, else `"final"`. */
78
+ readonly quality?: "proxy" | "final"
79
+ /** The result's length in seconds, when the run knows it. */
80
+ readonly durationSec?: number
81
+ }
82
+
83
+ /** A Clip Pack run's `output_data` (the fields typed here; others may be present). */
84
+ export interface ClipPackOutputData extends UseCaseOutputData {
85
+ readonly clips?: readonly ClipPackClip[]
86
+ /** How many planned clips could not be rendered. */
87
+ readonly failedClips?: number
88
+ /** Which planned clips could not be rendered, in plan order (a clip whose key is unknown is counted but not listed). */
89
+ readonly failedClipList?: readonly ClipPackFailedClip[]
90
+ /** How many delivered clips came without captions. */
91
+ readonly failedCaptions?: number
92
+ }
93
+
94
+ /** A Tighten Episode run's `output_data` (the fields typed here; others may be present). */
95
+ export interface TightenEpisodeOutputData extends UseCaseOutputData {
96
+ readonly speakers?: readonly UseCaseSpeaker[]
97
+ }
98
+
99
+ /** A Speaker Layout run's `output_data` (the fields typed here; others may be present). */
100
+ export interface SpeakerLayoutOutputData extends UseCaseOutputData {
101
+ readonly speakers?: readonly UseCaseSpeaker[]
102
+ }