@nodaro/shared 3.54.1 → 3.56.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 (195) hide show
  1. package/dist/{chunk-3CHOZ573.js → chunk-2AR3OXAA.js} +276 -17
  2. package/dist/chunk-2AR3OXAA.js.map +1 -0
  3. package/dist/{chunk-ZKHQSG76.js → chunk-2J6NTA5I.js} +4 -4
  4. package/dist/{chunk-ZKHQSG76.js.map → chunk-2J6NTA5I.js.map} +1 -1
  5. package/dist/{chunk-AGTCHDG5.cjs → chunk-33P5FI2U.cjs} +6 -6
  6. package/dist/{chunk-AGTCHDG5.cjs.map → chunk-33P5FI2U.cjs.map} +1 -1
  7. package/dist/{chunk-HG3KKCJJ.js → chunk-4JODLC2N.js} +3 -3
  8. package/dist/{chunk-HG3KKCJJ.js.map → chunk-4JODLC2N.js.map} +1 -1
  9. package/dist/{chunk-N3WL6IOJ.js → chunk-4O5STV7N.js} +55 -5
  10. package/dist/chunk-4O5STV7N.js.map +1 -0
  11. package/dist/chunk-4ONS6QRT.js +42 -0
  12. package/dist/chunk-4ONS6QRT.js.map +1 -0
  13. package/dist/{chunk-E4YES25K.js → chunk-55FQBILM.js} +4 -4
  14. package/dist/{chunk-E4YES25K.js.map → chunk-55FQBILM.js.map} +1 -1
  15. package/dist/{chunk-ZWB3NG4M.js → chunk-62ZQQA7L.js} +3 -3
  16. package/dist/{chunk-ZWB3NG4M.js.map → chunk-62ZQQA7L.js.map} +1 -1
  17. package/dist/{chunk-HEF4BIMA.js → chunk-6GGHM33Z.js} +4 -4
  18. package/dist/{chunk-HEF4BIMA.js.map → chunk-6GGHM33Z.js.map} +1 -1
  19. package/dist/{chunk-KMSEU6FK.js → chunk-7DGJDISO.js} +3 -3
  20. package/dist/{chunk-KMSEU6FK.js.map → chunk-7DGJDISO.js.map} +1 -1
  21. package/dist/{chunk-2OYV6K7D.cjs → chunk-7JM5EZF3.cjs} +13 -13
  22. package/dist/{chunk-2OYV6K7D.cjs.map → chunk-7JM5EZF3.cjs.map} +1 -1
  23. package/dist/{chunk-QP5JLSCJ.cjs → chunk-AFQFGZN7.cjs} +30 -3
  24. package/dist/chunk-AFQFGZN7.cjs.map +1 -0
  25. package/dist/chunk-AKDJKMAL.cjs +48 -0
  26. package/dist/chunk-AKDJKMAL.cjs.map +1 -0
  27. package/dist/{chunk-HZL7QMXK.js → chunk-AWS4BWEC.js} +7 -3
  28. package/dist/chunk-AWS4BWEC.js.map +1 -0
  29. package/dist/{chunk-5DVDHL7Y.js → chunk-AZDVL7IM.js} +20 -6
  30. package/dist/chunk-AZDVL7IM.js.map +1 -0
  31. package/dist/{chunk-2R74OU76.cjs → chunk-CGZLENU4.cjs} +276 -16
  32. package/dist/chunk-CGZLENU4.cjs.map +1 -0
  33. package/dist/{chunk-G7IUQKRU.cjs → chunk-CLKU3ZIU.cjs} +51 -51
  34. package/dist/{chunk-G7IUQKRU.cjs.map → chunk-CLKU3ZIU.cjs.map} +1 -1
  35. package/dist/{chunk-MCIBQ5BF.js → chunk-DURFRWAW.js} +9 -9
  36. package/dist/{chunk-MCIBQ5BF.js.map → chunk-DURFRWAW.js.map} +1 -1
  37. package/dist/{chunk-C5S75476.js → chunk-EAKO7PGC.js} +8 -4
  38. package/dist/{chunk-C5S75476.js.map → chunk-EAKO7PGC.js.map} +1 -1
  39. package/dist/{chunk-IPCWYKX5.cjs → chunk-EWARI452.cjs} +60 -46
  40. package/dist/chunk-EWARI452.cjs.map +1 -0
  41. package/dist/{chunk-C6IQCKJT.cjs → chunk-FCQYMPUQ.cjs} +4 -4
  42. package/dist/{chunk-C6IQCKJT.cjs.map → chunk-FCQYMPUQ.cjs.map} +1 -1
  43. package/dist/{chunk-CZCOL3M5.js → chunk-G4XWVWRI.js} +25 -4
  44. package/dist/chunk-G4XWVWRI.js.map +1 -0
  45. package/dist/{chunk-WVACGZYV.cjs → chunk-H7VMJBNZ.cjs} +8 -8
  46. package/dist/{chunk-WVACGZYV.cjs.map → chunk-H7VMJBNZ.cjs.map} +1 -1
  47. package/dist/{chunk-SEEQ3H22.cjs → chunk-HWJE4FNS.cjs} +59 -6
  48. package/dist/chunk-HWJE4FNS.cjs.map +1 -0
  49. package/dist/{chunk-3633VD2M.cjs → chunk-IKP4GOWZ.cjs} +8 -8
  50. package/dist/{chunk-3633VD2M.cjs.map → chunk-IKP4GOWZ.cjs.map} +1 -1
  51. package/dist/{chunk-5R6LTKE5.cjs → chunk-ILMHITHK.cjs} +5 -5
  52. package/dist/{chunk-5R6LTKE5.cjs.map → chunk-ILMHITHK.cjs.map} +1 -1
  53. package/dist/chunk-IOET54EV.js +39 -0
  54. package/dist/chunk-IOET54EV.js.map +1 -0
  55. package/dist/{chunk-ZAK276QF.js → chunk-JHTYULY2.js} +4 -4
  56. package/dist/{chunk-ZAK276QF.js.map → chunk-JHTYULY2.js.map} +1 -1
  57. package/dist/{chunk-OVIIJVXH.cjs → chunk-JO3XSUO2.cjs} +21 -21
  58. package/dist/{chunk-OVIIJVXH.cjs.map → chunk-JO3XSUO2.cjs.map} +1 -1
  59. package/dist/{chunk-UWMXMLMV.js → chunk-MROKQP4U.js} +3 -3
  60. package/dist/{chunk-UWMXMLMV.js.map → chunk-MROKQP4U.js.map} +1 -1
  61. package/dist/{chunk-J4CVGAAV.cjs → chunk-NZRG5CXQ.cjs} +7 -2
  62. package/dist/chunk-NZRG5CXQ.cjs.map +1 -0
  63. package/dist/{chunk-KM35K2M5.cjs → chunk-O7DXNX5J.cjs} +92 -25
  64. package/dist/chunk-O7DXNX5J.cjs.map +1 -0
  65. package/dist/chunk-OWNPYQSH.cjs +283 -0
  66. package/dist/chunk-OWNPYQSH.cjs.map +1 -0
  67. package/dist/{chunk-FIYVKW7F.cjs → chunk-PFXPAWPQ.cjs} +12 -12
  68. package/dist/{chunk-FIYVKW7F.cjs.map → chunk-PFXPAWPQ.cjs.map} +1 -1
  69. package/dist/chunk-QSWUSXRL.cjs +53 -0
  70. package/dist/chunk-QSWUSXRL.cjs.map +1 -0
  71. package/dist/{chunk-MGJR5OXO.js → chunk-RX7WII6I.js} +5 -5
  72. package/dist/{chunk-MGJR5OXO.js.map → chunk-RX7WII6I.js.map} +1 -1
  73. package/dist/chunk-S7FCFQ6X.js +255 -0
  74. package/dist/chunk-S7FCFQ6X.js.map +1 -0
  75. package/dist/{chunk-YBZQXZ6A.js → chunk-ST4WQ6ND.js} +68 -8
  76. package/dist/chunk-ST4WQ6ND.js.map +1 -0
  77. package/dist/{chunk-LKCPFD5X.js → chunk-SWVGHAYO.js} +5 -3
  78. package/dist/chunk-SWVGHAYO.js.map +1 -0
  79. package/dist/{chunk-MTUNORQB.cjs → chunk-TSKYEREJ.cjs} +11 -11
  80. package/dist/{chunk-MTUNORQB.cjs.map → chunk-TSKYEREJ.cjs.map} +1 -1
  81. package/dist/{chunk-LYWJAXPT.js → chunk-UMPZR56R.js} +3 -3
  82. package/dist/{chunk-LYWJAXPT.js.map → chunk-UMPZR56R.js.map} +1 -1
  83. package/dist/{chunk-6HUWQLF2.cjs → chunk-WKCFTWLO.cjs} +6 -6
  84. package/dist/{chunk-6HUWQLF2.cjs.map → chunk-WKCFTWLO.cjs.map} +1 -1
  85. package/dist/chunk-XPUGMYAJ.cjs +27 -0
  86. package/dist/{chunk-HD45Y7QU.cjs.map → chunk-XPUGMYAJ.cjs.map} +1 -1
  87. package/dist/{chunk-G5NTNQ7W.cjs → chunk-XROE3CAS.cjs} +5 -3
  88. package/dist/chunk-XROE3CAS.cjs.map +1 -0
  89. package/dist/{chunk-SZUDEFX2.cjs → chunk-ZXDH3L3P.cjs} +43 -39
  90. package/dist/{chunk-SZUDEFX2.cjs.map → chunk-ZXDH3L3P.cjs.map} +1 -1
  91. package/dist/{chunk-25KAGSPT.js → chunk-ZYITB47P.js} +3 -3
  92. package/dist/{chunk-25KAGSPT.js.map → chunk-ZYITB47P.js.map} +1 -1
  93. package/dist/entries/apps.cjs +43 -42
  94. package/dist/entries/apps.js +8 -7
  95. package/dist/entries/credits.cjs +151 -150
  96. package/dist/entries/credits.d.cts +4 -1
  97. package/dist/entries/credits.d.ts +4 -1
  98. package/dist/entries/credits.js +8 -7
  99. package/dist/entries/entities.cjs +125 -125
  100. package/dist/entries/entities.d.cts +1 -1
  101. package/dist/entries/entities.d.ts +1 -1
  102. package/dist/entries/entities.js +1 -1
  103. package/dist/entries/llm-models.d.cts +1 -1
  104. package/dist/entries/llm-models.d.ts +1 -1
  105. package/dist/entries/media.cjs +80 -56
  106. package/dist/entries/media.d.cts +49 -3
  107. package/dist/entries/media.d.ts +49 -3
  108. package/dist/entries/media.js +1 -1
  109. package/dist/entries/model-catalog.cjs +127 -66
  110. package/dist/entries/model-catalog.d.cts +61 -9
  111. package/dist/entries/model-catalog.d.ts +61 -9
  112. package/dist/entries/model-catalog.js +5 -4
  113. package/dist/entries/models.cjs +304 -276
  114. package/dist/entries/models.d.cts +3 -3
  115. package/dist/entries/models.d.ts +3 -3
  116. package/dist/entries/models.js +4 -4
  117. package/dist/entries/nodes.cjs +208 -207
  118. package/dist/entries/nodes.d.cts +1 -1
  119. package/dist/entries/nodes.d.ts +1 -1
  120. package/dist/entries/nodes.js +10 -9
  121. package/dist/entries/organizations.d.cts +9 -1
  122. package/dist/entries/organizations.d.ts +9 -1
  123. package/dist/entries/pipeline.cjs +161 -149
  124. package/dist/entries/pipeline.d.cts +165 -26
  125. package/dist/entries/pipeline.d.ts +165 -26
  126. package/dist/entries/pipeline.js +3 -3
  127. package/dist/entries/runtime-config.cjs +116 -0
  128. package/dist/entries/runtime-config.cjs.map +1 -0
  129. package/dist/entries/runtime-config.d.cts +308 -0
  130. package/dist/entries/runtime-config.d.ts +308 -0
  131. package/dist/entries/runtime-config.js +3 -0
  132. package/dist/entries/runtime-config.js.map +1 -0
  133. package/dist/entries/ugc.cjs +71 -71
  134. package/dist/entries/ugc.js +4 -4
  135. package/dist/entries/video.cjs +117 -117
  136. package/dist/entries/video.js +4 -4
  137. package/dist/entries/workflow.cjs +150 -146
  138. package/dist/entries/workflow.d.cts +8 -1
  139. package/dist/entries/workflow.d.ts +8 -1
  140. package/dist/entries/workflow.js +2 -2
  141. package/dist/index.cjs +3169 -2931
  142. package/dist/index.d.cts +7 -6
  143. package/dist/index.d.ts +7 -6
  144. package/dist/index.js +24 -22
  145. package/dist/{model-catalog-Dm2UiwUe.d.ts → model-catalog-vQ3NWn24.d.cts} +33 -2
  146. package/dist/{model-catalog-Dm2UiwUe.d.cts → model-catalog-vQ3NWn24.d.ts} +33 -2
  147. package/dist/{model-constants-DZUGVDOw.d.ts → model-constants-QZVHZX25.d.cts} +35 -6
  148. package/dist/{model-constants-DZUGVDOw.d.cts → model-constants-QZVHZX25.d.ts} +35 -6
  149. package/package.json +6 -1
  150. package/src/__tests__/fixtures/root-exports.baseline.json +2 -0
  151. package/src/__tests__/gpt-image-2-6.test.ts +277 -0
  152. package/src/__tests__/image-model-roles.test.ts +28 -9
  153. package/src/__tests__/runtime-config.test.ts +398 -0
  154. package/src/__tests__/video-face-mesh.test.ts +45 -2
  155. package/src/__tests__/voice-library-values.test.ts +24 -0
  156. package/src/credit-identifiers.ts +42 -0
  157. package/src/entries/model-catalog.ts +17 -0
  158. package/src/entries/models.ts +9 -0
  159. package/src/entries/runtime-config.ts +51 -0
  160. package/src/entries/workflow.ts +1 -1
  161. package/src/gpt-image-2-6.ts +104 -0
  162. package/src/i18n/style.ko.ts +2 -2
  163. package/src/i18n/style.pt-BR.ts +14 -14
  164. package/src/image-model-roles.ts +31 -10
  165. package/src/index.ts +1 -0
  166. package/src/model-catalog.ts +302 -14
  167. package/src/model-constants.ts +84 -3
  168. package/src/node-default-mappings.ts +4 -0
  169. package/src/node-refs.ts +11 -0
  170. package/src/organizations/views.ts +9 -1
  171. package/src/pipeline-types.ts +2 -0
  172. package/src/reference-board-templates.ts +2 -0
  173. package/src/runtime-config/contract.ts +492 -0
  174. package/src/runtime-config/worlds.ts +77 -0
  175. package/src/video-face-mesh.ts +72 -4
  176. package/src/voices.ts +175 -2
  177. package/dist/chunk-2R74OU76.cjs.map +0 -1
  178. package/dist/chunk-3CHOZ573.js.map +0 -1
  179. package/dist/chunk-5DVDHL7Y.js.map +0 -1
  180. package/dist/chunk-ATWLKUAI.cjs +0 -34
  181. package/dist/chunk-ATWLKUAI.cjs.map +0 -1
  182. package/dist/chunk-CZCOL3M5.js.map +0 -1
  183. package/dist/chunk-DUL5ZLTJ.js +0 -29
  184. package/dist/chunk-DUL5ZLTJ.js.map +0 -1
  185. package/dist/chunk-G5NTNQ7W.cjs.map +0 -1
  186. package/dist/chunk-HD45Y7QU.cjs +0 -27
  187. package/dist/chunk-HZL7QMXK.js.map +0 -1
  188. package/dist/chunk-IPCWYKX5.cjs.map +0 -1
  189. package/dist/chunk-J4CVGAAV.cjs.map +0 -1
  190. package/dist/chunk-KM35K2M5.cjs.map +0 -1
  191. package/dist/chunk-LKCPFD5X.js.map +0 -1
  192. package/dist/chunk-N3WL6IOJ.js.map +0 -1
  193. package/dist/chunk-QP5JLSCJ.cjs.map +0 -1
  194. package/dist/chunk-SEEQ3H22.cjs.map +0 -1
  195. package/dist/chunk-YBZQXZ6A.js.map +0 -1
