@nodaro/shared 3.32.0 → 3.33.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-ISJDAFKS.js → chunk-23FJQTEA.js} +8 -8
  2. package/dist/{chunk-ISJDAFKS.js.map → chunk-23FJQTEA.js.map} +1 -1
  3. package/dist/{chunk-VWGNPMJZ.cjs → chunk-2NQLSLSN.cjs} +5 -5
  4. package/dist/{chunk-VWGNPMJZ.cjs.map → chunk-2NQLSLSN.cjs.map} +1 -1
  5. package/dist/{chunk-IEBZHTPE.js → chunk-5RYLK3MQ.js} +28 -15
  6. package/dist/chunk-5RYLK3MQ.js.map +1 -0
  7. package/dist/{chunk-Z4AZW6FY.js → chunk-6WZ2VN7V.js} +5 -5
  8. package/dist/{chunk-Z4AZW6FY.js.map → chunk-6WZ2VN7V.js.map} +1 -1
  9. package/dist/{chunk-6DKDOWBL.js → chunk-7Z5LUTGU.js} +3 -3
  10. package/dist/{chunk-6DKDOWBL.js.map → chunk-7Z5LUTGU.js.map} +1 -1
  11. package/dist/{chunk-3CUFITU7.js → chunk-BG5D5CZ6.js} +67 -50
  12. package/dist/chunk-BG5D5CZ6.js.map +1 -0
  13. package/dist/{chunk-XAMC4S53.js → chunk-CUH22J4D.js} +3 -3
  14. package/dist/{chunk-XAMC4S53.js.map → chunk-CUH22J4D.js.map} +1 -1
  15. package/dist/{chunk-E2TGXG6X.cjs → chunk-D26ENTN2.cjs} +43 -43
  16. package/dist/{chunk-E2TGXG6X.cjs.map → chunk-D26ENTN2.cjs.map} +1 -1
  17. package/dist/{chunk-AVQK77G6.cjs → chunk-D6GNRSCV.cjs} +67 -50
  18. package/dist/chunk-D6GNRSCV.cjs.map +1 -0
  19. package/dist/{chunk-KHCBJ7KD.js → chunk-FT5CF6IA.js} +3 -3
  20. package/dist/{chunk-KHCBJ7KD.js.map → chunk-FT5CF6IA.js.map} +1 -1
  21. package/dist/{chunk-JX5YZ4DH.cjs → chunk-HC7VKIV5.cjs} +38 -38
  22. package/dist/{chunk-JX5YZ4DH.cjs.map → chunk-HC7VKIV5.cjs.map} +1 -1
  23. package/dist/{chunk-S5DMKUWK.cjs → chunk-HKFMXNVQ.cjs} +11 -11
  24. package/dist/{chunk-S5DMKUWK.cjs.map → chunk-HKFMXNVQ.cjs.map} +1 -1
  25. package/dist/{chunk-O5MP52U2.cjs → chunk-HRXEZ3SX.cjs} +4 -4
  26. package/dist/{chunk-O5MP52U2.cjs.map → chunk-HRXEZ3SX.cjs.map} +1 -1
  27. package/dist/{chunk-RJL7RCEM.cjs → chunk-HUR6ZJ7S.cjs} +6 -6
  28. package/dist/chunk-HUR6ZJ7S.cjs.map +1 -0
  29. package/dist/{chunk-QELDJGDK.cjs → chunk-JFS3NWZ5.cjs} +4 -4
  30. package/dist/{chunk-QELDJGDK.cjs.map → chunk-JFS3NWZ5.cjs.map} +1 -1
  31. package/dist/{chunk-5AUSSJIM.cjs → chunk-K3LLGRK7.cjs} +175 -2
  32. package/dist/chunk-K3LLGRK7.cjs.map +1 -0
  33. package/dist/{chunk-J6KHW2E5.cjs → chunk-M7GQBRZU.cjs} +16 -16
  34. package/dist/{chunk-J6KHW2E5.cjs.map → chunk-M7GQBRZU.cjs.map} +1 -1
  35. package/dist/{chunk-5U7VLG43.js → chunk-OTATNBMD.js} +3 -3
  36. package/dist/chunk-OTATNBMD.js.map +1 -0
  37. package/dist/{chunk-LPW3XNC2.js → chunk-OZSACQ2V.js} +3 -3
  38. package/dist/{chunk-LPW3XNC2.js.map → chunk-OZSACQ2V.js.map} +1 -1
  39. package/dist/{chunk-VIWSWVAW.js → chunk-PHZ23DP3.js} +3 -3
  40. package/dist/{chunk-VIWSWVAW.js.map → chunk-PHZ23DP3.js.map} +1 -1
  41. package/dist/{chunk-ZT77RY6R.js → chunk-PVJBAPYJ.js} +4 -4
  42. package/dist/{chunk-ZT77RY6R.js.map → chunk-PVJBAPYJ.js.map} +1 -1
  43. package/dist/{chunk-AROWPFO2.js → chunk-PXFQVLBX.js} +7 -4
  44. package/dist/chunk-PXFQVLBX.js.map +1 -0
  45. package/dist/{chunk-Q4CDQ2KO.js → chunk-QA3MVQ32.js} +4 -4
  46. package/dist/{chunk-Q4CDQ2KO.js.map → chunk-QA3MVQ32.js.map} +1 -1
  47. package/dist/{chunk-NB72XWXQ.cjs → chunk-SAW5OK36.cjs} +6 -6
  48. package/dist/{chunk-NB72XWXQ.cjs.map → chunk-SAW5OK36.cjs.map} +1 -1
  49. package/dist/{chunk-YHRG7UOC.js → chunk-SFW3UB2P.js} +4 -4
  50. package/dist/{chunk-YHRG7UOC.js.map → chunk-SFW3UB2P.js.map} +1 -1
  51. package/dist/chunk-TU33KYKW.cjs +25 -0
  52. package/dist/{chunk-WNG7HRVA.cjs.map → chunk-TU33KYKW.cjs.map} +1 -1
  53. package/dist/{chunk-QNGNOU4Z.js → chunk-UCFWI6D4.js} +3 -3
  54. package/dist/{chunk-QNGNOU4Z.js.map → chunk-UCFWI6D4.js.map} +1 -1
  55. package/dist/{chunk-RN3RMBJZ.js → chunk-UTQSSKSG.js} +4 -4
  56. package/dist/{chunk-RN3RMBJZ.js.map → chunk-UTQSSKSG.js.map} +1 -1
  57. package/dist/{chunk-NT6IJH4L.cjs → chunk-VA42637J.cjs} +61 -47
  58. package/dist/chunk-VA42637J.cjs.map +1 -0
  59. package/dist/{chunk-ULXI7A6Q.cjs → chunk-VNQRI2RO.cjs} +11 -11
  60. package/dist/{chunk-ULXI7A6Q.cjs.map → chunk-VNQRI2RO.cjs.map} +1 -1
  61. package/dist/{chunk-O7PUQLJ3.cjs → chunk-VXPLKQWY.cjs} +11 -8
  62. package/dist/chunk-VXPLKQWY.cjs.map +1 -0
  63. package/dist/{chunk-6IJOPRZP.cjs → chunk-WD6HJRBG.cjs} +21 -21
  64. package/dist/{chunk-6IJOPRZP.cjs.map → chunk-WD6HJRBG.cjs.map} +1 -1
  65. package/dist/{chunk-EK362Q45.cjs → chunk-WKOIGLQX.cjs} +8 -8
  66. package/dist/{chunk-EK362Q45.cjs.map → chunk-WKOIGLQX.cjs.map} +1 -1
  67. package/dist/{chunk-LKAIXWK3.js → chunk-XGFTL5XY.js} +3 -3
  68. package/dist/{chunk-LKAIXWK3.js.map → chunk-XGFTL5XY.js.map} +1 -1
  69. package/dist/{chunk-JSNV5O2F.cjs → chunk-ZL7UM6PU.cjs} +4 -4
  70. package/dist/{chunk-JSNV5O2F.cjs.map → chunk-ZL7UM6PU.cjs.map} +1 -1
  71. package/dist/{chunk-C57NEO3X.js → chunk-ZO5PBBFX.js} +173 -3
  72. package/dist/chunk-ZO5PBBFX.js.map +1 -0
  73. package/dist/entries/apps.cjs +42 -42
  74. package/dist/entries/apps.d.cts +10 -1
  75. package/dist/entries/apps.d.ts +10 -1
  76. package/dist/entries/apps.js +7 -7
  77. package/dist/entries/credits.cjs +155 -151
  78. package/dist/entries/credits.d.cts +41 -10
  79. package/dist/entries/credits.d.ts +41 -10
  80. package/dist/entries/credits.js +7 -7
  81. package/dist/entries/model-catalog.cjs +75 -63
  82. package/dist/entries/model-catalog.d.cts +2 -2
  83. package/dist/entries/model-catalog.d.ts +2 -2
  84. package/dist/entries/model-catalog.js +4 -4
  85. package/dist/entries/models.cjs +209 -209
  86. package/dist/entries/models.d.cts +3 -3
  87. package/dist/entries/models.d.ts +3 -3
  88. package/dist/entries/models.js +4 -4
  89. package/dist/entries/nodes.cjs +200 -200
  90. package/dist/entries/nodes.d.cts +1 -1
  91. package/dist/entries/nodes.d.ts +1 -1
  92. package/dist/entries/nodes.js +8 -8
  93. package/dist/entries/pipeline.cjs +149 -149
  94. package/dist/entries/pipeline.d.cts +6 -6
  95. package/dist/entries/pipeline.d.ts +6 -6
  96. package/dist/entries/pipeline.js +3 -3
  97. package/dist/entries/ugc.cjs +71 -71
  98. package/dist/entries/ugc.js +4 -4
  99. package/dist/entries/video.cjs +115 -115
  100. package/dist/entries/video.js +4 -4
  101. package/dist/entries/workflow.cjs +95 -95
  102. package/dist/entries/workflow.d.cts +13 -3
  103. package/dist/entries/workflow.d.ts +13 -3
  104. package/dist/entries/workflow.js +1 -1
  105. package/dist/index.cjs +1087 -1071
  106. package/dist/index.d.cts +4 -4
  107. package/dist/index.d.ts +4 -4
  108. package/dist/index.js +18 -18
  109. package/dist/{model-catalog-flJYaa-g.d.ts → model-catalog-V-ZNzRSd.d.cts} +91 -1
  110. package/dist/{model-catalog-flJYaa-g.d.cts → model-catalog-V-ZNzRSd.d.ts} +91 -1
  111. package/dist/{presentation-utils-BIqiCzSA.d.cts → presentation-utils-D0kxsWf9.d.cts} +2 -0
  112. package/dist/{presentation-utils-BdiObtwq.d.ts → presentation-utils-pZwlEAzo.d.ts} +2 -0
  113. package/dist/{scene-node-types-DjenYFLO.d.ts → scene-node-types-C3kl_zyK.d.cts} +1 -1
  114. package/dist/{scene-node-types-DjenYFLO.d.cts → scene-node-types-C3kl_zyK.d.ts} +1 -1
  115. package/package.json +1 -1
  116. package/src/__tests__/model-makers.test.ts +76 -0
  117. package/src/__tests__/presentation-utils.test.ts +15 -0
  118. package/src/__tests__/private-host.test.ts +53 -0
  119. package/src/component-types.ts +9 -0
  120. package/src/credit-identifiers.ts +62 -17
  121. package/src/entries/credits.ts +1 -0
  122. package/src/entries/model-catalog.ts +6 -0
  123. package/src/model-catalog.ts +207 -0
  124. package/src/presentation-utils.ts +7 -0
  125. package/src/private-host.ts +89 -59
  126. package/dist/chunk-3CUFITU7.js.map +0 -1
  127. package/dist/chunk-5AUSSJIM.cjs.map +0 -1
  128. package/dist/chunk-5U7VLG43.js.map +0 -1
  129. package/dist/chunk-AROWPFO2.js.map +0 -1
  130. package/dist/chunk-AVQK77G6.cjs.map +0 -1
  131. package/dist/chunk-C57NEO3X.js.map +0 -1
  132. package/dist/chunk-IEBZHTPE.js.map +0 -1
  133. package/dist/chunk-NT6IJH4L.cjs.map +0 -1
  134. package/dist/chunk-O7PUQLJ3.cjs.map +0 -1
  135. package/dist/chunk-RJL7RCEM.cjs.map +0 -1
  136. package/dist/chunk-WNG7HRVA.cjs +0 -25
