@nodaro/shared 3.64.0 → 3.66.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 (208) hide show
  1. package/dist/{chunk-J6B7J73J.cjs → chunk-23IKLMRL.cjs} +49 -49
  2. package/dist/{chunk-J6B7J73J.cjs.map → chunk-23IKLMRL.cjs.map} +1 -1
  3. package/dist/chunk-27HA6YOL.cjs +377 -0
  4. package/dist/chunk-27HA6YOL.cjs.map +1 -0
  5. package/dist/{chunk-OOZW2MM6.cjs → chunk-37ZSFS6A.cjs} +9 -9
  6. package/dist/{chunk-OOZW2MM6.cjs.map → chunk-37ZSFS6A.cjs.map} +1 -1
  7. package/dist/{chunk-AZNZ5WNZ.cjs → chunk-3L7GMQ4M.cjs} +142 -45
  8. package/dist/chunk-3L7GMQ4M.cjs.map +1 -0
  9. package/dist/{chunk-SXHHLZ22.js → chunk-3QJ3UR5Z.js} +9 -9
  10. package/dist/{chunk-SXHHLZ22.js.map → chunk-3QJ3UR5Z.js.map} +1 -1
  11. package/dist/chunk-3YWZ5SOZ.js +164 -0
  12. package/dist/chunk-3YWZ5SOZ.js.map +1 -0
  13. package/dist/{chunk-TTGZ2L3O.js → chunk-5GG4CG4Y.js} +3 -3
  14. package/dist/{chunk-TTGZ2L3O.js.map → chunk-5GG4CG4Y.js.map} +1 -1
  15. package/dist/{chunk-3KTWYYCN.js → chunk-5IZHECUP.js} +3 -3
  16. package/dist/{chunk-3KTWYYCN.js.map → chunk-5IZHECUP.js.map} +1 -1
  17. package/dist/{chunk-Q2Y4JHF7.js → chunk-5J2LIQYU.js} +5 -5
  18. package/dist/{chunk-Q2Y4JHF7.js.map → chunk-5J2LIQYU.js.map} +1 -1
  19. package/dist/{chunk-SHH2T4CR.js → chunk-5LWYX4GV.js} +3 -3
  20. package/dist/{chunk-SHH2T4CR.js.map → chunk-5LWYX4GV.js.map} +1 -1
  21. package/dist/{chunk-7AJGUI7L.cjs → chunk-5NVGKXJV.cjs} +34 -17
  22. package/dist/chunk-5NVGKXJV.cjs.map +1 -0
  23. package/dist/{chunk-D4KWNDPH.cjs → chunk-66QSUUB4.cjs} +12 -12
  24. package/dist/{chunk-D4KWNDPH.cjs.map → chunk-66QSUUB4.cjs.map} +1 -1
  25. package/dist/{chunk-KHH54GRP.cjs → chunk-6ET3KDO4.cjs} +15 -338
  26. package/dist/chunk-6ET3KDO4.cjs.map +1 -0
  27. package/dist/{chunk-ZI3QDUHO.js → chunk-AT53ZQUC.js} +3 -3
  28. package/dist/{chunk-ZI3QDUHO.js.map → chunk-AT53ZQUC.js.map} +1 -1
  29. package/dist/chunk-BMDOPJBP.cjs +185 -0
  30. package/dist/chunk-BMDOPJBP.cjs.map +1 -0
  31. package/dist/{chunk-PJJAZQVZ.js → chunk-BNR5FKL5.js} +3 -3
  32. package/dist/{chunk-PJJAZQVZ.js.map → chunk-BNR5FKL5.js.map} +1 -1
  33. package/dist/{chunk-5OBTGNUQ.cjs → chunk-E62W5I6A.cjs} +298 -2
  34. package/dist/chunk-E62W5I6A.cjs.map +1 -0
  35. package/dist/{chunk-GTWUS6MQ.cjs → chunk-EFYWV2V5.cjs} +61 -61
  36. package/dist/{chunk-GTWUS6MQ.cjs.map → chunk-EFYWV2V5.cjs.map} +1 -1
  37. package/dist/chunk-F6XIH3TZ.cjs +168 -0
  38. package/dist/chunk-F6XIH3TZ.cjs.map +1 -0
  39. package/dist/{chunk-NIAFR5EE.js → chunk-FGBGKBML.js} +32 -3
  40. package/dist/chunk-FGBGKBML.js.map +1 -0
  41. package/dist/{chunk-YQV53HRR.cjs → chunk-G2G7XGFU.cjs} +7 -7
  42. package/dist/{chunk-YQV53HRR.cjs.map → chunk-G2G7XGFU.cjs.map} +1 -1
  43. package/dist/{chunk-7KQ6W5DS.js → chunk-GF7ZA26H.js} +4 -4
  44. package/dist/{chunk-7KQ6W5DS.js.map → chunk-GF7ZA26H.js.map} +1 -1
  45. package/dist/{chunk-SPAHI7DY.cjs → chunk-GNLA5NTT.cjs} +4 -4
  46. package/dist/{chunk-SPAHI7DY.cjs.map → chunk-GNLA5NTT.cjs.map} +1 -1
  47. package/dist/{chunk-VPTA4Z7G.js → chunk-GTBW2KAY.js} +5 -5
  48. package/dist/{chunk-VPTA4Z7G.js.map → chunk-GTBW2KAY.js.map} +1 -1
  49. package/dist/{chunk-CHS2SIP6.cjs → chunk-HTDKEYMY.cjs} +90 -76
  50. package/dist/chunk-HTDKEYMY.cjs.map +1 -0
  51. package/dist/{chunk-EXEVT6D2.cjs → chunk-IWUW3YPM.cjs} +5 -5
  52. package/dist/{chunk-EXEVT6D2.cjs.map → chunk-IWUW3YPM.cjs.map} +1 -1
  53. package/dist/{chunk-ACZZHHFZ.cjs → chunk-JTYCJ5OL.cjs} +44 -22
  54. package/dist/chunk-JTYCJ5OL.cjs.map +1 -0
  55. package/dist/{chunk-HDPJNNMF.cjs → chunk-M5QY464F.cjs} +21 -21
  56. package/dist/{chunk-HDPJNNMF.cjs.map → chunk-M5QY464F.cjs.map} +1 -1
  57. package/dist/{chunk-DZ4IOP3Q.js → chunk-MVXZP6VB.js} +281 -3
  58. package/dist/chunk-MVXZP6VB.js.map +1 -0
  59. package/dist/{chunk-Y4GCJJPF.cjs → chunk-NYZQOIXJ.cjs} +35 -2
  60. package/dist/chunk-NYZQOIXJ.cjs.map +1 -0
  61. package/dist/{chunk-KB2SQAR3.js → chunk-OFQ6CU6S.js} +3 -3
  62. package/dist/{chunk-KB2SQAR3.js.map → chunk-OFQ6CU6S.js.map} +1 -1
  63. package/dist/{chunk-36VWLB4J.js → chunk-OXBU5AGH.js} +3 -3
  64. package/dist/{chunk-36VWLB4J.js.map → chunk-OXBU5AGH.js.map} +1 -1
  65. package/dist/{chunk-CHTZZRAL.cjs → chunk-OXTF4Y3P.cjs} +6 -6
  66. package/dist/{chunk-CHTZZRAL.cjs.map → chunk-OXTF4Y3P.cjs.map} +1 -1
  67. package/dist/{chunk-3AYM47GW.js → chunk-PAUWEWTY.js} +99 -9
  68. package/dist/chunk-PAUWEWTY.js.map +1 -0
  69. package/dist/{chunk-FHGRKQVZ.cjs → chunk-PGDR7CO3.cjs} +8 -8
  70. package/dist/{chunk-FHGRKQVZ.cjs.map → chunk-PGDR7CO3.cjs.map} +1 -1
  71. package/dist/{chunk-W6VJAUGM.cjs → chunk-PJAJCFLP.cjs} +94 -37
  72. package/dist/chunk-PJAJCFLP.cjs.map +1 -0
  73. package/dist/{chunk-IYSOVS7O.js → chunk-RVQW623D.js} +31 -13
  74. package/dist/chunk-RVQW623D.js.map +1 -0
  75. package/dist/{chunk-TPQJKS7D.js → chunk-SCDE676D.js} +21 -7
  76. package/dist/{chunk-CHS2SIP6.cjs.map → chunk-SCDE676D.js.map} +1 -1
  77. package/dist/chunk-SW5ZD7BO.js +143 -0
  78. package/dist/chunk-SW5ZD7BO.js.map +1 -0
  79. package/dist/{chunk-T2OVDF2M.cjs → chunk-T4GIHHXY.cjs} +6 -6
  80. package/dist/{chunk-T2OVDF2M.cjs.map → chunk-T4GIHHXY.cjs.map} +1 -1
  81. package/dist/{chunk-QYU7J5EQ.js → chunk-V6OXSXIX.js} +29 -18
  82. package/dist/chunk-V6OXSXIX.js.map +1 -0
  83. package/dist/{chunk-W7KHHNZR.js → chunk-VBP4DH37.js} +61 -9
  84. package/dist/chunk-VBP4DH37.js.map +1 -0
  85. package/dist/{chunk-67CMMTLN.cjs → chunk-WZG6GZIL.cjs} +4 -4
  86. package/dist/{chunk-67CMMTLN.cjs.map → chunk-WZG6GZIL.cjs.map} +1 -1
  87. package/dist/{chunk-O4RPXBDZ.cjs → chunk-X2YHKP4D.cjs} +8 -8
  88. package/dist/{chunk-O4RPXBDZ.cjs.map → chunk-X2YHKP4D.cjs.map} +1 -1
  89. package/dist/{chunk-OBOOHG3N.js → chunk-XEPKONJC.js} +3 -3
  90. package/dist/{chunk-OBOOHG3N.js.map → chunk-XEPKONJC.js.map} +1 -1
  91. package/dist/{chunk-O7RZRUMZ.js → chunk-XJWED257.js} +14 -309
  92. package/dist/chunk-XJWED257.js.map +1 -0
  93. package/dist/chunk-XSSLNINL.js +346 -0
  94. package/dist/chunk-XSSLNINL.js.map +1 -0
  95. package/dist/{chunk-4IUE2JB7.js → chunk-Z77M7Q2R.js} +3 -3
  96. package/dist/{chunk-4IUE2JB7.js.map → chunk-Z77M7Q2R.js.map} +1 -1
  97. package/dist/entries/apps.cjs +42 -42
  98. package/dist/entries/apps.js +7 -7
  99. package/dist/entries/captions.d.cts +1 -1
  100. package/dist/entries/captions.d.ts +1 -1
  101. package/dist/entries/credits.cjs +230 -214
  102. package/dist/entries/credits.d.cts +51 -14
  103. package/dist/entries/credits.d.ts +51 -14
  104. package/dist/entries/credits.js +10 -10
  105. package/dist/entries/entities.cjs +202 -193
  106. package/dist/entries/entities.d.cts +44 -9
  107. package/dist/entries/entities.d.ts +44 -9
  108. package/dist/entries/entities.js +2 -1
  109. package/dist/entries/llm-models.cjs +86 -62
  110. package/dist/entries/llm-models.d.cts +46 -15
  111. package/dist/entries/llm-models.d.ts +46 -15
  112. package/dist/entries/llm-models.js +2 -2
  113. package/dist/entries/media.cjs +79 -63
  114. package/dist/entries/media.d.cts +154 -1
  115. package/dist/entries/media.d.ts +154 -1
  116. package/dist/entries/media.js +1 -1
  117. package/dist/entries/model-catalog.cjs +175 -119
  118. package/dist/entries/model-catalog.d.cts +4 -54
  119. package/dist/entries/model-catalog.d.ts +4 -54
  120. package/dist/entries/model-catalog.js +4 -4
  121. package/dist/entries/models.cjs +503 -358
  122. package/dist/entries/models.d.cts +86 -7
  123. package/dist/entries/models.d.ts +86 -7
  124. package/dist/entries/models.js +6 -5
  125. package/dist/entries/nodes.cjs +212 -212
  126. package/dist/entries/nodes.d.cts +1 -1
  127. package/dist/entries/nodes.d.ts +1 -1
  128. package/dist/entries/nodes.js +8 -8
  129. package/dist/entries/pipeline.cjs +153 -153
  130. package/dist/entries/pipeline.d.cts +3 -3
  131. package/dist/entries/pipeline.d.ts +3 -3
  132. package/dist/entries/pipeline.js +3 -3
  133. package/dist/entries/social.cjs +177 -177
  134. package/dist/entries/social.js +2 -2
  135. package/dist/entries/ugc.cjs +71 -71
  136. package/dist/entries/ugc.js +4 -4
  137. package/dist/entries/video.cjs +174 -145
  138. package/dist/entries/video.d.cts +119 -2
  139. package/dist/entries/video.d.ts +119 -2
  140. package/dist/entries/video.js +7 -6
  141. package/dist/entries/workflow.d.cts +1 -1
  142. package/dist/entries/workflow.d.ts +1 -1
  143. package/dist/index.cjs +2086 -1793
  144. package/dist/index.d.cts +10 -9
  145. package/dist/index.d.ts +10 -9
  146. package/dist/index.js +24 -23
  147. package/dist/{model-catalog-Cf9fkEUp.d.ts → model-catalog-B-aQnUS8.d.cts} +186 -2
  148. package/dist/{model-catalog-Cf9fkEUp.d.cts → model-catalog-B-aQnUS8.d.ts} +186 -2
  149. package/dist/{model-constants-C_Nyft_i.d.cts → model-constants-BstsUup6.d.cts} +105 -6
  150. package/dist/{model-constants-BxjiWVQ9.d.ts → model-constants-DZ3tPGFO.d.ts} +105 -6
  151. package/dist/tts-capabilities-BJ4N8MIB.d.ts +133 -0
  152. package/dist/tts-capabilities-Cf_4nu1Z.d.cts +133 -0
  153. package/package.json +1 -1
  154. package/src/__tests__/dialogue-capabilities.test.ts +167 -6
  155. package/src/__tests__/extend-providers.test.ts +87 -0
  156. package/src/__tests__/flux-3-klein.test.ts +51 -3
  157. package/src/__tests__/image-run-limit.test.ts +96 -0
  158. package/src/__tests__/kling4-catalog.test.ts +1 -1
  159. package/src/__tests__/llm-models.test.ts +41 -4
  160. package/src/__tests__/seedream-5-5.test.ts +17 -0
  161. package/src/__tests__/speech-pricing.test.ts +62 -1
  162. package/src/__tests__/tts-capabilities.test.ts +160 -4
  163. package/src/__tests__/video-analysis-pricing.test.ts +13 -1
  164. package/src/__tests__/video-subjects.test.ts +209 -0
  165. package/src/__tests__/wired-character-names.test.ts +142 -0
  166. package/src/credit-estimators/index.ts +4 -0
  167. package/src/credit-estimators/speech.ts +57 -9
  168. package/src/credit-identifiers.ts +48 -13
  169. package/src/dialogue-capabilities.ts +220 -3
  170. package/src/dubbing-structure.ts +186 -0
  171. package/src/entries/entities.ts +2 -0
  172. package/src/entries/llm-models.ts +7 -0
  173. package/src/entries/media.ts +3 -1
  174. package/src/entries/model-catalog.ts +17 -0
  175. package/src/entries/models.ts +43 -0
  176. package/src/entries/video.ts +8 -1
  177. package/src/gemini-tts.ts +144 -0
  178. package/src/llm-models.ts +71 -21
  179. package/src/model-catalog.ts +283 -2
  180. package/src/model-constants.ts +167 -8
  181. package/src/tts-capabilities.ts +193 -1
  182. package/src/video-analysis-pricing.ts +11 -0
  183. package/src/video-character-refs.ts +165 -3
  184. package/src/wired-character-names.ts +134 -18
  185. package/src/wired-character-video-subjects.ts +63 -0
  186. package/dist/chunk-3AYM47GW.js.map +0 -1
  187. package/dist/chunk-5OBTGNUQ.cjs.map +0 -1
  188. package/dist/chunk-6YIV37V7.js +0 -31
  189. package/dist/chunk-6YIV37V7.js.map +0 -1
  190. package/dist/chunk-7AJGUI7L.cjs.map +0 -1
  191. package/dist/chunk-ACZZHHFZ.cjs.map +0 -1
  192. package/dist/chunk-AZNZ5WNZ.cjs.map +0 -1
  193. package/dist/chunk-DZ4IOP3Q.js.map +0 -1
  194. package/dist/chunk-IYSOVS7O.js.map +0 -1
  195. package/dist/chunk-KHH54GRP.cjs.map +0 -1
  196. package/dist/chunk-NIAFR5EE.js.map +0 -1
  197. package/dist/chunk-O7RZRUMZ.js.map +0 -1
  198. package/dist/chunk-QYU7J5EQ.js.map +0 -1
  199. package/dist/chunk-S3UGLZSF.js +0 -42
  200. package/dist/chunk-S3UGLZSF.js.map +0 -1
  201. package/dist/chunk-TPQJKS7D.js.map +0 -1
  202. package/dist/chunk-TQW3R44P.cjs +0 -38
  203. package/dist/chunk-TQW3R44P.cjs.map +0 -1
  204. package/dist/chunk-VZ6TE23U.cjs +0 -54
  205. package/dist/chunk-VZ6TE23U.cjs.map +0 -1
  206. package/dist/chunk-W6VJAUGM.cjs.map +0 -1
  207. package/dist/chunk-W7KHHNZR.js.map +0 -1
  208. package/dist/chunk-Y4GCJJPF.cjs.map +0 -1
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Google's Gemini text-to-speech models (served through KIE): the facts their
3
+ * capability sheets are built from. DATA only — each list is what the model
4
+ * accepts on the wire, so the catalog, the routes, the editor and any client
5
+ * read one place instead of copying a table that drifts.
6
+ *
7
+ * Two generations with different inputs:
8
+ * - 3.8 (Flash-Lite, Flash): 70 named voices grouped by use, `<angle>` tone
9
+ * tags from a closed list, and a free-text style per line.
10
+ * - 3.1 Flash and 2.5 Pro: 30 named voices, `[square]` tone tags written
11
+ * freely, and per-speaker style, pace, accent and audio profile.
12
+ * Neither takes a language field: the language follows the text.
13
+ */
14
+
15
+ /** What a Gemini 3.8 voice is meant for, as KIE groups them. A stable id; clients translate it. */
16
+ export const GEMINI_TTS_VOICE_GROUPS = [
17
+ "tutor",
18
+ "commercial-voiceover",
19
+ "instructional",
20
+ "podcast",
21
+ "storyteller",
22
+ "digital-assistant",
23
+ "call-center",
24
+ "concierge",
25
+ "tech-support",
26
+ "professional",
27
+ ] as const
28
+ export type GeminiTtsVoiceGroup = (typeof GEMINI_TTS_VOICE_GROUPS)[number]
29
+
30
+ /** A named voice a speech model speaks: its wire name (the id a request sends), and what it is meant for when the model groups its voices. */
31
+ export interface TtsNamedVoice {
32
+ readonly id: string
33
+ readonly group?: GeminiTtsVoiceGroup
34
+ }
35
+
36
+ /** Gemini 3.8's 70 voices, in KIE's order, by use. */
37
+ const GEMINI_3_8_VOICES_BY_GROUP: Readonly<Record<GeminiTtsVoiceGroup, readonly string[]>> = {
38
+ "tutor": ["Bodi", "Lumi", "Sadaltager", "Sola", "Sulafat", "Varo", "Zephyr"],
39
+ "commercial-voiceover": ["Koda", "Kore", "Nika", "Tavi", "Zeno"],
40
+ "instructional": ["Algenib", "Despina", "Erinome", "Kira", "Ludo", "Mako", "Rasalgethi", "Rina"],
41
+ "podcast": ["Alnilam", "Brio", "Jori", "Laomedeia", "Rami", "Veda"],
42
+ "storyteller": ["Achird", "Enzo", "Riko", "Sami", "Zali", "Zubenelgenubi"],
43
+ "digital-assistant": ["Algieba", "Aoede", "Autonoe", "Callirrhoe", "Enceladus", "Gero", "Iapetus", "Neno", "Olin", "Tari", "Umbriel"],
44
+ "call-center": ["Achernar", "Charon", "Daro", "Fola", "Hali", "Milo", "Puck"],
45
+ "concierge": ["Arlo", "Cleo", "Fenrir", "Finn", "Leda", "Lora", "Orus"],
46
+ "tech-support": ["Enya", "Jett", "Knox", "Nyla", "Sadachbia", "Vindemiatrix"],
47
+ "professional": ["Cruz", "Elio", "Gacrux", "Pulcherrima", "Schedar", "Tova", "Zuri"],
48
+ }
49
+
50
+ export const GEMINI_3_8_TTS_VOICES: readonly TtsNamedVoice[] = GEMINI_TTS_VOICE_GROUPS.flatMap((group) =>
51
+ GEMINI_3_8_VOICES_BY_GROUP[group].map((id) => ({ id, group })),
52
+ )
53
+
54
+ /** Gemini 3.1 Flash's and 2.5 Pro's 30 voices (one list for both), alphabetical as KIE lists them. */
55
+ export const GEMINI_3_1_TTS_VOICES: readonly TtsNamedVoice[] = [
56
+ "Achernar", "Achird", "Algenib", "Algieba", "Alnilam", "Aoede", "Autonoe", "Callirrhoe", "Charon", "Despina",
57
+ "Enceladus", "Erinome", "Fenrir", "Gacrux", "Iapetus", "Kore", "Laomedeia", "Leda", "Orus", "Puck",
58
+ "Pulcherrima", "Rasalgethi", "Sadachbia", "Sadaltager", "Schedar", "Sulafat", "Umbriel", "Vindemiatrix", "Zephyr", "Zubenelgenubi",
59
+ ].map((id) => ({ id }))
60
+
61
+ /** The voice a 3.8 request runs with when it names none — KIE's own default. */
62
+ export const GEMINI_3_8_DEFAULT_VOICE = "Fola"
63
+ /** The voice a 3.1 / 2.5 request runs with when it names none (3.8's default is not on their list). */
64
+ export const GEMINI_3_1_DEFAULT_VOICE = "Kore"
65
+
66
+ /**
67
+ * The tone tags Gemini 3.8 performs, by their own names. A request writes them
68
+ * in angle brackets (`<laugh>`); the platform's `[square]` tags are rewritten
69
+ * to these where they match, and every other tag is taken out
70
+ * (`@nodaro/prompts` `toAngleTags`).
71
+ */
72
+ export const GEMINI_3_8_TONE_TAGS = [
73
+ "argh", "breath", "cackle", "cheer", "chuckle", "chuckles", "cough", "cry", "exhales", "gasp",
74
+ "giggle", "groan", "growl", "grr", "grunt", "heavy breath", "hiss", "laugh", "laughter", "long pause",
75
+ "moan", "pant", "pff", "phew", "scream", "short pause", "shout", "shriek", "sigh", "sighs",
76
+ "sneeze", "snicker", "snort", "sob", "throat-clearing", "tsk", "whimper", "whispering", "whispers", "yawn",
77
+ ] as const
78
+
79
+ /** Gemini 3.1 / 2.5's speaking styles (one per request: the speaker's). */
80
+ export const GEMINI_3_1_TTS_STYLES = ["Vocal Smile", "Newscaster", "Whisper", "Empathetic", "Promo/Hype", "Deadpan"] as const
81
+ /** Gemini 3.1 / 2.5's paces. */
82
+ export const GEMINI_3_1_TTS_PACES = ["Natural", "Rapid Fire", "The Drift", "Staccato"] as const
83
+ /** Gemini 3.1 / 2.5's accents. */
84
+ export const GEMINI_3_1_TTS_ACCENTS = [
85
+ "Neutral",
86
+ "American (Gen)",
87
+ "American (Valley)",
88
+ "American (South)",
89
+ "British (RP)",
90
+ "British (Brixton)",
91
+ "Transatlantic",
92
+ "Australian",
93
+ ] as const
94
+
95
+ /**
96
+ * The longest free-text direction a request may carry (3.8's style, 3.1 /
97
+ * 2.5's audio profile). The provider names no limit; a direction is a
98
+ * sentence or two, and this keeps a request from carrying a script's worth of
99
+ * unbilled text (decided 2026-11-12: style text is not billed).
100
+ */
101
+ export const TTS_DIRECTION_MAX_CHARS = 1000
102
+
103
+ /**
104
+ * Per-request text cap of every Gemini speech model: the provider's limit on
105
+ * one turn's text. Taken from its schema, not measured.
106
+ */
107
+ export const GEMINI_TTS_MAX_CHARS = 10000
108
+
109
+ /**
110
+ * A one-off clone of a speaker's voice for ONE request (KIE's `replica`, Gemini
111
+ * 3.8 Flash; decided 2026-11-13): two WAV recordings of the same adult — a
112
+ * reference of natural speech and a consent recording of the owner reading
113
+ * {@link REPLICA_CONSENT_SENTENCE} — sent in place of a named voice. Nothing is
114
+ * saved as a voice. Each is an https link.
115
+ */
116
+ export interface TtsReplica {
117
+ readonly sourceAudioUrl: string
118
+ readonly consentAudioUrl: string
119
+ }
120
+
121
+ /** The most bytes either recording may have (KIE: 10 MB per file). */
122
+ export const REPLICA_MAX_BYTES = 10 * 1024 * 1024
123
+ /** The reference recording's length, in seconds (KIE: 10–30 s of natural speech). */
124
+ export const REPLICA_SOURCE_MIN_SEC = 10
125
+ export const REPLICA_SOURCE_MAX_SEC = 30
126
+ /** The consent recording's most seconds (one sentence; KIE sets no range for it). */
127
+ export const REPLICA_CONSENT_MAX_SEC = 30
128
+ /** The sentence the voice's owner reads in the consent recording (KIE's; other supported languages' versions are accepted too). */
129
+ export const REPLICA_CONSENT_SENTENCE = "I am the owner of this voice and I consent to Google using this voice to create a synthetic voice model."
130
+
131
+ /**
132
+ * What a caller confirms for a one-off clone (decided 2026-11-13): the editor's
133
+ * consent checkbox says it, and an API or MCP request says it with
134
+ * `replica.consent: true`. A clone without it is refused before anything is
135
+ * read or held.
136
+ */
137
+ export const REPLICA_CONSENT_ATTESTATION =
138
+ "I confirm the voice in these recordings is my own, or that its owner, an adult, has given me consent to clone it for this generation, and that neither recording is AI-generated."
139
+
140
+ /** A one-off clone as an API or MCP request sends it: the two recordings and the caller's consent (`REPLICA_CONSENT_ATTESTATION`). */
141
+ export interface TtsReplicaRequest extends TtsReplica {
142
+ readonly consent: true
143
+ }
144
+
package/src/llm-models.ts CHANGED
@@ -167,8 +167,8 @@ export interface LlmModelDef {
167
167
  * and every estimate surface quotes that call. The sizes themselves are
168
168
  * backend data (`backend/src/lib/pricing/llm-cost.ts`), held to this flag by
169
169
  * a backend test. No model sets it today (GPT-6.1 Terra did for part of
170
- * 2026-11-12, until its aggregator's added input stopped depending on the
171
- * effort).
170
+ * 2026-11-12; since 2026-11-13 its added input is counted at the ceiling it
171
+ * has been seen at, the same with or without an effort).
172
172
  */