@@ -4,8 +4,8 @@
4
4
  * tone of the picture under it — drawn on the faces of a clip, frame for
5
5
  * frame. An internal step of Nodaro Motion's face masking: the lines go on
6
6
  * the masked (or depth) clip so the video model still sees where the mouth
7
- * and the eyes are. A request may draw only the eye and lip outlines, or
8
- * only the lip outline (`parts`).
7
+ * and the eyes are. A request may draw only the eye and lip outlines, only
8
+ * the lip outline, or the face's contours (`parts`).
9
9
  *
10
10
  * Priced by the clip's length at the 30 fps basis Video Mask uses
11
11
  * (`videoMaskBilledSeconds`), one row per length bucket.
@@ -32,11 +32,71 @@ export const VIDEO_FACE_MESH_LIMITS = {
32
32
  * What a face mesh run draws on each face (`VideoFaceMeshRequest.parts`):
33
33
  * `"full"` (the default) the thin wireframe and the darker eye and lip
34
34
  * outlines; `"features"` the eye outlines and the lip outline only, no
35
- * wireframe; `"mouth"` the lip outline only.
35
+ * wireframe; `"mouth"` the lip outline only; `"contours"` the face oval,
36
+ * both eyebrows, the nose and the eye and lip outlines, no wireframe (a host
37
+ * that draws them says so to its engine: `videoFaceMeshContours`).
36
38
  */
37
- export const VIDEO_FACE_MESH_PARTS = ["full", "features", "mouth"] as const
39
+ export const VIDEO_FACE_MESH_PARTS = ["full", "features", "mouth", "contours"] as const
38
40
  export type VideoFaceMeshParts = (typeof VIDEO_FACE_MESH_PARTS)[number]
39
41
 
42
+ /**
43
+ * The face mesh's layers (`VideoFaceMeshRequest.layers`), each drawn or not
44
+ * on its own:
45
+ * - `wireframe`: the thin mesh over the whole face;
46
+ * - `eyes`: the eye outlines; `lips`: the lip outline, outer and inner;
47
+ * - `contours`: the face oval, both eyebrows and the nose. With it on, every
48
+ * line drawn leaves out what the face hides (a turned face's far side);
49
+ * with it off, nothing is left out;
50
+ * - `irises`: a circle round each iris and a dot at its centre, drawn only
51
+ * inside the eye's opening (an eyelid covers it, a closed eye hides it);
52
+ * - `bold`: the lines drawn thicker and in a deeper tone. It draws nothing
53
+ * of its own: it changes the lines of the other layers.
54
+ * Every `parts` value is one set of layers (`videoFaceMeshLayersOfParts`),
55
+ * drawn exactly as that value is.
56
+ */
57
+ export const VIDEO_FACE_MESH_LAYERS = ["wireframe", "eyes", "lips", "contours", "irises", "bold"] as const
58
+ export type VideoFaceMeshLayer = (typeof VIDEO_FACE_MESH_LAYERS)[number]
59
+ /** The layers that draw lines of their own (all but `bold`): a set needs at least one. */
60
+ export const VIDEO_FACE_MESH_LINE_LAYERS = ["wireframe", "eyes", "lips", "contours", "irises"] as const satisfies readonly VideoFaceMeshLayer[]
61
+ /** A set of layers: each one on when `true`; left out or `false` is off. */
62
+ export type VideoFaceMeshLayers = { readonly [K in VideoFaceMeshLayer]?: boolean }
63
+
64
+ const PARTS_LAYERS: Readonly<Record<VideoFaceMeshParts, readonly VideoFaceMeshLayer[]>> = {
65
+ full: ["wireframe", "eyes", "lips"],
66
+ features: ["eyes", "lips"],
67
+ mouth: ["lips"],
68
+ contours: ["eyes", "lips", "contours"],
69
+ }
70
+
71
+ /** The set of layers a `parts` value draws (left out: `"full"`), a new object with only its layers, each `true`. */
72
+ export function videoFaceMeshLayersOfParts(parts: VideoFaceMeshParts = "full"): VideoFaceMeshLayers {
73
+ return Object.fromEntries(PARTS_LAYERS[parts].map((l) => [l, true]))
74
+ }
75
+
76
+ /** The set with only its layers that are on, each `true`, in `VIDEO_FACE_MESH_LAYERS` order: a new object. */
77
+ export function videoFaceMeshLayersOn(layers: VideoFaceMeshLayers | null | undefined): VideoFaceMeshLayers {
78
+ return Object.fromEntries(VIDEO_FACE_MESH_LAYERS.filter((l) => layers?.[l] === true).map((l) => [l, true]))
79
+ }
80
+
81
+ /** Whether the set draws any line (a layer other than `bold` on). */
82
+ export function videoFaceMeshLayersDrawLines(layers: VideoFaceMeshLayers | null | undefined): boolean {
83
+ return VIDEO_FACE_MESH_LINE_LAYERS.some((l) => layers?.[l] === true)
84
+ }
85
+
86
+ /**
87
+ * The `parts` value that draws exactly this set of layers, or undefined when
88
+ * none does (a set only layers can name: the irises, bold lines, the eyes
89
+ * alone…). `among` limits the values it may answer (a setting that takes only
90
+ * some of them).
91
+ */
92
+ export function videoFaceMeshPartsOfLayers(
93
+ layers: VideoFaceMeshLayers | null | undefined,
94
+ among: readonly VideoFaceMeshParts[] = VIDEO_FACE_MESH_PARTS,
95
+ ): VideoFaceMeshParts | undefined {
96
+ const on = VIDEO_FACE_MESH_LAYERS.filter((l) => layers?.[l] === true)
97
+ return among.find((p) => PARTS_LAYERS[p].length === on.length && PARTS_LAYERS[p].every((l) => on.includes(l)))
98
+ }
99
+
40
100
  /**
41
101
  * The version of what a face mesh run draws for a given clip and settings:
42
102
  * every finished `video-face-mesh` job reports it as `output_data.recipe`,
@@ -113,6 +173,12 @@ export interface VideoFaceMeshRequest {
113
173
  * are drawn as they are in the full mesh (the same tone and width).
114
174
  */
115
175
  readonly parts?: VideoFaceMeshParts
176
+ /**
177
+ * What is drawn, layer by layer (`VIDEO_FACE_MESH_LAYERS`), in place of
178
+ * `parts` (never both). At least one layer other than `bold`. A set that is
179
+ * a `parts` value's draws exactly as that value does.
180
+ */
181
+ readonly layers?: VideoFaceMeshLayers
116
182
  }
