@nodaro/shared 3.69.0 → 3.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/{chunk-25C2E2GI.cjs → chunk-4A3ITJJB.cjs} +6 -6
  2. package/dist/{chunk-25C2E2GI.cjs.map → chunk-4A3ITJJB.cjs.map} +1 -1
  3. package/dist/{chunk-5EQRIUGI.cjs → chunk-4HV3LY4A.cjs} +78 -78
  4. package/dist/chunk-4HV3LY4A.cjs.map +1 -0
  5. package/dist/{chunk-PERUFUVH.cjs → chunk-5B337MCI.cjs} +15 -15
  6. package/dist/{chunk-PERUFUVH.cjs.map → chunk-5B337MCI.cjs.map} +1 -1
  7. package/dist/{chunk-7EQJIGVT.js → chunk-6FUVGATF.js} +3 -3
  8. package/dist/{chunk-7EQJIGVT.js.map → chunk-6FUVGATF.js.map} +1 -1
  9. package/dist/{chunk-WML66SUV.cjs → chunk-6PEWM2B3.cjs} +18 -18
  10. package/dist/{chunk-WML66SUV.cjs.map → chunk-6PEWM2B3.cjs.map} +1 -1
  11. package/dist/{chunk-KLEKJUQI.js → chunk-BO6IKV24.js} +5 -5
  12. package/dist/{chunk-KLEKJUQI.js.map → chunk-BO6IKV24.js.map} +1 -1
  13. package/dist/{chunk-KSHAAPQF.cjs → chunk-BOCHNFDU.cjs} +4 -4
  14. package/dist/chunk-BOCHNFDU.cjs.map +1 -0
  15. package/dist/{chunk-AH6OQXLW.js → chunk-BQV6NV7E.js} +3 -3
  16. package/dist/{chunk-AH6OQXLW.js.map → chunk-BQV6NV7E.js.map} +1 -1
  17. package/dist/{chunk-BDW25A7Y.js → chunk-BVP4M5AK.js} +247 -11
  18. package/dist/chunk-BVP4M5AK.js.map +1 -0
  19. package/dist/{chunk-ML55U7WM.js → chunk-C2UHX7OF.js} +3 -3
  20. package/dist/{chunk-ML55U7WM.js.map → chunk-C2UHX7OF.js.map} +1 -1
  21. package/dist/{chunk-Q2LEJXLZ.cjs → chunk-C32IL6RD.cjs} +2 -2
  22. package/dist/{chunk-Q2LEJXLZ.cjs.map → chunk-C32IL6RD.cjs.map} +1 -1
  23. package/dist/{chunk-5WHU7CYE.js → chunk-CL7ECTK2.js} +52 -7
  24. package/dist/chunk-CL7ECTK2.js.map +1 -0
  25. package/dist/{chunk-FUYBUT65.js → chunk-COA2OJIH.js} +51 -28
  26. package/dist/chunk-COA2OJIH.js.map +1 -0
  27. package/dist/{chunk-PLANUXQL.cjs → chunk-CV2BEK52.cjs} +25 -3
  28. package/dist/chunk-CV2BEK52.cjs.map +1 -0
  29. package/dist/{chunk-HW6TLOK4.cjs → chunk-DRPHRE4J.cjs} +2 -2
  30. package/dist/{chunk-HW6TLOK4.cjs.map → chunk-DRPHRE4J.cjs.map} +1 -1
  31. package/dist/{chunk-LZPG4XHT.js → chunk-F3XG5J5V.js} +3 -3
  32. package/dist/{chunk-LZPG4XHT.js.map → chunk-F3XG5J5V.js.map} +1 -1
  33. package/dist/{chunk-I6TBKTW3.cjs → chunk-H52P7DD2.cjs} +73 -73
  34. package/dist/{chunk-I6TBKTW3.cjs.map → chunk-H52P7DD2.cjs.map} +1 -1
  35. package/dist/{chunk-AGIG5HUU.cjs → chunk-HUCGHMOI.cjs} +17 -17
  36. package/dist/{chunk-AGIG5HUU.cjs.map → chunk-HUCGHMOI.cjs.map} +1 -1
  37. package/dist/{chunk-3AB3YIFM.cjs → chunk-I4C6ZYU4.cjs} +6 -6
  38. package/dist/{chunk-3AB3YIFM.cjs.map → chunk-I4C6ZYU4.cjs.map} +1 -1
  39. package/dist/{chunk-UVUHVY7F.js → chunk-JCYTTTM2.js} +2 -2
  40. package/dist/{chunk-UVUHVY7F.js.map → chunk-JCYTTTM2.js.map} +1 -1
  41. package/dist/{chunk-7OSUEYZ4.js → chunk-JPSKVBYB.js} +3 -3
  42. package/dist/{chunk-7OSUEYZ4.js.map → chunk-JPSKVBYB.js.map} +1 -1
  43. package/dist/{chunk-TAPBDT47.js → chunk-JVYDKXGY.js} +4 -4
  44. package/dist/{chunk-TAPBDT47.js.map → chunk-JVYDKXGY.js.map} +1 -1
  45. package/dist/{chunk-YT4ZTJVC.js → chunk-K2P7KOIT.js} +11 -11
  46. package/dist/{chunk-YT4ZTJVC.js.map → chunk-K2P7KOIT.js.map} +1 -1
  47. package/dist/{chunk-YVQFYW2U.js → chunk-K3YGI5IW.js} +25 -4
  48. package/dist/chunk-K3YGI5IW.js.map +1 -0
  49. package/dist/{chunk-4IMEJQVQ.cjs → chunk-K5WRF2F3.cjs} +4 -4
  50. package/dist/{chunk-4IMEJQVQ.cjs.map → chunk-K5WRF2F3.cjs.map} +1 -1
  51. package/dist/{chunk-TDU45K6Z.js → chunk-KD4UUCMW.js} +5 -5
  52. package/dist/{chunk-TDU45K6Z.js.map → chunk-KD4UUCMW.js.map} +1 -1
  53. package/dist/{chunk-UJREE6EQ.cjs → chunk-LBKMQAXD.cjs} +9 -9
  54. package/dist/{chunk-UJREE6EQ.cjs.map → chunk-LBKMQAXD.cjs.map} +1 -1
  55. package/dist/{chunk-XZYZYWKG.cjs → chunk-MI4WEFJ4.cjs} +21 -21
  56. package/dist/{chunk-XZYZYWKG.cjs.map → chunk-MI4WEFJ4.cjs.map} +1 -1
  57. package/dist/{chunk-RURPG6IS.cjs → chunk-MN7BUGXF.cjs} +7 -7
  58. package/dist/{chunk-RURPG6IS.cjs.map → chunk-MN7BUGXF.cjs.map} +1 -1
  59. package/dist/{chunk-54E2JO4E.cjs → chunk-NNCHSLFD.cjs} +309 -26
  60. package/dist/chunk-NNCHSLFD.cjs.map +1 -0
  61. package/dist/{chunk-6Q4BS6AR.js → chunk-NT3ZFUNJ.js} +31 -3
  62. package/dist/chunk-NT3ZFUNJ.js.map +1 -0
  63. package/dist/{chunk-G6AOKNAY.js → chunk-PPXUSZJU.js} +3 -3
  64. package/dist/{chunk-G6AOKNAY.js.map → chunk-PPXUSZJU.js.map} +1 -1
  65. package/dist/{chunk-6QJHSN6J.cjs → chunk-QCGSL4CJ.cjs} +4 -4
  66. package/dist/{chunk-6QJHSN6J.cjs.map → chunk-QCGSL4CJ.cjs.map} +1 -1
  67. package/dist/{chunk-DE55SA2X.js → chunk-QME5O4NG.js} +8 -6
  68. package/dist/chunk-QME5O4NG.js.map +1 -0
  69. package/dist/{chunk-KL6GAYTT.js → chunk-S6DXSQCV.js} +5 -3
  70. package/dist/chunk-S6DXSQCV.js.map +1 -0
  71. package/dist/{chunk-LSX2OFNB.js → chunk-SAOIGWA2.js} +3 -3
  72. package/dist/{chunk-LSX2OFNB.js.map → chunk-SAOIGWA2.js.map} +1 -1
  73. package/dist/{chunk-PHQVAPSD.js → chunk-SHSDGAI4.js} +29 -17
  74. package/dist/chunk-SHSDGAI4.js.map +1 -0
  75. package/dist/{chunk-QNPYYSLT.cjs → chunk-SR7WH4FX.cjs} +33 -33
  76. package/dist/{chunk-QNPYYSLT.cjs.map → chunk-SR7WH4FX.cjs.map} +1 -1
  77. package/dist/{chunk-OZA4DE23.js → chunk-SZ7ALYPK.js} +3 -3
  78. package/dist/{chunk-OZA4DE23.js.map → chunk-SZ7ALYPK.js.map} +1 -1
  79. package/dist/{chunk-DNWFFVC6.js → chunk-T4YYUI5Q.js} +3 -3
  80. package/dist/{chunk-DNWFFVC6.js.map → chunk-T4YYUI5Q.js.map} +1 -1
  81. package/dist/{chunk-ZWEVRMFN.cjs → chunk-TOYWEF6E.cjs} +51 -28
  82. package/dist/chunk-TOYWEF6E.cjs.map +1 -0
  83. package/dist/{chunk-V24EPI5N.cjs → chunk-U4DIGIC3.cjs} +5 -3
  84. package/dist/chunk-U4DIGIC3.cjs.map +1 -0
  85. package/dist/{chunk-NTCSXKZ3.cjs → chunk-U6APV2PO.cjs} +5 -5
  86. package/dist/{chunk-NTCSXKZ3.cjs.map → chunk-U6APV2PO.cjs.map} +1 -1
  87. package/dist/{chunk-7PC2YHBN.cjs → chunk-UJIPIVTB.cjs} +48 -48
  88. package/dist/{chunk-7PC2YHBN.cjs.map → chunk-UJIPIVTB.cjs.map} +1 -1
  89. package/dist/{chunk-H5KHWTAE.js → chunk-UY6QZX7H.js} +4 -4
  90. package/dist/chunk-UY6QZX7H.js.map +1 -0
  91. package/dist/{chunk-DBD4BCGH.cjs → chunk-VDFQKLDG.cjs} +33 -2
  92. package/dist/chunk-VDFQKLDG.cjs.map +1 -0
  93. package/dist/{chunk-OEOOXL3F.js → chunk-VZIMLPDC.js} +5 -5
  94. package/dist/chunk-VZIMLPDC.js.map +1 -0
  95. package/dist/{chunk-TWUFC32F.cjs → chunk-W4CJ2P3F.cjs} +8 -8
  96. package/dist/{chunk-TWUFC32F.cjs.map → chunk-W4CJ2P3F.cjs.map} +1 -1
  97. package/dist/{chunk-HP3YIWNJ.js → chunk-WARGPM7P.js} +2 -2
  98. package/dist/{chunk-HP3YIWNJ.js.map → chunk-WARGPM7P.js.map} +1 -1
  99. package/dist/{chunk-3OHRFSQL.cjs → chunk-WHK3HTFY.cjs} +73 -60
  100. package/dist/chunk-WHK3HTFY.cjs.map +1 -0
  101. package/dist/{chunk-5ZCZL73I.js → chunk-X3YRSRHP.js} +3 -3
  102. package/dist/{chunk-5ZCZL73I.js.map → chunk-X3YRSRHP.js.map} +1 -1
  103. package/dist/{chunk-OOUJZR4K.js → chunk-XK75VOEH.js} +5 -5
  104. package/dist/{chunk-OOUJZR4K.js.map → chunk-XK75VOEH.js.map} +1 -1
  105. package/dist/{chunk-LY6IR5LL.cjs → chunk-YHZUTPZL.cjs} +26 -24
  106. package/dist/{chunk-DE55SA2X.js.map → chunk-YHZUTPZL.cjs.map} +1 -1
  107. package/dist/{chunk-MGSGLRHZ.cjs → chunk-ZJQ2L3MI.cjs} +72 -11
  108. package/dist/chunk-ZJQ2L3MI.cjs.map +1 -0
  109. package/dist/entries/apps.cjs +43 -43
  110. package/dist/entries/apps.js +8 -8
  111. package/dist/entries/credits.cjs +426 -238
  112. package/dist/entries/credits.d.cts +277 -1
  113. package/dist/entries/credits.d.ts +277 -1
  114. package/dist/entries/credits.js +11 -11
  115. package/dist/entries/edl.cjs +60 -60
  116. package/dist/entries/edl.d.cts +96 -1
  117. package/dist/entries/edl.d.ts +96 -1
  118. package/dist/entries/edl.js +1 -1
  119. package/dist/entries/llm-models.cjs +76 -72
  120. package/dist/entries/llm-models.d.cts +38 -4
  121. package/dist/entries/llm-models.d.ts +38 -4
  122. package/dist/entries/llm-models.js +2 -2
  123. package/dist/entries/media.cjs +87 -87
  124. package/dist/entries/media.js +1 -1
  125. package/dist/entries/model-catalog.cjs +133 -133
  126. package/dist/entries/model-catalog.js +4 -4
  127. package/dist/entries/models.cjs +431 -415
  128. package/dist/entries/models.d.cts +62 -27
  129. package/dist/entries/models.d.ts +62 -27
  130. package/dist/entries/models.js +7 -7
  131. package/dist/entries/nodes.cjs +215 -215
  132. package/dist/entries/nodes.js +11 -11
  133. package/dist/entries/pipeline.cjs +153 -153
  134. package/dist/entries/pipeline.js +3 -3
  135. package/dist/entries/social.cjs +241 -177
  136. package/dist/entries/social.d.cts +189 -6
  137. package/dist/entries/social.d.ts +189 -6
  138. package/dist/entries/social.js +2 -2
  139. package/dist/entries/ugc.cjs +71 -71
  140. package/dist/entries/ugc.js +4 -4
  141. package/dist/entries/video.cjs +153 -153
  142. package/dist/entries/video.js +7 -7
  143. package/dist/entries/workflow.cjs +152 -152
  144. package/dist/entries/workflow.js +4 -4
  145. package/dist/index.cjs +2203 -1931
  146. package/dist/index.d.cts +5 -5
  147. package/dist/index.d.ts +5 -5
  148. package/dist/index.js +27 -27
  149. package/package.json +1 -1
  150. package/src/__tests__/audio-isolation-pricing.test.ts +49 -0
  151. package/src/__tests__/cast-swap-limits.test.ts +54 -20
  152. package/src/__tests__/competitors.test.ts +69 -0
  153. package/src/__tests__/credit-identifiers.test.ts +9 -10
  154. package/src/__tests__/lip-sync-pricing.test.ts +29 -2
  155. package/src/__tests__/llm-models.test.ts +50 -7
  156. package/src/__tests__/motion-transfer-pricing.test.ts +252 -0
  157. package/src/__tests__/suno-separate.test.ts +32 -0
  158. package/src/__tests__/video-to-video-pricing.test.ts +151 -0
  159. package/src/audio-isolation-pricing.ts +80 -0
  160. package/src/cast-swap-limits.ts +43 -25
  161. package/src/competitors.ts +86 -8
  162. package/src/credit-identifiers.ts +6 -0
  163. package/src/entries/credits.ts +56 -0
  164. package/src/entries/edl.ts +2 -0
  165. package/src/entries/llm-models.ts +2 -0
  166. package/src/entries/models.ts +4 -0
  167. package/src/entries/social.ts +34 -0
  168. package/src/generated/unit-contracts.ts +1 -0
  169. package/src/lip-sync-pricing.ts +25 -0
  170. package/src/llm-models.ts +60 -4
  171. package/src/model-catalog.ts +46 -23
  172. package/src/motion-transfer-pricing.ts +239 -0
  173. package/src/node-runtime-keys.ts +2 -2
  174. package/src/producer-types.ts +2 -0
  175. package/src/suno-separate.ts +51 -0
  176. package/src/topics.ts +162 -0
  177. package/src/use-case-output.ts +102 -0
  178. package/src/video-face-mesh.ts +1 -1
  179. package/src/video-to-video-pricing.ts +248 -0
  180. package/dist/chunk-3OHRFSQL.cjs.map +0 -1
  181. package/dist/chunk-54E2JO4E.cjs.map +0 -1
  182. package/dist/chunk-5EQRIUGI.cjs.map +0 -1
  183. package/dist/chunk-5WHU7CYE.js.map +0 -1
  184. package/dist/chunk-6Q4BS6AR.js.map +0 -1
  185. package/dist/chunk-BDW25A7Y.js.map +0 -1
  186. package/dist/chunk-DBD4BCGH.cjs.map +0 -1
  187. package/dist/chunk-FUYBUT65.js.map +0 -1
  188. package/dist/chunk-H5KHWTAE.js.map +0 -1
  189. package/dist/chunk-KL6GAYTT.js.map +0 -1
  190. package/dist/chunk-KSHAAPQF.cjs.map +0 -1
  191. package/dist/chunk-LY6IR5LL.cjs.map +0 -1
  192. package/dist/chunk-MGSGLRHZ.cjs.map +0 -1
  193. package/dist/chunk-OEOOXL3F.js.map +0 -1
  194. package/dist/chunk-PHQVAPSD.js.map +0 -1
  195. package/dist/chunk-PLANUXQL.cjs.map +0 -1
  196. package/dist/chunk-V24EPI5N.cjs.map +0 -1
  197. package/dist/chunk-YVQFYW2U.js.map +0 -1
  198. package/dist/chunk-ZWEVRMFN.cjs.map +0 -1