@@ -103,6 +103,90 @@ interface TtsCapabilities {
103
103
  /** Languages offered in pickers (ISO 639-1; `fil` has no two-letter code). A curated list, not the vendor's full one. */
104
104
  languages: readonly string[];
105
105
  }
106
+ /**
107
+ * The companies that make the catalog's models: ONE id per company, and the id
108
+ * is a public fact (the company's name, lowercased and hyphenated). Part of the
109
+ * `GET /v1/models` wire contract (`maker: { id, name }`), and the key a
110
+ * deployment publishes a maker's mark under (`logoUrl`), so an id never changes
111
+ * once shipped — a client may key its own assets on it.
112
+ *
113
+ * `maker` is not `family`: the family is the grouping label clients filter on,
114
+ * and a few name a lab, a product line or a cloud brand rather than the company
115
+ * (Tongyi-MAI and HappyHorse are Alibaba's, Depth Anything and Volcengine are
116
+ * ByteDance's, InfiniTalk is Meituan's). Every model of one family has one
117
+ * maker (`model-makers.test.ts`), and every maker here makes at least one model.
118
+ */
119
+ declare const MODEL_MAKERS: {
120
+ readonly alibaba: {
121
+ readonly name: "Alibaba";
122
+ };
123
+ readonly "black-forest-labs": {
124
+ readonly name: "Black Forest Labs";
125
+ };
126
+ readonly bytedance: {
127
+ readonly name: "ByteDance";
128
+ };
129
+ readonly elevenlabs: {
130
+ readonly name: "ElevenLabs";
131
+ };
132
+ readonly google: {
133
+ readonly name: "Google";
134
+ };
135
+ readonly ideogram: {
136
+ readonly name: "Ideogram";
137
+ };
138
+ readonly kuaishou: {
139
+ readonly name: "Kuaishou";
140
+ };
141
+ readonly lightricks: {
142
+ readonly name: "Lightricks";
143
+ };
144
+ readonly meituan: {
145
+ readonly name: "Meituan";
146
+ };
147
+ readonly minimax: {
148
+ readonly name: "MiniMax";
149
+ };
150
+ readonly nodaro: {
151
+ readonly name: "Nodaro";
152
+ };
153
+ readonly openai: {
154
+ readonly name: "OpenAI";
155
+ };
156
+ readonly recraft: {
157
+ readonly name: "Recraft";
158
+ };
159
+ readonly runway: {
160
+ readonly name: "Runway";
161
+ };
162
+ readonly suno: {
163
+ readonly name: "Suno";
164
+ };
165
+ readonly "sync-labs": {
166
+ readonly name: "Sync Labs";
167
+ };
168
+ readonly "topaz-labs": {
169
+ readonly name: "Topaz Labs";
170
+ };
171
+ readonly xai: {
172
+ readonly name: "xAI";
173
+ };
174
+ };
175
+ /** A company id from {@link MODEL_MAKERS}. */
176
+ type ModelMakerId = keyof typeof MODEL_MAKERS;
177
+ /** A model's maker as `GET /v1/models` serves it: the stable id and the company's name. */
178
+ interface ModelMaker {
179
+ id: ModelMakerId;
180
+ name: string;
181
+ }
182
+ /** True for an id of {@link MODEL_MAKERS} (and nothing it inherits). */
183
+ declare function isModelMakerId(value: unknown): value is ModelMakerId;
184
+ /**
185
+ * The maker of a catalog entry, in its wire shape — undefined when its `maker`
186
+ * is not a registry id (an entry built at run time without one). Never throws,
187
+ * so one bad entry cannot fail a whole model listing.
188
+ */
189
+ declare function modelMakerOf(entry: Pick<ModelCatalogEntry, "maker">): ModelMaker | undefined;
106
190
  interface ModelCatalogEntry {
107
191
  id: string;
108
192
  kind: ModelKind;
@@ -116,6 +200,12 @@ interface ModelCatalogEntry {
116
200
  modes: readonly ModelMode[];
117
201
  /** Vendor / lab that produced the model. Used for UI grouping. */
118
202
  family: string;
203
+ /**
204
+ * The company that made the model (see {@link MODEL_MAKERS}). REQUIRED, so a
205
+ * new model cannot ship without one; every model of a `family` names the same
206
+ * maker.
207
+ */
208
+ maker: ModelMakerId;
119
209
  /** Display name (NOT the id — the id is the API enum value). */
120
210
  label: string;
121
211
  /**
@@ -558,4 +648,4 @@ declare function modelIdsByKindMode(kind: ModelKind | null, modes: readonly Mode
558
648
  includeHidden?: boolean;
559
649
  }): [string, ...string[]];
560
650
 
561
- export { groupByFamily as A, groupByKindAndFamily as B, hasFeature as C, isAutoAspectToken as D, listModels as E, modelIdsByKindMode as F, modelTakesSeed as G, modelsWithFeature as H, nearestCatalogAspectRatio as I, normalizeModelInput as J, normalizeVideoRequestParams as K, type LabeledOption as L, MODEL_CATALOG as M, type NormalizedModelInput as N, qualityOptionsByKind as O, type PriceVariant as P, resolutionOptionsByKind as Q, validateModelInput as R, SPEECH_UNIT_PRICE_NOTE as S, type TtsCapabilities as T, type ValidationField as V, MODEL_KINDS as a, MODEL_RECOMMENDATIONS as b, type ModelCatalogEntry as c, type ModelInputAdjustment as d, type ModelInputContext as e, type ModelKind as f, type ModelMenuOption as g, type ModelMode as h, type ModelRecommendation as i, type ModelValidationIssue as j, type NormalizedVideoRequest as k, type SourceImageSize as l, type TtsSettingLever as m, aspectRatioOptionsByKind as n, autoAspectNeedsSourceImage as o, buildModelMenu as p, creditRangesAll as q, defaultResolutionFor as r, durationsByMode as s, fitAspectRatioToModel as t, getAspectRatioOptions as u, getCreditRange as v, getDurationsForModel as w, getModel as x, getQualityOptions as y, getResolutionOptions as z };
651
+ export { getModel as A, getQualityOptions as B, getResolutionOptions as C, groupByFamily as D, groupByKindAndFamily as E, hasFeature as F, isAutoAspectToken as G, isModelMakerId as H, listModels as I, modelIdsByKindMode as J, modelMakerOf as K, type LabeledOption as L, MODEL_CATALOG as M, type NormalizedModelInput as N, modelTakesSeed as O, type PriceVariant as P, modelsWithFeature as Q, nearestCatalogAspectRatio as R, SPEECH_UNIT_PRICE_NOTE as S, type TtsCapabilities as T, normalizeModelInput as U, type ValidationField as V, normalizeVideoRequestParams as W, qualityOptionsByKind as X, resolutionOptionsByKind as Y, validateModelInput as Z, MODEL_KINDS as a, MODEL_MAKERS as b, MODEL_RECOMMENDATIONS as c, type ModelCatalogEntry as d, type ModelInputAdjustment as e, type ModelInputContext as f, type ModelKind as g, type ModelMaker as h, type ModelMakerId as i, type ModelMenuOption as j, type ModelMode as k, type ModelRecommendation as l, type ModelValidationIssue as m, type NormalizedVideoRequest as n, type SourceImageSize as o, type TtsSettingLever as p, aspectRatioOptionsByKind as q, autoAspectNeedsSourceImage as r, buildModelMenu as s, creditRangesAll as t, defaultResolutionFor as u, durationsByMode as v, fitAspectRatioToModel as w, getAspectRatioOptions as x, getCreditRange as y, getDurationsForModel as z };
@@ -74,6 +74,8 @@ declare function getInputFieldSchema(nodeType: string): InputFieldSchema | undef
74
74
  *
75
75
  * An override sent under a renamed exposed-field key (an app published before
76
76
  * the rename) lands on the node's current field — `canonicalizeOverrideKeys`.
77
+ *
78
+ * An override of `null` clears the field: the merged node has no such key.
77
79
  */
78
80
  declare function mergeNodeInputOverrides(nodeType: string | undefined, data: Record<string, unknown>, overrides: Record<string, unknown>): Record<string, unknown>;
79
81
  /** Migrate a legacy string[] order to PresentationItem[]. */
@@ -74,6 +74,8 @@ declare function getInputFieldSchema(nodeType: string): InputFieldSchema | undef
74
74
  *
75
75
  * An override sent under a renamed exposed-field key (an app published before
76
76
  * the rename) lands on the node's current field — `canonicalizeOverrideKeys`.
77
+ *
78
+ * An override of `null` clears the field: the merged node has no such key.
77
79
  */
78
80
  declare function mergeNodeInputOverrides(nodeType: string | undefined, data: Record<string, unknown>, overrides: Record<string, unknown>): Record<string, unknown>;
79
81
  /** Migrate a legacy string[] order to PresentationItem[]. */
@@ -335,7 +335,7 @@ type ImageToVideoProvider = typeof IMAGE_TO_VIDEO_PROVIDERS[number];
335
335
  declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v"];
336
336
  type TextToVideoProvider = typeof TEXT_TO_VIDEO_PROVIDERS[number];
337
337
  /** Unified video-generation providers (image-to-video ∪ text-to-video) for the generate-video node. */
338
- declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "minimax" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
338
+ declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
339
339
  type VideoGenProvider = typeof VIDEO_GEN_PROVIDERS[number];
340
340
  /**
341
341
  * Video models that expose DISTINCT provider ids per mode (text-to-video vs
@@ -335,7 +335,7 @@ type ImageToVideoProvider = typeof IMAGE_TO_VIDEO_PROVIDERS[number];
335
335
  declare const TEXT_TO_VIDEO_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "grok", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "wan", "hailuo-standard", "bytedance-lite", "bytedance-pro", "wan-turbo", "wan-2.7-t2v", "happyhorse", "runway-kie", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", "kling-3-omni", "kling-master", "hailuo-2.3", "hailuo-2.3-pro", "bytedance-pro-fast", "happyhorse-ref2v"];
336
336
  type TextToVideoProvider = typeof TEXT_TO_VIDEO_PROVIDERS[number];
337
337
  /** Unified video-generation providers (image-to-video ∪ text-to-video) for the generate-video node. */
338
- declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "minimax" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
338
+ declare const VIDEO_GEN_PROVIDERS: readonly ["minimax", "veo3", "veo3.1", "veo3_lite", "kling", "kling-turbo", "kling-3.0", "kling-master", "seedance", "seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5", "minimax-h3", "hailuo-2.3-pro", "hailuo-2.3", "hailuo-standard", "wan-i2v", "wan-turbo", "bytedance-lite", "bytedance-pro", "bytedance-pro-fast", "grok-i2v", "wan-2.7-i2v", "happyhorse-i2v", "happyhorse-ref2v", "runway-kie", "kling-3-omni", "gemini-omni-video", "gemini-omni-flash", "wan-3", "wan-3-prime", "ltx-2.3-pro", "ltx-2.3-fast", "grok-imagine-video-1.5", ...("seedance-2-5" | "minimax" | "veo3" | "kling-3.0" | "seedance-2" | "veo3.1" | "wan-turbo" | "bytedance-lite" | "kling-turbo" | "hailuo-standard" | "grok" | "minimax-h3" | "hailuo-2.3-pro" | "hailuo-2.3" | "veo3_lite" | "gemini-omni-video" | "gemini-omni-flash" | "kling" | "kling-master" | "kling-3-omni" | "grok-imagine-video-1.5" | "seedance" | "seedance-2-fast" | "seedance-2-mini" | "wan-3" | "wan-3-prime" | "wan" | "wan-2.7-t2v" | "ltx-2.3-pro" | "ltx-2.3-fast" | "happyhorse" | "happyhorse-ref2v" | "bytedance-pro" | "bytedance-pro-fast" | "runway-kie")[]];
339
339
  type VideoGenProvider = typeof VIDEO_GEN_PROVIDERS[number];
340
340
  /**
341
341
  * Video models that expose DISTINCT provider ids per mode (text-to-video vs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodaro/shared",
3
- "version": "3.32.0",
3
+ "version": "3.33.0",
4
4
  "description": "Shared types, model catalog, wire contracts, and structural vocabularies for the Nodaro platform and SDK.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,76 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG, MODEL_MAKERS, isModelMakerId, modelMakerOf } from "../model-catalog.js"
3
+
4
+ /**
5
+ * Every catalog model names the company that made it (`maker`), served on
6
+ * `GET /v1/models` as `maker: { id, name }` and used to pick the maker's mark
7
+ * (`logoUrl`). The field is required on `ModelCatalogEntry`, so a new model
8
+ * without one does not compile; these cases also cover entries built at run
9
+ * time and keep the registry and the catalog in step.
10
+ */
11
+ describe("model makers", () => {
12
+ it("every catalog model names a maker from the registry", () => {
13
+ const unknown = Object.values(MODEL_CATALOG)
14
+ .filter((m) => !isModelMakerId(m.maker))
15
+ .map((m) => `${m.id}: ${String(m.maker)}`)
16
+ expect(unknown).toEqual([])
17
+ })
18
+
19
+ it("every registered maker makes at least one catalog model", () => {
20
+ const used = new Set<string>(Object.values(MODEL_CATALOG).map((m) => m.maker))
21
+ expect(Object.keys(MODEL_MAKERS).filter((id) => !used.has(id))).toEqual([])
22
+ })
23
+
24
+ it("maker ids are lowercase slugs, and every maker has a name", () => {
25
+ for (const [id, maker] of Object.entries(MODEL_MAKERS)) {
26
+ expect(id).toMatch(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
27
+ expect(maker.name.trim().length, id).toBeGreaterThan(0)
28
+ }
29
+ })
30
+
31
+ it("all the models of one family come from one maker", () => {
32
+ // `family` is the vendor / lab grouping clients filter on; a family whose
33
+ // models name two makers is almost always a copied entry that kept the
34
+ // other company's maker.
35
+ const makersByFamily = new Map<string, Set<string>>()
36
+ for (const m of Object.values(MODEL_CATALOG)) {
37
+ const makers = makersByFamily.get(m.family) ?? new Set<string>()
38
+ makers.add(m.maker)
39
+ makersByFamily.set(m.family, makers)
40
+ }
41
+ const split = [...makersByFamily]
42
+ .filter(([, makers]) => makers.size > 1)
43
+ .map(([family, makers]) => `${family}: ${[...makers].join(", ")}`)
44
+ expect(split).toEqual([])
45
+ })
46
+
47
+ it("a family named after a lab, a product line or a cloud brand resolves to the company behind it", () => {
48
+ expect(MODEL_CATALOG["z-image"]!.maker).toBe("alibaba") // Tongyi-MAI (Alibaba's Tongyi Lab)
49
+ expect(MODEL_CATALOG["happyhorse"]!.maker).toBe("alibaba")
50
+ expect(MODEL_CATALOG["video-depth-anything"]!.maker).toBe("bytedance")
51
+ expect(MODEL_CATALOG["depth-anything-frames"]!.maker).toBe("bytedance")
52
+ expect(MODEL_CATALOG["volcengine-lipsync"]!.maker).toBe("bytedance") // Volcano Engine
53
+ expect(MODEL_CATALOG["infinitalk"]!.maker).toBe("meituan") // MeiGen-AI
54
+ })
55
+
56
+ it("modelMakerOf serves the maker's id and the company's name", () => {
57
+ expect(modelMakerOf(MODEL_CATALOG["veo3"]!)).toEqual({ id: "google", name: "Google" })
58
+ expect(modelMakerOf(MODEL_CATALOG["flux"]!)).toEqual({ id: "black-forest-labs", name: "Black Forest Labs" })
59
+ expect(modelMakerOf(MODEL_CATALOG["seedance-2"]!)).toEqual({ id: "bytedance", name: "ByteDance" })
60
+ })
61
+
62
+ it("modelMakerOf never throws: an entry built at run time without a known maker has none", () => {
63
+ expect(modelMakerOf({ maker: "acme" as never })).toBeUndefined()
64
+ expect(modelMakerOf({ maker: undefined as never })).toBeUndefined()
65
+ expect(modelMakerOf({ maker: "toString" as never })).toBeUndefined()
66
+ })
67
+
68
+ it("isModelMakerId accepts only the registry's own ids", () => {
69
+ expect(isModelMakerId("google")).toBe(true)
70
+ expect(isModelMakerId("Google")).toBe(false)
71
+ expect(isModelMakerId("toString")).toBe(false)
72
+ expect(isModelMakerId("")).toBe(false)
73
+ expect(isModelMakerId(42)).toBe(false)
74
+ expect(isModelMakerId(undefined)).toBe(false)
75
+ })
76
+ })
@@ -1314,3 +1314,18 @@ describe("mergeNodeInputOverrides", () => {
1314
1314
  expect(overrides).toEqual({ extractedAudioUrl: "https://cdn/new.mp3" })
1315
1315
  })
1316
1316
  })
1317
+
1318
+ describe("mergeNodeInputOverrides — a null override clears the field", () => {
1319
+ // JSON cannot carry `undefined`, so an app card that clears a lever (a resolution the new model has no
1320
+ // such lever for, Draft turned off) sends null. The run must then have NO value there — neither null nor
1321
+ // the publisher's saved one.
1322
+ it("removes the key from the merged data", () => {
1323
+ const merged = mergeNodeInputOverrides("video-to-video", { provider: "wan", v2vResolution: "720p", draft: true }, { provider: "runway-aleph", v2vResolution: null, draft: null })
1324
+ expect(merged).toEqual({ provider: "runway-aleph" })
1325
+ expect(Object.hasOwn(merged, "v2vResolution")).toBe(false)
1326
+ })
1327
+
1328
+ it("leaves every other override as it was", () => {
1329
+ expect(mergeNodeInputOverrides("text-to-speech", { stability: 0.5 }, { stability: 0 })).toEqual({ stability: 0 })
1330
+ })
1331
+ })
@@ -10,6 +10,59 @@ describe("isPrivateOrReservedIP", () => {
10
10
  it("passes public addresses", () => {
11
11
  for (const ip of ["8.8.8.8", "93.184.216.34", "172.32.0.1", "2606:4700::1"]) expect(isPrivateOrReservedIP(ip), ip).toBe(false)
12
12
  })
13
+
14
+ it("refuses the whole of link-local fe80::/10 (fe80:: to febf::) and the old site-local fec0::/10", () => {
15
+ for (const ip of ["fe80::1", "fe90::1", "fea0::abcd", "febf:ffff::1", "FE85::1", "fe80::1%eth0", "fec0::1", "feff::1"]) {
16
+ expect(isPrivateOrReservedIP(ip), ip).toBe(true)
17
+ }
18
+ expect(isPrivateOrReservedIP("fe7f::1")).toBe(false) // just below fe80::/10
19
+ })
20
+
21
+ it("judges an IPv6 address that carries an IPv4 one by the IPv4 it reaches (NAT64, 6to4, mapped, compatible)", () => {
22
+ for (const ip of [
23
+ "64:ff9b::a9fe:a9fe", // NAT64 → 169.254.169.254
24
+ "64:ff9b::7f00:1", // NAT64 → 127.0.0.1
25
+ "64:ff9b::10.0.0.1", // NAT64, dotted tail
26
+ "2002:a9fe:a9fe::1", // 6to4 → 169.254.169.254
27
+ "2002:c0a8:0101::", // 6to4 → 192.168.1.1
28
+ "::ffff:a9fe:a9fe",
29
+ "0:0:0:0:0:ffff:127.0.0.1",
30
+ "::2", // IPv4-compatible 0.0.0.2
31
+ ]) {
32
+ expect(isPrivateOrReservedIP(ip), ip).toBe(true)
33
+ }
34
+ for (const ip of ["64:ff9b::808:808", "64:ff9b::8.8.8.8", "2002:808:808::1", "::ffff:808:808"]) {
35
+ expect(isPrivateOrReservedIP(ip), ip).toBe(false)
36
+ }
37
+ })
38
+
39
+ it("refuses local-use NAT64 and Teredo", () => {
40
+ for (const ip of ["64:ff9b:1::1", "2001:0:4136:e378:8000:63bf:3fff:fdd2", "2001::1"]) {
41
+ expect(isPrivateOrReservedIP(ip), ip).toBe(true)
42
+ }
43
+ expect(isPrivateOrReservedIP("2001:4860:4860::8888")).toBe(false) // a public 2001: address
44
+ })
45
+
46
+ it("refuses the IETF protocol block of IPv4", () => {
47
+ expect(isPrivateOrReservedIP("192.0.0.170")).toBe(true)
48
+ expect(isPrivateOrReservedIP("192.0.1.1")).toBe(false)
49
+ })
50
+
51
+ // Unroutable, so no SSRF target — and the same rule decides which client
52
+ // addresses the server trusts and keys rate limits on, where these stand in
53
+ // for public addresses (client-address.ts). Refusing them would make a
54
+ // documentation address an "unknown" client.
55
+ it("does not refuse the documentation blocks", () => {
56
+ for (const ip of ["192.0.2.1", "198.51.100.7", "203.0.113.9", "2001:db8::1", "2001:db8:abcd:12::1"]) {
57
+ expect(isPrivateOrReservedIP(ip), ip).toBe(false)
58
+ }
59
+ })
60
+
61
+ it("fails closed on something with a colon that is not an IPv6 address", () => {
62
+ for (const ip of ["::ffff:zzzz", "1:2:3", "1::2::3", "::ffff:300.1.1.1", "1:2:3:4:5:6:7:8:9"]) {
63
+ expect(isPrivateOrReservedIP(ip), ip).toBe(true)
64
+ }
65
+ })
13
66
  })
14
67
 
15
68
  describe("isLocalOrPrivateHostname", () => {
@@ -18,6 +18,15 @@ export interface ExposedSetting {
18
18
  /** Full option list with labels for select fields (preferred over allowedValues). */
19
19
  options?: Array<{ value: string; label: string }>
20
20
  defaultValue: unknown
21
+ /**
22
+ * Set when the setting is one of the node's quick settings (the editor's bottom-bar levers): the node type,
23
+ * so the consuming workflow can render the same control, and the node's own lever values its choices depend
24
+ * on (its model, Draft, …), so the control offers what that model takes. Never prompts or results.
25
+ */
26
+ quick?: {
27
+ nodeType: string
28
+ context?: Record<string, string | number | boolean>
29
+ }
21
30
  }
22
31
 
23
32
  export interface ComponentMetadata {
@@ -31,7 +31,7 @@ import {
31
31
  import { isFlux2Model, FLUX2_RES_MP, type Flux2Model } from "./flux2-pricing.js"
32
32
  import { VIDEO_DURATION_AUTO } from "./video-duration-auto.js"
33
33
  import { uiResolutionFill } from "./video-ui-defaults.js"
34
- import { MODEL_CATALOG, autoAspectNeedsSourceImage, normalizeModelInput, defaultResolutionFor, type ModelInputAdjustment, type SourceImageSize } from "./model-catalog.js"
34
+ import { MODEL_CATALOG, autoAspectNeedsSourceImage, normalizeModelInput, normalizeVideoRequestParams, defaultResolutionFor, type ModelInputAdjustment, type SourceImageSize } from "./model-catalog.js"
35
35
 
36
36
  /**
37
37
  * The megapixel tier a Flux 2 credit identifier is keyed on, for ANY incoming
@@ -499,6 +499,50 @@ export function buildVideoCreditModelIdentifier(
499
499
  return identifier
500
500
  }
501
501
 
502
+ /**
503
+ * The credit identifier a video GENERATION node is quoted at — Generate Video
504
+ * (and the legacy Image/Text to Video nodes) and the Video to Video Seedance
505
+ * edit lane, on every surface that quotes one: the node's cost pill, the
506
+ * editor's run estimate, the prompt modal and the backend pre-run estimator.
507
+ *
508
+ * It applies the request levers the run applies BEFORE it prices
509
+ * (payload-builder's `resolveVideoRequestNorm`): the model's UI resolution fill
510
+ * when the node names none (`uiResolutionFill` — what the run sends), then the
511
+ * catalog normalizer `normalizeVideoRequestParams`, which also owns the Seedance
512
+ * Draft rule (a draft is priced AND sent at 480p whatever resolution came with
513
+ * it). Without that, a node with no resolution was quoted at the identifier's
514
+ * own default band (720p on Seedance 2.5) while the run sent and reserved 480p.
515
+ *
516
+ * `hasVideoRef` must come from the GRAPH (a wired reference-video edge, e.g.
517
+ * `countRefModalityEdges(edges, id, "video") > 0`), never node data: nothing
518
+ * writes `referenceVideoUrls` into a video node, so reading it there always
519
+ * quoted the plain ladder for a run that reserves on the `-ref` one.
520
+ */
521
+ export function videoGenerationCreditId(args: {
522
+ provider: string
523
+ duration?: number | string
524
+ sound?: boolean
525
+ nodeType?: "image-to-video" | "text-to-video"
526
+ mode?: string
527
+ resolution?: string
528
+ draft?: boolean
529
+ hasVideoRef?: boolean
530
+ }): string {
531
+ const { resolution } = normalizeVideoRequestParams(args.provider, {
532
+ resolution: args.resolution ?? uiResolutionFill(args.provider),
533
+ draft: args.draft === true,
534
+ })
535
+ return buildVideoCreditModelIdentifier(
536
+ args.provider,
537
+ args.duration,
538
+ args.sound,
539
+ args.nodeType ?? "image-to-video",
540
+ args.mode,
541
+ resolution,
542
+ args.hasVideoRef === true,
543
+ )
544
+ }
545
+
502
546
  /**
503
547
  * The credit identifier a Video to Video node's Seedance EDIT lane reserves
504
548
  * under. Seedance has no v2v endpoint — the lane is a text-to-video job in edit
@@ -506,26 +550,27 @@ export function buildVideoCreditModelIdentifier(
506
550
  * REFERENCE-VIDEO ladder at the model's LONGEST clip (Auto duration), and the
507
551
  * measured settlement refunds down to what was actually delivered.
508
552
  *
509
- * It exists because that is a 7-positional-argument call with four
510
- * easy-to-transpose slots, and FOUR surfaces must agree on it exactly: the
511
- * orchestrator's reservation (payload-builder.ts), the backend pre-run
512
- * estimator (ee/billing/credits.ts), the node's cost pill, and the frontend
513
- * run-level estimate (config-panels/helpers.ts). A quote that disagrees with
514
- * the reserve is the documented `price_not_configured` / blank-pill trap.
553
+ * A thin call into {@link videoGenerationCreditId}, so a Generate Video node
554
+ * making the same KIE call (Seedance, Auto, a wired reference video) is quoted
555
+ * the same id. FOUR surfaces must agree on it exactly: the orchestrator's
556
+ * reservation (payload-builder.ts), the backend pre-run estimator
557
+ * (ee/billing/credits.ts), the node's cost pill, and the frontend run-level
558
+ * estimate (config-panels/helpers.ts). A quote that disagrees with the reserve
559
+ * is the documented `price_not_configured` / blank-pill trap.
515
560
  *
516
561
  * `resolution` is the node's one `v2vResolution` field; when unset the model's
517
- * own UI fill is priced, which is what the lane will send.
562
+ * own UI fill is priced, which is what the lane will send. `draft` is the
563
+ * node's Seedance Draft toggle (priced at 480p).
518
564
  */
519
- export function seedanceVideoEditCreditId(provider: string, resolution?: string): string {
520
- return buildVideoCreditModelIdentifier(
565
+ export function seedanceVideoEditCreditId(provider: string, resolution?: string, draft?: boolean): string {
566
+ return videoGenerationCreditId({
521
567
  provider,
522
- VIDEO_DURATION_AUTO,
523
- undefined,
524
- "text-to-video",
525
- undefined,
526
- resolution ?? uiResolutionFill(provider),
527
- /* hasVideoRef */ true,
528
- )
568
+ duration: VIDEO_DURATION_AUTO,
569
+ nodeType: "text-to-video",
570
+ resolution,
571
+ draft,
572
+ hasVideoRef: true,
573
+ })
529
574
  }
530
575
 
531
576
  /** What the video credit identifier PRICES for a request, for the levers whose
@@ -23,6 +23,7 @@ export {
23
23
  imageGenAutoAspectNeedsSourceImage,
24
24
  buildVideoCreditModelIdentifier,
25
25
  seedanceVideoEditCreditId,
26
+ videoGenerationCreditId,
26
27
  pricedVideoSelection,
27
28
  buildMotionCreditModelIdentifier,
28
29
  speedRampCreditId,
@@ -13,6 +13,10 @@ export type { Flux2Model } from "../flux2-pricing.js"
13
13
  export {
14
14
  MODEL_CATALOG,
15
15
  MODEL_RECOMMENDATIONS,
16
+ // The companies behind the models (`maker` on every entry; the wire's `maker`).
17
+ MODEL_MAKERS,
18
+ isModelMakerId,
19
+ modelMakerOf,
16
20
  SPEECH_UNIT_PRICE_NOTE,
17
21
  listModels,
18
22
  groupByFamily,
@@ -48,6 +52,8 @@ export type {
48
52
  NormalizedVideoRequest,
49
53
  ModelCatalogEntry,
50
54
  ModelKind,
55
+ ModelMaker,
56
+ ModelMakerId,
51
57
  ModelMode,
52
58
  ModelRecommendation,
53
59
  ModelValidationIssue,