117
183
 
118
184
  /** A finished `video-face-mesh` job's `output_data`. */
@@ -130,5 +196,7 @@ export interface VideoFaceMeshOutput {
130
196
  readonly colormap?: VideoDepthColormap
131
197
  /** What was drawn when it was not the full mesh (a request with `parts` `"features"` or `"mouth"`); absent = the full mesh. */
132
198
  readonly parts?: Exclude<VideoFaceMeshParts, "full">
199
+ /** The layers drawn, for a request that named `layers` (only those on, each `true`); absent: `parts` says. */
200
+ readonly layers?: VideoFaceMeshLayers
133
201
  readonly recipe: string
134
202
  }
package/src/voices.ts CHANGED
@@ -52,18 +52,108 @@ export interface SharedVoice extends Voice {
52
52
  * joins this set the release it ships.
53
53
  */
54
54
  verifiedProviders?: TtsProvider[]
55
+ /**
56
+ * The library's one-word tone for the voice (`calm`, `deep`, `cute`, …) —
57
+ * one of {@link VOICE_LIBRARY_DESCRIPTIVES}, or a word the library added
58
+ * since; `""` when it states none, like every other field here. The value
59
+ * a `descriptives` filter matches. Absent only on a server older than this
60
+ * field.
61
+ */
62
+ descriptive?: string
63
+ /**
64
+ * The voice's primary language as the library codes it (`en`, `he`, …) and
65
+ * its locale (`en-US`); `""` when unstated. For what a `language` filter
66
+ * matches see {@link SharedVoice.verifiedLanguages}. Absent only on a
67
+ * server older than these fields.
68
+ */
69
+ language?: string
70
+ locale?: string
71
+ /**
72
+ * Every language the voice is verified for, as the library codes them, the
73
+ * primary language first — the set `GET /v1/voices/library?language=`
74
+ * matches against (a voice whose primary language is English and that is
75
+ * verified for Spanish is listed under `language=es`), and what the
76
+ * `languages` facet counts. Absent only on a server older than this field.
77
+ */
78
+ verifiedLanguages?: string[]
55
79
  }