173
173
  effortPriced?: true
174
174
  /**
@@ -939,11 +939,11 @@ export const LLM_MODELS: readonly LlmModelDef[] = [
939
939
  //
940
940
  // KIE's endpoint adds its own instructions to every call and counts them as
941
941
  // input. The hold and the estimate count them too
942
- // (backend/src/lib/pricing/llm-cost.ts, `llmLaneAddedInputTokens`). They
943
- // were several times larger with an effort sent on the morning of
944
- // 2026-11-12 and the same size either way by that afternoon, so its price
945
- // does not depend on the effort: not `effortPriced` (re-measure if KIE's
946
- // reported input jumps again).
942
+ // (backend/src/lib/pricing/llm-cost.ts, `llmLaneAddedInputTokens`). Their
943
+ // size has moved (about 4,400 and about 25,500 tokens on the same request,
944
+ // 2026-11-12/13), so both count the ceiling, with or without an effort
945
+ // (decided 2026-11-13): its price does not depend on the effort, so not
946
+ // `effortPriced`. The charge follows what KIE states or reports.
947
947
  kieSlugOrModel: "gpt-6-1-terra",
948
948
  vendor: "openai",
949
949
  structuredOutputMode: "responses-json-schema",
@@ -1566,8 +1566,13 @@ export function defaultReasoningEffort(feature: string, modelId?: string): LlmRe
1566
1566
  * no video). Gemini 2/3 family supports image + video + audio natively.
1567
1567
  * GPT-5.x via KIE chat-completions / responses supports image only — audio
1568
1568
  * input requires a separate audio-capable model we don't route to today.
1569
+ *
1570
+ * `file` (decided 2026-11-13): the model reads documents (PDF) sent with the
1571
+ * call. Declared on the one model that does — GPT-6.1 Terra — and never
1572
+ * derived for any other: absent means no. Read it through
1573
+ * {@link llmAcceptsFiles}.
1569
1574
  */