@@ -443,6 +443,19 @@ var LLM_MODELS = [
443
443
  // `models/gemini-4-hydrogen` (models.list, 2026-11-16: input 1,048,576,
444
444
  // output 65,536).
445
445
  directGeminiModel: "gemini-4-hydrogen",
446
+ // Reads PDF files (decided 2026-11-17). Measured on KIE 2026-11-17: a PDF
447
+ // is read only as an `image_url` part (a `data:application/pdf` URL, or an
448
+ // https link ending in `.pdf`); the `file` and `input_file` shapes are
449
+ // dropped, billed. Read correctly at 1, 5, 14 and 15 pages (facts from
450
+ // pages 2, 8 and 11), up to 2.2 MB by link and 1.36 million characters
451
+ // inline; 1,280 to 2,670 prompt tokens a page. Google's own API reads an
452
+ // inline `application/pdf` part (probed 2026-11-17, thinking LOW): the
453
+ // same three documents answered correctly with almost the same counts —
454
+ // 5 pages 13,332 prompt tokens (KIE 13,357), 14 pages 28,048 (28,068),
455
+ // 15 pages and 2.2 MB 19,207 (19,220) — 520 image tokens a page plus the
456
+ // page's text. Not measured on either lane: a blank or scanned page, more
457
+ // than 15 pages, more than 2.2 MB, several files in one call.
458
+ fileWire: { kie: "image-url", direct: "inline-data" },
446
459
  // KIE accepted reasoning_effort low / medium / high / xhigh (xhigh reasons
447
460
  // clearly deeper); Google 400s thinkingLevel MINIMAL on this model ("not
448
461
  // supported") and answers LOW / MEDIUM / HIGH / XHIGH (probed 2026-11-16).
@@ -730,6 +743,8 @@ var LLM_MODELS = [
730
743
  // `effortPriced`. The charge follows what KIE states or reports.
731
744
  kieSlugOrModel: "gpt-6-1-terra",
732
745
  vendor: "openai",
746
+ // A PDF goes inline as an `input_file` part (probed 2026-11-13).
747
+ fileWire: { kie: "input-file" },
733
748
  structuredOutputMode: "responses-json-schema",
734
749
  supportsImages: true,
735
750
  maxOutputTokens: 16384,
@@ -1196,7 +1211,10 @@ var LLM_MODALITY_CAPS = {
1196
1211
  // audio were not probed. Google's own API (where a media call is pinned
1197
1212
  // when this install has a Gemini key, as Carbon's) lists video and audio
1198
1213
  // input for it; not probed with media.
1199
- "gemini-4-hydrogen": { image: true, video: true, audio: true },
1214
+ // It also reads documents (PDF, decided 2026-11-17; `fileWire` on its
1215
+ // registry entry says how each lane is sent one). The `file` cap is read only
1216
+ // by the LLM nodes (`llmAcceptsFiles`), so it enrols the model in nothing else.
1217
+ "gemini-4-hydrogen": { image: true, video: true, audio: true, file: true },
1200
1218
  "claude-haiku-4.5": { image: true, video: false, audio: false },
1201
1219
  "claude-haiku-5.5": { image: true, video: false, audio: false },
1202
1220
  "claude-sonnet-4.6": { image: true, video: false, audio: false },
@@ -1246,6 +1264,9 @@ function getLlmModalityCaps(modelId) {
1246
1264
  function llmAcceptsFiles(modelId) {
1247
1265
  return Boolean(modelId && LLM_MODALITY_CAPS[modelId]?.file);
1248
1266
  }
1267
+ function llmFileWire(modelId) {
1268
+ return llmAcceptsFiles(modelId) ? LLM_MODELS.find((m) => m.id === modelId)?.fileWire : void 0;
1269
+ }
1249
1270
  var LLM_FILE_MODELS = LLM_MODELS.filter((m) => llmAcceptsFiles(m.id));
1250
1271
  var LLM_REFERENCE_FILES_MAX = 5;
1251
1272
  var LLM_REFERENCE_FILES_MAX_TOTAL_BYTES = 6 * 1024 * 1024;
@@ -1481,6 +1502,7 @@ exports.llmAcceptsFiles = llmAcceptsFiles;
1481
1502
  exports.llmCreditIdForRung = llmCreditIdForRung;
1482
1503
  exports.llmCreditRung = llmCreditRung;
1483
1504
  exports.llmDefaultsFeature = llmDefaultsFeature;
1505
+ exports.llmFileWire = llmFileWire;
1484
1506
  exports.llmPriceKey = llmPriceKey;
1485
1507
  exports.llmRouteDefaults = llmRouteDefaults;
1486
1508
  exports.llmSendsSchema = llmSendsSchema;
@@ -1498,5 +1520,5 @@ exports.resolveLlmCreditId = resolveLlmCreditId;
1498
1520
  exports.resolveVideoAnalysisModel = resolveVideoAnalysisModel;
1499
1521
  exports.structuredWireMode = structuredWireMode;
1500
1522
  exports.supportsAdvancedMode = supportsAdvancedMode;
1501
- //# sourceMappingURL=chunk-PLANUXQL.cjs.map
1502
- //# sourceMappingURL=chunk-PLANUXQL.cjs.map
1523
+ //# sourceMappingURL=chunk-CV2BEK52.cjs.map
1524
+ //# sourceMappingURL=chunk-CV2BEK52.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/llm-models.ts"],"names":["modelId"],"mappings":";;;AA2BO,IAAM,wBAAwB,CAAC,MAAA,EAAQ,OAAO,QAAA,EAAU,MAAA,EAAQ,SAAS,KAAK;AAG9E,IAAM,mCAAoD,IAAI,GAAA,CAAI,CAAC,OAAA,EAAS,KAAK,CAAC;AACzF,IAAM,WAAA,GAAkD,EAAE,IAAA,EAAM,CAAA,EAAG,GAAA,EAAK,CAAA,EAAG,MAAA,EAAQ,CAAA,EAAG,IAAA,EAAM,CAAA,EAAG,KAAA,EAAO,CAAA,EAAG,KAAK,CAAA,EAAE;AA8RzG,IAAM,sBAAA,GAAyB;AAG/B,SAAS,qBAAqB,KAAA,EAA4B;AAC/D,EAAA,OAAO,MAAM,oBAAA,IAAwB,sBAAA;AACvC;AAEO,IAAM,UAAA,GAAqC;AAAA,EAChD;AAAA,IACE,EAAA,EAAI,gBAAA;AAAA,IACJ,WAAA,EAAa,gBAAA;AAAA,IACb,MAAA,EAAQ,QAAA;AAAA,IACR,IAAA,EAAM,uCAAA;AAAA,IACN,IAAA,EAAM,SAAA;AAAA,IACN,SAAA,EAAW,kBAAA;AAAA,IACX,cAAA,EAAgB,gBAAA;AAAA,IAChB,MAAA,EAAQ,QAAA;AAAA,IACR,oBAAA,EAAsB,qBAAA;AAAA,IACtB,cAAA,EAAgB,IAAA;AAAA,IAChB,eAAA,EAAiB,IAAA;AAAA;AAAA;AAAA;AAAA,IAIjB,iBAAA,EAAmB,wBAAA;AAAA;AAAA;AAAA,IAGnB,sBAAA,EAAwB,CAAC,MAAA,EAAQ,KAAA,EAAO,UAAU,MA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IAAM,4BAAA,GAAuC,qBAAqB,2BAA2B;AAE7F,IAAM,0BAAA,GAAgE;AAAA,EAC3E,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,KAAA;AAAA,EACL,KAAA,EAAO,OAAA;AAAA,EACP,YAAA,EAAc;AAChB;AAEO,SAAS,oBAAoB,CAAA,EAAmC;AACrE,EAAA,OAAQ,yBAAA,CAAgD,SAAS,CAAC,CAAA;AACpE;AAEO,SAAS,yBAAyB,CAAA,EAAwC;AAC/E,EAAA,OAAQ,0BAAA,CAAiD,SAAS,CAAC,CAAA;AACrE;AAWO,SAAS,0BAA0B,KAAA,EAA+B;AACvE,EAAA,IAAI,KAAA,IAAS,wBAAA,CAAyB,KAAK,CAAA,EAAG,OAAO,KAAA;AACrD,EAAA,IAAI,SAAS,MAAA,CAAO,SAAA,CAAU,eAAe,IAAA,CAAK,oBAAA,EAAsB,KAAK,CAAA,EAAG;AAC9E,IAAA,OAAO,qBAAqB,KAA+B,CAAA;AAAA,EAC7D;AACA,EAAA,IAAI,KAAA,IAAS,yBAAA,CAA0B,QAAA,CAAS,KAAK,GAAG,OAAO,KAAA;AAC/D,EAAA,OAAO,4BAAA;AACT","file":"chunk-CV2BEK52.cjs","sourcesContent":["/**\n * LLM Model Registry — shared between frontend and backend.\n *\n * Single source of truth for available chat/LLM models routed through KIE.ai,\n * with direct Anthropic SDK fallback for Claude models. This is the\n * NON-monetary side of the registry (model ids, capabilities, tiers,\n * feature defaults). The provider-$ per-token rate table and the\n * `calculateLlmCost` formula derived from it live in\n * `backend/src/lib/pricing/llm-cost.ts` (core, not ee/ — internal LLM cost\n * logging needs them regardless of edition). They were moved out of this\n * package (published Apache-2.0 on npm — an irrevocable grant) per the\n * 2026-07-06 public-flip IP audit, S5: \"Keep the model-id enum; strip prices\n * + measurement notes.\"\n */\n\nexport type LlmTier = \"economy\" | \"standard\" | \"premium\"\nexport type KieApiFormat = \"chat-completions\" | \"messages\" | \"responses\"\n\n/** How a document is sent to a model, per lane (see `LlmModelDef.fileWire`). */\nexport interface LlmFileWire {\n /** The shape on the aggregator's lane: `input-file` (responses dialect) or `image-url` (chat-completions dialect). */\n kie: \"input-file\" | \"image-url\"\n /** The shape on the vendor's own API, for a model that has one. */\n direct?: \"inline-data\"\n}\nexport type LlmVendor = \"anthropic\" | \"deepseek\" | \"google\" | \"moonshot\" | \"openai\" | \"xai\"\n\nexport const LLM_REASONING_EFFORTS = [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const\nexport type LlmReasoningEffort = (typeof LLM_REASONING_EFFORTS)[number]\n/** Levels that bill one tier up. `high` is the Claude-family server default — it never bumps. */\nexport const EFFORT_TIER_BUMP: ReadonlySet<LlmReasoningEffort> = new Set([\"xhigh\", \"max\"])\nconst EFFORT_RANK: Record<LlmReasoningEffort, number> = { none: 0, low: 1, medium: 2, high: 3, xhigh: 4, max: 5 }\n\nexport interface LlmModelDef {\n id: string\n displayName: string\n /**\n * The product line a person thinks in and filters by (\"Claude\", \"GPT\",\n * \"Gemini\") — the LLM twin of a catalog entry's `series`. REQUIRED, so a new\n * model cannot ship without one; one line never spans two vendors (registry\n * test).\n */\n series: string\n desc: string\n tier: LlmTier\n kieFormat: KieApiFormat\n /** For chat-completions: the slug prefix (e.g. \"gemini-3-flash\").\n * For messages: the model id sent in the body (e.g. \"claude-haiku-4-5-v1messages\").\n * For responses: the model id sent in the body (e.g. \"gpt-5-4\"). */\n kieSlugOrModel: string\n /**\n * The registry id of the model the aggregator ACTUALLY answers this id's KIE\n * lane with, when that is a different model. Set together with borrowing\n * that model's `kieSlugOrModel`, so the wire names what really runs. Only\n * the KIE lane is affected: the direct lane still serves `directGeminiModel`.\n * The KIE lane is costed on that model's KIE rate row. A lookup by the\n * borrowed slug ({@link getLlmModel}) always resolves to its owner, never\n * to the borrower. Absent = KIE serves this id as itself.\n */\n kieServedAs?: string\n /**\n * true = no longer offered: every model menu and advertised list leaves it\n * out ({@link PICKABLE_LLM_MODELS}, {@link groupLlmModelsByVendor}), while\n * the id stays in {@link LLM_MODEL_IDS}, so a saved node or API call that\n * names it keeps validating, resolving and running exactly as before. No\n * default may point at a retired model (registry test).\n */\n retired?: true\n vendor: LlmVendor\n supportsImages: boolean\n maxOutputTokens: number\n /**\n * How this model can be forced into schema-valid structured output.\n * - \"anthropic-tool\" → forced tool_choice on the Claude wire (direct SDK\n * guaranteed; KIE's proxy re-serializes the tool call\n * as a `<tool_calls>` text tag — decoded in llm-client).\n * - \"kie-response-format\" → KIE chat-completions `response_format: json_schema`\n * (verified enforced for Gemini via KIE).\n * - \"responses-json-schema\" → KIE codex/v1/responses `text.format: json_schema`\n * (live-verified 2026-07-14 for gpt-5.4/5.5 and the\n * whole GPT-5.6 family, text AND vision inputs).\n * - undefined → no native mode; callers fall back to parse + retry.\n * Capability-driven so `llmCompleteStructured` never hardcodes provider ids.\n */\n structuredOutputMode?: \"anthropic-tool\" | \"kie-response-format\" | \"responses-json-schema\"\n /**\n * For a model with NO trusted `structuredOutputMode`: the wire field a\n * structured call still sends its schema in, as a hint the model reads but\n * the provider was not found to hold its answer to. Read through\n * {@link structuredWireMode}, which every request builder uses; everything\n * that decides TRUST (STRUCTURED_VISION_MODELS, the structured-model\n * filters) keeps reading `structuredOutputMode` alone, so a hinted model is\n * never offered where guaranteed structured output is required. Every answer\n * is still parsed, validated and re-asked by `llmCompleteStructured`, as for\n * any model. Never set together with `structuredOutputMode` (registry test).\n */\n structuredOutputHint?: \"kie-response-format\" | \"responses-json-schema\"\n /**\n * The KIE lane sends this model's structured calls NO `response_format`: the\n * schema rides the system prompt instead (the one-object rule and the schema,\n * as the KIE Claude lane's prompt-JSON), in the wire form `response_format`\n * sent (keyword-named properties aliased and restored on the answer; Google's\n * compact form), and `llmCompleteStructured` parses, validates and re-asks the\n * answer as it does for any model. When every KIE answer of an unpinned call\n * fails validation, the direct lane, which enforces the schema, is asked once\n * before the call fails. For a model whose KIE endpoint fails a request that\n * carries `response_format`.\n *\n * Per LANE, not per model: `structuredOutputMode` stays, so the trust readers\n * (STRUCTURED_VISION_MODELS, the structured-model filters) and the direct\n * lane's enforced `responseJsonSchema` are unchanged. Nothing reads trust to\n * skip validation, and only an `anthropic-tool` model streams partial values,\n * so a KIE-served answer here is checked like any untrusted one. Only on a\n * `kieFormat: \"chat-completions\"` model whose wire mode is\n * `kie-response-format` (registry test).\n */\n kieSchemaInPrompt?: true\n /** If set, fallback to direct Anthropic SDK with this model ID when KIE.ai fails */\n directFallbackModel?: string\n /**\n * Google Gemini API model id for the DIRECT lane (generativelanguage, keyed\n * by `GEMINI_API_KEY`) — the Google-side twin of `directFallbackModel`.\n * Presence declares \"this model CAN be served straight from Google\"; absence\n * pins it to KIE forever. Stated, never derived: Google carries `-preview`\n * suffixes on unreleased models, so the id routinely differs from both `id`\n * and `kieSlugOrModel` (`gemini-3.1-pro` → `gemini-3.1-pro-preview`).\n */\n directGeminiModel?: string\n /**\n * How a document (PDF) is sent to this model on each lane that can serve it\n * (decided 2026-11-17). Declared by exactly the models whose modality caps\n * say `file` ({@link llmAcceptsFiles}); a lane's builder sends a document\n * only in the shape named here and refuses one on a model that names none,\n * so a file is never dropped on the way.\n *\n * `kie`:\n * - `\"input-file\"`: an inline `input_file` part on the responses dialect.\n * - `\"image-url\"`: an `image_url` part on the chat-completions dialect,\n * holding a `data:application/pdf;base64,…` URL or an https link whose\n * path ends in `.pdf`. That dialect silently drops the `file` and\n * `input_file` shapes (a billed answer about no file), so this is the one\n * shape sent there.\n *\n * `direct`: `\"inline-data\"`, an `application/pdf` inline part on the vendor's\n * own API. Set on every file model that declares a direct lane, and on no\n * other.\n *\n * Never derived from the dialect: a model gets a shape only by its own\n * probe, recorded with its date on the entry, and\n * `llm-models.test.ts` lists every declaration by model.\n */\n fileWire?: LlmFileWire\n /**\n * Try the direct-vendor lane FIRST for this model, with KIE as the failure\n * fallback. Absent (while `directGeminiModel` is set) = KIE first, direct\n * only when KIE fails.\n *\n * This is a per-model COST decision, not just a routing one: the two lanes\n * bill the same model at materially different unit rates, so a model that\n * backs a high-volume default (see `LLM_FEATURE_DEFAULTS`) is usually better\n * left on whichever lane is cheaper. The rate tables for both lanes live in\n * `backend/src/lib/pricing/llm-cost.ts` — deliberately not in this package,\n * which is published to npm.\n *\n * Mutually exclusive with `preferKie` — the Claude-side half of the same\n * idea. Guarded by a registry test so the two can't both be set.\n */\n preferDirect?: true\n /**\n * true = served ONLY on the vendor's own API (`directGeminiModel`): KIE is\n * never called for this model — not as the primary lane, not as a failure\n * or exhausted-account fallback, not on a pin. `kieSlugOrModel` still names\n * the aggregator's endpoint, for the record and for a later re-enable after\n * a re-probe; nothing sends to it.\n *\n * Every call therefore runs direct, so {@link llmServesDirect} is true for it\n * and it bills on the direct rung by default, Advanced mode or not. Without a\n * direct key the call fails as provider-unavailable rather than reaching KIE.\n * Stronger than `preferDirect` (which keeps KIE as the fallback); the two are\n * mutually exclusive, as are `directOnly` and `preferKie` (registry test).\n */\n directOnly?: true\n /** Effort levels this model accepts (ascending). Absent/empty = no effort lever, picker hidden. */\n reasoningEfforts?: readonly LlmReasoningEffort[]\n /**\n * true = a REQUESTED effort below this model's lowest level is sent as that\n * lowest level, never as nothing ({@link effectiveReasoningEffort}): with no\n * effort on the wire the provider runs this model at its HIGHEST level, so\n * dropping a `none` request would buy the most reasoning instead of the\n * least. Auto — no effort requested at all — still sends nothing. Absent =\n * a request below the lowest level is dropped (Auto), the usual rule.\n */\n effortBelowLowestSendsLowest?: true\n /**\n * true = the PRICE of a call on this model depends on whether it sends a\n * reasoning effort, not only on its lane: the aggregator adds input of its\n * own to every call, whose size depends on it. So the model's price key\n * names the effort a call sends ({@link llmPriceKey}: `:effort-<level>`),\n * and every estimate surface quotes that call. The sizes themselves are\n * backend data (`backend/src/lib/pricing/llm-cost.ts`), held to this flag by\n * a backend test. No model sets it today (GPT-6.1 Terra did for part of\n * 2026-11-12; since 2026-11-13 its added input is counted at the ceiling it\n * has been seen at, the same with or without an effort).\n */\n effortPriced?: true\n /**\n * Effort levels available on the DIRECT lane, when the vendor's own API\n * accepts more than the aggregator does. Absent = the direct lane offers the\n * same set as `reasoningEfforts`.\n *\n * This exists because `reasoningEfforts` has to stay at the KIE-safe\n * intersection — sending a level KIE rejects is a hard failure — while the\n * vendor API accepts the full ladder. Unlocking those extra levels is one of\n * the concrete things Advanced mode buys.\n */\n directReasoningEfforts?: readonly LlmReasoningEffort[]\n /**\n * true = Google's own API takes `thinkingLevel: XHIGH` on this model, so an\n * `xhigh` (or `max`) effort on the direct lane is sent as XHIGH. Absent =\n * both collapse onto HIGH there, the level every other Gemini tops out at.\n * Declared per model from a probe, never derived from a model name. Only\n * meaningful with `directGeminiModel` and an `xhigh` level on the direct\n * ladder (registry test).\n */\n directXhighThinking?: true\n /** false = model rejects `temperature` (Claude 5-era, GPT-5.6). Absent = accepts. */\n supportsTemperature?: false\n /**\n * false = the model 400s on a FORCED `tool_choice` (`{ type: \"tool\" }` /\n * `{ type: \"any\" }`) — Claude Sonnet 5.5 and Opus 5.5 (vendor docs: \"not\n * supported for this model\"). Absent = forcing is accepted.\n *\n * Only meaningful with `structuredOutputMode: \"anthropic-tool\"`: such a model\n * is asked with `tool_choice: auto` plus an instruction naming the tool, and\n * the tool carries `strict: true` whenever its schema is expressible in the\n * vendor's strict subset (`anthropicStrictToolSchema` in llm-client). The\n * caller's Zod still validates every answer, so nothing the wire withholds is\n * lost. Declared per model, never matched on a model name.\n */\n supportsForcedToolChoice?: false\n /**\n * true = the model binds each thinking block to the exact conversation prefix\n * that produced it (\"preserved thinking\" — Claude Sonnet 5.5 / Opus 5.5 /\n * Haiku 5.5):\n * replaying a block after an earlier turn was edited, dropped or rebuilt is a\n * 400 on accounts the vendor enforces. A caller that trims or rebuilds stored\n * history between requests (the Workflow Copilot keeps a token budget by\n * dropping its oldest turns) must strip thinking blocks from the turns it\n * replays. Within one request's own tool loop the history only grows, so\n * blocks produced there stay valid.\n */\n conversationBoundThinking?: true\n /**\n * true = this model's reasoning effort takes effect ONLY on the vendor's own\n * API: the aggregator accepts the field and silently ignores it. Measured\n * 2026-10-08 for the Claude family on KIE — `low`, `max` and no effort gave\n * the same output length on a reasoning-heavy prompt, and no thinking block\n * ever came back, even on Sonnet 4.6 at `max`.\n *\n * So an effort-bearing call on such a model is SERVED direct, and it bills\n * as Advanced mode does — one rung up (decided 2026-10-08: \"effort =\n * Advanced\"). {@link llmServesDirect} is the one place that decides it, for\n * the credit identifier and the routing alike.\n */\n effortRequiresDirect?: true\n /** Claude-only: KIE is the preferred routing, direct Anthropic the fallback. */\n preferKie?: true\n /**\n * KIE's NON-streaming endpoint for this model is unreliable (measured);\n * `llmComplete` serves it by opening the streaming wire and collapsing it to\n * one response. Streaming responses do not reliably carry\n * `credits_consumed`, so provider cost on this path comes from the rate\n * table (`backend/src/lib/pricing/llm-cost.ts`) rather than the real charge.\n *\n * Declared per model — a per-model condition on KIE's side, like the\n * Claude-lane one behind `callKieMessagesCollapsed`. The flag says WHICH\n * model is affected, and `llm-client` reads it instead of matching model\n * names. Today only the `responses` dispatcher in `callKie` honours it (the\n * one format where the condition has been measured); a chat-completions or\n * messages model that needs the same treatment must also teach its `callKie`\n * case to read the flag — declaring it alone changes nothing there.\n */\n kieCollapseStream?: true\n /**\n * true = the model reasons even when NO thinking parameter is sent, so its\n * reasoning tokens share the `max_tokens` budget on EVERY call — not just\n * effort-bearing ones. Claude Opus 5 flipped this default (on Opus 4.8/4.7\n * and Sonnet 5, omitting `thinking` means no thinking at all).\n *\n * Consumers MUST give such a model output headroom regardless of the\n * requested effort, or reasoning silently eats a small legacy cap and the\n * answer truncates with `stop_reason: max_tokens` — a paid-for empty reply\n * (since #1588 the client fails such a call rather than return the\n * fragment, but the floor is what keeps it from happening). `deriveParams`\n * (llm-client.ts) floors to {@link reasoningOutputFloor}; the film\n * pipeline's `callLLM` — Anthropic SDK only, so only its Claude members\n * matter — floors at the default. Keep the flag in sync with the vendor's\n * documented default rather than inferring it from the model name.\n */\n thinkingDefaultOn?: true\n /**\n * The output-token cap a REASONING call on this model is floored to — the\n * room its thinking shares with the answer (`thinkingDefaultOn`, or an\n * xhigh/max effort). Absent = {@link REASONING_OUTPUT_FLOOR}; read it through\n * {@link reasoningOutputFloor}, never directly.\n *\n * Declare it ONLY where a lane serving this model is not known to accept the\n * default: the floor rides every lane the model can be served on (KIE AND its\n * direct fallback), so it has to sit at the intersection of what they take —\n * the rule `maxOutputTokens` already follows for the Gemini flash entries.\n * Never below `maxOutputTokens` (a floor under the default cap is not a\n * floor — guarded by a registry test).\n */\n reasoningOutputFloor?: number\n}\n\n/** The reasoning floor for a model that declares no lane limit of its own. */\nexport const REASONING_OUTPUT_FLOOR = 32768\n\n/** The output cap a reasoning call on `model` is floored to (see `LlmModelDef.reasoningOutputFloor`). */\nexport function reasoningOutputFloor(model: LlmModelDef): number {\n return model.reasoningOutputFloor ?? REASONING_OUTPUT_FLOOR\n}\n\nexport const LLM_MODELS: readonly LlmModelDef[] = [\n {\n id: \"gemini-3-flash\",\n displayName: \"Gemini 3 Flash\",\n series: \"Gemini\",\n desc: \"Fast and cheap, good for simple tasks\",\n tier: \"economy\",\n kieFormat: \"chat-completions\",\n kieSlugOrModel: \"gemini-3-flash\",\n vendor: \"google\",\n structuredOutputMode: \"kie-response-format\",\n supportsImages: true,\n maxOutputTokens: 8192,\n // KIE-first: no `preferDirect` — direct is the reliability fallback only.\n // (Per-lane rates are deliberately NOT in this published package; see\n // backend/src/lib/pricing/llm-cost.ts.)\n directGeminiModel: \"gemini-3-flash-preview\",\n // No `reasoningEfforts` at all on the KIE lane, but the vendor API accepts\n // the full minimal→high ladder (`none` maps to Google's `minimal`).\n directReasoningEfforts: [\"none\", \"low\", \"medium\", \"high\"],\n // Reasons with no thinking param sent — Google's Gemini 3 default (dynamic\n // thinking; `minimal` is its floor, never off), measured on 3.6 in #1588.\n // Floored at the KIE-safe 8192, the same intersection as `maxOutputTokens`.\n thinkingDefaultOn: true,\n reasoningOutputFloor: 8192,\n },\n {\n id: \"gemini-3.6-flash\",\n displayName: \"Gemini 3.6 Flash\",\n series: \"Gemini\",\n // Demoted 2026-09-06 alongside 3.7: superlatives belong to the CURRENT top\n // model of a family only, and 3.8 now holds that slot.\n desc: \"Fast Gemini, sharper reasoning\",\n tier: \"economy\",\n kieFormat: \"chat-completions\",\n // KIE serves Gemini 3.6 Flash on the OpenAI-compatible dialect under this\n // slug (docs.kie.ai/market/gemini/gemini-3-6-flash-openai.md) — same\n // chat-completions path shape as gemini-3-flash, different slug prefix.\n kieSlugOrModel: \"gemini-3-6-flash-openai\",\n vendor: \"google\",\n structuredOutputMode: \"kie-response-format\",\n supportsImages: true,\n maxOutputTokens: 8192,\n // KIE's 3.6 endpoint accepts `reasoning_effort: low | high` (thinking\n // level) — exactly the chat-completions wire mapping deriveParams sends.\n // Google's own API additionally accepts `minimal` and `medium` on this\n // model; the set stays at the KIE-safe intersection because ONE field\n // feeds both lanes and this model is KIE-first. Widen it only if/when\n // `preferDirect` is set here.\n reasoningEfforts: [\"low\", \"high\"],\n // Google's own API additionally accepts `minimal` and `medium` here —\n // live-verified 2026-07-28. Advanced mode unlocks them.\n directReasoningEfforts: [\"none\", \"low\", \"medium\", \"high\"],\n // KIE-first: this model backs 5 of the LLM_FEATURE_DEFAULTS plus the\n // video-analysis fast tier, so it carries the highest call volume of any\n // Gemini entry — the lane with the lower unit cost wins by default and\n // direct is the reliability fallback only.\n directGeminiModel: \"gemini-3.6-flash\",\n // Reasons with NO thinking param sent — measured, issue #1588: a Generate\n // Text node capped at 1,100 tokens fell back to the direct lane (KIE 500),\n // spent ~1,060 of them reasoning, and returned 120 characters cut mid-URL.\n // On the same input the KIE runs used ~500 output tokens in all, so only\n // the fallback runs broke — every other run of a 5-minute schedule.\n // Floored at 8192, NOT the default 32768: the floor rides the KIE endpoint\n // too, and 8192 is all it is known to take (see `maxOutputTokens`).\n thinkingDefaultOn: true,\n reasoningOutputFloor: 8192,\n },\n {\n id: \"gemini-3.7-flash\",\n displayName: \"Gemini 3.7 Flash\",\n series: \"Gemini\",\n // Demoted 2026-09-06 when 3.8 registered below: superlatives belong to the\n // CURRENT top model of a family only (same rule the Opus entries follow) —\n // `desc` renders in every picker, so leaving \"Newest\" on the older flash\n // steers the A/B's traffic backwards.\n desc: \"Fast Gemini, agentic-tuned\",\n tier: \"economy\",\n kieFormat: \"chat-completions\",\n // Retired 2026-10-19: the aggregator answers this model's own endpoint\n // (`gemini-3-7-flash-openai`) with 3.8, so the KIE lane now names 3.8's\n // endpoint outright and says so. The direct Google lane below still serves\n // real 3.7, Advanced mode included. The entry leaves every picker; saved\n // nodes and API callers that name the id keep running unchanged.\n kieSlugOrModel: \"gemini-3-8-flash-openai\",\n kieServedAs: \"gemini-3.8-flash\",\n retired: true,\n vendor: \"google\",\n structuredOutputMode: \"kie-response-format\",\n // The KIE endpoint is 3.8's, so it takes 3.8's rule: no `response_format`\n // there, the schema in the prompt (see gemini-3.8-flash below).\n kieSchemaInPrompt: true,\n supportsImages: true,\n // Google's own cap is 65,536, but the field feeds BOTH lanes and the KIE\n // flash endpoints cap at 8192 (the measured 3.6 posture) — stay at the\n // KIE-safe intersection, same reasoning as `reasoningEfforts` below.\n maxOutputTokens: 8192,\n // KIE's 3.7 endpoint enumerates reasoning_effort low | high (verified\n // against its OpenAPI spec 2026-08-18), identical to 3.6.\n reasoningEfforts: [\"low\", \"high\"],\n // Assumed parity with 3.6 pending a live probe on the direct lane.\n directReasoningEfforts: [\"none\", \"low\", \"medium\", \"high\"],\n directGeminiModel: \"gemini-3.7-flash\",\n // Gemini 3 default: reasons with no thinking param sent (measured on 3.6,\n // #1588). KIE-safe floor, same intersection as `maxOutputTokens`.\n thinkingDefaultOn: true,\n reasoningOutputFloor: 8192,\n },\n {\n id: \"gemini-3.8-flash\",\n displayName: \"Gemini 3.8 Flash\",\n series: \"Gemini\",\n // Inherits \"Newest\" from 3.7 (demoted above). Deliberately does NOT name\n // agentic video: that capability exists only on the direct Google lane\n // (Interactions API, not wired here). Plain video + audio input is wired\n // (LLM_MODALITY_CAPS below) — a picker desc must not promise a lever this\n // entry cannot expose.\n desc: \"Newest fast Gemini, agentic-tuned\",\n tier: \"economy\",\n kieFormat: \"chat-completions\",\n // KIE serves it on the OpenAI-compatible dialect under this slug\n // (docs.kie.ai/market/gemini/gemini-3-8-flash-openai.md) — identical\n // chat-completions path shape to gemini-3.7-flash / gemini-3.6-flash,\n // different slug prefix.\n kieSlugOrModel: \"gemini-3-8-flash-openai\",\n vendor: \"google\",\n // Live-verified 2026-09-06 on the KIE lane: `response_format: json_schema`\n // is ENFORCED (the reply came back exact-schema valid, credits_consumed\n // present) — not merely accepted-and-ignored.\n structuredOutputMode: \"kie-response-format\",\n // Since 2026-11-13 the KIE endpoint answers ANY request carrying\n // `response_format` (json_schema strict or not, json_object; any effort or\n // none; with or without media) with HTTP 200 and an in-band\n // `{\"code\":500}` after ~34 s, while the same request without it answers;\n // 3.6 Flash, 3.1 Pro and Carbon take the same body. So the KIE lane sends\n // the schema in the prompt (measured: a real Video Analysis roll, video\n // included, answered schema-valid that way). The direct lane keeps its\n // enforced `responseJsonSchema` (asked once when a call's KIE answers never\n // validate), and the trust this mode carries stays.\n kieSchemaInPrompt: true,\n supportsImages: true,\n // 16384 here, NOT the 8192 its 3.6 / 3.7 siblings sit at. Those two stay at\n // the KIE-safe intersection because nobody measured their endpoints past\n // it; 3.8's WAS measured — live-verified 2026-09-06, `max_tokens: 20000`\n // was honored for 14,892 completion tokens with finish_reason \"stop\" (no\n // truncation), so the KIE lane is not the binding constraint. 16384 keeps\n // it level with the rest of the registry's ceiling rather than at the cap.\n maxOutputTokens: 16384,\n // KIE's 3.8 endpoint enumerates reasoning_effort low | high (its doc enum),\n // and usage carries completion_tokens_details.reasoning_tokens — same\n // KIE-safe intersection as 3.6 / 3.7, because ONE field feeds both lanes\n // and this model is KIE-first.\n reasoningEfforts: [\"low\", \"high\"],\n // Google's own API accepts the full minimal→high ladder here (`none` maps\n // to `minimal`), same as 3.7. Advanced mode is what unlocks it.\n directReasoningEfforts: [\"none\", \"low\", \"medium\", \"high\"],\n // KIE-first (no `preferDirect`) — 3.7's posture exactly: the cheap lane\n // serves the A/B, direct is Advanced mode + the reliability fallback.\n directGeminiModel: \"gemini-3.8-flash\",\n // Gemini 3 default: reasons with no thinking param sent (measured on 3.6,\n // #1588). Floored at its own 16384, inside the 20000 its KIE endpoint was\n // measured to honour.\n thinkingDefaultOn: true,\n reasoningOutputFloor: 16384,\n },\n {\n id: \"claude-haiku-4.5\",\n displayName: \"Claude Haiku 4.5\",\n series: \"Claude\",\n // Demoted 2026-10-10 when claude-haiku-5.5 registered.\n desc: \"Previous Haiku, fast economy\",\n tier: \"economy\",\n kieFormat: \"messages\",\n kieSlugOrModel: \"claude-haiku-4-5\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n supportsImages: true,\n maxOutputTokens: 8192,\n directFallbackModel: \"claude-haiku-4-5-20251001\",\n // KIE-first since 2026-10-08 (a call is priced on the lane it runs on);\n // KIE served it plain and with a tool on its streaming wire that day.\n preferKie: true,\n },\n {\n id: \"claude-haiku-5.5\",\n displayName: \"Claude Haiku 5.5\",\n series: \"Claude\",\n desc: \"Latest Haiku, fast and low-cost with reasoning\",\n tier: \"economy\",\n kieFormat: \"messages\",\n // KIE plain id on the Claude-native messages dialect\n // (docs.kie.ai/market/claude/claude-haiku-5-5.md). Live-probed 2026-10-10\n // on the streaming wire: plain, system prompt, base64 image, a forced tool\n // and an auto + strict tool (both came back as a real tool_use block), and\n // `max_tokens: 32768` were all served.\n kieSlugOrModel: \"claude-haiku-5-5\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n // NO `supportsForcedToolChoice: false`, unlike Sonnet 5.5 / Opus 5.5: this\n // model ACCEPTS a forced tool_choice (probed on Anthropic's API 2026-10-10).\n // A forced call skips thinking (same usage with and without an effort), and\n // an effort-bearing structured call is already sent the auto choice.\n //\n // A thinking block is valid only while everything before it is unchanged\n // (vendor docs: the same history check the other 5.5 models run).\n conversationBoundThinking: true,\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-haiku-5-5\",\n // The first Haiku with effort levels. The vendor default is `medium`, where\n // most of the family defaults to `high`.\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores effort on this slug too — measured 2026-10-10 on a\n // reasoning-heavy prompt: none / low / max / KIE's own `thinkingFlag` gave\n // 2,076 / 1,886 / 2,223 / 1,927 output tokens and no thinking block, while\n // Anthropic's API gave 2,059 at low and 28,097 at max. An effort call runs\n // direct and bills as Advanced.\n effortRequiresDirect: true,\n // Anthropic 400s a non-default sampling value (\"`temperature` is deprecated\n // for this model\", probed 2026-10-10); KIE's proxy accepted temperature: 0.2.\n supportsTemperature: false,\n preferKie: true,\n // Adaptive thinking runs when no thinking param is sent (vendor default),\n // on BOTH lanes: a no-effort KIE call spent ~2,000 output tokens on a\n // ~350-token answer and returned no thinking block.\n thinkingDefaultOn: true,\n },\n {\n id: \"claude-sonnet-4.6\",\n displayName: \"Claude Sonnet 4.6\",\n series: \"Claude\",\n desc: \"Balanced quality and speed\",\n tier: \"standard\",\n kieFormat: \"messages\",\n kieSlugOrModel: \"claude-sonnet-4-6\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-sonnet-4-6\",\n // KIE-first since 2026-10-08 (a call is priced on the lane it runs on);\n // KIE served it plain and with a tool on its streaming wire that day.\n preferKie: true,\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n },\n {\n id: \"gpt-5.2\",\n displayName: \"GPT-5.2\",\n series: \"GPT\",\n desc: \"Strong general purpose\",\n tier: \"standard\",\n kieFormat: \"chat-completions\",\n kieSlugOrModel: \"gpt-5-2\",\n vendor: \"openai\",\n supportsImages: true,\n maxOutputTokens: 16384,\n },\n {\n id: \"gemini-3.1-pro\",\n displayName: \"Gemini 3.1 Pro\",\n series: \"Gemini\",\n desc: \"Advanced reasoning, large context\",\n tier: \"premium\",\n kieFormat: \"chat-completions\",\n kieSlugOrModel: \"gemini-3.1-pro\",\n vendor: \"google\",\n structuredOutputMode: \"kie-response-format\",\n supportsImages: true,\n maxOutputTokens: 16384,\n directGeminiModel: \"gemini-3.1-pro-preview\",\n // Google documents low/medium/high for 3.1 Pro — no `minimal` tier, so\n // this ladder is deliberately shorter than the flash models'.\n directReasoningEfforts: [\"low\", \"medium\", \"high\"],\n // NO `reasoningEfforts` (the proxied ladder) ON PURPOSE, not an omission.\n // That endpoint accepts `reasoning_effort: low | high` and already DEFAULTS\n // to \"high\", so leaving it unset gets its deepest setting and a ladder here\n // would unlock nothing. The two lanes are NOT equivalent at their maxima:\n // verified 2026-07-29 on identical input, the proxy's ceiling produces\n // roughly a quarter of the reasoning tokens that the direct lane's\n // `thinkingLevel: HIGH` does, and it does not expose Google's deeper tiers\n // at all. That difference is visible in fine-detail reading (small on-screen\n // text such as a name badge), which is exactly what video-analysis casts\n // identities from — so adding an entry here would silently move analysis to\n // the shallower lane. Don't. Full comparison lives with the analysis engine.\n // KIE-first since 2026-10-08 (decided: a call is priced on the lane it runs\n // on, so the base premium price buys the KIE lane; the direct lane is\n // Advanced mode, billed `premium-direct`). It was the one direct-first\n // Gemini before. What the direct lane buys, now behind Advanced: real\n // `thinkingLevel` control, native media ingestion, and a `responseJsonSchema`\n // that honours `additionalProperties` (KIE's `response_format` silently DROPS\n // record/map-shaped fields — see the z.record rule in backend/CLAUDE.md).\n // Video-analysis is unaffected: it pins `requireLane: \"direct\"` itself.\n // Reasons with no thinking param sent on both lanes — the proxied endpoint\n // DEFAULTS to \"high\" (above), and the direct lane reasons harder still.\n // Floored at its own 16384: its KIE fallback is not known to take more.\n thinkingDefaultOn: true,\n reasoningOutputFloor: 16384,\n },\n {\n id: \"gemini-4-argon\",\n displayName: \"Gemini 4 Argon\",\n series: \"Gemini\",\n desc: \"Newest premium Gemini, 1M context\",\n tier: \"premium\",\n kieFormat: \"chat-completions\",\n // DIRECT-ONLY (decided 2026-10-17): KIE serves it on the OpenAI-compatible\n // dialect under this slug (docs.kie.ai/market/gemini/gemini-4-argon-openai.md,\n // byte-identical to the 3.8 Flash spec apart from the name), but that lane\n // failed its probe the same day — of 15 completed calls, 6 came back HTTP 200\n // `finish_reason: stop` with an EMPTY reply (both image calls among them,\n // each still charged), `completion_tokens` was NEGATIVE on reasoning calls\n // (-33, -38), replies leaked code-execution fences (```python?code_reference),\n // `response_format` json_schema left an enum field holding prose, and an\n // off-enum `reasoning_effort: medium` was an empty 200 rather than an error.\n // So no call reaches KIE (`directOnly`); the slug is kept for the record.\n // Re-enable it only after a re-probe of that lane comes back clean.\n // KIE also flags the page \"Chat only — not yet adapted for agent use\", like\n // kimi-k3 / deepseek below: it may not back a tool-loop feature. No registry\n // gate enforces that today — the only tool loops (Workflow Copilot, the\n // pipeline stage calls) are Claude-only by construction.\n kieSlugOrModel: \"gemini-4-argon-openai\",\n vendor: \"google\",\n // The direct lane enforces `responseJsonSchema` (an enum field came back\n // in-enum, 2026-10-17). This mode is what turns that schema on there.\n structuredOutputMode: \"kie-response-format\",\n supportsImages: true,\n // The registry's usual 16384 default. Google's own cap is 32,768\n // (models.list); every call is floored to that (`thinkingDefaultOn`, below).\n maxOutputTokens: 16384,\n directGeminiModel: \"gemini-4-argon\",\n directOnly: true,\n // The direct lane's ladder, and the only one: every call runs there.\n // Google rejects thinkingLevel MINIMAL on this model with a 400 (\"not\n // supported for this model\") and accepts LOW / MEDIUM / HIGH (probed\n // 2026-10-17) — 3.1 Pro's shape, not the flash one. `none` maps to MINIMAL\n // in the direct client, so it is not offered; a `none` request clamps to\n // Auto.\n reasoningEfforts: [\"low\", \"medium\", \"high\"],\n // Gemini's documented default (dynamic thinking with no param sent). The no-param\n // call reported no thought tokens on a two-part puzzle (HIGH reported 452),\n // so this is the vendor default rather than a measurement — kept because it\n // only raises the output ceiling. No `reasoningOutputFloor`: its one lane\n // is Google's, whose cap IS the default 32768 (models.list), and calls sent\n // maxOutputTokens 32768 / 65536 were served, not refused (2026-10-17). How\n // much output it gives at that cap is unmeasured — both long-output probes\n // ended early (one declined the task, one stopped on RECITATION).\n thinkingDefaultOn: true,\n },\n {\n id: \"gemini-4-carbon\",\n displayName: \"Gemini 4 Carbon\",\n series: \"Gemini\",\n desc: \"Deepest-reasoning Gemini, 1M context\",\n tier: \"premium\",\n kieFormat: \"chat-completions\",\n // KIE serves it on the OpenAI-compatible dialect under this slug\n // (docs.kie.ai/market/gemini/gemini-4-carbon-openai — Argon's page with the\n // name swapped). Unlike Argon's, this lane passed its probe (2026-11-12):\n // every call answered, images read, a stream ended cleanly, no empty 200,\n // no negative counts, no code-execution fences. KIE flags it \"Chat only\",\n // like Argon: it may not back a tool-loop feature (none does today).\n kieSlugOrModel: \"gemini-4-carbon-openai\",\n vendor: \"google\",\n // NO trusted `structuredOutputMode` (decided 2026-11-12): KIE did NOT\n // enforce a `response_format` json_schema — both probe calls came back as\n // JSON holding an off-enum value in the enum field (\"cheerful and\n // energized\" for happy | sad). So it is not a STRUCTURED_VISION_MODELS\n // member (not offered by describe-to-picker), and every answer is parsed,\n // validated and re-asked by `llmCompleteStructured`.\n // The schema still goes on the wire, as a hint (`structuredOutputHint`): as\n // `response_format` on KIE (the probe's replies followed its shape, only the\n // enum slipped) and as `responseJsonSchema` on the direct Google lane,\n // which enforced it in the probe — on every attempt, the re-ask included.\n structuredOutputHint: \"kie-response-format\",\n supportsImages: true,\n // The registry's usual 16384, as Argon. Every call is floored to the\n // default 32768 (`thinkingDefaultOn`, below): Google lists an output cap of\n // 32,768 (models.list) and accepted maxOutputTokens 65536; KIE's doc\n // states up to 65,536 tokens, thinking included.\n maxOutputTokens: 16384,\n // KIE first, Google as the reliability fallback (and Advanced mode) — no\n // `preferDirect`, no `directOnly`. Google serves `models/gemini-4-carbon`\n // beside Argon (models.list, 2026-11-12).\n directGeminiModel: \"gemini-4-carbon\",\n // KIE's documented `reasoning_effort` enum, and the direct lane's ladder\n // too: Google 400s thinkingLevel MINIMAL on this model (\"not supported\")\n // and answers LOW / MEDIUM / HIGH (probed 2026-11-12) — Argon's shape. So\n // no `none` (it maps to MINIMAL in the direct client) and no\n // `directReasoningEfforts`: a `none` request clamps to Auto on both lanes.\n reasoningEfforts: [\"low\", \"medium\", \"high\"],\n // Reasons with no thinking param sent on both lanes: KIE's `total_tokens`\n // ran well past prompt + completion on every no-effort call (its dialect\n // reports no reasoning split), and Google's no-level call reported thought\n // tokens. No `reasoningOutputFloor`: both lanes take the default 32768.\n thinkingDefaultOn: true,\n },\n {\n id: \"gemini-4-hydrogen\",\n displayName: \"Gemini 4 Hydrogen\",\n series: \"Gemini\",\n desc: \"Fast multimodal Gemini 4, four thinking levels, 1M context\",\n tier: \"premium\",\n kieFormat: \"chat-completions\",\n // KIE serves it on the OpenAI-compatible dialect under this slug, the\n // same shape as Carbon's. Its lane passed its probe (2026-11-16, 29 calls):\n // every call answered, images read, streams ended cleanly with a final\n // usage chunk (no reasoning deltas), no empty 200, no in-band error, no\n // negative counts, no code fences or code-execution leaks. KIE flags it\n // \"Chat only\", like Carbon: it may not back a tool-loop feature (none\n // does today). Latency: median 7 s, but 4 of 29 trivial calls took\n // 31–78 s — inside the KIE lane's default timeout, which no model\n // overrides.\n kieSlugOrModel: \"gemini-4-hydrogen-openai\",\n vendor: \"google\",\n // NO trusted `structuredOutputMode` (decided 2026-11-16), as Carbon: KIE\n // did NOT enforce a `response_format` json_schema — 3 of 3 probe calls\n // came back as valid JSON with prose in the enum field. So it is not a\n // STRUCTURED_VISION_MODELS member, and every answer is parsed, validated\n // and re-asked by `llmCompleteStructured`. The schema still goes on the\n // wire as a hint: `response_format` on KIE, `responseJsonSchema` on the\n // direct Google lane, which enforced it (enum honoured) in the probe.\n structuredOutputHint: \"kie-response-format\",\n supportsImages: true,\n // The registry's usual 16384, as Carbon. Every call is floored to the\n // default 32768 (`thinkingDefaultOn`, below): KIE accepted max_tokens\n // 32768 and 65536, and Google lists an output cap of 65,536 (models.list)\n // and accepted maxOutputTokens 65536.\n maxOutputTokens: 16384,\n // KIE first, Google as the reliability fallback (and Advanced mode) — no\n // `preferDirect`, no `directOnly`, as Carbon. Google serves\n // `models/gemini-4-hydrogen` (models.list, 2026-11-16: input 1,048,576,\n // output 65,536).\n directGeminiModel: \"gemini-4-hydrogen\",\n // Reads PDF files (decided 2026-11-17). Measured on KIE 2026-11-17: a PDF\n // is read only as an `image_url` part (a `data:application/pdf` URL, or an\n // https link ending in `.pdf`); the `file` and `input_file` shapes are\n // dropped, billed. Read correctly at 1, 5, 14 and 15 pages (facts from\n // pages 2, 8 and 11), up to 2.2 MB by link and 1.36 million characters\n // inline; 1,280 to 2,670 prompt tokens a page. Google's own API reads an\n // inline `application/pdf` part (probed 2026-11-17, thinking LOW): the\n // same three documents answered correctly with almost the same counts —\n // 5 pages 13,332 prompt tokens (KIE 13,357), 14 pages 28,048 (28,068),\n // 15 pages and 2.2 MB 19,207 (19,220) — 520 image tokens a page plus the\n // page's text. Not measured on either lane: a blank or scanned page, more\n // than 15 pages, more than 2.2 MB, several files in one call.\n fileWire: { kie: \"image-url\", direct: \"inline-data\" },\n // KIE accepted reasoning_effort low / medium / high / xhigh (xhigh reasons\n // clearly deeper); Google 400s thinkingLevel MINIMAL on this model (\"not\n // supported\") and answers LOW / MEDIUM / HIGH / XHIGH (probed 2026-11-16).\n // So no `none` (it maps to MINIMAL in the direct client) and no\n // `directReasoningEfforts`: one ladder on both lanes. KIE also accepted\n // the off-enum `none`, `minimal` and `max` and still reasoned, so the\n // clamp here is what keeps a request on the ladder: `none` runs at Auto,\n // `max` at xhigh.\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\"],\n // Google takes thinkingLevel XHIGH on this model, so an xhigh effort on\n // the direct lane is sent as XHIGH rather than collapsing to HIGH.\n directXhighThinking: true,\n // Reasons with no thinking param sent on both lanes (KIE reported\n // reasoning tokens on every no-effort call; Google's no-level call\n // thought). Unlike Carbon, KIE's `completion_tokens` INCLUDES the\n // reasoning (`completion_tokens_details.reasoning_tokens` is a part of it;\n // total = prompt + completion), so the reported output count is billed as\n // it stands. No `reasoningOutputFloor`: both lanes take the default 32768.\n thinkingDefaultOn: true,\n },\n {\n id: \"claude-opus-4.7\",\n displayName: \"Claude Opus 4.7\",\n series: \"Claude\",\n // Superlatives belong to the CURRENT top model only — `desc` renders in every\n // model picker, so leaving \"highest quality\" on an older Opus steers\n // quality-critical work backwards (all three Opus entries bill premium, so\n // the mis-steer is invisible on the invoice).\n desc: \"Older Opus, complex tasks\",\n tier: \"premium\",\n kieFormat: \"messages\",\n kieSlugOrModel: \"claude-opus-4-7\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-opus-4-7\",\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n supportsTemperature: false,\n preferKie: true,\n },\n {\n id: \"gpt-5.4\",\n displayName: \"GPT-5.4\",\n series: \"GPT\",\n // Demoted 2026-09-06: two GPT generations have shipped above it, so\n // \"Latest\" steered the picker at the oldest premium GPT in the registry.\n desc: \"Older GPT, premium quality\",\n tier: \"premium\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-5-4\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n reasoningEfforts: [\"low\", \"medium\", \"high\"],\n },\n {\n id: \"gpt-5.5\",\n displayName: \"GPT-5.5\",\n series: \"GPT\",\n desc: \"Previous flagship GPT, deep reasoning\",\n tier: \"premium\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-5-5\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n reasoningEfforts: [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n supportsTemperature: false,\n },\n {\n id: \"gpt-5.6-luna\",\n displayName: \"GPT-5.6 Luna\",\n series: \"GPT\",\n desc: \"Fastest GPT-5.6, high-volume workloads\",\n tier: \"economy\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-5-6-luna\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n reasoningEfforts: [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n supportsTemperature: false,\n },\n {\n id: \"gpt-5.6-terra\",\n displayName: \"GPT-5.6 Terra\",\n series: \"GPT\",\n desc: \"Balanced GPT-5.6 for production work\",\n tier: \"standard\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-5-6-terra\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n reasoningEfforts: [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n supportsTemperature: false,\n },\n {\n id: \"gpt-5.6-sol\",\n displayName: \"GPT-5.6 Sol\",\n series: \"GPT\",\n // Demoted 2026-09-06 when gpt-6-astra registered below — \"Flagship /\n // deepest\" is the current top GPT's copy only. Worded to stay distinct\n // from gpt-5.5's \"Previous flagship GPT, deep reasoning\": all three read\n // premium on the invoice, so a stale superlative mis-steers silently.\n desc: \"Previous flagship GPT-5.6, deep reasoning\",\n tier: \"premium\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-5-6-sol\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n reasoningEfforts: [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n supportsTemperature: false,\n // SERVED COLLAPSED, on the astra precedent (2026-09-17). The 2026-07-14\n // verification that KIE's non-stream responses endpoint serves the GPT-5.6\n // family reliably no longer holds: a live call — a recast continuity\n // review, ~3k tokens, `reasoning.effort: high`, `text.format: json_schema`\n // — came back `500 {\"error\":{\"type\":\"server_error\"}}` / \"Server exception,\n // please try again later\". Same endpoint family, same dialect and the same\n // signature astra was measured on (12 calls: non-stream 2/6, streaming\n // 5/6; a schema-less non-stream call 500'd too, so the lane is the trigger\n // and not the schema). ONE sighting here rather than a fresh 12-call probe\n // — the precedent is strong and the flag is cheap to reverse.\n //\n // THE COST: SSE does not reliably carry `credits_consumed`, so this model's\n // provider cost becomes the rate-table estimate instead of the billed\n // figure. That is the price of a lane that answers, and it is the same\n // trade astra already makes.\n kieCollapseStream: true,\n },\n {\n id: \"gpt-6-astra\",\n displayName: \"GPT-6 Astra\",\n series: \"GPT\",\n desc: \"Flagship GPT-6, deepest reasoning\",\n tier: \"premium\",\n kieFormat: \"responses\",\n // KIE serves GPT-6 on the responses dialect under the OpenAI family path —\n // codex/v1/responses, which llm-client DERIVES from `vendor` (the same\n // derivation that keeps Grok on grok/v1/responses). So this field is the\n // body `model` only, not a path segment. Live-verified 2026-09-06 on the\n // streaming path (array `input`, SSE deltas), which is the ONLY path we\n // serve it on — see `kieCollapseStream` below. The non-stream reply does\n // carry `credits_consumed` (and cached_tokens/cache_write_tokens in usage)\n // on the ~1 call in 3 that returns one, but we no longer take that reply,\n // so provider cost here is the rate-table estimate.\n // KIE's codex/v1/responses injects its own Codex-agent `instructions`\n // prompt ABOVE the caller's `developer` message — observed in the\n // 2026-07-14 live probe of that endpoint, and unchanged for GPT-6. Budget\n // for it when a developer message has to dominate.\n kieSlugOrModel: \"gpt-6-astra\",\n vendor: \"openai\",\n // Live-verified 2026-09-06: `text.format: json_schema` is passed through\n // and ENFORCED — the server echoed `strict: true` and returned\n // schema-valid JSON.\n structuredOutputMode: \"responses-json-schema\",\n // text + image + file inputs per KIE's doc. No video/audio — see the\n // image-only LLM_MODALITY_CAPS row below.\n supportsImages: true,\n maxOutputTokens: 16384,\n // KIE's documented enum for this endpoint. No `none` on purpose: the\n // endpoint reasons unconditionally (see thinkingDefaultOn below), so a\n // \"none\" level would be a lie the wire silently overrides.\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\"],\n // Live-probed 2026-09-06: `temperature: 0.2` was sent and the request echo\n // stayed at 1.0 — silently IGNORED, so never send it. Same treatment as the\n // GPT-5.6 family and grok-4.6.\n supportsTemperature: false,\n // With NO reasoning param sent, the server echoed effort \"medium\" — it\n // reasons by default (2026-09-06), so reasoning tokens share `max_tokens`\n // on EVERY call, not just effort-bearing ones. Consumers must floor output\n // headroom off this flag or a premium answer truncates into a paid-for\n // empty reply.\n thinkingDefaultOn: true,\n // Measured 2026-09-06, 12 identical requests (developer + user message,\n // reasoning.effort low, text.format json_schema): `stream: false`\n // succeeded 2/6 in 4–5 s and 500'd 4/6 with\n // {\"error\":{\"type\":\"server_error\"}} after 34, 34, 35 and 64 s, while the\n // same body with `stream: true` succeeded 5/6 in the same 4–5 s. An\n // earlier non-stream probe timed out at 90 s with 0 bytes, and a\n // non-stream call WITHOUT a schema 500'd after 65 s — the schema is not\n // the trigger, the non-stream lane is. The very same endpoint serves\n // gpt-5.4/5.5/5.6 non-stream reliably (live-verified 2026-07-14), which is\n // why this is per-model and not a lane-wide flag.\n kieCollapseStream: true,\n },\n // ── GPT-6 Luna / Sol / 6.1 Sol ────────────────────────────────────────────\n // Same KIE endpoint and dialect as gpt-6-astra (codex/v1/responses; the doc\n // pages differ only in the model name). Live-probed 2026-10-08, per model:\n // `text.format` json_schema ENFORCED (echo `strict: true`, schema-valid\n // reply), `temperature: 0.2` echoed back as 1 → silently ignored, no\n // reasoning param → echo \"medium\" (reasons by default), and data-URI vision.\n // Unlike astra, the NON-stream lane served them reliably — luna 10/10 and sol\n // 10/10, 6.1 sol 8/8 at levels other than `none` (incl. 4 long structured\n // calls each, 500–1,500 output tokens) — so none of them is collapsed:\n // `credits_consumed` stays the real provider charge.\n // Their ladder is WIDER than astra's doc-enum one: `none` and `max` were each\n // sent and echoed back by the endpoint (6.1 sol excepted below).\n {\n id: \"gpt-6-luna\",\n displayName: \"GPT-6 Luna\",\n series: \"GPT\",\n desc: \"Fastest GPT-6, high-volume workloads\",\n tier: \"economy\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-6-luna\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n reasoningEfforts: [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n supportsTemperature: false,\n thinkingDefaultOn: true,\n },\n {\n id: \"gpt-6-sol\",\n displayName: \"GPT-6 Sol\",\n series: \"GPT\",\n desc: \"Strong GPT-6, deep reasoning at lower cost\",\n // Premium by decision (2026-10-08), not by unit cost — \"Sol\" is the\n // deep-reasoning rung of the family, and gpt-5.6-sol bills premium too.\n tier: \"premium\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-6-sol\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n reasoningEfforts: [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n supportsTemperature: false,\n thinkingDefaultOn: true,\n },\n {\n id: \"gpt-6.1-sol\",\n displayName: \"GPT-6.1 Sol\",\n series: \"GPT\",\n // Measured slow: 30–76 s for 500–1,100 output tokens (2026-10-08), roughly\n // twice gpt-6-sol on the same request — say so where the picker shows it.\n desc: \"Newest GPT-6 Sol, thorough but slower\",\n tier: \"premium\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"gpt-6-1-sol\",\n vendor: \"openai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n // NO `none`: every probe at `reasoning.effort: none` failed (502, a 120 s\n // timeout, 502, 429 — 0/4, 2026-10-08) while every other level answered,\n // and the same request at `none` succeeded on luna and sol. Clamping maps a\n // `none` request to nothing sent (Auto) rather than to a level that fails.\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n supportsTemperature: false,\n thinkingDefaultOn: true,\n },\n {\n id: \"gpt-6.1-terra\",\n displayName: \"GPT-6.1 Terra\",\n series: \"GPT\",\n desc: \"Fast, efficient GPT-6.1, sharp visual reasoning\",\n tier: \"standard\",\n kieFormat: \"responses\",\n // The GPT-6 wire (codex/v1/responses, derived from `vendor`); KIE's doc is\n // 6.1 Sol's page with the name swapped and `none` added to the effort enum.\n // Live-probed 2026-11-12: non-stream 16/16, `text.format` json_schema\n // ENFORCED (asked for prose, it returned schema JSON with the enum\n // honoured), data-URI vision, SSE deltas. Unlike luna / sol / 6.1 sol it\n // reports REAL top-level `usage.input_tokens` — see `kieInputUntrusted` in\n // backend/src/lib/llm/kie-cost.ts.\n //\n // KIE's endpoint adds its own instructions to every call and counts them as\n // input. The hold and the estimate count them too\n // (backend/src/lib/pricing/llm-cost.ts, `llmLaneAddedInputTokens`). Their\n // size has moved (about 4,400 and about 25,500 tokens on the same request,\n // 2026-11-12/13), so both count the ceiling, with or without an effort\n // (decided 2026-11-13): its price does not depend on the effort, so not\n // `effortPriced`. The charge follows what KIE states or reports.\n kieSlugOrModel: \"gpt-6-1-terra\",\n vendor: \"openai\",\n // A PDF goes inline as an `input_file` part (probed 2026-11-13).\n fileWire: { kie: \"input-file\" },\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n // NO `none` (decided 2026-11-12): KIE answers it, but a `none` sent on the\n // wire is answered as an effort (it echoed `medium`) while reasoning no\n // more than Auto. Clamping maps a `none` request to nothing sent (Auto).\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // Same doc as 6.1 Sol: no temperature lever.\n supportsTemperature: false,\n // NO `thinkingDefaultOn`: with no effort sent (and at low / medium / high)\n // the probe reported 0 reasoning tokens; only xhigh (8) and max (27)\n // reasoned, and those already floor the cap (`raiseToReasoningFloor`).\n },\n {\n id: \"grok-4.6\",\n displayName: \"Grok 4.6\",\n series: \"Grok\",\n // Demoted 2026-10-08 when grok-4.7 registered — the flagship copy moved up.\n desc: \"Previous Grok, strong reasoning\",\n tier: \"standard\",\n kieFormat: \"responses\",\n // KIE serves Grok on the responses dialect under its own family path —\n // grok/v1/responses, NOT codex/v1/responses (llm-client derives the path\n // from `vendor`). Live-verified end-to-end 2026-08-18: array `input`,\n // `developer` system role, `input_image` URL vision, `text.format`\n // json_schema enforcement, SSE `response.output_text.delta` stream, and\n // `credits_consumed` actual-cost capture. (grok-4.5 was deferred 2026-07-13\n // because none of this was live; 4.6 is its activation.)\n kieSlugOrModel: \"grok-4-6\",\n vendor: \"xai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n // KIE's documented enum, each level live-verified (echoed back) 2026-08-18.\n // No `none`: the endpoint reasons unconditionally (see thinkingDefaultOn).\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\"],\n // Live-probed 2026-08-18: `temperature` is silently IGNORED (request echo\n // stays at the 0.7 default), so never send it — same treatment as GPT-5.5+.\n supportsTemperature: false,\n // Reasons with NO reasoning param sent (effort defaults to \"low\" server-side\n // — a trivial probe spent 169 of 170 output tokens on reasoning), so every\n // call needs output headroom, not just xhigh.\n thinkingDefaultOn: true,\n },\n {\n id: \"grok-4.7\",\n displayName: \"Grok 4.7\",\n series: \"Grok\",\n desc: \"xAI flagship, strong reasoning\",\n tier: \"standard\",\n kieFormat: \"responses\",\n // Same grok/v1/responses family path and wire as grok-4.6 (the KIE doc\n // pages differ only in the model name). Live-probed 2026-10-08: non-stream\n // 6/6, `text.format` json_schema enforced, data-URI vision, SSE deltas.\n kieSlugOrModel: \"grok-4-7\",\n vendor: \"xai\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n // 4.6's ladder. `none` is NOT honoured: the endpoint echoed it back as\n // \"minimal\" and still reasoned (33 of 35 output tokens), so offering it\n // would promise a lever the wire overrides.\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\"],\n // `temperature: 0.2` → echo stayed at the 0.7 default: ignored.\n supportsTemperature: false,\n // \"Capital of France\" with no reasoning param spent 310 of 311 output\n // tokens reasoning.\n thinkingDefaultOn: true,\n },\n {\n id: \"claude-sonnet-5\",\n displayName: \"Claude Sonnet 5\",\n series: \"Claude\",\n // Demoted 2026-10-08 when claude-sonnet-5.5 registered.\n desc: \"Previous Sonnet, near-Opus quality\",\n tier: \"standard\",\n kieFormat: \"messages\",\n kieSlugOrModel: \"claude-sonnet-5\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-sonnet-5\",\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n supportsTemperature: false,\n preferKie: true,\n },\n {\n id: \"claude-sonnet-5.5\",\n displayName: \"Claude Sonnet 5.5\",\n series: \"Claude\",\n desc: \"Latest Sonnet, near-Opus quality at Sonnet cost\",\n tier: \"standard\",\n kieFormat: \"messages\",\n // KIE serves it on the Claude-native messages dialect under its plain id\n // (docs.kie.ai/market/claude/claude-sonnet-5-5.md — the page is\n // claude-opus-5's with the model name swapped). Live-probed 2026-10-08 on\n // the streaming wire: plain, effort, and forced/auto+strict tool calls all\n // answered.\n kieSlugOrModel: \"claude-sonnet-5-5\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n // Anthropic 400s a forced tool_choice on this model. KIE's proxy happened\n // to accept one in the probe, but the direct lane is where every\n // effort-bearing and every streamed structured call goes.\n supportsForcedToolChoice: false,\n conversationBoundThinking: true,\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-sonnet-5-5\",\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n // Anthropic rejects non-default sampling values on this model (KIE's proxy\n // accepted temperature: 0.2 in the probe; the direct lane is the contract).\n supportsTemperature: false,\n preferKie: true,\n // Adaptive thinking runs when no thinking param is sent (vendor default).\n thinkingDefaultOn: true,\n },\n {\n id: \"claude-opus-4.8\",\n displayName: \"Claude Opus 4.8\",\n series: \"Claude\",\n desc: \"Previous-gen Opus, long-horizon work\",\n tier: \"premium\",\n kieFormat: \"messages\",\n kieSlugOrModel: \"claude-opus-4-8\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-opus-4-8\",\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n supportsTemperature: false,\n preferKie: true,\n },\n {\n id: \"claude-opus-5\",\n displayName: \"Claude Opus 5\",\n series: \"Claude\",\n // Demoted 2026-10-08 when claude-opus-5.5 registered.\n desc: \"Previous Opus, deep agentic reasoning\",\n tier: \"premium\",\n kieFormat: \"messages\",\n // KIE serves Opus 5 on the Claude-native messages dialect under the plain\n // id (docs.kie.ai/market/claude/claude-opus-5.md) — same path shape as\n // claude-opus-4-8 / claude-fable-5.\n kieSlugOrModel: \"claude-opus-5\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-opus-5\",\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n supportsTemperature: false,\n preferKie: true,\n // Opus 5 reasons with NO thinking param sent (vendor default flipped from\n // Opus 4.8/4.7) — so every call needs output headroom, not just xhigh/max.\n thinkingDefaultOn: true,\n },\n {\n id: \"claude-opus-5.5\",\n displayName: \"Claude Opus 5.5\",\n series: \"Claude\",\n // Positioned as Fable-class (decided 2026-10-08: offered wherever Fable is).\n desc: \"Latest Opus, frontier-class reasoning\",\n tier: \"premium\",\n kieFormat: \"messages\",\n // KIE plain id on the messages dialect (docs.kie.ai/market/claude/\n // claude-opus-5-5 — claude-opus-5's page with the name swapped).\n // Live-probed 2026-10-08 on the streaming wire (plain + effort); the KIE\n // Claude lane was erroring for claude-opus-5 too during the tool probes.\n kieSlugOrModel: \"claude-opus-5-5\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n // Forced tool_choice is a 400 on this model (vendor docs) — see the field.\n supportsForcedToolChoice: false,\n conversationBoundThinking: true,\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-opus-5-5\",\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n supportsTemperature: false,\n preferKie: true,\n // Thinking cannot be turned off on this model at all (`disabled` is a 400\n // at every effort); with no effort sent it runs adaptive at the vendor's\n // `medium` default. Nothing on our wire sends `disabled`.\n thinkingDefaultOn: true,\n },\n {\n id: \"claude-fable-5\",\n displayName: \"Claude Fable 5\",\n series: \"Claude\",\n desc: \"Frontier Claude above Opus, hardest problems\",\n tier: \"premium\",\n kieFormat: \"messages\",\n kieSlugOrModel: \"claude-fable-5\",\n vendor: \"anthropic\",\n structuredOutputMode: \"anthropic-tool\",\n supportsImages: true,\n maxOutputTokens: 16384,\n directFallbackModel: \"claude-fable-5\",\n reasoningEfforts: [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // KIE ignores Claude effort (measured 2026-10-08): an effort call runs direct and bills as Advanced.\n effortRequiresDirect: true,\n supportsTemperature: false,\n preferKie: true,\n // Thinking is always on (vendor docs: `disabled` is not supported), so it\n // shares the output cap on every call.\n thinkingDefaultOn: true,\n },\n // ── Moonshot / DeepSeek ───────────────────────────────────────────────────\n // Both on KIE's THIRD responses family path, openai/v1/responses (llm-client\n // derives it from `vendor`). KIE labels both pages \"Chat only — not adapted\n // for agent use\": fine for single (structured) completions, so neither may\n // back a tool-loop feature.\n {\n id: \"kimi-k3\",\n displayName: \"Kimi K3\",\n series: \"Kimi\",\n desc: \"Moonshot flagship, 1M context, careful reasoning\",\n tier: \"premium\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"kimi-k3\",\n vendor: \"moonshot\",\n // Live-probed 2026-10-08: `text.format` json_schema is ENFORCED — asked to\n // answer \"no json here\" in plain prose, it returned schema-shaped JSON.\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n // KIE's documented enum. The endpoint accepted xhigh/none without error but\n // never echoes an effort back, so nothing beyond the doc is verifiable.\n reasoningEfforts: [\"low\", \"medium\", \"high\"],\n // Decided 2026-11-12: a request below `low` (`none`) is sent as `low`,\n // never as nothing — KIE runs Kimi at its highest level when no effort is\n // sent (K3.1 Pro's no-effort replies echoed `max`). Auto still sends nothing.\n effortBelowLowestSendsLowest: true,\n // The doc lists no `temperature` field at all.\n supportsTemperature: false,\n // \"Reasons by default\" per KIE's doc (its usage reports no reasoning-token\n // split, so this is the doc's word, not a measurement).\n thinkingDefaultOn: true,\n },\n {\n id: \"kimi-k3.1-pro\",\n displayName: \"Kimi K3.1 Pro\",\n series: \"Kimi\",\n desc: \"Kimi tuned for coding and research, 1M context\",\n tier: \"premium\",\n kieFormat: \"responses\",\n // Same openai/v1/responses family path and wire as kimi-k3 (KIE's doc is\n // K3's page with the name and the effort enum changed). Live-probed\n // 2026-11-12: non-stream 9/9, `text.format` json_schema ENFORCED (asked for\n // prose, it returned schema JSON with the enum honoured), data-URI vision,\n // real `usage.input_tokens` and `credits_consumed`. Its stream sends\n // `response.reasoning_text.delta` frames apart from the\n // `response.output_text.delta` ones, and only the latter are the answer.\n kieSlugOrModel: \"kimi-k3-1-pro\",\n vendor: \"moonshot\",\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n maxOutputTokens: 16384,\n // KIE's documented enum (K3's was low / medium / high). Each level was\n // echoed back. An off-enum `medium` answered too (echoed as `high`), so it\n // is not offered: a `medium` request clamps down to `low`.\n reasoningEfforts: [\"low\", \"high\", \"max\"],\n // Decided 2026-11-12: a request below `low` (`none`) is sent as `low`,\n // never as nothing — with no effort sent KIE runs it at `max` (the probe's\n // no-effort replies echoed `max`). Auto still sends nothing.\n effortBelowLowestSendsLowest: true,\n // The doc lists no `temperature` field at all, as K3's.\n supportsTemperature: false,\n // Measured: every probe call reported reasoning tokens (20 to 163), the\n // no-effort ones included (they echoed effort `max`).\n thinkingDefaultOn: true,\n },\n {\n id: \"deepseek-v4.1-flash\",\n displayName: \"DeepSeek V4.1 Flash\",\n series: \"DeepSeek\",\n desc: \"Very cheap and fast, solid reasoning\",\n tier: \"economy\",\n kieFormat: \"responses\",\n kieSlugOrModel: \"deepseek-v4-1-flash\",\n vendor: \"deepseek\",\n // Live-probed 2026-10-08: json_schema echoed `strict: true` and enforced.\n structuredOutputMode: \"responses-json-schema\",\n supportsImages: true,\n // ADVISORY ONLY: KIE documents `max_output_tokens` as \"not supported … no\n // effect\" on this model (a probe sending it was accepted and ignored), so\n // neither this cap nor the reasoning floor binds its output length, and the\n // `incomplete` cap-stop signal cannot fire from our own cap.\n maxOutputTokens: 16384,\n // The endpoint takes none/minimal/low/medium/high/xhigh/max; each of none,\n // low and xhigh was echoed back. `minimal` is not in our ladder.\n reasoningEfforts: [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n // Documented \"not supported … no effect\".\n supportsTemperature: false,\n thinkingDefaultOn: true,\n },\n] as const\n\nexport const LLM_MODEL_IDS = LLM_MODELS.map((m) => m.id)\n\n/** True when the model is registered but retired (see `LlmModelDef.retired`). */\nexport function isLlmModelRetired(id: string): boolean {\n return getLlmModel(id)?.retired === true\n}\n\n/** The models a picker may OFFER: the registry minus retired entries. The\n * accepted set is still {@link LLM_MODEL_IDS}. */\nexport const PICKABLE_LLM_MODELS: readonly LlmModelDef[] = LLM_MODELS.filter((m) => !m.retired)\n\n/**\n * {@link PICKABLE_LLM_MODELS}, plus `currentId`'s own entry when it is a\n * retired model — for a plain select that has to keep showing a saved node's\n * value as selected. Registry order either way.\n */\nexport function pickableLlmModels(currentId?: string): LlmModelDef[] {\n return LLM_MODELS.filter((m) => !m.retired || m.id === currentId)\n}\n\n/** Vision models that can return GUARANTEED structured output — the\n * describe-to-picker analyzer forces a schema over an image, so its model\n * pickers AND the backend route gate offer exactly these: Anthropic (forced\n * tool), Gemini (KIE `response_format`), and GPT responses-format models\n * (KIE `text.format` json_schema — vision+schema live-verified 2026-07-14).\n * Single source of truth so the picker, the config panel, and the route gate\n * can't drift. */\nexport const STRUCTURED_VISION_MODELS = LLM_MODELS.filter(\n (m) => m.supportsImages && m.structuredOutputMode != null,\n)\n\n/**\n * How a structured call's schema goes on the wire for `model`: its trusted\n * `structuredOutputMode`, else its `structuredOutputHint`; undefined = the\n * schema is not sent at all (a model with neither: plain text, parsed and\n * re-asked). What the request builders read — never a TRUST decision, which\n * reads `structuredOutputMode` alone.\n */\nexport function structuredWireMode(\n model: Pick<LlmModelDef, \"structuredOutputMode\" | \"structuredOutputHint\">,\n): LlmModelDef[\"structuredOutputMode\"] {\n return model.structuredOutputMode ?? model.structuredOutputHint\n}\n\n/**\n * Does a structured call on `modelId` (unset = `feature`'s default model) send\n * its schema ({@link structuredWireMode})? On the wire, or in the system prompt\n * on a lane that carries it there (`kieSchemaInPrompt`): either way the model\n * reads it, so a request's size counts it. A schema that is not sent is not\n * read by the model. A model the registry does not know counts as yes (the\n * larger size).\n */\nexport function llmSendsSchema(modelId: string | undefined, feature?: string): boolean {\n const id = modelId || (feature ? LLM_FEATURE_DEFAULTS[feature as LlmFeature] : undefined)\n const model = id ? getLlmModel(id) : undefined\n return !model || structuredWireMode(model) !== undefined\n}\n\n/**\n * Models {@link STRUCTURED_VISION_MODELS} carries that describe-to-picker does\n * NOT offer — now none.\n *\n * Claude Fable 5 was withheld here (production cost audit, 2026-10-20): a\n * legend-sized read cost far above every tier rung. Metered pricing charges\n * each read what it really costs (tokens × the model's rate on the lane that\n * served it), so nothing needs withholding and the set is empty.\n *\n * @deprecated Always empty since metered LLM pricing. Kept exported so existing\n * importers keep compiling; it will be removed in a future major.\n */\nexport const DESCRIBE_TO_PICKER_WITHHELD_MODELS: ReadonlySet<string> = new Set<string>()\n\n/**\n * The same (empty) set for the other legend-sized structured reads:\n * `POST /v1/text-to-picker` and `POST /v1/llm/structured`.\n *\n * @deprecated Always empty since metered LLM pricing; see\n * {@link DESCRIBE_TO_PICKER_WITHHELD_MODELS}.\n */\nexport const LLM_STRUCTURED_WITHHELD_MODELS: ReadonlySet<string> = DESCRIBE_TO_PICKER_WITHHELD_MODELS\n\n/**\n * The models describe-to-picker offers and accepts: the structured vision\n * models minus {@link DESCRIBE_TO_PICKER_WITHHELD_MODELS} (empty — every one). The ONE list the\n * route gate, the config panel and the quick strip read, so a model the route\n * refuses is never offered and a saved node naming one is snapped to the\n * default (the route answers it with a `validation_error`).\n */\nexport const DESCRIBE_TO_PICKER_MODELS = STRUCTURED_VISION_MODELS.filter(\n (m) => !DESCRIBE_TO_PICKER_WITHHELD_MODELS.has(m.id),\n)\n\n/**\n * Vendor presentation order + labels for model pickers. Every LlmVendor MUST\n * appear in the order list (guarded by a registry test) so a new vendor can't\n * ship with its models silently sorted to the end of every menu unlabeled.\n * Alphabetical on purpose: stable, and no vendor-preference fights.\n */\nexport const LLM_VENDOR_ORDER: readonly LlmVendor[] = [\"anthropic\", \"deepseek\", \"google\", \"moonshot\", \"openai\", \"xai\"]\nexport const LLM_VENDOR_LABELS: Record<LlmVendor, string> = {\n anthropic: \"Anthropic\",\n deepseek: \"DeepSeek\",\n google: \"Google\",\n moonshot: \"Moonshot AI\",\n openai: \"OpenAI\",\n xai: \"xAI\",\n}\n\nconst TIER_RANK: Record<LlmTier, number> = { economy: 0, standard: 1, premium: 2 }\n\nexport interface LlmModelGroup {\n vendor: LlmVendor\n /** Display heading for the group (LLM_VENDOR_LABELS[vendor]). */\n label: string\n models: LlmModelDef[]\n}\n\n/**\n * The ONE ordering every LLM model menu renders: grouped by vendor (in\n * LLM_VENDOR_ORDER), and inside each group sorted economy → standard → premium\n * (registry order breaks ties, which keeps family generations adjacent).\n * A flat registry-order dump was genuinely hard to scan at 17 models — every\n * picker (config panel, quick strips, quick toolbar) derives from this so the\n * menus can't drift apart. Groups with no models (after `filter`) are omitted.\n * Retired models are never listed, whatever list is passed in: a menu offers\n * only what can be picked (a saved retired value is labelled by the caller).\n */\nexport function groupLlmModelsByVendor(models: readonly LlmModelDef[] = LLM_MODELS): LlmModelGroup[] {\n const groups: LlmModelGroup[] = []\n for (const vendor of LLM_VENDOR_ORDER) {\n const members = models\n .filter((m) => m.vendor === vendor && !m.retired)\n .sort((a, b) => TIER_RANK[a.tier] - TIER_RANK[b.tier])\n if (members.length > 0) groups.push({ vendor, label: LLM_VENDOR_LABELS[vendor], models: members })\n }\n return groups\n}\n\n/** {@link groupLlmModelsByVendor} flattened — for menus that can't render\n * group headers (e.g. the compact node quick strips) but should still read\n * vendor-clustered and tier-ordered. */\nexport function orderedLlmModels(models: readonly LlmModelDef[] = LLM_MODELS): LlmModelDef[] {\n return groupLlmModelsByVendor(models).flatMap((g) => g.models)\n}\n\nexport type LlmFeature =\n | \"ai-writer\"\n | \"llm-chat\"\n | \"prompt-helper\"\n | \"scene-graph-ai\"\n | \"after-effects\"\n | \"motion-graphics\"\n | \"motion-graphics-lottie\"\n | \"lottie-overlay\"\n | \"3d-title\"\n // Scene3D previz authoring — generate-3d-scene AND edit-3d-scene share one\n // feature: both send the model a scene (the edit sends the WHOLE plan in) and\n // both get back structured geometry, so the token profile is the same shape.\n // The deterministic edit lane never reaches an LLM and bills the separate\n // zero-cost `3d-scene-ops` identifier instead.\n | \"3d-scene\"\n | \"image-to-text\"\n // Per-ad creative analysis on the social scraper nodes (Meta Ads first):\n // one structured vision call per ad, priced per REQUESTED ad by tier and\n // folded into the scrape's own identifier (packages/shared/meta-ads-scrape).\n | \"meta-ads-analysis\"\n | \"describe-to-picker\"\n | \"qa-check\"\n | \"generate-script\"\n | \"translate\"\n | \"image-critic\"\n // Choose Best (reduce) — the pick-best-llm strategy's judge. Its own\n // feature (not ai-writer, which it used to piggyback on) so the model\n // default and the tiered credit ids are the strategy's own.\n | \"pick-best-llm\"\n // In-app Workflow Copilot turns (backend agent loop; metered, reservation\n // ceiling under `STATIC_CREDIT_COSTS[\"workflow-copilot\"]`).\n | \"workflow-copilot\"\n // \"Steal the format\": Content Recipe (why a post worked, one structured\n // call over its analysis) and Content Ideas (recipes + brand → ideas, a\n // call per five ideas). Cloud-only; the implementation is a private plugin.\n // Ideas are priced per batch of five — see content-recipe-ideas.ts.\n | \"content-recipe\"\n | \"content-ideas\"\n\n/** Engine-dependent LlmFeature for the motion-graphics node (design §8: every credit-id site must branch on engine). */\nexport function motionGraphicsFeature(engine?: string): LlmFeature {\n return engine === \"lottie\" ? \"motion-graphics-lottie\" : \"motion-graphics\"\n}\n\n/** Feature → default model when user hasn't selected one */\nexport const LLM_FEATURE_DEFAULTS: Record<LlmFeature, string> = {\n \"ai-writer\": \"claude-sonnet-5.5\",\n \"llm-chat\": \"gemini-3.6-flash\",\n \"prompt-helper\": \"gemini-3.6-flash\",\n \"scene-graph-ai\": \"claude-sonnet-5.5\",\n \"after-effects\": \"claude-sonnet-5.5\",\n \"motion-graphics\": \"claude-sonnet-5.5\",\n \"motion-graphics-lottie\": \"claude-sonnet-5.5\",\n \"lottie-overlay\": \"claude-sonnet-5.5\",\n \"3d-title\": \"claude-sonnet-5.5\",\n \"3d-scene\": \"claude-sonnet-5.5\",\n \"image-to-text\": \"claude-sonnet-5.5\",\n // Economy on purpose: the analysis reads ONE frame + the copy per ad and\n // runs once per returned ad — volume, not depth. Must stay an image-capable\n // structured-output model (STRUCTURED_VISION_MODELS); a registry test pins it.\n \"meta-ads-analysis\": \"gemini-3.6-flash\",\n // Economy by decision (2026-10-20, from a production cost audit): the\n // analyzer's legend-sized prompt made the former default, Opus 5.5 at high\n // on Anthropic's own API, the platform's most expensive read per run. Gemini\n // 3.8 Flash reads it on the aggregator at the cheapest rung; Opus 5.5 at\n // high stays available by choice (LLM_FEATURE_DEFAULT_EFFORTS). Still an\n // image-capable structured model (DESCRIBE_TO_PICKER_MODELS) — a registry\n // test pins it.\n \"describe-to-picker\": \"gemini-3.8-flash\",\n \"qa-check\": \"gemini-3.6-flash\",\n \"generate-script\": \"gemini-3.6-flash\",\n \"translate\": \"gemini-3.6-flash\",\n \"image-critic\": \"claude-sonnet-5.5\",\n \"pick-best-llm\": \"claude-sonnet-5.5\",\n \"workflow-copilot\": \"claude-sonnet-5\",\n // Both economy on purpose — measured: ten ideas in Hebrew took ~1 min here\n // and ~3.5 min (two calls) on claude-sonnet-4.6. The private plugin keeps\n // the same two defaults for API callers that omit the model.\n \"content-recipe\": \"gemini-3.6-flash\",\n \"content-ideas\": \"gemini-3.6-flash\",\n}\n\n/**\n * Billed features with no defaults of their own → the feature whose defaults\n * (model, {@link LLM_FEATURE_DEFAULT_EFFORTS} effort) their route borrows:\n * Generate Structured runs on Generate Text's, Text to Picker on Describe to\n * Picker's, the Choose Best judge on `pick-best-llm`'s. Read it through\n * {@link llmDefaultsFeature}. Structure only — no prices.\n */\nexport const LLM_FEATURE_DEFAULTS_FROM: Readonly<Record<string, LlmFeature>> = {\n \"llm-structured\": \"llm-chat\",\n \"text-to-picker\": \"describe-to-picker\",\n \"reduce:pick-best-llm\": \"pick-best-llm\",\n}\n\n/** The feature whose defaults a call of `feature` runs with: its {@link LLM_FEATURE_DEFAULTS_FROM} entry, else itself. */\nexport function llmDefaultsFeature(feature: string): string {\n return Object.hasOwn(LLM_FEATURE_DEFAULTS_FROM, feature) ? LLM_FEATURE_DEFAULTS_FROM[feature]! : feature\n}\n\n/**\n * The model describe-to-picker re-asks ONCE when a Claude analyzer could not\n * answer for a platform-side reason: its direct lane down or the platform's\n * account refused, and the KIE retry of the same Claude model failing too,\n * answering with nothing valid, or answering empty. KIE's Claude endpoint\n * drops images when tools are sent, so that retry is the weak leg; see\n * backend/src/lib/llm/kie-lane.ts.\n *\n * Gemini because a Claude outage does not touch it: another vendor, on its\n * own lanes. Must stay an image-capable structured-output model\n * (STRUCTURED_VISION_MODELS — a registry test pins it); the route charges an\n * answer from it at this model's own credit price.\n */\nexport const DESCRIBE_TO_PICKER_FALLBACK_MODEL = \"gemini-3.8-flash\"\n\n/**\n * Feature → ONE model with a recipe: the reasoning effort it runs at on that\n * feature when the caller sends none. Read it through\n * {@link defaultReasoningEffort}, never directly: the effort belongs to that\n * model, so a call on any other model — the feature's default included, when\n * it is a different model — must not pick it up.\n */\nexport const LLM_FEATURE_DEFAULT_EFFORTS: Partial<Record<LlmFeature, { model: string; effort: LlmReasoningEffort }>> = {\n // Decided 2026-10-09 from the picker bake-off v2: Opus 5.5 at `high` read\n // 4/4 portraits with the most attributes per image, ~9 s a read. Its effort\n // only takes effect on Anthropic's own API (`effortRequiresDirect`), so a\n // read on it runs direct — and bills as such (`llmServesDirect`). It was the\n // feature's default model until 2026-10-20 (see LLM_FEATURE_DEFAULTS); the\n // recipe stays with the model, so choosing Opus 5.5 still reads at high.\n \"describe-to-picker\": { model: \"claude-opus-5.5\", effort: \"high\" },\n}\n\n/**\n * The reasoning effort a `feature` call runs at when the caller sends none:\n * the recipe effort ({@link LLM_FEATURE_DEFAULT_EFFORTS}), but ONLY while the\n * call runs on the recipe's model — named, or reached because the model was\n * omitted (`undefined` / `\"\"`) and it is the feature's default. A caller on\n * any other model with no effort gets `undefined`: that model's Auto.\n *\n * WHY only on that model: the effort is part of that model's recipe, not a\n * feature policy. Forcing `high` on a Gemini or GPT call that never asked for\n * it would change the timing of every existing workflow that picked one (and,\n * on a Claude model, its lane and its bill) — which is also why the feature's\n * default model gets it only when it IS the recipe's model.\n *\n * The one place the route, the node's credit badge and its effort pickers\n * read, so what runs, what is billed and what is shown cannot disagree.\n */\nexport function defaultReasoningEffort(feature: string, modelId?: string): LlmReasoningEffort | undefined {\n const recipe = LLM_FEATURE_DEFAULT_EFFORTS[feature as LlmFeature]\n if (!recipe) return undefined\n const effective = modelId || LLM_FEATURE_DEFAULTS[feature as LlmFeature]\n return getLlmModel(effective)?.id === recipe.model ? recipe.effort : undefined\n}\n\n/**\n * Per-model multimodal input capabilities. Drives both frontend UI gating\n * and backend route-level filtering for the LLM Chat node references.\n *\n * As of 2026-05: Claude Messages API supports text + image only (no audio,\n * no video). Gemini 2/3 family supports image + video + audio natively.\n * GPT-5.x via KIE chat-completions / responses supports image only — audio\n * input requires a separate audio-capable model we don't route to today.\n *\n * `file` (decided 2026-11-13): the model reads documents (PDF) sent with the\n * call. Declared on each model that does — GPT-6.1 Terra, and Gemini 4\n * Hydrogen from 2026-11-17 — and never derived for any other: absent means\n * no. Read it through {@link llmAcceptsFiles}. A model that declares it also\n * declares how a file is sent to it (`fileWire` on its registry entry).\n */\nexport const LLM_MODALITY_CAPS: Record<string, LlmModalityCaps> = {\n // Keeps full caps after KIE dropped its channel (2026-11-13): it stays a\n // VIDEO_ANALYSIS_LLM_MODELS member as the legacy `fast` backing (below), so a\n // stored raw `llmModel: \"gemini-3-flash\"` still resolves and prices under its\n // own credit family.\n \"gemini-3-flash\": { image: true, video: true, audio: true },\n \"gemini-3.6-flash\": { image: true, video: true, audio: true },\n // gemini-3.7-flash is IMAGE-ONLY by DECISION, not omission: full video+audio\n // caps would auto-enroll it in VIDEO_ANALYSIS_LLM_MODELS (derived below) and\n // force a video-analysis tier + pricing decision that is deliberately\n // deferred while the smart-family A/B routes this model internally (#747).\n // Flip these two flags ONLY together with that VA-side decision.\n \"gemini-3.7-flash\": { image: true, video: false, audio: false },\n // gemini-3.8-flash takes video + audio (decided 2026-11-13): it backs the\n // video-analysis `fast` tier (VIDEO_ANALYSIS_TIERS below) since KIE dropped\n // gemini-3-flash's channel, which is what enrols it in\n // VIDEO_ANALYSIS_LLM_MODELS. Its KIE lane reads a video URL sent as an\n // `image_url` part, the same channel gemini-3-flash used (live-verified\n // 2026-11-13 with the analysis request: prompt tokens include the clip).\n \"gemini-3.8-flash\": { image: true, video: true, audio: true },\n \"gemini-3.1-pro\": { image: true, video: true, audio: true },\n // gemini-4-argon is IMAGE-ONLY by DECISION, not omission (decided 2026-10-17):\n // the model DOES read video and audio, but full caps would\n // auto-enroll it in VIDEO_ANALYSIS_LLM_MODELS (derived below) and force a\n // video-analysis tier + pricing decision. That waits on a Video Analysis\n // bake-off; flip these two flags ONLY together with its outcome.\n \"gemini-4-argon\": { image: true, video: false, audio: false },\n // gemini-4-carbon takes video + audio (decided 2026-11-13): it backs the\n // video-analysis `ultra` tier (VIDEO_ANALYSIS_TIERS below), which is what\n // enrols it in VIDEO_ANALYSIS_LLM_MODELS. The same caps let LLM Chat send it\n // video and audio references, and let a trend's LLM step that reads the clip\n // choose it (modelReadsClip) — both intended. It was image-only from\n // 2026-11-12 until this enrolment was decided.\n \"gemini-4-carbon\": { image: true, video: true, audio: true },\n // gemini-4-hydrogen takes video + audio ON THE LLM NODES ONLY (decided\n // 2026-11-16; probed 2026-11-17): it is listed in LLM_NODE_ONLY_MEDIA_MODELS\n // (below), so these caps do NOT enrol it in VIDEO_ANALYSIS_LLM_MODELS or let\n // a trend's clip-reading LLM step choose it. Its KIE lane reads both through\n // the `image_url` part the chat-completions builder already sends (an https\n // URL or a `data:` URL; an `input_audio` part is dropped by KIE, billed, so\n // it is never sent): a 52 s 480p clip by URL read correctly 3 of 3, its\n // sound heard, ≈105 prompt tokens a second (≈74 of frames, ≈32 of sound);\n // an mp3 by URL or data URL transcribed 3 of 3, ≈32 tokens a second. KIE\n // takes a linked file up to 74 MB and picks its type from the link's\n // extension (an extensionless link is refused). Longer clips and long\n // audio were not probed. Google's own API (where a media call is pinned\n // when this install has a Gemini key, as Carbon's) lists video and audio\n // input for it; not probed with media.\n // It also reads documents (PDF, decided 2026-11-17; `fileWire` on its\n // registry entry says how each lane is sent one). The `file` cap is read only\n // by the LLM nodes (`llmAcceptsFiles`), so it enrols the model in nothing else.\n \"gemini-4-hydrogen\": { image: true, video: true, audio: true, file: true },\n \"claude-haiku-4.5\": { image: true, video: false, audio: false },\n \"claude-haiku-5.5\": { image: true, video: false, audio: false },\n \"claude-sonnet-4.6\": { image: true, video: false, audio: false },\n \"claude-opus-4.7\": { image: true, video: false, audio: false },\n \"gpt-5.2\": { image: true, video: false, audio: false },\n \"gpt-5.4\": { image: true, video: false, audio: false },\n \"gpt-5.5\": { image: true, video: false, audio: false },\n \"gpt-5.6-luna\": { image: true, video: false, audio: false },\n \"gpt-5.6-terra\": { image: true, video: false, audio: false },\n \"gpt-5.6-sol\": { image: true, video: false, audio: false },\n // KIE's GPT-6 doc lists text + image + file inputs only — no video, no audio.\n \"gpt-6-astra\": { image: true, video: false, audio: false },\n // Same KIE doc as astra: text + image + file inputs only.\n \"gpt-6-luna\": { image: true, video: false, audio: false },\n \"gpt-6-sol\": { image: true, video: false, audio: false },\n \"gpt-6.1-sol\": { image: true, video: false, audio: false },\n // Reads PDFs (`file`, probed 2026-11-13: KIE took a PDF inline and by link,\n // and refused a text file and a Word file — so PDF only).\n \"gpt-6.1-terra\": { image: true, video: false, audio: false, file: true },\n \"grok-4.6\": { image: true, video: false, audio: false },\n \"grok-4.7\": { image: true, video: false, audio: false },\n \"claude-sonnet-5\": { image: true, video: false, audio: false },\n \"claude-sonnet-5.5\": { image: true, video: false, audio: false },\n \"claude-opus-4.8\": { image: true, video: false, audio: false },\n \"claude-opus-5\": { image: true, video: false, audio: false },\n \"claude-opus-5.5\": { image: true, video: false, audio: false },\n \"claude-fable-5\": { image: true, video: false, audio: false },\n // KIE documents text + image input only for both.\n \"kimi-k3\": { image: true, video: false, audio: false },\n \"kimi-k3.1-pro\": { image: true, video: false, audio: false },\n \"deepseek-v4.1-flash\": { image: true, video: false, audio: false },\n}\n\n/**\n * Models whose video and audio caps are for the LLM nodes ONLY (LLM Chat, the\n * MCP `generate_text` tool and their API routes) and never enrol them in\n * another product that derives \"the models that read video\" from\n * {@link LLM_MODALITY_CAPS}: Video Analysis ({@link VIDEO_ANALYSIS_LLM_MODELS})\n * and a trend's clip-reading LLM step. Gemini 4 Hydrogen (decided 2026-11-16).\n */\nexport const LLM_NODE_ONLY_MEDIA_MODELS: readonly string[] = [\"gemini-4-hydrogen\"]\n\n/** Whether `modelId` reads video/audio on the LLM nodes only ({@link LLM_NODE_ONLY_MEDIA_MODELS}). */\nexport function readsMediaOnLlmNodesOnly(modelId: string | undefined): boolean {\n return Boolean(modelId && LLM_NODE_ONLY_MEDIA_MODELS.includes(modelId))\n}\n\n/**\n * Whether `modelId` reads VIDEO for a product other than the LLM nodes (Video\n * Analysis, a trend's clip step, anything new): its `video` cap, less\n * {@link LLM_NODE_ONLY_MEDIA_MODELS}. Every such product reads the cap through\n * this, never `.video` directly (`tools/__tests__/llm-media-caps-guard.test.mjs`).\n */\nexport function readsVideoOutsideLlmNodes(modelId: string | undefined): boolean {\n return getLlmModalityCaps(modelId).video && !readsMediaOnLlmNodesOnly(modelId)\n}\n\n/** The audio twin of {@link readsVideoOutsideLlmNodes}. */\nexport function readsAudioOutsideLlmNodes(modelId: string | undefined): boolean {\n return getLlmModalityCaps(modelId).audio && !readsMediaOnLlmNodesOnly(modelId)\n}\n\n/** Capability lookup with safe default — unknown models get image-only. */\nexport function getLlmModalityCaps(modelId: string | undefined): LlmModalityCaps {\n if (!modelId) return { image: true, video: false, audio: false }\n return LLM_MODALITY_CAPS[modelId] ?? { image: true, video: false, audio: false }\n}\n\n/** What a model reads besides text (see {@link LLM_MODALITY_CAPS}). */\nexport interface LlmModalityCaps {\n image: boolean\n video: boolean\n audio: boolean\n /** Documents (PDF). Set only where it is true. */\n file?: true\n}\n\n/** Does `modelId` read documents sent with the call (`file` in its modality caps)? An unknown model does not. */\nexport function llmAcceptsFiles(modelId: string | undefined): boolean {\n return Boolean(modelId && LLM_MODALITY_CAPS[modelId]?.file)\n}\n\n/** How `modelId` is sent a document on each lane (`fileWire` on its registry entry); `undefined` for a model that reads none. */\nexport function llmFileWire(modelId: string | undefined): LlmFileWire | undefined {\n return llmAcceptsFiles(modelId) ? LLM_MODELS.find((m) => m.id === modelId)?.fileWire : undefined\n}\n\n/** The models that read documents, in registry order — what a refusal names. */\nexport const LLM_FILE_MODELS: readonly LlmModelDef[] = LLM_MODELS.filter((m) => llmAcceptsFiles(m.id))\n\n/** The most documents one LLM call takes (`referenceFileUrls`). */\nexport const LLM_REFERENCE_FILES_MAX = 5\n\n/**\n * The most bytes the documents of one LLM call may total: 6 MiB. They are sent\n * inline with the call, which carries about ten million characters in all,\n * and base64 makes 6 MiB about 8.4 million of them (the rest is the call's\n * images').\n */\nexport const LLM_REFERENCE_FILES_MAX_TOTAL_BYTES = 6 * 1024 * 1024\n\n/**\n * The most pages the documents of one LLM call may have IN ALL (decided\n * 2026-11-13: 100 for the whole call, not per file, until a probe shows the\n * aggregator reads more in one call).\n */\nexport const LLM_REFERENCE_FILES_MAX_PAGES = 100\n\n/** The document types an LLM call takes: PDF only (the aggregator refused text and Word files, 2026-11-13). */\nexport const LLM_REFERENCE_FILE_MIME_TYPES: readonly string[] = [\"application/pdf\"]\n\n/**\n * Dash-form aliases resolve to their canonical dot-form ids. Several wire\n * contracts carry dash forms (`PIPELINE_PINNABLE_SCRIPT_LLMS`, provider slugs,\n * configs persisted before the id scheme settled), while `LLM_MODELS` keys the\n * canonical `major.minor` form — an exact-only lookup makes every such caller\n * throw \"Unknown LLM model\" at run time. Normalizing here (instead of editing\n * the enums) keeps stored configs and published-package consumers valid.\n */\nfunction dashAliasToCanonical(id: string): string {\n return id.replace(/-(\\d+)-(\\d+)$/, \"-$1.$2\")\n}\n\n/**\n * Retired provider slugs that still name a registered model — a model whose KIE\n * lane moved to another model's endpoint (`kieServedAs`) no longer carries its\n * old slug, but stored configs and job rows may.\n */\nconst LEGACY_PROVIDER_SLUGS: Readonly<Record<string, string>> = {\n \"gemini-3-7-flash-openai\": \"gemini-3.7-flash\",\n}\n\nexport function getLlmModel(id: string): LlmModelDef | undefined {\n const exact = LLM_MODELS.find((m) => m.id === id)\n if (exact) return exact\n const canonical = dashAliasToCanonical(id)\n if (canonical !== id) {\n const aliased = LLM_MODELS.find((m) => m.id === canonical)\n if (aliased) return aliased\n }\n const legacy = LEGACY_PROVIDER_SLUGS[id]\n if (legacy) return LLM_MODELS.find((m) => m.id === legacy)\n // Last resort: provider slugs double as historical aliases (e.g. the\n // dated Anthropic slugs, the `-preview`-suffixed Google ids) — accept any\n // model whose slug matches exactly, on either lane. A KIE slug borrowed\n // through `kieServedAs` belongs to the model that answers it, so the\n // borrower never matches on it — whatever the registry order.\n return LLM_MODELS.find(\n (m) =>\n (m.kieSlugOrModel === id && !m.kieServedAs) ||\n m.directFallbackModel === id ||\n m.directGeminiModel === id,\n )\n}\n\nexport function getLlmTier(id: string): LlmTier {\n return getLlmModel(id)?.tier ?? \"standard\"\n}\n\n/**\n * Effort levels this model actually accepts on the lane it will be served on.\n *\n * The two lanes do NOT offer the same ladder: the aggregator accepts a narrower\n * set than the vendor's own API does, which is one of the concrete things\n * Advanced mode buys. Kept as one lookup so the UI picker and the wire-side\n * clamp can never disagree about what's selectable.\n */\nexport function availableReasoningEfforts(\n modelId: string | undefined,\n advanced = false,\n): readonly LlmReasoningEffort[] {\n const model = getLlmModel(modelId ?? \"\")\n if (!model) return []\n if (advanced && supportsAdvancedMode(modelId)) {\n return model.directReasoningEfforts ?? model.reasoningEfforts ?? []\n }\n return model.reasoningEfforts ?? []\n}\n\n/**\n * Highest level the model supports that is ≤ the requested level; undefined =\n * treat as Auto. A request below the model's lowest level is dropped (Auto) —\n * except on a model that declares `effortBelowLowestSendsLowest`, where it is\n * sent as that lowest level. No request at all is always Auto.\n */\nexport function effectiveReasoningEffort(\n modelId: string | undefined,\n requested?: string,\n advanced = false,\n): LlmReasoningEffort | undefined {\n if (!requested || !(requested in EFFORT_RANK)) return undefined\n const levels = availableReasoningEfforts(modelId, advanced)\n if (!levels || levels.length === 0) return undefined\n const req = requested as LlmReasoningEffort\n let best: LlmReasoningEffort | undefined\n for (const l of levels) {\n if (EFFORT_RANK[l] <= EFFORT_RANK[req] && (best === undefined || EFFORT_RANK[l] > EFFORT_RANK[best])) best = l\n }\n if (best === undefined && getLlmModel(modelId ?? \"\")?.effortBelowLowestSendsLowest) return levels[0]\n return best\n}\n\n/**\n * Build a composite credit identifier for an LLM feature.\n * - economy tier → \"ai-writer:economy\"\n * - standard tier → \"ai-writer\" (no suffix — backward compatible)\n * - premium tier → \"ai-writer:premium\"\n * A reasoning effort of \"xhigh\" or \"max\" (after clamping to what the model\n * actually supports) bills one tier up (economy→standard, standard→premium;\n * premium stays premium). `high` is the Claude-family server default and\n * never bumps.\n */\n\n/**\n * The sampling defaults each LLM feature's route sends when Advanced mode is\n * OFF — and therefore the values its Advanced panel must seed the sliders with.\n *\n * SINGLE SOURCE because the two used to disagree: the routes hardcoded their\n * own literals while the toggle fell back to 0.7/2048, so the panel displayed\n * a temperature the run never used, and one arrow-key press on 3D Title's Max\n * Tokens silently cut its budget from 3072 to 2048 on a node that emits\n * structured JSON.\n *\n * `structuredOutput` marks the features whose prompt asks the model for JSON —\n * a high temperature measurably degrades schema adherence there, so the panel\n * warns. Absent `temperature` means the route sends none (vendor default).\n */\nexport interface LlmRouteDefaults {\n temperature?: number\n maxTokens?: number\n structuredOutput?: true\n}\n\nexport const LLM_ROUTE_DEFAULTS: Record<string, LlmRouteDefaults> = {\n \"llm-chat\": { temperature: 0.7, maxTokens: 8192 },\n \"ai-writer\": { temperature: 0.7, maxTokens: 8192 },\n \"prompt-helper\": { temperature: 0.7, maxTokens: 8192, structuredOutput: true },\n \"generate-script\": { maxTokens: 16384, structuredOutput: true },\n \"qa-check\": { maxTokens: 1024, structuredOutput: true },\n \"image-critic\": { maxTokens: 1024, structuredOutput: true },\n \"image-to-text\": { maxTokens: 1024 },\n \"describe-to-picker\": { structuredOutput: true },\n \"scene-graph-ai\": { temperature: 0.3, maxTokens: 4096, structuredOutput: true },\n \"after-effects\": { temperature: 0.3, maxTokens: 2048, structuredOutput: true },\n \"lottie-overlay\": { temperature: 0.3, maxTokens: 2048, structuredOutput: true },\n \"motion-graphics\": { temperature: 0.3, maxTokens: 2048, structuredOutput: true },\n \"motion-graphics-lottie\": { temperature: 0.3, maxTokens: 8192, structuredOutput: true },\n \"3d-title\": { temperature: 0.4, maxTokens: 3072, structuredOutput: true },\n // A 100-object plan with keyframe tracks is the biggest structured payload\n // any composer feature emits — 3072 (3d-title's cap) truncates it mid-array.\n \"3d-scene\": { temperature: 0.3, maxTokens: 8192, structuredOutput: true },\n}\n\n/** Route defaults for a feature; `{}` for an unknown one. */\nexport function llmRouteDefaults(feature: string | undefined): LlmRouteDefaults {\n return (feature && LLM_ROUTE_DEFAULTS[feature]) || {}\n}\n\n/** One step up the economy → standard → premium ladder. Premium is the ceiling. */\nfunction bumpTier(tier: LlmTier): LlmTier {\n if (tier === \"economy\") return \"standard\"\n if (tier === \"standard\") return \"premium\"\n return tier\n}\n\n/**\n * Can this model be run in Advanced mode?\n *\n * Advanced mode pins the call to the vendor's own API, which is the only lane\n * where sampling levers (`temperature`, `maxTokens`) and the full effort range\n * actually take effect. Capability-derived from the registry — a model without\n * a direct lane simply cannot offer it, so UI and routes both gate on this\n * rather than on a hand-maintained model list.\n */\nexport function supportsAdvancedMode(modelId: string | undefined): boolean {\n const model = modelId ? getLlmModel(modelId) : undefined\n return Boolean(model?.directGeminiModel || model?.directFallbackModel)\n}\n\n/** User-facing reason a model can't offer Advanced mode. Single-sourced so the\n * config panel's disabled hint and the route's 400 say the same thing. */\nexport const ADVANCED_MODE_UNAVAILABLE_REASON =\n \"Advanced mode is available on Gemini and Claude models — switch the model to enable it.\"\n\n/**\n * Is this call served on the vendor's own API — and therefore billed as such?\n *\n * The rule (decided 2026-10-08): a call is priced on the lane it runs on.\n * It runs direct when Advanced mode is on, when the model is served nowhere\n * else (`directOnly`), or when it carries a reasoning effort on a model whose\n * effort only works there (`effortRequiresDirect` — the Claude family).\n * Everything else runs on the aggregator at its price,\n * falling back to the vendor's API only if the aggregator fails (at no extra\n * charge).\n *\n * The SINGLE decision both the credit identifier and the LLM client's routing\n * read, so what is billed and where it runs cannot disagree. Ignores a stale\n * `advancedMode` on a model with no direct lane, like the bump always has.\n */\nexport function llmServesDirect(\n modelId: string | undefined,\n reasoningEffort?: string,\n advancedMode?: boolean,\n): boolean {\n if (!supportsAdvancedMode(modelId)) return false\n if (advancedMode || getLlmModel(modelId!)?.directOnly) return true\n return Boolean(\n getLlmModel(modelId!)?.effortRequiresDirect && effectiveReasoningEffort(modelId, reasoningEffort) !== undefined,\n )\n}\n\n/**\n * The price key of a metered LLM call — what a client asks\n * `POST /v1/credits/model-costs` (or `GET /v1/credits/model-cost?model=`) for\n * the call's estimated price: `<feature>:<modelId>`, plus `:direct` when the\n * call is served on the vendor's own API ({@link llmServesDirect}), which is\n * priced at the direct rate, or — on a model whose price depends on the effort\n * (`effortPriced`, served on the aggregator) — `:effort-<level>` naming the\n * effort the call sends. On every other model the effort changes the key only\n * through its lane. Read back by {@link parseLlmPriceKeyModel}.\n *\n * With no `reasoningEffort` the default effort of the feature the call\n * borrows its defaults from applies ({@link llmDefaultsFeature},\n * {@link defaultReasoningEffort}) — the effort the call then runs at — so the\n * key names the lane (and, where it matters, the effort) the call is held and\n * charged on.\n *\n * `modelId` must already be resolved: the model the call runs on, never empty\n * (a caller with no model passes the feature's default, `LLM_FEATURE_DEFAULTS`\n * of {@link llmDefaultsFeature}). An empty id throws a `TypeError`.\n */\nexport function llmPriceKey(\n feature: string,\n modelId: string,\n reasoningEffort?: string,\n advancedMode?: boolean,\n): string {\n if (!modelId) throw new TypeError(`llmPriceKey: modelId must be a resolved model id (feature \"${feature}\")`)\n const effort = reasoningEffort ?? defaultReasoningEffort(llmDefaultsFeature(feature), modelId)\n if (llmServesDirect(modelId, effort, advancedMode)) return `${feature}:${modelId}${LLM_PRICE_KEY_DIRECT}`\n // A model whose price depends on the effort (`effortPriced`) names the one\n // the call sends — clamped as the aggregator's wire clamps it, so a level it\n // does not offer is the effort that is really sent (or none). Every other\n // model's key is unchanged.\n const sent = getLlmModel(modelId)?.effortPriced ? effectiveReasoningEffort(modelId, effort) : undefined\n return sent ? `${feature}:${modelId}${LLM_PRICE_KEY_EFFORT}${sent}` : `${feature}:${modelId}`\n}\n\n/** The price-key suffix of a call served on the vendor's own API (see {@link llmPriceKey}). */\nexport const LLM_PRICE_KEY_DIRECT = \":direct\"\n/** The price-key suffix naming the effort a call sends, on an `effortPriced` model: `:effort-<level>`. */\nexport const LLM_PRICE_KEY_EFFORT = \":effort-\"\n\n/** A price key's model part, read back by {@link parseLlmPriceKeyModel}. */\nexport interface LlmPriceKeyModel {\n modelId: string\n /** Present only for a key that names the direct lane. */\n lane?: \"direct\"\n /** Present only for a key that names an effort (an `effortPriced` model's). */\n reasoningEffort?: LlmReasoningEffort\n}\n\nconst REGISTRY_MODEL_IDS: ReadonlySet<string> = new Set(LLM_MODEL_IDS)\n\n/**\n * The part of a price key after its `<feature>:` — `<modelId>`,\n * `<modelId>:direct` or `<modelId>:effort-<level>` — read back, or null for\n * anything that is not a key {@link llmPriceKey} could build: a model that is\n * not a registry id (never a borrowed slug), an effort on a model whose price\n * does not depend on it, a level it does not offer on the aggregator, any\n * other suffix. The one reader both the server and the editor use, so every\n * key names exactly one price.\n */\nexport function parseLlmPriceKeyModel(tail: string): LlmPriceKeyModel | null {\n if (REGISTRY_MODEL_IDS.has(tail)) return { modelId: tail }\n if (tail.endsWith(LLM_PRICE_KEY_DIRECT)) {\n const modelId = tail.slice(0, -LLM_PRICE_KEY_DIRECT.length)\n return REGISTRY_MODEL_IDS.has(modelId) ? { modelId, lane: \"direct\" } : null\n }\n const at = tail.lastIndexOf(LLM_PRICE_KEY_EFFORT)\n if (at <= 0) return null\n const modelId = tail.slice(0, at)\n const level = tail.slice(at + LLM_PRICE_KEY_EFFORT.length) as LlmReasoningEffort\n const model = REGISTRY_MODEL_IDS.has(modelId) ? getLlmModel(modelId) : undefined\n if (!model?.effortPriced || !availableReasoningEfforts(modelId).includes(level)) return null\n return { modelId, reasoningEffort: level }\n}\n\n/**\n * The credit rungs an LLM feature bills on, cheapest first. `premium-direct` is\n * reached only by a premium model served direct (decided 2026-10-08): the bump\n * for running direct moves one rung on THIS ladder, so a premium model has\n * somewhere to go. The effort bump keeps the three-rung ladder.\n */\nexport const LLM_CREDIT_RUNGS = [\"economy\", \"standard\", \"premium\", \"premium-direct\"] as const\nexport type LlmCreditRung = (typeof LLM_CREDIT_RUNGS)[number]\n\n/** The credit identifier for `feature` on one rung — the standard rung is the bare feature id. */\nexport function llmCreditIdForRung(feature: string, rung: LlmCreditRung): string {\n return rung === \"standard\" ? feature : `${feature}:${rung}`\n}\n\n/** Every credit identifier a tier-priced LLM feature can bill under, in rung order. */\nexport function llmTierCreditIds(feature: string): string[] {\n return LLM_CREDIT_RUNGS.map((rung) => llmCreditIdForRung(feature, rung))\n}\n\nexport function buildLlmCreditIdentifier(\n feature: string,\n modelId?: string,\n reasoningEffort?: string,\n advancedMode?: boolean,\n): string {\n if (!modelId) return feature\n return llmCreditIdForRung(feature, llmCreditRung(modelId, reasoningEffort, advancedMode))\n}\n\n/**\n * The rung a call on `modelId` bills on — the half of\n * {@link buildLlmCreditIdentifier} a feature with its own id shape reads (the\n * social scrapers' per-post analysis), so its rung cannot drift from the LLM\n * features'.\n */\nexport function llmCreditRung(modelId: string, reasoningEffort?: string, advancedMode?: boolean): LlmCreditRung {\n let tier = getLlmTier(modelId)\n const eff = effectiveReasoningEffort(modelId, reasoningEffort)\n if (eff !== undefined && EFFORT_TIER_BUMP.has(eff)) tier = bumpTier(tier)\n // A call served on the vendor's own API (Advanced mode, a directOnly model,\n // or an effort on a model whose effort only works there — llmServesDirect)\n // bills materially more per token than the aggregator. It bumps\n // INDEPENDENTLY of the effort bump — the two are separate cost levers and\n // genuinely stack, so a max-effort advanced economy call lands at premium —\n // and on the four-rung ladder, so a premium model served direct lands at\n // `premium-direct`. A stale flag on a model with no direct lane never\n // inflates a bill.\n return llmServesDirect(modelId, reasoningEffort, advancedMode) ? bumpToDirectRung(tier) : tier\n}\n\n/** One rung up the four-rung ladder — the direct-lane bump. */\nfunction bumpToDirectRung(tier: LlmTier): LlmCreditRung {\n return tier === \"premium\" ? \"premium-direct\" : bumpTier(tier)\n}\n\n/**\n * Resolve llmModel (+ reasoningEffort, advancedMode) from raw body for the\n * creditGuard preHandler (before Zod parsing). Returns the credit identifier\n * for the given feature.\n */\nexport function resolveLlmCreditId(feature: string, body: unknown): string {\n const b = body as Record<string, unknown> | undefined\n return buildLlmCreditIdentifier(\n feature,\n b?.llmModel as string | undefined,\n b?.reasoningEffort as string | undefined,\n b?.advancedMode === true,\n )\n}\n\n/**\n * Models capable of video-analysis: capability-derived, never hand-listed\n * (route-enum-sync convention) — less the models that read media on the LLM\n * nodes only ({@link LLM_NODE_ONLY_MEDIA_MODELS}), which no Video Analysis\n * tier, price or stored `llmModel` passthrough reaches.\n */\nexport const VIDEO_ANALYSIS_LLM_MODELS: string[] = LLM_MODELS\n .filter((m) => readsVideoOutsideLlmNodes(m.id) && readsAudioOutsideLlmNodes(m.id))\n .map((m) => m.id)\n\n/**\n * Video-analysis quality TIERS — the ONLY analyzer identifiers exposed to users\n * (API, UI, docs). Each maps to an internal analysis model; the underlying\n * vendor/model name is never surfaced. Default is `pro`. The guard test\n * (video-analysis-pricing.test.ts) asserts every tier target is a real\n * VIDEO_ANALYSIS_LLM_MODELS member AND every such model is reachable by a tier,\n * so adding a video model forces a tier decision instead of silently leaking.\n *\n * `ultra` (decided 2026-11-13) reads every window with the deepest-reasoning\n * analysis model, at the same frame sampling as the other single-model tiers.\n * It is priced between the mixed tiers and `smart`.\n */\nexport const VIDEO_ANALYSIS_TIERS = { fast: \"gemini-3.8-flash\", pro: \"gemini-3.1-pro\", ultra: \"gemini-4-carbon\" } as const\nexport type VideoAnalysisModelTier = keyof typeof VIDEO_ANALYSIS_TIERS\n/**\n * Models that PREVIOUSLY backed a tier, mapped to the tier they backed.\n * They stay video+audio-capable (so they remain in VIDEO_ANALYSIS_LLM_MODELS):\n * stored raw `llmModel` values keep resolving via the passthrough in\n * `resolveVideoAnalysisModel` and keep pricing under their own credit family —\n * but no tier reaches them for NEW runs. UIs use this map to reverse a stored\n * raw id to the tier the user originally chose (video-configs fail-safe).\n * The tier guard test requires every video-capable model to be a tier target\n * OR a key here, so replacing a tier's backing model stays an explicit,\n * two-sided decision.\n */\nexport const VIDEO_ANALYSIS_LEGACY_MODELS: Record<string, VideoAnalysisModelTier> = {\n // Backed the fast tier from 2026-07 until 2026-07-29, when the economy tiers\n // moved to the cheaper lane and the older, cheaper flash. It is now the engine\n // behind the `smart` tier — but `smart` is a SENTINEL that never exposes a model\n // id, so as far as this map is concerned it no longer backs a selectable tier and\n // belongs here: stored raw `llmModel` values keep resolving and keep pricing\n // under their own credit family.\n \"gemini-3.6-flash\": \"fast\",\n // Backed the fast tier from 2026-07-29 until 2026-11-13, when KIE dropped its\n // channel (every call answers `code 422 \"The channel is not supported\"`) and\n // the fast tier moved to gemini-3.8-flash. Stored raw `llmModel` values keep\n // resolving and keep pricing under their own credit family; the analysis\n // engine serves their rolls with the current fast model.\n \"gemini-3-flash\": \"fast\",\n}\n/**\n * MIXED tiers — advanced multi-engine analysis plans whose identifier resolves\n * to an engine-plan SENTINEL consumed by the analysis engine, never to a single\n * model id. Two variants, same price (one shared `video-analysis:mixed:*`\n * credit family): `mixed` targets maximum result quality; `mixed-fast` targets\n * run-to-run output consistency. What each plan does internally is deliberately\n * NOT published here (Apache irrevocability; only the wire vocabulary below is\n * contract — the engine lives in the private analysis plugin).\n */\nexport const VIDEO_ANALYSIS_MIXED_TIERS = [\"mixed\", \"mixed-fast\", \"smart\"] as const\nexport type VideoAnalysisMixedTier = (typeof VIDEO_ANALYSIS_MIXED_TIERS)[number]\n/**\n * `smart` is an ENGINE-PLAN sentinel like the mixed tiers — it names a plan, not a\n * model — but it is a different SHAPE of plan, and the distinction is the whole\n * reason it exists as a separate tier rather than a repricing of the others.\n *\n * The economy tiers (`fast`, `pro`, `mixed`, `mixed-fast`) run several passes on\n * the cheaper proxied transport and vote. That transport is cheaper per token and\n * additionally does no deep reasoning, which is why they cost less — and also why\n * they are less accurate. `smart` is a HYBRID plan (2026-08-03 re-plan): one\n * native-transport skeleton pass with everything turned up, blended with several\n * economy-transport donor rolls, and the merged result is always refined —\n * `selectionMode` (the `choose`/`combine` toggle the other tiers expose) does not\n * apply to `smart`; it always applies the equivalent of `combine`.\n *\n * As with the mixed sentinels, what the plan does internally is deliberately not\n * published here; only the wire vocabulary is contract.\n */\n/** UI/listing order — recommended (smart) first, then `ultra`, the other high-accuracy tier. */\nexport const VIDEO_ANALYSIS_TIER_ORDER = [\"smart\", \"ultra\", \"pro\", \"fast\", \"mixed\", \"mixed-fast\"] as const\nexport type VideoAnalysisTier = (typeof VIDEO_ANALYSIS_TIER_ORDER)[number]\nexport const DEFAULT_VIDEO_ANALYSIS_TIER: VideoAnalysisTier = \"pro\"\nexport const DEFAULT_VIDEO_ANALYSIS_MODEL: string = VIDEO_ANALYSIS_TIERS[DEFAULT_VIDEO_ANALYSIS_TIER]\n/** Neutral, vendor-free display labels for the UI. */\nexport const VIDEO_ANALYSIS_TIER_LABELS: Record<VideoAnalysisTier, string> = {\n smart: \"Smart\",\n ultra: \"Ultra\",\n fast: \"Fast\",\n pro: \"Pro\",\n mixed: \"Mixed\",\n \"mixed-fast\": \"Mixed (consistent)\",\n}\n\nexport function isVideoAnalysisTier(v: string): v is VideoAnalysisTier {\n return (VIDEO_ANALYSIS_TIER_ORDER as readonly string[]).includes(v)\n}\n\nexport function isVideoAnalysisMixedTier(v: string): v is VideoAnalysisMixedTier {\n return (VIDEO_ANALYSIS_MIXED_TIERS as readonly string[]).includes(v)\n}\n\n/**\n * Resolve a user-supplied tier OR a raw internal model id to the analysis\n * ENGINE IDENTIFIER carried in the worker payload:\n * - model-backed tiers (\"fast\"/\"pro\"/\"ultra\") → the internal model id;\n * - mixed tiers (\"mixed\"/\"mixed-fast\") → the sentinel ITSELF (the engine\n * expands it to a multi-model roll plan);\n * - raw model ids pass through (back-compat for stored `llmModel` values);\n * - empty/unknown → the default tier's model (never an error).\n */\nexport function resolveVideoAnalysisModel(input?: string | null): string {\n if (input && isVideoAnalysisMixedTier(input)) return input\n if (input && Object.prototype.hasOwnProperty.call(VIDEO_ANALYSIS_TIERS, input)) {\n return VIDEO_ANALYSIS_TIERS[input as VideoAnalysisModelTier]\n }\n if (input && VIDEO_ANALYSIS_LLM_MODELS.includes(input)) return input\n return DEFAULT_VIDEO_ANALYSIS_MODEL\n}\n"]}
@@ -677,5 +677,5 @@ exports.transcriptSpeakerLabels = transcriptSpeakerLabels;
677
677
  exports.unwrapEditPlanOutput = unwrapEditPlanOutput;
678
678
  exports.validateSpeakerTrackSetDescriptor = validateSpeakerTrackSetDescriptor;
679
679
  exports.validateSpeakerTracks = validateSpeakerTracks;
680
- //# sourceMappingURL=chunk-HW6TLOK4.cjs.map
681
- //# sourceMappingURL=chunk-HW6TLOK4.cjs.map
680
+ //# sourceMappingURL=chunk-DRPHRE4J.cjs.map
681
+ //# sourceMappingURL=chunk-DRPHRE4J.cjs.map