56
80
 
81
+ /**
82
+ * The `use_cases` values the Voice Library groups its voices by
83
+ * (`GET /v1/voices/library?use_cases=<one>`): what a picker shows as its
84
+ * categories. The route passes the value through verbatim, so a value the
85
+ * library adds later works before it is listed here.
86
+ */
87
+ export const VOICE_LIBRARY_USE_CASES = [
88
+ "advertisement",
89
+ "characters_animation",
90
+ "conversational",
91
+ "entertainment_tv",
92
+ "informative_educational",
93
+ "narrative_story",
94
+ "social_media",
95
+ ] as const
96
+ export type VoiceLibraryUseCase = (typeof VOICE_LIBRARY_USE_CASES)[number]
97
+
98
+ /**
99
+ * The tones (`descriptives`) the Voice Library labels its voices with
100
+ * (`GET /v1/voices/library?descriptives=<one>`), alphabetical — what a picker
101
+ * shows as a category's sub-groups. Every voice carries at most one. The
102
+ * library adds and drops words over time: this is the list it used when it
103
+ * was last read (2026-11); `GET /v1/voices/library/facets` says which exist
104
+ * now, with how many voices each, and the route passes any value through.
105
+ */
106
+ export const VOICE_LIBRARY_DESCRIPTIVES = [
107
+ "anxious",
108
+ "calm",
109
+ "casual",
110
+ "childish",
111
+ "chill",
112
+ "classy",
113
+ "confident",
114
+ "crisp",
115
+ "cute",
116
+ "deep",
117
+ "excited",
118
+ "formal",
119
+ "gentle",
120
+ "grumpy",
121
+ "husky",
122
+ "hyped",
123
+ "intense",
124
+ "mature",
125
+ "meditative",
126
+ "modulated",
127
+ "neutral",
128
+ "pleasant",
129
+ "professional",
130
+ "raspy",
131
+ "relaxed",
132
+ "robotic",
133
+ "rough",
134
+ "sad",
135
+ "sassy",
136
+ "serious",
137
+ "soft",
138
+ "upbeat",
139
+ "whispery",
140
+ "wise",
141
+ ] as const
142
+ export type VoiceLibraryDescriptive = (typeof VOICE_LIBRARY_DESCRIPTIVES)[number]
143
+
57
144
  /** Query params for `GET /v1/voices/library`. All optional; sent as a querystring. */