1570
- export const LLM_MODALITY_CAPS: Record<string, { image: boolean; video: boolean; audio: boolean }> = {
1575
+ export const LLM_MODALITY_CAPS: Record<string, LlmModalityCaps> = {
1571
1576
  // Keeps full caps after KIE dropped its channel (2026-11-13): it stays a
1572
1577
  // VIDEO_ANALYSIS_LLM_MODELS member as the legacy `fast` backing (below), so a
1573
1578
  // stored raw `llmModel: "gemini-3-flash"` still resolves and prices under its
@@ -1594,12 +1599,13 @@ export const LLM_MODALITY_CAPS: Record<string, { image: boolean; video: boolean;
1594
1599
  // video-analysis tier + pricing decision. That waits on a Video Analysis
1595
1600
  // bake-off; flip these two flags ONLY together with its outcome.
1596
1601
  "gemini-4-argon": { image: true, video: false, audio: false },
1597
- // gemini-4-carbon is IMAGE-ONLY for now, by decision (2026-11-12): the model
1598
- // reads video and audio, but full caps would auto-enroll it in
1599
- // VIDEO_ANALYSIS_LLM_MODELS (derived below). Its video + audio input comes in
1600
- // a follow-up change that also decides its Video Analysis enrolment; flip
1601
- // these two flags ONLY together with that.
1602
- "gemini-4-carbon": { image: true, video: false, audio: false },
1602
+ // gemini-4-carbon takes video + audio (decided 2026-11-13): it backs the
1603
+ // video-analysis `ultra` tier (VIDEO_ANALYSIS_TIERS below), which is what
1604
+ // enrols it in VIDEO_ANALYSIS_LLM_MODELS. The same caps let LLM Chat send it
1605
+ // video and audio references, and let a trend's LLM step that reads the clip
1606
+ // choose it (modelReadsClip) — both intended. It was image-only from
1607
+ // 2026-11-12 until this enrolment was decided.
1608
+ "gemini-4-carbon": { image: true, video: true, audio: true },
1603
1609
  "claude-haiku-4.5": { image: true, video: false, audio: false },
1604
1610
  "claude-haiku-5.5": { image: true, video: false, audio: false },
1605
1611
  "claude-sonnet-4.6": { image: true, video: false, audio: false },
@@ -1616,8 +1622,9 @@ export const LLM_MODALITY_CAPS: Record<string, { image: boolean; video: boolean;
1616
1622
  "gpt-6-luna": { image: true, video: false, audio: false },
1617
1623
  "gpt-6-sol": { image: true, video: false, audio: false },
1618
1624
  "gpt-6.1-sol": { image: true, video: false, audio: false },
1619
- // KIE's doc also takes files (PDFs, documents); that input is not wired here.
1620
- "gpt-6.1-terra": { image: true, video: false, audio: false },
1625
+ // Reads PDFs (`file`, probed 2026-11-13: KIE took a PDF inline and by link,
1626
+ // and refused a text file and a Word file — so PDF only).
1627
+ "gpt-6.1-terra": { image: true, video: false, audio: false, file: true },
1621
1628
  "grok-4.6": { image: true, video: false, audio: false },
1622
1629
  "grok-4.7": { image: true, video: false, audio: false },
1623
1630
  "claude-sonnet-5": { image: true, video: false, audio: false },
@@ -1633,11 +1640,49 @@ export const LLM_MODALITY_CAPS: Record<string, { image: boolean; video: boolean;
1633
1640
  }
1634
1641
 
1635
1642
  /** Capability lookup with safe default — unknown models get image-only. */
1636
- export function getLlmModalityCaps(modelId: string | undefined): { image: boolean; video: boolean; audio: boolean } {
1643
+ export function getLlmModalityCaps(modelId: string | undefined): LlmModalityCaps {
1637
1644
  if (!modelId) return { image: true, video: false, audio: false }
1638
1645
  return LLM_MODALITY_CAPS[modelId] ?? { image: true, video: false, audio: false }
1639
1646
  }
1640
1647
 
1648
+ /** What a model reads besides text (see {@link LLM_MODALITY_CAPS}). */
1649
+ export interface LlmModalityCaps {
1650
+ image: boolean
1651
+ video: boolean
1652
+ audio: boolean
1653
+ /** Documents (PDF). Set only where it is true. */
1654
+ file?: true
1655
+ }
1656
+
1657
+ /** Does `modelId` read documents sent with the call (`file` in its modality caps)? An unknown model does not. */
1658
+ export function llmAcceptsFiles(modelId: string | undefined): boolean {
1659
+ return Boolean(modelId && LLM_MODALITY_CAPS[modelId]?.file)
1660
+ }
1661
+
1662
+ /** The models that read documents, in registry order — what a refusal names. */
1663
+ export const LLM_FILE_MODELS: readonly LlmModelDef[] = LLM_MODELS.filter((m) => llmAcceptsFiles(m.id))
1664
+
1665
+ /** The most documents one LLM call takes (`referenceFileUrls`). */
1666
+ export const LLM_REFERENCE_FILES_MAX = 5
1667
+
1668
+ /**
1669
+ * The most bytes the documents of one LLM call may total: 6 MiB. They are sent
1670
+ * inline with the call, which carries about ten million characters in all,
1671
+ * and base64 makes 6 MiB about 8.4 million of them (the rest is the call's
1672
+ * images').
1673
+ */
1674
+ export const LLM_REFERENCE_FILES_MAX_TOTAL_BYTES = 6 * 1024 * 1024
1675
+
1676
+ /**
1677
+ * The most pages the documents of one LLM call may have IN ALL (decided
1678
+ * 2026-11-13: 100 for the whole call, not per file, until a probe shows the
1679
+ * aggregator reads more in one call).
1680
+ */
1681
+ export const LLM_REFERENCE_FILES_MAX_PAGES = 100
1682
+
1683
+ /** The document types an LLM call takes: PDF only (the aggregator refused text and Word files, 2026-11-13). */
1684
+ export const LLM_REFERENCE_FILE_MIME_TYPES: readonly string[] = ["application/pdf"]
1685
+
1641
1686
  /**
1642
1687
  * Dash-form aliases resolve to their canonical dot-form ids. Several wire
1643
1688
  * contracts carry dash forms (`PIPELINE_PINNABLE_SCRIPT_LLMS`, provider slugs,
@@ -1997,8 +2042,12 @@ export const VIDEO_ANALYSIS_LLM_MODELS: string[] = LLM_MODELS
1997
2042
  * (video-analysis-pricing.test.ts) asserts every tier target is a real
1998
2043
  * VIDEO_ANALYSIS_LLM_MODELS member AND every such model is reachable by a tier,
1999
2044
  * so adding a video model forces a tier decision instead of silently leaking.
2045
+ *
2046
+ * `ultra` (decided 2026-11-13) reads every window with the deepest-reasoning
2047
+ * analysis model, at the same frame sampling as the other single-model tiers.
2048
+ * It is priced between the mixed tiers and `smart`.
2000
2049
  */
2001
- export const VIDEO_ANALYSIS_TIERS = { fast: "gemini-3.8-flash", pro: "gemini-3.1-pro" } as const
2050
+ export const VIDEO_ANALYSIS_TIERS = { fast: "gemini-3.8-flash", pro: "gemini-3.1-pro", ultra: "gemini-4-carbon" } as const
2002
2051
  export type VideoAnalysisModelTier = keyof typeof VIDEO_ANALYSIS_TIERS
2003
2052
  /**
2004
2053
  * Models that PREVIOUSLY backed a tier, mapped to the tier they backed.
@@ -2054,14 +2103,15 @@ export type VideoAnalysisMixedTier = (typeof VIDEO_ANALYSIS_MIXED_TIERS)[number]
2054
2103
  * As with the mixed sentinels, what the plan does internally is deliberately not
2055
2104
  * published here; only the wire vocabulary is contract.
2056
2105
  */
2057
- /** UI/listing order — recommended (smart) first. */
2058
- export const VIDEO_ANALYSIS_TIER_ORDER = ["smart", "pro", "fast", "mixed", "mixed-fast"] as const
2106
+ /** UI/listing order — recommended (smart) first, then `ultra`, the other high-accuracy tier. */
2107
+ export const VIDEO_ANALYSIS_TIER_ORDER = ["smart", "ultra", "pro", "fast", "mixed", "mixed-fast"] as const
2059
2108
  export type VideoAnalysisTier = (typeof VIDEO_ANALYSIS_TIER_ORDER)[number]
2060
2109
  export const DEFAULT_VIDEO_ANALYSIS_TIER: VideoAnalysisTier = "pro"
2061
2110
  export const DEFAULT_VIDEO_ANALYSIS_MODEL: string = VIDEO_ANALYSIS_TIERS[DEFAULT_VIDEO_ANALYSIS_TIER]
2062
2111
  /** Neutral, vendor-free display labels for the UI. */
2063
2112
  export const VIDEO_ANALYSIS_TIER_LABELS: Record<VideoAnalysisTier, string> = {
2064
2113
  smart: "Smart",
2114
+ ultra: "Ultra",
2065
2115
  fast: "Fast",
2066
2116
  pro: "Pro",
2067
2117
  mixed: "Mixed",
@@ -2079,7 +2129,7 @@ export function isVideoAnalysisMixedTier(v: string): v is VideoAnalysisMixedTier
2079
2129
  /**
2080
2130
  * Resolve a user-supplied tier OR a raw internal model id to the analysis
2081
2131
  * ENGINE IDENTIFIER carried in the worker payload:
2082
- * - model-backed tiers ("fast"/"pro") → the internal model id;
2132
+ * - model-backed tiers ("fast"/"pro"/"ultra") → the internal model id;
2083
2133
  * - mixed tiers ("mixed"/"mixed-fast") → the sentinel ITSELF (the engine
2084
2134
  * expands it to a multi-model roll plan);
2085
2135
  * - raw model ids pass through (back-compat for stored `llmModel` values);