58
145
  export interface VoiceLibraryParams {
59
146
  search?: string
60
147
  gender?: string
61
148
  age?: string
62
149
  accent?: string
150
+ /** A language code as the library uses them (`en`, `he`); matches a voice's VERIFIED languages, not only its primary one. */
63
151
  language?: string
64
152
  category?: string
65
- use_cases?: string
66
- descriptives?: string
153
+ /** One of `VOICE_LIBRARY_USE_CASES` (any other string is passed through as sent). */
154
+ use_cases?: VoiceLibraryUseCase | (string & {})
155
+ /** One of `VOICE_LIBRARY_DESCRIPTIVES` (any other string is passed through as sent); one value per call. */
156
+ descriptives?: VoiceLibraryDescriptive | (string & {})
67
157
  featured?: boolean
68
158
  /** e.g. "trending" — passed through to the route. */
69
159
  sort?: string
@@ -79,6 +169,59 @@ export interface VoiceLibraryResponse {
79
169
  hasMore: boolean
80
170
  }
81
171
 
172
+ /**
173
+ * Query params for `GET /v1/voices/library/facets`: the listing's filters,
174
+ * without paging and sort. All optional.
175
+ */
176
+ export type VoiceLibraryFacetsParams = Pick<
177
+ VoiceLibraryParams,
178
+ "search" | "gender" | "age" | "accent" | "language" | "category" | "use_cases" | "descriptives" | "featured"
179
+ >
180
+
181
+ /** One value of a facet and how many voices carry it. */
182
+ export interface VoiceLibraryFacetCount {
183
+ value: string
184
+ count: number
185
+ }
186
+
187
+ /**
188
+ * `GET /v1/voices/library/facets` response: for the filters sent, how many
189
+ * library voices match (`total`) and that number broken down by every facet,
190
+ * so one call fills a whole picker screen. Each facet's counts apply every
191
+ * filter EXCEPT its own (a client shows every category's count while one is
192
+ * chosen); values with no voices are left out; lists are sorted by count,
193
+ * then by value. The values are the library's own spellings — the same
194
+ * strings the listing's filters take.
195
+ *
196
+ * Counted over the platform's copy of the library, refreshed on a schedule
197
+ * (`updatedAt` is when it was read), not over the live listing: a count may
198
+ * trail the listing by a few voices. `languages` counts a voice under every
199
+ * language it is verified for (what the listing's `language` filter matches),
200
+ * so those counts add up to more than `total`.
201
+ */
202
+ export interface VoiceLibraryFacets {
203
+ /** Voices matching every filter sent. */
204
+ total: number
205
+ use_cases: VoiceLibraryFacetCount[]
206
+ languages: VoiceLibraryFacetCount[]
207
+ descriptives: VoiceLibraryFacetCount[]
208
+ genders: VoiceLibraryFacetCount[]
209
+ ages: VoiceLibraryFacetCount[]
210
+ accents: VoiceLibraryFacetCount[]
211
+ categories: VoiceLibraryFacetCount[]
212
+ /**
213
+ * True when `search` was sent: the library's own search is fuzzy (it stems
214
+ * and tolerates a typo), which the counts cannot reproduce — under `search`
215
+ * they match the name and description as written and are a lower estimate.
216
+ */
217
+ approximate: boolean
218
+ /** When the copy these counts come from was read (ISO 8601); null when there is none (no speech key). */
219
+ updatedAt: string | null
220
+ /** Present (true) when the deployment has no speech key: nothing to count. */
221
+ keyMissing?: boolean
222
+ hint?: string
223
+ }
224
+
82
225
  /**
83
226
  * A user voice clone. `GET /v1/voice-clones` returns the full shape; the create
84
227
  * response (`POST /v1/voice-clones/from-url`) returns only `id, name,
@@ -101,3 +244,33 @@ export interface VoiceClone {
101
244
  /** Only on the create response (credit-tracking); never on the list. */
102
245
  jobId?: string
103
246
  }
247
+
248
+ /**
249
+ * What a favorite voice is — the `voiceType` a text-to-speech run takes for it:
250
+ * a premade voice, a Voice Library voice, or one of the user's own clones
251
+ * (`custom`). The one list the route, the MCP tool and the CLI validate against.
252
+ */
253
+ export const VOICE_FAVORITE_TYPES = ["premade", "library", "custom"] as const
254
+ export type VoiceFavoriteType = (typeof VOICE_FAVORITE_TYPES)[number]
255
+
256
+ /**
257
+ * One of the signed-in user's favorite voices (`GET /v1/voices/favorites`), newest
258
+ * first. `voiceId` is what a text-to-speech request takes as `voice` with
259
+ * `voiceType`; `name` and `previewUrl` are the snapshot the client sent when it
260
+ * starred the voice, so a favorites list renders with no second lookup.
261
+ */
262
+ export interface VoiceFavorite {
263
+ voiceId: string
264
+ voiceType: VoiceFavoriteType
265
+ name: string
266
+ previewUrl: string | null
267
+ createdAt: string
268
+ }
269
+
270
+ /** Body of `PUT /v1/voices/favorites/:voiceId`: the voice's kind and the snapshot to show it by. */
271
+ export interface VoiceFavoriteInput {
272
+ voiceId: string
273
+ voiceType: VoiceFavoriteType
274
+ name: string
275
+ previewUrl?: string | null
276
+ }