@nodaro/shared 3.67.0 → 3.69.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 (202) hide show
  1. package/dist/{chunk-T4GIHHXY.cjs → chunk-25C2E2GI.cjs} +6 -6
  2. package/dist/{chunk-T4GIHHXY.cjs.map → chunk-25C2E2GI.cjs.map} +1 -1
  3. package/dist/{chunk-OXTF4Y3P.cjs → chunk-3AB3YIFM.cjs} +6 -6
  4. package/dist/{chunk-OXTF4Y3P.cjs.map → chunk-3AB3YIFM.cjs.map} +1 -1
  5. package/dist/{chunk-23IKLMRL.cjs → chunk-3OHRFSQL.cjs} +53 -51
  6. package/dist/{chunk-23IKLMRL.cjs.map → chunk-3OHRFSQL.cjs.map} +1 -1
  7. package/dist/{chunk-GNLA5NTT.cjs → chunk-4IMEJQVQ.cjs} +4 -4
  8. package/dist/{chunk-GNLA5NTT.cjs.map → chunk-4IMEJQVQ.cjs.map} +1 -1
  9. package/dist/{chunk-JTYCJ5OL.cjs → chunk-54E2JO4E.cjs} +100 -33
  10. package/dist/chunk-54E2JO4E.cjs.map +1 -0
  11. package/dist/{chunk-HTDKEYMY.cjs → chunk-5EQRIUGI.cjs} +139 -91
  12. package/dist/chunk-5EQRIUGI.cjs.map +1 -0
  13. package/dist/{chunk-AT53ZQUC.js → chunk-5WHU7CYE.js} +3 -3
  14. package/dist/{chunk-AT53ZQUC.js.map → chunk-5WHU7CYE.js.map} +1 -1
  15. package/dist/{chunk-BNR5FKL5.js → chunk-5ZCZL73I.js} +3 -3
  16. package/dist/{chunk-BNR5FKL5.js.map → chunk-5ZCZL73I.js.map} +1 -1
  17. package/dist/{chunk-6FQBKI2A.cjs → chunk-6JSYNKFL.cjs} +4 -4
  18. package/dist/{chunk-6FQBKI2A.cjs.map → chunk-6JSYNKFL.cjs.map} +1 -1
  19. package/dist/{chunk-WZG6GZIL.cjs → chunk-6QJHSN6J.cjs} +4 -4
  20. package/dist/{chunk-WZG6GZIL.cjs.map → chunk-6QJHSN6J.cjs.map} +1 -1
  21. package/dist/{chunk-OFQ6CU6S.js → chunk-7EQJIGVT.js} +3 -3
  22. package/dist/{chunk-OFQ6CU6S.js.map → chunk-7EQJIGVT.js.map} +1 -1
  23. package/dist/{chunk-XEPKONJC.js → chunk-7OSUEYZ4.js} +3 -3
  24. package/dist/{chunk-XEPKONJC.js.map → chunk-7OSUEYZ4.js.map} +1 -1
  25. package/dist/{chunk-3L7GMQ4M.cjs → chunk-7PC2YHBN.cjs} +54 -49
  26. package/dist/chunk-7PC2YHBN.cjs.map +1 -0
  27. package/dist/{chunk-BMDOPJBP.cjs → chunk-AGIG5HUU.cjs} +17 -17
  28. package/dist/{chunk-BMDOPJBP.cjs.map → chunk-AGIG5HUU.cjs.map} +1 -1
  29. package/dist/{chunk-5LWYX4GV.js → chunk-AH6OQXLW.js} +3 -3
  30. package/dist/{chunk-5LWYX4GV.js.map → chunk-AH6OQXLW.js.map} +1 -1
  31. package/dist/{chunk-RVQW623D.js → chunk-BDW25A7Y.js} +72 -18
  32. package/dist/chunk-BDW25A7Y.js.map +1 -0
  33. package/dist/{chunk-5J2LIQYU.js → chunk-DE55SA2X.js} +5 -5
  34. package/dist/{chunk-5J2LIQYU.js.map → chunk-DE55SA2X.js.map} +1 -1
  35. package/dist/{chunk-VBP4DH37.js → chunk-DNWFFVC6.js} +130 -15
  36. package/dist/chunk-DNWFFVC6.js.map +1 -0
  37. package/dist/{chunk-CLAKSLXF.js → chunk-E3PU7YC6.js} +3 -3
  38. package/dist/{chunk-CLAKSLXF.js.map → chunk-E3PU7YC6.js.map} +1 -1
  39. package/dist/{chunk-MVXZP6VB.js → chunk-FUYBUT65.js} +97 -2
  40. package/dist/chunk-FUYBUT65.js.map +1 -0
  41. package/dist/{chunk-SW5ZD7BO.js → chunk-G6AOKNAY.js} +3 -3
  42. package/dist/{chunk-SW5ZD7BO.js.map → chunk-G6AOKNAY.js.map} +1 -1
  43. package/dist/{chunk-EFYWV2V5.cjs → chunk-I6TBKTW3.cjs} +61 -61
  44. package/dist/{chunk-EFYWV2V5.cjs.map → chunk-I6TBKTW3.cjs.map} +1 -1
  45. package/dist/{chunk-3YWZ5SOZ.js → chunk-KLEKJUQI.js} +5 -5
  46. package/dist/{chunk-3YWZ5SOZ.js.map → chunk-KLEKJUQI.js.map} +1 -1
  47. package/dist/{chunk-OXBU5AGH.js → chunk-LSX2OFNB.js} +3 -3
  48. package/dist/{chunk-OXBU5AGH.js.map → chunk-LSX2OFNB.js.map} +1 -1
  49. package/dist/{chunk-66QSUUB4.cjs → chunk-LY6IR5LL.cjs} +12 -12
  50. package/dist/{chunk-66QSUUB4.cjs.map → chunk-LY6IR5LL.cjs.map} +1 -1
  51. package/dist/{chunk-5GG4CG4Y.js → chunk-LZPG4XHT.js} +3 -3
  52. package/dist/{chunk-5GG4CG4Y.js.map → chunk-LZPG4XHT.js.map} +1 -1
  53. package/dist/{chunk-PGDR7CO3.cjs → chunk-MGSGLRHZ.cjs} +8 -8
  54. package/dist/{chunk-PGDR7CO3.cjs.map → chunk-MGSGLRHZ.cjs.map} +1 -1
  55. package/dist/{chunk-Z77M7Q2R.js → chunk-ML55U7WM.js} +3 -3
  56. package/dist/{chunk-Z77M7Q2R.js.map → chunk-ML55U7WM.js.map} +1 -1
  57. package/dist/{chunk-ALRXY4QH.cjs → chunk-N7ZJD4CK.cjs} +6 -2
  58. package/dist/chunk-N7ZJD4CK.cjs.map +1 -0
  59. package/dist/{chunk-O2QOBA6Q.js → chunk-NPGP6FMU.js} +43 -3
  60. package/dist/chunk-NPGP6FMU.js.map +1 -0
  61. package/dist/{chunk-IWUW3YPM.cjs → chunk-NTCSXKZ3.cjs} +5 -5
  62. package/dist/{chunk-IWUW3YPM.cjs.map → chunk-NTCSXKZ3.cjs.map} +1 -1
  63. package/dist/chunk-NWNRATS3.js +13 -0
  64. package/dist/chunk-NWNRATS3.js.map +1 -0
  65. package/dist/{chunk-SCDE676D.js → chunk-OEOOXL3F.js} +65 -23
  66. package/dist/chunk-OEOOXL3F.js.map +1 -0
  67. package/dist/{chunk-GF7ZA26H.js → chunk-OOUJZR4K.js} +4 -4
  68. package/dist/{chunk-GF7ZA26H.js.map → chunk-OOUJZR4K.js.map} +1 -1
  69. package/dist/{chunk-5IZHECUP.js → chunk-OZA4DE23.js} +3 -3
  70. package/dist/{chunk-5IZHECUP.js.map → chunk-OZA4DE23.js.map} +1 -1
  71. package/dist/{chunk-GTBW2KAY.js → chunk-PHQVAPSD.js} +8 -6
  72. package/dist/{chunk-GTBW2KAY.js.map → chunk-PHQVAPSD.js.map} +1 -1
  73. package/dist/{chunk-5NVGKXJV.cjs → chunk-PLANUXQL.cjs} +89 -3
  74. package/dist/chunk-PLANUXQL.cjs.map +1 -0
  75. package/dist/{chunk-ZQ2BHOFH.cjs → chunk-Q2LEJXLZ.cjs} +6 -6
  76. package/dist/{chunk-ZQ2BHOFH.cjs.map → chunk-Q2LEJXLZ.cjs.map} +1 -1
  77. package/dist/{chunk-PJAJCFLP.cjs → chunk-QNPYYSLT.cjs} +168 -44
  78. package/dist/chunk-QNPYYSLT.cjs.map +1 -0
  79. package/dist/{chunk-G2G7XGFU.cjs → chunk-RURPG6IS.cjs} +7 -7
  80. package/dist/{chunk-G2G7XGFU.cjs.map → chunk-RURPG6IS.cjs.map} +1 -1
  81. package/dist/{chunk-PAUWEWTY.js → chunk-TDU45K6Z.js} +12 -7
  82. package/dist/chunk-TDU45K6Z.js.map +1 -0
  83. package/dist/{chunk-X2YHKP4D.cjs → chunk-TWUFC32F.cjs} +8 -8
  84. package/dist/{chunk-X2YHKP4D.cjs.map → chunk-TWUFC32F.cjs.map} +1 -1
  85. package/dist/{chunk-O6TBB4IF.cjs → chunk-TZWXZDSX.cjs} +48 -2
  86. package/dist/chunk-TZWXZDSX.cjs.map +1 -0
  87. package/dist/{chunk-F6XIH3TZ.cjs → chunk-UJREE6EQ.cjs} +9 -9
  88. package/dist/{chunk-F6XIH3TZ.cjs.map → chunk-UJREE6EQ.cjs.map} +1 -1
  89. package/dist/{chunk-CFTXW3ZL.js → chunk-UVUHVY7F.js} +3 -3
  90. package/dist/{chunk-CFTXW3ZL.js.map → chunk-UVUHVY7F.js.map} +1 -1
  91. package/dist/{chunk-37ZSFS6A.cjs → chunk-WML66SUV.cjs} +9 -9
  92. package/dist/{chunk-37ZSFS6A.cjs.map → chunk-WML66SUV.cjs.map} +1 -1
  93. package/dist/{chunk-M5QY464F.cjs → chunk-XZYZYWKG.cjs} +21 -21
  94. package/dist/{chunk-M5QY464F.cjs.map → chunk-XZYZYWKG.cjs.map} +1 -1
  95. package/dist/{chunk-3QJ3UR5Z.js → chunk-YT4ZTJVC.js} +9 -9
  96. package/dist/{chunk-3QJ3UR5Z.js.map → chunk-YT4ZTJVC.js.map} +1 -1
  97. package/dist/{chunk-V6OXSXIX.js → chunk-YVQFYW2U.js} +86 -4
  98. package/dist/chunk-YVQFYW2U.js.map +1 -0
  99. package/dist/{chunk-E62W5I6A.cjs → chunk-ZWEVRMFN.cjs} +97 -2
  100. package/dist/chunk-ZWEVRMFN.cjs.map +1 -0
  101. package/dist/entries/apps.cjs +42 -42
  102. package/dist/entries/apps.js +7 -7
  103. package/dist/entries/credits.cjs +295 -219
  104. package/dist/entries/credits.d.cts +233 -70
  105. package/dist/entries/credits.d.ts +233 -70
  106. package/dist/entries/credits.js +11 -11
  107. package/dist/entries/llm-models.cjs +84 -68
  108. package/dist/entries/llm-models.d.cts +36 -3
  109. package/dist/entries/llm-models.d.ts +36 -3
  110. package/dist/entries/llm-models.js +2 -2
  111. package/dist/entries/media.cjs +111 -107
  112. package/dist/entries/media.d.cts +17 -2
  113. package/dist/entries/media.d.ts +17 -2
  114. package/dist/entries/media.js +3 -3
  115. package/dist/entries/model-catalog.cjs +133 -133
  116. package/dist/entries/model-catalog.js +4 -4
  117. package/dist/entries/models.cjs +433 -397
  118. package/dist/entries/models.d.cts +2 -2
  119. package/dist/entries/models.d.ts +2 -2
  120. package/dist/entries/models.js +8 -8
  121. package/dist/entries/nodes.cjs +212 -212
  122. package/dist/entries/nodes.js +8 -8
  123. package/dist/entries/pipeline.cjs +153 -153
  124. package/dist/entries/pipeline.d.cts +1 -1
  125. package/dist/entries/pipeline.d.ts +1 -1
  126. package/dist/entries/pipeline.js +3 -3
  127. package/dist/entries/runtime-config.cjs +53 -29
  128. package/dist/entries/runtime-config.d.cts +53 -1
  129. package/dist/entries/runtime-config.d.ts +53 -1
  130. package/dist/entries/runtime-config.js +1 -1
  131. package/dist/entries/social.cjs +177 -177
  132. package/dist/entries/social.js +2 -2
  133. package/dist/entries/types.d.cts +12 -5
  134. package/dist/entries/types.d.ts +12 -5
  135. package/dist/entries/ugc.cjs +71 -71
  136. package/dist/entries/ugc.js +4 -4
  137. package/dist/entries/video.cjs +152 -152
  138. package/dist/entries/video.d.cts +2 -1
  139. package/dist/entries/video.d.ts +2 -1
  140. package/dist/entries/video.js +6 -6
  141. package/dist/index.cjs +1882 -1726
  142. package/dist/index.d.cts +5 -5
  143. package/dist/index.d.ts +5 -5
  144. package/dist/index.js +25 -25
  145. package/dist/{model-constants-DZ3tPGFO.d.ts → model-constants-B5DNHIP8.d.ts} +156 -12
  146. package/dist/{model-constants-BstsUup6.d.cts → model-constants-CQr_d3Kw.d.cts} +156 -12
  147. package/package.json +1 -1
  148. package/src/__tests__/add-captions-nemotron-pricing.test.ts +13 -1
  149. package/src/__tests__/extend-providers.test.ts +43 -6
  150. package/src/__tests__/fixtures/measured-input-quote-parity.json +2352 -1
  151. package/src/__tests__/fixtures/planned-length-quote-parity.json +100 -10
  152. package/src/__tests__/fixtures/probed-node-quote-parity.json +132 -0
  153. package/src/__tests__/fixtures/video-utility-quote-parity.json +945 -38
  154. package/src/__tests__/gemini-omni-extend.test.ts +110 -0
  155. package/src/__tests__/gvp-supported-providers.test.ts +3 -0
  156. package/src/__tests__/llm-models.test.ts +116 -2
  157. package/src/__tests__/llm-price-key.test.ts +2 -0
  158. package/src/__tests__/nemotron-transcribe-pricing.test.ts +32 -0
  159. package/src/__tests__/runtime-config-lists.test.ts +92 -0
  160. package/src/__tests__/seedance-2-5-flash-catalog.test.ts +194 -0
  161. package/src/__tests__/video-character-refs.test.ts +48 -0
  162. package/src/catalog-projection.ts +12 -5
  163. package/src/credit-estimators/add-captions-nemotron.ts +11 -1
  164. package/src/credit-estimators/index.ts +6 -1
  165. package/src/credit-estimators/nemotron-transcribe.ts +35 -3
  166. package/src/credit-estimators/pitch-tempo.ts +14 -0
  167. package/src/credit-estimators/video-sfx.ts +15 -0
  168. package/src/credit-estimators/video-utils.ts +48 -12
  169. package/src/credit-identifiers.ts +51 -32
  170. package/src/entries/credits.ts +18 -0
  171. package/src/entries/llm-models.ts +4 -0
  172. package/src/entries/models.ts +11 -0
  173. package/src/entries/runtime-config.ts +10 -1
  174. package/src/gemini-omni-extend-quote.ts +76 -0
  175. package/src/lip-sync-pricing.ts +16 -1
  176. package/src/llm-models.ts +117 -2
  177. package/src/model-catalog.ts +95 -0
  178. package/src/model-constants.ts +274 -11
  179. package/src/node-default-mappings.ts +2 -0
  180. package/src/priced-clip-seconds.ts +19 -1
  181. package/src/runtime-config/lists.ts +87 -0
  182. package/src/runtime-config/worlds.ts +10 -0
  183. package/src/seedance-extend-rate.ts +83 -20
  184. package/src/seedance-lip-sync.ts +68 -0
  185. package/src/video-character-refs.ts +26 -6
  186. package/dist/chunk-3L7GMQ4M.cjs.map +0 -1
  187. package/dist/chunk-5NVGKXJV.cjs.map +0 -1
  188. package/dist/chunk-ALRXY4QH.cjs.map +0 -1
  189. package/dist/chunk-E62W5I6A.cjs.map +0 -1
  190. package/dist/chunk-HTDKEYMY.cjs.map +0 -1
  191. package/dist/chunk-JTYCJ5OL.cjs.map +0 -1
  192. package/dist/chunk-MVXZP6VB.js.map +0 -1
  193. package/dist/chunk-O2QOBA6Q.js.map +0 -1
  194. package/dist/chunk-O6TBB4IF.cjs.map +0 -1
  195. package/dist/chunk-PAUWEWTY.js.map +0 -1
  196. package/dist/chunk-PJAJCFLP.cjs.map +0 -1
  197. package/dist/chunk-RVQW623D.js.map +0 -1
  198. package/dist/chunk-SCDE676D.js.map +0 -1
  199. package/dist/chunk-SMOO5FAH.js +0 -10
  200. package/dist/chunk-SMOO5FAH.js.map +0 -1
  201. package/dist/chunk-V6OXSXIX.js.map +0 -1
  202. package/dist/chunk-VBP4DH37.js.map +0 -1
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkD34K455O_cjs = require('./chunk-D34K455O.cjs');
4
- var chunkE62W5I6A_cjs = require('./chunk-E62W5I6A.cjs');
4
+ var chunkZWEVRMFN_cjs = require('./chunk-ZWEVRMFN.cjs');
5
5
 
6
6
  // src/input-image-pricing.ts
7
7
  function isPricedPerInputImage(model) {
8
- return typeof model === "string" && (chunkD34K455O_cjs.isGptImage26Tiered(model) || chunkE62W5I6A_cjs.isMinimaxH3Image(model) || chunkE62W5I6A_cjs.isSeedream55(model));
8
+ return typeof model === "string" && (chunkD34K455O_cjs.isGptImage26Tiered(model) || chunkZWEVRMFN_cjs.isMinimaxH3Image(model) || chunkZWEVRMFN_cjs.isSeedream55(model));
9
9
  }
10
10
  function isPricedPerInputImageEdit(model) {
11
- return typeof model === "string" && (chunkD34K455O_cjs.isGptImage26I2i(model) || chunkE62W5I6A_cjs.isMinimaxH3ImageI2i(model) || chunkE62W5I6A_cjs.isSeedream55I2i(model));
11
+ return typeof model === "string" && (chunkD34K455O_cjs.isGptImage26I2i(model) || chunkZWEVRMFN_cjs.isMinimaxH3ImageI2i(model) || chunkZWEVRMFN_cjs.isSeedream55I2i(model));
12
12
  }
13
13
  function priceReadsInputImages(model) {
14
- return isPricedPerInputImage(model) || chunkE62W5I6A_cjs.isFlux3Klein(model);
14
+ return isPricedPerInputImage(model) || chunkZWEVRMFN_cjs.isFlux3Klein(model);
15
15
  }
16
16
  function pricedSentImages(provider, references, baseImageUrl) {
17
17
  const countsBase = priceReadsInputImages(provider) && typeof baseImageUrl === "string" && baseImageUrl.length > 0 && !references.includes(baseImageUrl);
@@ -32,11 +32,11 @@ function pricedEstimatedImages(model, data, wiredImages) {
32
32
 
33
33
  // src/safety-retry-policy.ts
34
34
  function safetyRetryPolicy(modelId) {
35
- const entry = chunkE62W5I6A_cjs.getModel(modelId);
35
+ const entry = chunkZWEVRMFN_cjs.getModel(modelId);
36
36
  const safetyFilter = entry?.safetyFilter;
37
37
  if (!safetyFilter?.stochastic) return { maxAttempts: 1 };
38
38
  const fallback = safetyFilter.fallback;
39
- if (fallback && chunkE62W5I6A_cjs.getModel(fallback)) {
39
+ if (fallback && chunkZWEVRMFN_cjs.getModel(fallback)) {
40
40
  return { maxAttempts: 2, fallback };
41
41
  }
42
42
  return { maxAttempts: 2 };
@@ -48,5 +48,5 @@ exports.priceReadsInputImages = priceReadsInputImages;
48
48
  exports.pricedEstimatedImages = pricedEstimatedImages;
49
49
  exports.pricedSentImages = pricedSentImages;
50
50
  exports.safetyRetryPolicy = safetyRetryPolicy;
51
- //# sourceMappingURL=chunk-X2YHKP4D.cjs.map
52
- //# sourceMappingURL=chunk-X2YHKP4D.cjs.map
51
+ //# sourceMappingURL=chunk-TWUFC32F.cjs.map
52
+ //# sourceMappingURL=chunk-TWUFC32F.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/input-image-pricing.ts","../src/safety-retry-policy.ts"],"names":["isGptImage26Tiered","isMinimaxH3Image","isSeedream55","isGptImage26I2i","isMinimaxH3ImageI2i","isSeedream55I2i","isFlux3Klein","GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES","getModel"],"mappings":";;;;;;AAkBO,SAAS,sBAAsB,KAAA,EAAyB;AAC7D,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,KAAaA,oCAAA,CAAmB,KAAK,KAAKC,kCAAA,CAAiB,KAAK,CAAA,IAAKC,8BAAA,CAAa,KAAK,CAAA,CAAA;AACjH;AAGO,SAAS,0BAA0B,KAAA,EAAyB;AACjE,EAAA,OAAO,OAA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IAAA,CAAK,kBAAkB,CAAA,GAC9B,OAAO,IAAA,CAAK,sBAAsB,CAAA,GAClC,MAAA,CAAO,KAAK,SAAS,CAAA,GACrB,MAAA,CAAO,IAAA,CAAK,iBAAiB,CAAA,GAC7B,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,GACxB,MAAA,CAAO,IAAA,CAAK,cAAc,IAC1B,WAAA,IACC,cAAA,CAAe,IAAA,CAAK,SAAS,IAAIC,oDAAA,GAAqC,CAAA,CAAA,IACtE,yBAAA,CAA0B,KAAK,IAAI,CAAA,GAAI,CAAA,CAAA;AAE5C;;;AClEO,SAAS,kBAAkB,OAAA,EAAoC;AACpE,EAAA,MAAM,KAAA,GAAQC,2BAAS,OAAO,CAAA;AAC9B,EAAA,MAAM,eAAe,KAAA,EAAO,YAAA;AAC5B,EAAA,IAAI,CAAC,YAAA,EAAc,UAAA,EAAY,OAAO,EAAE,aAAa,CAAA,EAAE;AAEvD,EAAA,MAAM,WAAW,YAAA,CAAa,QAAA;AAC9B,EAAA,IAAI,QAAA,IAAYA,0BAAA,CAAS,QAAQ,CAAA,EAAG;AAClC,IAAA,OAAO,EAAE,WAAA,EAAa,CAAA,EAAG,QAAA,EAAS;AAAA,EACpC;AACA,EAAA,OAAO,EAAE,aAAa,CAAA,EAAE;AAC1B","file":"chunk-X2YHKP4D.cjs","sourcesContent":["/**\n * The image models whose price depends on how many input images a run sends:\n * GPT Image 2.6 Flare and Sunburst, MiniMax H3 Image and Seedream 5.5. Every place that\n * prices a run counts those images through here, so a model that joins\n * `isPricedPerInputImage` is counted on every path at once. FLUX 3 Klein is\n * counted the same way (`priceReadsInputImages`): its price does not move with\n * the images, but whether any go decides the id it runs, and is priced, on.\n */\nimport {\n GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES,\n isGptImage26I2i,\n isGptImage26Tiered,\n} from \"./gpt-image-2-6.js\"\nimport { isMinimaxH3Image, isMinimaxH3ImageI2i } from \"./minimax-h3-image.js\"\nimport { isSeedream55, isSeedream55I2i } from \"./seedream-5-5.js\"\nimport { isFlux3Klein } from \"./flux-3-klein.js\"\n\n/** True for a model whose price counts the input images a run sends. */\nexport function isPricedPerInputImage(model: unknown): boolean {\n return typeof model === \"string\" && (isGptImage26Tiered(model) || isMinimaxH3Image(model) || isSeedream55(model))\n}\n\n/** True for the edit id of such a model: it always sends at least its source. */\nexport function isPricedPerInputImageEdit(model: unknown): boolean {\n return typeof model === \"string\" && (isGptImage26I2i(model) || isMinimaxH3ImageI2i(model) || isSeedream55I2i(model))\n}\n\n/**\n * True for a model whose price id reads the input images a run sends: one\n * priced per input image ({@link isPricedPerInputImage}), or FLUX 3 Klein, which\n * runs on its edit id whenever an image goes (its text-to-image endpoint takes\n * none) and is priced on that id, at the same price. Every place that prices a\n * run counts the images through {@link pricedSentImages} and\n * {@link pricedEstimatedImages} for such a model, so the id priced is the id\n * the provider runs.\n */\nexport function priceReadsInputImages(model: unknown): boolean {\n return isPricedPerInputImage(model) || isFlux3Klein(model)\n}\n\n/**\n * The images a Generate Image run sends its provider: its references and, when\n * it edits a base image, that image too (the worker puts it first, unless it is\n * already one of the references). The base is counted only on a model whose\n * price reads the images ({@link priceReadsInputImages}); any other model is\n * priced, and held to its image limit, on its references alone, as before.\n */\nexport function pricedSentImages(\n provider: string | undefined,\n references: readonly string[],\n baseImageUrl: unknown,\n): number {\n const countsBase =\n priceReadsInputImages(provider) &&\n typeof baseImageUrl === \"string\" &&\n baseImageUrl.length > 0 &&\n !references.includes(baseImageUrl)\n return references.length + (countsBase ? 1 : 0)\n}\n\nfunction namesMoodboard(direction: unknown): boolean {\n if (direction === null || typeof direction !== \"object\") return false\n const style = (direction as Record<string, unknown>).style\n return (Array.isArray(style) ? style : [style]).some(\n (value) => typeof value === \"string\" && value.startsWith(\"moodboard:\"),\n )\n}\n\n/**\n * The input images a workflow estimate counts for one node on a model whose\n * price reads them ({@link priceReadsInputImages}): every list on the node, its source or base image, what is\n * wired in, a moodboard its direction names (at the most a moodboard holds),\n * and an edit model's own source. An estimate may over-quote, never under.\n */\nexport function pricedEstimatedImages(\n model: string,\n data: Record<string, unknown>,\n wiredImages: number,\n): number {\n const listed = (v: unknown) => (Array.isArray(v) ? v.length : 0)\n const single = (v: unknown) => (typeof v === \"string\" && v.length > 0 ? 1 : 0)\n return (\n listed(data.referenceImageUrls) +\n listed(data.characterDefinitionIds) +\n listed(data.extraRefs) +\n single(data.referenceImageUrl) +\n single(data.baseImageUrl) +\n single(data.sourceImageUrl) +\n wiredImages +\n (namesMoodboard(data.direction) ? GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES : 0) +\n (isPricedPerInputImageEdit(model) ? 1 : 0)\n )\n}\n","import { getModel } from \"./model-catalog.js\"\n\n/**\n * Retry/fallback behavior derived from a catalog entry's `safetyFilter`\n * flag (see `ModelCatalogEntry.safetyFilter` in `model-catalog.ts`).\n */\nexport interface SafetyRetryPolicy {\n /** 2 when the model declares `safetyFilter.stochastic`, else 1. */\n maxAttempts: 1 | 2\n /**\n * Catalog model id to offer when the retry also blocks. Only present\n * when the entry declares one AND it resolves to a real catalog entry.\n */\n fallback?: string\n}\n\n/**\n * The provider's safety filter is known to be non-deterministic on some\n * catalog models — a benign prompt can trip it once and pass on an\n * identical retry. For those models the platform retries a blocked\n * request once (`maxAttempts: 2`) before giving up; `fallback` names the\n * catalog model to offer the user when the retry also blocks.\n *\n * Every model not flagged this way — including an unrecognized id —\n * gets a single attempt and no fallback.\n */\nexport function safetyRetryPolicy(modelId: string): SafetyRetryPolicy {\n const entry = getModel(modelId)\n const safetyFilter = entry?.safetyFilter\n if (!safetyFilter?.stochastic) return { maxAttempts: 1 }\n\n const fallback = safetyFilter.fallback\n if (fallback && getModel(fallback)) {\n return { maxAttempts: 2, fallback }\n }\n return { maxAttempts: 2 }\n}\n"]}
1
+ {"version":3,"sources":["../src/input-image-pricing.ts","../src/safety-retry-policy.ts"],"names":["isGptImage26Tiered","isMinimaxH3Image","isSeedream55","isGptImage26I2i","isMinimaxH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ACF;AAQO,SAAS,qBAAA,CACd,KAAA,EACA,IAAA,EACA,WAAA,EACQ;AACR,EAAA,MAAM,MAAA,GAAS,CAAC,CAAA,KAAgB,KAAA,CAAM,QAAQ,CAAC,CAAA,GAAI,EAAE,MAAA,GAAS,CAAA;AAC9D,EAAA,MAAM,MAAA,GAAS,CAAC,CAAA,KAAgB,OAAO,MAAM,QAAA,IAAY,CAAA,CAAE,MAAA,GAAS,CAAA,GAAI,CAAA,GAAI,CAAA;AAC5E,EAAA,OACE,MAAA,CAAO,IAAA,CAAK,kBAAkB,CAAA,GAC9B,OAAO,IAAA,CAAK,sBAAsB,CAAA,GAClC,MAAA,CAAO,KAAK,SAAS,CAAA,GACrB,MAAA,CAAO,IAAA,CAAK,iBAAiB,CAAA,GAC7B,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,GACxB,MAAA,CAAO,IAAA,CAAK,cAAc,IAC1B,WAAA,IACC,cAAA,CAAe,IAAA,CAAK,SAAS,IAAIC,oDAAA,GAAqC,CAAA,CAAA,IACtE,yBAAA,CAA0B,KAAK,IAAI,CAAA,GAAI,CAAA,CAAA;AAE5C;;;AClEO,SAAS,kBAAkB,OAAA,EAAoC;AACpE,EAAA,MAAM,KAAA,GAAQC,2BAAS,OAAO,CAAA;AAC9B,EAAA,MAAM,eAAe,KAAA,EAAO,YAAA;AAC5B,EAAA,IAAI,CAAC,YAAA,EAAc,UAAA,EAAY,OAAO,EAAE,aAAa,CAAA,EAAE;AAEvD,EAAA,MAAM,WAAW,YAAA,CAAa,QAAA;AAC9B,EAAA,IAAI,QAAA,IAAYA,0BAAA,CAAS,QAAQ,CAAA,EAAG;AAClC,IAAA,OAAO,EAAE,WAAA,EAAa,CAAA,EAAG,QAAA,EAAS;AAAA,EACpC;AACA,EAAA,OAAO,EAAE,aAAa,CAAA,EAAE;AAC1B","file":"chunk-TWUFC32F.cjs","sourcesContent":["/**\n * The image models whose price depends on how many input images a run sends:\n * GPT Image 2.6 Flare and Sunburst, MiniMax H3 Image and Seedream 5.5. Every place that\n * prices a run counts those images through here, so a model that joins\n * `isPricedPerInputImage` is counted on every path at once. FLUX 3 Klein is\n * counted the same way (`priceReadsInputImages`): its price does not move with\n * the images, but whether any go decides the id it runs, and is priced, on.\n */\nimport {\n GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES,\n isGptImage26I2i,\n isGptImage26Tiered,\n} from \"./gpt-image-2-6.js\"\nimport { isMinimaxH3Image, isMinimaxH3ImageI2i } from \"./minimax-h3-image.js\"\nimport { isSeedream55, isSeedream55I2i } from \"./seedream-5-5.js\"\nimport { isFlux3Klein } from \"./flux-3-klein.js\"\n\n/** True for a model whose price counts the input images a run sends. */\nexport function isPricedPerInputImage(model: unknown): boolean {\n return typeof model === \"string\" && (isGptImage26Tiered(model) || isMinimaxH3Image(model) || isSeedream55(model))\n}\n\n/** True for the edit id of such a model: it always sends at least its source. */\nexport function isPricedPerInputImageEdit(model: unknown): boolean {\n return typeof model === \"string\" && (isGptImage26I2i(model) || isMinimaxH3ImageI2i(model) || isSeedream55I2i(model))\n}\n\n/**\n * True for a model whose price id reads the input images a run sends: one\n * priced per input image ({@link isPricedPerInputImage}), or FLUX 3 Klein, which\n * runs on its edit id whenever an image goes (its text-to-image endpoint takes\n * none) and is priced on that id, at the same price. Every place that prices a\n * run counts the images through {@link pricedSentImages} and\n * {@link pricedEstimatedImages} for such a model, so the id priced is the id\n * the provider runs.\n */\nexport function priceReadsInputImages(model: unknown): boolean {\n return isPricedPerInputImage(model) || isFlux3Klein(model)\n}\n\n/**\n * The images a Generate Image run sends its provider: its references and, when\n * it edits a base image, that image too (the worker puts it first, unless it is\n * already one of the references). The base is counted only on a model whose\n * price reads the images ({@link priceReadsInputImages}); any other model is\n * priced, and held to its image limit, on its references alone, as before.\n */\nexport function pricedSentImages(\n provider: string | undefined,\n references: readonly string[],\n baseImageUrl: unknown,\n): number {\n const countsBase =\n priceReadsInputImages(provider) &&\n typeof baseImageUrl === \"string\" &&\n baseImageUrl.length > 0 &&\n !references.includes(baseImageUrl)\n return references.length + (countsBase ? 1 : 0)\n}\n\nfunction namesMoodboard(direction: unknown): boolean {\n if (direction === null || typeof direction !== \"object\") return false\n const style = (direction as Record<string, unknown>).style\n return (Array.isArray(style) ? style : [style]).some(\n (value) => typeof value === \"string\" && value.startsWith(\"moodboard:\"),\n )\n}\n\n/**\n * The input images a workflow estimate counts for one node on a model whose\n * price reads them ({@link priceReadsInputImages}): every list on the node, its source or base image, what is\n * wired in, a moodboard its direction names (at the most a moodboard holds),\n * and an edit model's own source. An estimate may over-quote, never under.\n */\nexport function pricedEstimatedImages(\n model: string,\n data: Record<string, unknown>,\n wiredImages: number,\n): number {\n const listed = (v: unknown) => (Array.isArray(v) ? v.length : 0)\n const single = (v: unknown) => (typeof v === \"string\" && v.length > 0 ? 1 : 0)\n return (\n listed(data.referenceImageUrls) +\n listed(data.characterDefinitionIds) +\n listed(data.extraRefs) +\n single(data.referenceImageUrl) +\n single(data.baseImageUrl) +\n single(data.sourceImageUrl) +\n wiredImages +\n (namesMoodboard(data.direction) ? GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES : 0) +\n (isPricedPerInputImageEdit(model) ? 1 : 0)\n )\n}\n","import { getModel } from \"./model-catalog.js\"\n\n/**\n * Retry/fallback behavior derived from a catalog entry's `safetyFilter`\n * flag (see `ModelCatalogEntry.safetyFilter` in `model-catalog.ts`).\n */\nexport interface SafetyRetryPolicy {\n /** 2 when the model declares `safetyFilter.stochastic`, else 1. */\n maxAttempts: 1 | 2\n /**\n * Catalog model id to offer when the retry also blocks. Only present\n * when the entry declares one AND it resolves to a real catalog entry.\n */\n fallback?: string\n}\n\n/**\n * The provider's safety filter is known to be non-deterministic on some\n * catalog models — a benign prompt can trip it once and pass on an\n * identical retry. For those models the platform retries a blocked\n * request once (`maxAttempts: 2`) before giving up; `fallback` names the\n * catalog model to offer the user when the retry also blocks.\n *\n * Every model not flagged this way — including an unrecognized id —\n * gets a single attempt and no fallback.\n */\nexport function safetyRetryPolicy(modelId: string): SafetyRetryPolicy {\n const entry = getModel(modelId)\n const safetyFilter = entry?.safetyFilter\n if (!safetyFilter?.stochastic) return { maxAttempts: 1 }\n\n const fallback = safetyFilter.fallback\n if (fallback && getModel(fallback)) {\n return { maxAttempts: 2, fallback }\n }\n return { maxAttempts: 2 }\n}\n"]}
@@ -20,6 +20,9 @@ var WORLD_REQUIRED_NODE_TYPES = Object.freeze({
20
20
  function worldAllowed(worlds, id) {
21
21
  return worlds?.allow === void 0 || worlds.allow.includes(id);
22
22
  }
23
+ function worldOffered(worlds, id, nodeWithheld) {
24
+ return worldAllowed(worlds, id) && !WORLD_REQUIRED_NODE_TYPES[id].some(nodeWithheld);
25
+ }
23
26
  function orderWorlds(order) {
24
27
  const out = [];
25
28
  for (const id of order ?? []) if (isWorldId(id) && !out.includes(id)) out.push(id);
@@ -27,6 +30,43 @@ function orderWorlds(order) {
27
30
  return out;
28
31
  }
29
32
 
33
+ // src/runtime-config/lists.ts
34
+ function listsSet(lists) {
35
+ return lists !== void 0 && (lists.allow.length > 0 || lists.deny.length > 0);
36
+ }
37
+ function listsWithhold(lists, id, gated) {
38
+ if (lists.allow.length > 0 && gated(id) && !lists.allow.includes(id)) return true;
39
+ return lists.deny.includes(id);
40
+ }
41
+ var ALLOW_LIST_EXEMPT_NODE_TYPES = Object.freeze([
42
+ "collect",
43
+ "component",
44
+ "deduplicate",
45
+ "extract-field",
46
+ "filter-list",
47
+ "group",
48
+ "json-process",
49
+ "merge-lists",
50
+ "preview",
51
+ "router",
52
+ "selector",
53
+ "site-capture",
54
+ "sort-list",
55
+ "sticky-note",
56
+ "teleport-receive",
57
+ "teleport-send"
58
+ ]);
59
+ var EXEMPT = new Set(ALLOW_LIST_EXEMPT_NODE_TYPES);
60
+ function isAllowListGatedNodeType(type) {
61
+ return !EXEMPT.has(type);
62
+ }
63
+ var DENY_OF_NODE_WITHHOLDS = /* @__PURE__ */ new Map([["voice-clone-one-off", "voice-clone"]]);
64
+ function nodeListsWithhold(nodes, type, gated = isAllowListGatedNodeType) {
65
+ if (listsWithhold(nodes, type, gated)) return true;
66
+ const follows = DENY_OF_NODE_WITHHOLDS.get(type);
67
+ return follows !== void 0 && nodes.deny.includes(follows);
68
+ }
69
+
30
70
  // src/runtime-config/contract.ts
31
71
  var RUNTIME_CONFIG_GLOBAL = "__NODARO_RUNTIME__";
32
72
  var RUNTIME_CONFIG_KEYS = Object.freeze([
@@ -264,6 +304,7 @@ function readRuntimeConfig(scope = globalThis) {
264
304
  }
265
305
  }
266
306
 
307
+ exports.ALLOW_LIST_EXEMPT_NODE_TYPES = ALLOW_LIST_EXEMPT_NODE_TYPES;
267
308
  exports.RUNTIME_CONFIG_GLOBAL = RUNTIME_CONFIG_GLOBAL;
268
309
  exports.RUNTIME_CONFIG_KEYS = RUNTIME_CONFIG_KEYS;
269
310
  exports.RUNTIME_SURFACE_DEFAULT = RUNTIME_SURFACE_DEFAULT;
@@ -273,12 +314,16 @@ exports.UI_STRING_PRODUCTS = UI_STRING_PRODUCTS;
273
314
  exports.WORLD_IDS = WORLD_IDS;
274
315
  exports.WORLD_REQUIRED_NODE_TYPES = WORLD_REQUIRED_NODE_TYPES;
275
316
  exports.buildUiStringManifest = buildUiStringManifest;
317
+ exports.isAllowListGatedNodeType = isAllowListGatedNodeType;
276
318
  exports.isBrandLogoRef = isBrandLogoRef;
277
319
  exports.isHttpsOrigin = isHttpsOrigin;
278
320
  exports.isLegacyUiHost = isLegacyUiHost;
279
321
  exports.isSameSitePath = isSameSitePath;
280
322
  exports.isSsoOnly = isSsoOnly;
281
323
  exports.isWorldId = isWorldId;
324
+ exports.listsSet = listsSet;
325
+ exports.listsWithhold = listsWithhold;
326
+ exports.nodeListsWithhold = nodeListsWithhold;
282
327
  exports.orderWorlds = orderWorlds;
283
328
  exports.parseRuntimeConfig = parseRuntimeConfig;
284
329
  exports.parseRuntimeStrings = parseRuntimeStrings;
@@ -292,5 +337,6 @@ exports.surfaceUnitLabel = surfaceUnitLabel;
292
337
  exports.uiStringManifestFile = uiStringManifestFile;
293
338
  exports.uiStringPlaceholders = uiStringPlaceholders;
294
339
  exports.worldAllowed = worldAllowed;
295
- //# sourceMappingURL=chunk-O6TBB4IF.cjs.map
296
- //# sourceMappingURL=chunk-O6TBB4IF.cjs.map
340
+ exports.worldOffered = worldOffered;
341
+ //# sourceMappingURL=chunk-TZWXZDSX.cjs.map
342
+ //# sourceMappingURL=chunk-TZWXZDSX.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/runtime-config/worlds.ts","../src/runtime-config/lists.ts","../src/runtime-config/contract.ts"],"names":["strings"],"mappings":";;;AAaO,IAAM,SAAA,GAAY,MAAA,CAAO,MAAA,CAAO,CAAC,SAAA,EAAW,OAAA,EAAS,OAAA,EAAS,OAAA,EAAS,QAAA,EAAU,QAAA,EAAU,OAAA,EAAS,KAAA,EAAO,QAAQ,CAAU;AAIpI,IAAM,YAAA,GAAoC,IAAI,GAAA,CAAI,SAAS,CAAA;AAEpD,SAAS,UAAU,KAAA,EAAkC;AAC1D,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,YAAA,CAAa,IAAI,KAAK,CAAA;AAC5D;AAiBO,IAAM,yBAAA,GAA0E,OAAO,MAAA,CAAO;AAAA,EACnG,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,EAAE,CAAA;AAAA,EACzB,KAAA,EAAO,MAAA,CAAO,MAAA,CAAO,CAAC,gBAAgB,CAAC,CAAA;AAAA,EACvC,OAAO,MAAA,CAAO,MAAA,CAAO,CAAC,gBAAA,EAAkB,eAAe,CAAC,CAAA;AAAA,EACxD,KAAA,EAAO,MAAA,CAAO,MAAA,CAAO,CAAC,eAAe,CAAC,CAAA;AAAA,EACtC,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,CAAC,WAAW,CAAC,CAAA;AAAA,EACnC,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,CAAC,WAAW,CAAC,CAAA;AAAA,E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,OAAO,CAAA,MAAO,OAAA,GAAU,mBAAA,CAAoB,IAAI,OAAO,CAAA;AACxE,EAAA,IAAI,QAAA,CAAS,GAAA,CAAI,UAAU,CAAA,IAAK,GAAA,CAAI,UAAA,CAAW,WAAA,KAAgB,IAAA,EAAM,GAAA,CAAI,UAAA,GAAa,EAAE,WAAA,EAAa,IAAA,EAAK;AAC1G,EAAA,IAAI,GAAA,CAAI,eAAA,KAAoB,IAAA,EAAM,GAAA,CAAI,eAAA,GAAkB,IAAA;AACxD,EAAA,IAAI,cAAc,GAAA,CAAI,WAAW,CAAA,EAAG,GAAA,CAAI,cAAc,GAAA,CAAI,WAAA;AAC1D,EAAA,IAAI,cAAc,GAAA,CAAI,YAAY,CAAA,EAAG,GAAA,CAAI,eAAe,GAAA,CAAI,YAAA;AAC5D,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,GAAA,CAAI,aAAa,CAAA,EAAG;AACpC,IAAA,MAAM,KAAA,GAAQ,GAAA,CAAI,aAAA,CAAc,MAAA,CAAO,cAAc,CAAA;AACrD,IAAA,IAAI,KAAA,CAAM,MAAA,GAAS,CAAA,EAAG,GAAA,CAAI,aAAA,GAAgB,KAAA;AAAA,EAC5C;AACA,EAAA,IAAI,cAAc,GAAA,CAAI,UAAU,CAAA,EAAG,GAAA,CAAI,aAAa,GAAA,CAAI,UAAA;AACxD,EAAA,OAAO,GAAA;AACT;AAGO,SAAS,iBAAA,CAAkB,QAAiB,UAAA,EAAiC;AAClF,EAAA,IAAI;AACF,IAAA,OAAO,kBAAA,CAAmB,QAAA,CAAS,KAAK,CAAA,IAAK,OAAO,UAAU,UAAA,GAAc,KAAA,CAAc,qBAAqB,CAAA,GAAI,KAAA,CAAS,CAAA;AAAA,EAC9H,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF","file":"chunk-TZWXZDSX.cjs","sourcesContent":["/**\n * The worlds a Nodaro deployment can offer — the tabs of the shared site\n * header, in its canonical display order — and the node types each one runs.\n *\n * A world is offered to a viewer when the deployment's profile allows it\n * (`surface.worlds.allow`, when set) AND every node type it runs is available\n * to that viewer. The platform's `GET /v1/surface/availability` answers both\n * per viewer; this table is the one copy that answer and every client read,\n * so a world is never shown where its runs would be refused.\n *\n * Structural vocabulary only (ids and node-type names), no content.\n */\n\nexport const WORLD_IDS = Object.freeze([\"explore\", \"image\", \"video\", \"music\", \"trends\", \"motion\", \"voice\", \"app\", \"studio\"] as const)\n\nexport type WorldId = (typeof WORLD_IDS)[number]\n\nconst WORLD_ID_SET: ReadonlySet<string> = new Set(WORLD_IDS)\n\nexport function isWorldId(value: unknown): value is WorldId {\n return typeof value === \"string\" && WORLD_ID_SET.has(value)\n}\n\n/**\n * The node types each world runs: a world is offered only while every one of\n * them is available to the viewer. A world with none runs no node of its own\n * and is gated by the allowlist alone: Explore is a showcase, App is the\n * workflow editor (whose nodes are gated one by one inside it), Studio is its\n * own product.\n *\n * - `image`: Generate Image (`POST /v1/generate-image`).\n * - `video`: Generate Video and Text to Video — the world's two routes\n * (`/v1/generate-video` from a start frame, `/v1/text-to-video` from a\n * prompt). The canvas's Image to Video node is not one of them.\n * - `music`: Suno Create Music (`/v1/suno/generate`).\n * - `trends`, `motion`: Cast Swap (`/v1/cast-swap`), the run both worlds start.\n * - `voice`: Voice Changer Pro (`/v1/voice-changer-pro`).\n */\nexport const WORLD_REQUIRED_NODE_TYPES: Readonly<Record<WorldId, readonly string[]>> = Object.freeze({\n explore: Object.freeze([]),\n image: Object.freeze([\"generate-image\"]),\n video: Object.freeze([\"generate-video\", \"text-to-video\"]),\n music: Object.freeze([\"suno-generate\"]),\n trends: Object.freeze([\"cast-swap\"]),\n motion: Object.freeze([\"cast-swap\"]),\n voice: Object.freeze([\"voice-changer-pro\"]),\n app: Object.freeze([]),\n studio: Object.freeze([]),\n})\n\n/** The worlds part of a deployment's surface profile. */\nexport interface SurfaceWorlds {\n /**\n * When PRESENT, exactly these worlds are offered (`[]` offers none). Absent:\n * every world is, subject to its node types. Unlike the profile's other\n * lists, presence is what narrows, so a list whose ids are all unknown\n * offers nothing instead of everything.\n */\n readonly allow?: readonly string[]\n /** The world a visit to the site's root lands on. Always one `allow` lets through. */\n readonly home?: WorldId\n /** Display order; worlds it leaves out follow in canonical order. */\n readonly order?: readonly WorldId[]\n}\n\n/** Does the profile's allowlist let this world through? (Node availability is checked separately.) */\nexport function worldAllowed(worlds: SurfaceWorlds | undefined, id: string): boolean {\n return worlds?.allow === undefined || worlds.allow.includes(id)\n}\n\n/**\n * Whether a world is offered: the profile's allowlist lets it through and none\n * of the node types it runs (`WORLD_REQUIRED_NODE_TYPES`) is withheld, as\n * `nodeWithheld` judges them: the platform per viewer, or a client by the\n * deployment's own lists (`nodeListsWithhold`) before the platform's answer.\n */\nexport function worldOffered(worlds: SurfaceWorlds | undefined, id: WorldId, nodeWithheld: (type: string) => boolean): boolean {\n return worldAllowed(worlds, id) && !WORLD_REQUIRED_NODE_TYPES[id].some(nodeWithheld)\n}\n\n/** Every world, `order`'s known ids first (each once), then the rest in canonical order. */\nexport function orderWorlds(order?: readonly string[]): WorldId[] {\n const out: WorldId[] = []\n for (const id of order ?? []) if (isWorldId(id) && !out.includes(id)) out.push(id)\n for (const id of WORLD_IDS) if (!out.includes(id)) out.push(id)\n return out\n}\n","/**\n * How a deployment's own lists withhold what it offers: `surface.nodes` and\n * `surface.models` in its runtime configuration, each an `allow` / `deny`\n * pair. This is the platform's rule before any admin setting (Admin →\n * Availability can replace the lists, and switches models off); a client\n * applies it the same way before the platform's per-viewer answer\n * (`GET /v1/surface/availability`) has arrived, or after it could not be read,\n * so a restricted deployment is judged by its own lists from the first paint.\n * The worlds' half is `worldOffered` (worlds.ts).\n *\n * Structural vocabulary only (ids and node-type names), no content.\n */\n\n/** One kind's lists (`surface.nodes`, `surface.models`). */\nexport interface SurfaceAllowDeny {\n readonly allow: readonly string[]\n readonly deny: readonly string[]\n}\n\n/** Whether a kind's lists say anything: either one names an id. */\nexport function listsSet(lists: SurfaceAllowDeny | undefined): boolean {\n return lists !== undefined && (lists.allow.length > 0 || lists.deny.length > 0)\n}\n\n/**\n * Whether `lists` withhold `id`. A non-empty `allow` is a whitelist: it\n * withholds every id outside it that it governs (`gated`: a whitelist only\n * inverts over the ids an operator can see and set). `deny` withholds every\n * id it names, governed or not, and wins over `allow`.\n */\nexport function listsWithhold(lists: SurfaceAllowDeny, id: string, gated: (id: string) => boolean): boolean {\n if (lists.allow.length > 0 && gated(id) && !lists.allow.includes(id)) return true\n return lists.deny.includes(id)\n}\n\n/**\n * Node types an `allow` list never withholds by leaving them out, so only\n * `deny` withholds them: the canvas's utility nodes (they cost nothing and run\n * nothing, and a whitelist that forgot the sticky note must not take away the\n * canvas's notes) and Site Capture (an install switch governs it). The\n * platform's own registry is held to this list.\n */\nexport const ALLOW_LIST_EXEMPT_NODE_TYPES: readonly string[] = Object.freeze([\n \"collect\",\n \"component\",\n \"deduplicate\",\n \"extract-field\",\n \"filter-list\",\n \"group\",\n \"json-process\",\n \"merge-lists\",\n \"preview\",\n \"router\",\n \"selector\",\n \"site-capture\",\n \"sort-list\",\n \"sticky-note\",\n \"teleport-receive\",\n \"teleport-send\",\n])\n\nconst EXEMPT: ReadonlySet<string> = new Set(ALLOW_LIST_EXEMPT_NODE_TYPES)\n\n/** Whether a node whitelist governs `type`: every node type but {@link ALLOW_LIST_EXEMPT_NODE_TYPES}. */\nexport function isAllowListGatedNodeType(type: string): boolean {\n return !EXEMPT.has(type)\n}\n\n/**\n * Capabilities a `deny` of another node withholds too: a one-off voice clone\n * inside a speech node is voice cloning behind another door, so a deployment\n * that denies the Voice Clone node withholds it.\n */\nconst DENY_OF_NODE_WITHHOLDS: ReadonlyMap<string, string> = new Map([[\"voice-clone-one-off\", \"voice-clone\"]])\n\n/**\n * Whether a deployment's node lists withhold `type`: {@link listsWithhold}\n * over the node types a whitelist governs, and a capability that follows a\n * denied node. `gated` is the caller's universe; by default\n * {@link isAllowListGatedNodeType}, which governs a type it has never heard of\n * (a client then withholds it rather than offering it).\n */\nexport function nodeListsWithhold(nodes: SurfaceAllowDeny, type: string, gated: (type: string) => boolean = isAllowListGatedNodeType): boolean {\n if (listsWithhold(nodes, type, gated)) return true\n const follows = DENY_OF_NODE_WITHHOLDS.get(type)\n return follows !== undefined && nodes.deny.includes(follows)\n}\n","import { isWorldId, type SurfaceWorlds, type WorldId } from \"./worlds.js\"\n\n/**\n * The deployment runtime config — the object a Nodaro platform container\n * writes to `/config.js` at boot as `window.__NODARO_RUNTIME__`, and that every\n * product served from the same site reads before its app starts. One published\n * build then serves any deployment without a rebuild.\n *\n * This module is the contract between that writer and its readers: the key\n * names, their shapes, and a lenient parser. Structural vocabulary only: no\n * content, no prices, nothing about any one deployment. The platform's own\n * schema stays the authority on what a deployment may set. What reaches the\n * page has already been validated there and stripped of every server-only\n * value; this parser only refuses to hand a reader a value of the wrong type.\n */\n\n/** The global `/config.js` assigns. */\nexport const RUNTIME_CONFIG_GLOBAL = \"__NODARO_RUNTIME__\"\n\n/** Every top-level key `/config.js` can carry. */\nexport const RUNTIME_CONFIG_KEYS = Object.freeze([\n \"apiUrl\",\n \"supabaseUrl\",\n \"supabaseAnonKey\",\n \"freecutUrl\",\n \"audiomassUrl\",\n \"defaultLocale\",\n \"surface\",\n \"moderation\",\n \"previewStopRule\",\n \"mediaOrigin\",\n \"flowUiOrigin\",\n \"legacyUiHosts\",\n \"linkOrigin\",\n] as const)\nexport type RuntimeConfigKey = (typeof RUNTIME_CONFIG_KEYS)[number]\n\nexport const SURFACE_HEADER_MODES = Object.freeze([\"default\", \"white-label\"] as const)\n/** `white-label`: the deployment's own header, with no platform links or art. */\nexport type SurfaceHeaderMode = (typeof SURFACE_HEADER_MODES)[number]\n\nexport const SURFACE_CATALOG_IMAGES = Object.freeze([\"default\", \"none\", \"own\"] as const)\n/** Pictures on picker options: the platform's (`default`), none, or the deployment's own (`own`). */\nexport type SurfaceCatalogImages = (typeof SURFACE_CATALOG_IMAGES)[number]\n\nexport interface RuntimeSurfaceSibling {\n readonly label: string\n readonly url: string\n readonly urlByHost?: Readonly<Record<string, string>>\n}\n\nexport interface RuntimeSurfaceBrand {\n readonly productName: string\n readonly description?: string\n readonly wordmark?: string\n readonly platformLinks?: boolean\n /** A same-site path (`/brand/logo.svg`) or an https URL. */\n readonly logo?: string\n /** The page's icons, each a path on this site (`/brand/favicon.svg`): see `isSameSitePath`. */\n readonly favicon?: readonly string[]\n}\n\n/**\n * Overrides of a product's UI strings, `product → locale id → message key →\n * text`. Each product reads only its own namespace (`UI_STRING_PRODUCTS`). The\n * platform checks every entry against that product's dictionary before it\n * reaches a page: the key exists, the locale is one the deployment offers, the\n * text is plain and keeps the base string's `{placeholders}`.\n */\nexport type RuntimeSurfaceStrings = Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, string>>>>>>\n\n/** The display side of billing. The server-only billing keys never reach a page. */\nexport interface RuntimeSurfaceBilling {\n readonly costTab: \"inherit\" | \"hidden\"\n readonly sidebarCard: \"inherit\" | \"hidden\"\n readonly selfServe: boolean\n readonly unitLabel?: string\n readonly unitRate?: number\n readonly unitDecimals?: number\n /**\n * The unit's word per interface language, beside the single `unitLabel`: a\n * language the deployment gives no word for uses `unitLabel`. Read with\n * `surfaceUnitLabel`.\n */\n readonly unitLabels?: Readonly<Record<string, string>>\n}\n\n/**\n * The deployment's surface profile as a page receives it, with every default\n * applied. Lists that are empty keep the product's own default, except\n * `worlds.allow` (see `SurfaceWorlds`).\n */\nexport interface RuntimeSurface {\n readonly nav: { readonly hide: readonly string[] }\n readonly features: { readonly hide: readonly string[] }\n readonly dashboard: { readonly tabs: readonly string[] }\n readonly nodes: { readonly deny: readonly string[]; readonly allow: readonly string[] }\n readonly models: { readonly deny: readonly string[]; readonly allow: readonly string[] }\n /** `requireSignIn`: no guest visits. When the deployment does not say, true exactly when sign-in is SSO-only. */\n readonly auth: { readonly methods: readonly string[]; readonly ssoLabel?: string; readonly requireSignIn: boolean }\n readonly siblings: { readonly apps: readonly RuntimeSurfaceSibling[] }\n readonly brand: RuntimeSurfaceBrand\n /** `offered`: the languages a visitor may pick from; absent = every language the product ships. */\n readonly locale: { readonly default?: string; readonly picker: boolean; readonly offered?: readonly string[] }\n readonly outputs: { readonly allowPublic: boolean }\n readonly voice: { readonly allowedGenders: readonly string[] }\n readonly billing: RuntimeSurfaceBilling\n readonly catalogs: { readonly required: boolean; readonly factoryPresets: boolean; readonly images: SurfaceCatalogImages }\n /** `links`: whether media may be imported from a link to another site. */\n readonly imports: { readonly links: boolean }\n readonly header: SurfaceHeaderMode\n readonly worlds: SurfaceWorlds\n /** The deployment's own wording for UI strings; `{}` = none. Read with `surfaceStringOverride`. */\n readonly strings: RuntimeSurfaceStrings\n /** Carried as given; no reader acts on it. */\n readonly catalogPolicy?: unknown\n}\n\nexport interface NodaroRuntimeConfig {\n /** The API base. `\"/\"` means this page's own origin: see `resolveRuntimeApiBase`. */\n readonly apiUrl?: string\n /** The Supabase URL. `\"/supabase\"` means this page's own origin: see `resolveRuntimeSupabaseUrl`. */\n readonly supabaseUrl?: string\n readonly supabaseAnonKey?: string\n /** The platform editor's embedded video editor. */\n readonly freecutUrl?: string\n /** The platform editor's embedded audio editor. */\n readonly audiomassUrl?: string\n /** The language a first-time visitor starts in. */\n readonly defaultLocale?: string\n /** Present only when the deployment configured a surface profile. */\n readonly surface?: RuntimeSurface\n /** The platform editor's upload-moderation capability. */\n readonly moderation?: { readonly uploadImage?: boolean }\n /** A platform editor rollout flag. */\n readonly previewStopRule?: boolean\n /**\n * The https origin this deployment serves user media from\n * (`https://media.example.com`). Present only on a white-label deployment\n * whose public media URL is https; absent, a reader trusts no media host\n * beyond its own site.\n */\n readonly mediaOrigin?: string\n /**\n * The https origin of the app's pages' own host, when this deployment gives\n * them one. Alone (with `linkOrigin`), every host keeps serving the pages\n * and only a browser's saved settings carry over to it. With\n * `legacyUiHosts` too, the pages have moved there, and a page on it calls\n * the API same-origin. Absent: the deployment has one host.\n */\n readonly flowUiOrigin?: string\n /** The hosts the app's pages moved away from (with `flowUiOrigin`): a navigation on one goes to the page's home. Absent: nothing moved. */\n readonly legacyUiHosts?: readonly string[]\n /**\n * The https origin the API keeps, with `flowUiOrigin`: where a browser's\n * saved settings are carried over from and, once the pages have moved\n * (`legacyUiHosts`), the origin developer-facing links name (published\n * apps, embeds, API examples). Absent: the page's own origin, as ever.\n */\n readonly linkOrigin?: string\n}\n\n// ── Rules shared by the platform and its readers ─────────────────────────────\n\n/** Sign-in is SSO-only when SSO is the one method offered. */\nexport function isSsoOnly(methods: readonly unknown[]): boolean {\n return methods.length > 0 && methods.every((m) => m === \"sso\")\n}\n\n/** An explicit `requireSignIn` wins; otherwise a deployment requires sign-in exactly when it is SSO-only. */\nexport function surfaceRequiresSignIn(auth: { readonly methods?: unknown; readonly requireSignIn?: unknown } | undefined): boolean {\n if (typeof auth?.requireSignIn === \"boolean\") return auth.requireSignIn\n return isSsoOnly(strings(auth?.methods))\n}\n\n// Whitespace, control characters and backslashes never belong in a logo\n// reference, and a browser reads `/\\host` as `//host`: another site.\nconst UNSAFE_REF_CHARS = /[\\s\\u0000-\\u001f\\u007f\\\\]/\nconst PROBE_ORIGIN = \"https://origin.invalid\"\n\n/**\n * A brand logo reference a page may load: a path on the page's own site\n * (`/brand/logo.svg`), or an https URL without credentials. A protocol-relative\n * `//host/…`, any other scheme (`http:`, `data:`, `javascript:`) and anything\n * with whitespace or a backslash is not one.\n */\nexport function isBrandLogoRef(value: unknown): value is string {\n if (typeof value !== \"string\" || value.length === 0 || UNSAFE_REF_CHARS.test(value)) return false\n try {\n if (value.startsWith(\"/\")) return !value.startsWith(\"//\") && new URL(value, PROBE_ORIGIN).origin === PROBE_ORIGIN\n const url = new URL(value)\n return url.protocol === \"https:\" && url.hostname.length > 0 && !url.username && !url.password\n } catch {\n return false\n }\n}\n\n// Quotes, angle brackets and backticks would end an HTML attribute that holds\n// the path, and none belongs in a path anyway.\nconst HTML_SPECIAL_CHARS = /[\"'<>`]/\n\n/**\n * A path on the page's own site (`/brand/favicon.svg`, `/icon.png?v=2`): what\n * `brand.favicon` holds, written into the page's `<head>` as a link. Stricter\n * than `isBrandLogoRef`: no URL to another site at all, and no character that\n * could end an HTML attribute.\n */\nexport function isSameSitePath(value: unknown): value is string {\n return typeof value === \"string\" && value.startsWith(\"/\") && !HTML_SPECIAL_CHARS.test(value) && isBrandLogoRef(value)\n}\n\n/**\n * The products whose UI strings a deployment may override, each keyed in\n * `surface.strings` by its id and checked against that product's own\n * dictionary. `flow`: the platform's workflow editor; `tools`: the tools app;\n * `voice`: the voice app. One profile words them all. A product adopts the\n * overrides by adding its id here and giving the platform its key manifest\n * (`uiStringManifestFile`), which a deployment composing the app into one\n * image copies next to Flow's own.\n */\nexport const UI_STRING_PRODUCTS = Object.freeze([\"flow\", \"tools\", \"voice\"] as const)\nexport type UiStringProduct = (typeof UI_STRING_PRODUCTS)[number]\n\n/**\n * What a product's build emits beside its output so the platform can check a\n * deployment's overrides at boot: every key of its base (English) dictionary\n * with the placeholder names that key's text uses, and the locales the product\n * offers. Keys and names only, never the text.\n */\nexport interface UiStringManifest {\n /** The `surface.strings` namespace the dictionary answers to (`UI_STRING_PRODUCTS`). */\n readonly product: string\n /** The locales overrides may target when the deployment sets no `locale.offered`. */\n readonly locales: readonly string[]\n /** Every key a deployment may override → the placeholder names its base text uses, sorted. */\n readonly keys: Readonly<Record<string, readonly string[]>>\n}\n\n/** The manifest's file name, at the root of the product's build output. */\nexport function uiStringManifestFile(product: string): string {\n return `ui-strings-manifest.${product}.json`\n}\n\n// `{name}`: anything else in braces (`{{now}}`, `{image:1}`, `{ variables`) is\n// text, the same way the dictionaries' interpolation reads it.\nconst UI_STRING_PLACEHOLDER = /\\{(\\w+)\\}/g\n\n/** The placeholder names `text` uses, each once, sorted. */\nexport function uiStringPlaceholders(text: string): string[] {\n return [...new Set(Array.from(text.matchAll(UI_STRING_PLACEHOLDER), (m) => m[1]))].sort()\n}\n\n/**\n * The manifest of a base dictionary. A key whose base text is blank is left\n * out: it is grammar data (a word's grammatical gender, the gap between two\n * joined fragments), not wording, and overriding it would only break the\n * sentences built from it.\n */\nexport function buildUiStringManifest(product: string, dict: Readonly<Record<string, string>>, locales: readonly string[]): UiStringManifest {\n const keys = Object.entries(dict)\n .filter(([, text]) => text.trim() !== \"\")\n .map(([key, text]): [string, string[]] => [key, uiStringPlaceholders(text)])\n return { product, locales: [...locales], keys: Object.fromEntries(keys) }\n}\n\n/** The deployment's text for `key` in `locale` of `product`, or undefined. */\nexport function surfaceStringOverride(strings: RuntimeSurfaceStrings | undefined, product: string, locale: string, key: string): string | undefined {\n const byLocale = strings && Object.hasOwn(strings, product) ? strings[product] : undefined\n const texts = byLocale && Object.hasOwn(byLocale, locale) ? byLocale[locale] : undefined\n const text = texts && Object.hasOwn(texts, key) ? texts[key] : undefined\n return typeof text === \"string\" ? text : undefined\n}\n\n/**\n * The deployment's word for its unit in `locale`: the `billing.unitLabels`\n * entry for that language, else its single `unitLabel` (`single`). `labels` is\n * the map as it arrives, on the surface or on a `display` object beside its\n * `unit`.\n */\nexport function surfaceUnitLabel(labels: Readonly<Record<string, string>> | undefined, locale: string | undefined, single: string): string {\n const word = labels && locale !== undefined && Object.hasOwn(labels, locale) ? labels[locale] : undefined\n return typeof word === \"string\" && word.length > 0 ? word : single\n}\n\n/**\n * A host the app's pages move away from, on a deployment that moved them to a\n * host of their own (`LEGACY_UI_HOSTS`, `legacyUiHosts`): a bare host name in\n * lower case, with no scheme, port, path or space. The one rule for it: the\n * server refuses to start on an entry that is not one, and a reader of\n * /config.js drops it.\n */\nexport function isLegacyUiHost(value: unknown): value is string {\n return typeof value === \"string\" && /^[a-z0-9.-]+$/.test(value)\n}\n\n/**\n * An https origin, spelled exactly as a browser spells one\n * (`https://media.example.com`, a port only when it is not 443): what\n * `new URL(src).origin` is compared with, so a path, a trailing slash,\n * credentials, another letter case or any other scheme could never match, and\n * is not one.\n */\nexport function isHttpsOrigin(value: unknown): value is string {\n if (typeof value !== \"string\") return false\n try {\n const url = new URL(value)\n return url.protocol === \"https:\" && url.origin === value\n } catch {\n return false\n }\n}\n\n/**\n * The base a client builds API URLs on. `\"/\"` is the same-origin sentinel (a\n * site answering on more than one hostname cannot name one) and resolves to\n * `\"\"`: build every URL relative to the page. `undefined` when the config names\n * none, so the app keeps its own build-time value. It never makes up a URL.\n */\nexport function resolveRuntimeApiBase(cfg: Pick<NodaroRuntimeConfig, \"apiUrl\"> | undefined): string | undefined {\n const value = typeof cfg?.apiUrl === \"string\" ? cfg.apiUrl.trim() : \"\"\n if (!value) return undefined\n return value === \"/\" ? \"\" : value\n}\n\n/**\n * The Supabase URL a browser client uses. supabase-js needs an absolute URL, so\n * the same-origin sentinel `\"/supabase\"` resolves against `origin`, the page's\n * own (`location.origin`). `undefined` when the config names none.\n */\nexport function resolveRuntimeSupabaseUrl(cfg: Pick<NodaroRuntimeConfig, \"supabaseUrl\"> | undefined, origin: string): string | undefined {\n const value = typeof cfg?.supabaseUrl === \"string\" ? cfg.supabaseUrl.trim() : \"\"\n if (!value) return undefined\n return value === \"/supabase\" ? `${origin.replace(/\\/+$/, \"\")}/supabase` : value\n}\n\n// ── The parser ───────────────────────────────────────────────────────────────\n\ntype Rec = Readonly<Record<string, unknown>>\n\nfunction isRecord(value: unknown): value is Rec {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\nconst record = (value: unknown): Rec => (isRecord(value) ? value : {})\nfunction strings(value: unknown): string[] {\n return Array.isArray(value) ? value.filter((x): x is string => typeof x === \"string\") : []\n}\nconst optional = <K extends string, V>(key: K, value: V | undefined): { [P in K]?: V } =>\n (value === undefined ? {} : { [key]: value }) as { [P in K]?: V }\nconst asString = (value: unknown): string | undefined => (typeof value === \"string\" ? value : undefined)\nconst asBoolean = (value: unknown): boolean | undefined => (typeof value === \"boolean\" ? value : undefined)\n\nfunction siblingApps(value: unknown): RuntimeSurfaceSibling[] {\n if (!Array.isArray(value)) return []\n return value.flatMap((raw) => {\n if (!isRecord(raw) || typeof raw.label !== \"string\" || typeof raw.url !== \"string\") return []\n const byHost = isRecord(raw.urlByHost)\n ? Object.fromEntries(Object.entries(raw.urlByHost).filter((e): e is [string, string] => typeof e[1] === \"string\"))\n : {}\n return [{ label: raw.label, url: raw.url, ...optional(\"urlByHost\", Object.keys(byHost).length ? byHost : undefined) }]\n })\n}\n\nfunction faviconsOf(value: unknown): string[] | undefined {\n const paths = (Array.isArray(value) ? value : [value]).filter(isSameSitePath)\n return paths.length ? [...new Set(paths)] : undefined\n}\n\nfunction brandOf(value: unknown): RuntimeSurfaceBrand {\n const b = record(value)\n return {\n productName: typeof b.productName === \"string\" && b.productName ? b.productName : \"Nodaro\",\n ...optional(\"description\", asString(b.description)),\n ...optional(\"wordmark\", asString(b.wordmark)),\n ...optional(\"platformLinks\", asBoolean(b.platformLinks)),\n ...optional(\"logo\", isBrandLogoRef(b.logo) ? b.logo : undefined),\n ...optional(\"favicon\", faviconsOf(b.favicon)),\n }\n}\n\n/**\n * `surface.strings`, keeping only text: a product, locale or key whose value\n * has the wrong type is left out, and an emptied level with it. Built from\n * entries, so a `\"__proto__\"` key stays an ordinary key. Never throws.\n */\nexport function parseRuntimeStrings(raw: unknown): RuntimeSurfaceStrings {\n const products: [string, Record<string, Record<string, string>>][] = []\n for (const [product, byLocale] of Object.entries(record(raw))) {\n const locales: [string, Record<string, string>][] = []\n for (const [locale, texts] of Object.entries(record(byLocale))) {\n const kept = Object.entries(record(texts)).filter((e): e is [string, string] => typeof e[1] === \"string\")\n if (kept.length) locales.push([locale, Object.fromEntries(kept)])\n }\n if (locales.length) products.push([product, Object.fromEntries(locales)])\n }\n return Object.fromEntries(products)\n}\n\nfunction localeOf(value: unknown): RuntimeSurface[\"locale\"] {\n const l = record(value)\n return {\n ...optional(\"default\", asString(l.default)),\n picker: l.picker !== false,\n ...optional(\"offered\", Array.isArray(l.offered) ? strings(l.offered) : undefined),\n }\n}\n\n/** Text words only, built from entries so a `\"__proto__\"` key stays an ordinary key; nothing usable leaves the key out. */\nfunction unitLabelsOf(value: unknown): Readonly<Record<string, string>> | undefined {\n const words = Object.entries(record(value)).filter((e): e is [string, string] => typeof e[1] === \"string\" && e[1].length > 0)\n return words.length ? Object.fromEntries(words) : undefined\n}\n\nfunction billingOf(value: unknown): RuntimeSurfaceBilling {\n const b = record(value)\n // Both or neither: a label without a rate (or the reverse) would put one\n // unit's name on another unit's numbers. The per-language words stand beside\n // the label, so they live and fall with it.\n const coherent = typeof b.unitLabel === \"string\" && b.unitLabel.length > 0 && typeof b.unitRate === \"number\" && Number.isFinite(b.unitRate) && b.unitRate > 0\n const decimals = typeof b.unitDecimals === \"number\" && Number.isInteger(b.unitDecimals) && b.unitDecimals >= 0 && b.unitDecimals <= 4 ? b.unitDecimals : undefined\n return {\n costTab: b.costTab === \"hidden\" ? \"hidden\" : \"inherit\",\n sidebarCard: b.sidebarCard === \"hidden\" ? \"hidden\" : \"inherit\",\n selfServe: b.selfServe !== false,\n ...(coherent\n ? { unitLabel: b.unitLabel as string, unitRate: b.unitRate as number, ...optional(\"unitDecimals\", decimals), ...optional(\"unitLabels\", unitLabelsOf(b.unitLabels)) }\n : {}),\n }\n}\n\n/** A value outside the known set reads as the restrictive one: a reader older than its platform must not show more. */\nfunction catalogImagesOf(value: unknown): SurfaceCatalogImages {\n if (value === undefined) return \"default\"\n return (SURFACE_CATALOG_IMAGES as readonly unknown[]).includes(value) ? (value as SurfaceCatalogImages) : \"none\"\n}\n\nfunction linksAllowed(value: unknown): boolean {\n if (value === undefined) return true\n if (!isRecord(value)) return false\n return value.links === undefined ? true : value.links === true\n}\n\nfunction headerModeOf(value: unknown): SurfaceHeaderMode {\n return value === undefined || value === \"default\" ? \"default\" : \"white-label\"\n}\n\nfunction worldsOf(value: unknown): SurfaceWorlds {\n if (value === undefined) return {}\n // Present but not an object: offer none rather than everything.\n if (!isRecord(value)) return { allow: [] }\n const allow = value.allow === undefined ? undefined : strings(value.allow)\n const order = Array.isArray(value.order) ? [...new Set(value.order.filter(isWorldId))] : []\n const home: WorldId | undefined = isWorldId(value.home) && (allow === undefined || allow.includes(value.home)) ? value.home : undefined\n return { ...optional(\"allow\", allow), ...optional(\"home\", home), ...optional(\"order\", order.length ? order : undefined) }\n}\n\n/** The surface block of `/config.js`, every default applied. Never throws. */\nexport function parseRuntimeSurface(raw: unknown): RuntimeSurface {\n const s = record(raw)\n const auth = record(s.auth)\n const methods = strings(auth.methods)\n const allowDeny = (v: unknown) => ({ deny: strings(record(v).deny), allow: strings(record(v).allow) })\n const catalogs = record(s.catalogs)\n return {\n nav: { hide: strings(record(s.nav).hide) },\n features: { hide: strings(record(s.features).hide) },\n dashboard: { tabs: strings(record(s.dashboard).tabs) },\n nodes: allowDeny(s.nodes),\n models: allowDeny(s.models),\n auth: { methods, ...optional(\"ssoLabel\", asString(auth.ssoLabel)), requireSignIn: surfaceRequiresSignIn({ methods, requireSignIn: auth.requireSignIn }) },\n siblings: { apps: siblingApps(record(s.siblings).apps) },\n brand: brandOf(s.brand),\n locale: localeOf(s.locale),\n outputs: { allowPublic: record(s.outputs).allowPublic !== false },\n voice: { allowedGenders: strings(record(s.voice).allowedGenders) },\n billing: billingOf(s.billing),\n catalogs: { required: catalogs.required === true, factoryPresets: catalogs.factoryPresets !== false, images: catalogImagesOf(catalogs.images) },\n imports: { links: linksAllowed(s.imports) },\n header: headerModeOf(s.header),\n worlds: worldsOf(s.worlds),\n strings: parseRuntimeStrings(s.strings),\n ...optional(\"catalogPolicy\", s.catalogPolicy),\n }\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value === \"object\" && value !== null) {\n for (const child of Object.values(value)) deepFreeze(child)\n Object.freeze(value)\n }\n return value\n}\n\n/** The surface a deployment that configured none renders. */\nexport const RUNTIME_SURFACE_DEFAULT: RuntimeSurface = deepFreeze(parseRuntimeSurface(undefined))\n\nconst STRING_KEYS = [\"apiUrl\", \"supabaseUrl\", \"supabaseAnonKey\", \"freecutUrl\", \"audiomassUrl\", \"defaultLocale\"] as const\n\n/**\n * `/config.js`'s object, typed. Keeps each key only when it has the expected\n * type; a blank string is no value. Never throws.\n */\nexport function parseRuntimeConfig(raw: unknown): NodaroRuntimeConfig {\n if (!isRecord(raw)) return {}\n const out: { -readonly [K in keyof NodaroRuntimeConfig]: NodaroRuntimeConfig[K] } = {}\n for (const key of STRING_KEYS) {\n const value = raw[key]\n if (typeof value === \"string\" && value.trim()) out[key] = value.trim()\n }\n if (isRecord(raw.surface)) out.surface = parseRuntimeSurface(raw.surface)\n if (isRecord(raw.moderation) && raw.moderation.uploadImage === true) out.moderation = { uploadImage: true }\n if (raw.previewStopRule === true) out.previewStopRule = true\n if (isHttpsOrigin(raw.mediaOrigin)) out.mediaOrigin = raw.mediaOrigin\n if (isHttpsOrigin(raw.flowUiOrigin)) out.flowUiOrigin = raw.flowUiOrigin\n if (Array.isArray(raw.legacyUiHosts)) {\n const hosts = raw.legacyUiHosts.filter(isLegacyUiHost)\n if (hosts.length > 0) out.legacyUiHosts = hosts\n }\n if (isHttpsOrigin(raw.linkOrigin)) out.linkOrigin = raw.linkOrigin\n return out\n}\n\n/** Read and parse the runtime config `/config.js` set on `scope` (default: the global object). */\nexport function readRuntimeConfig(scope: unknown = globalThis): NodaroRuntimeConfig {\n try {\n return parseRuntimeConfig(isRecord(scope) || typeof scope === \"function\" ? (scope as Rec)[RUNTIME_CONFIG_GLOBAL] : undefined)\n } catch {\n return {}\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkE62W5I6A_cjs = require('./chunk-E62W5I6A.cjs');
3
+ var chunkZWEVRMFN_cjs = require('./chunk-ZWEVRMFN.cjs');
4
4
 
5
5
  // src/tts-capabilities.ts
6
6
  var TTS_PROVIDER_ALIASES = {
@@ -13,12 +13,12 @@ function canonicalTtsProvider(provider) {
13
13
  function findTtsCapabilities(provider) {
14
14
  if (typeof provider !== "string" || !provider) return void 0;
15
15
  const id = canonicalTtsProvider(provider);
16
- if (!Object.hasOwn(chunkE62W5I6A_cjs.MODEL_CATALOG, id)) return void 0;
17
- const entry = chunkE62W5I6A_cjs.MODEL_CATALOG[id];
16
+ if (!Object.hasOwn(chunkZWEVRMFN_cjs.MODEL_CATALOG, id)) return void 0;
17
+ const entry = chunkZWEVRMFN_cjs.MODEL_CATALOG[id];
18
18
  return entry.modes.includes("tts") ? entry.tts : void 0;
19
19
  }
20
20
  function getTtsCapabilities(provider) {
21
- return findTtsCapabilities(provider) ?? chunkE62W5I6A_cjs.MODEL_CATALOG[TTS_FALLBACK_PROVIDER].tts;
21
+ return findTtsCapabilities(provider) ?? chunkZWEVRMFN_cjs.MODEL_CATALOG[TTS_FALLBACK_PROVIDER].tts;
22
22
  }
23
23
  function ttsSupportsAudioTags(provider) {
24
24
  return getTtsCapabilities(provider).audioTags;
@@ -96,7 +96,7 @@ function ttsDirectionProblem(provider, values) {
96
96
  var namedVoiceIds;
97
97
  function anyModelsNamedVoice(voice) {
98
98
  namedVoiceIds ??= new Set(
99
- Object.values(chunkE62W5I6A_cjs.MODEL_CATALOG).flatMap((m) => m.modes.includes("tts") ? (m.tts?.voices ?? []).map((v) => v.id) : [])
99
+ Object.values(chunkZWEVRMFN_cjs.MODEL_CATALOG).flatMap((m) => m.modes.includes("tts") ? (m.tts?.voices ?? []).map((v) => v.id) : [])
100
100
  );
101
101
  return namedVoiceIds.has(voice);
102
102
  }
@@ -113,7 +113,7 @@ function ttsTakesReplica(provider) {
113
113
  return getTtsCapabilities(provider).replica === true;
114
114
  }
115
115
  function replicaModels() {
116
- return Object.values(chunkE62W5I6A_cjs.MODEL_CATALOG).filter((m) => m.modes.includes("tts") && m.tts?.replica === true).map((m) => m.id);
116
+ return Object.values(chunkZWEVRMFN_cjs.MODEL_CATALOG).filter((m) => m.modes.includes("tts") && m.tts?.replica === true).map((m) => m.id);
117
117
  }
118
118
  function isHttpsLink(value) {
119
119
  if (typeof value !== "string") return false;
@@ -137,7 +137,7 @@ function ttsReplicaProblem(provider, value) {
137
137
  }
138
138
  function replicaConsentProblem(value) {
139
139
  if (value === void 0 || value === null) return void 0;
140
- return value.consent === true ? void 0 : `replica.consent must be true: it confirms "${chunkE62W5I6A_cjs.REPLICA_CONSENT_ATTESTATION}"`;
140
+ return value.consent === true ? void 0 : `replica.consent must be true: it confirms "${chunkZWEVRMFN_cjs.REPLICA_CONSENT_ATTESTATION}"`;
141
141
  }
142
142
 
143
143
  exports.TTS_FALLBACK_PROVIDER = TTS_FALLBACK_PROVIDER;
@@ -164,5 +164,5 @@ exports.ttsSupportsStitching = ttsSupportsStitching;
164
164
  exports.ttsSupportsTimestamps = ttsSupportsTimestamps;
165
165
  exports.ttsTakesReplica = ttsTakesReplica;
166
166
  exports.ttsVoiceForModel = ttsVoiceForModel;
167
- //# sourceMappingURL=chunk-F6XIH3TZ.cjs.map
168
- //# sourceMappingURL=chunk-F6XIH3TZ.cjs.map
167
+ //# sourceMappingURL=chunk-UJREE6EQ.cjs.map
168
+ //# sourceMappingURL=chunk-UJREE6EQ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tts-capabilities.ts"],"names":["MODEL_CATALOG","REPLICA_CONSENT_ATTESTATION"],"mappings":";;;;;AAmBO,IAAM,oBAAA,GAAyD;AAAA,EACpE,UAAA,EAAY;AACd;AAGO,IAAM,qBAAA,GAAwB;AAQ9B,SAAS,qBAAqB,QAAA,EAA0B;AAC7D,EAAA,OAAO,OAAO,QAAA,KAAa,QAAA,IAAY,MAAA,CAAO,MAAA,CAAO,sBAAsB,QAAQ,CAAA,GAAI,oBAAA,CAAqB,QAAQ,CAAA,GAAK,QAAA;AAC3H;AAGO,SAAS,oBAAoB,QAAA,EAA2D;AAG7F,EAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,CAAC,UAAU,OAAO,MAAA;AACtD,EAAA,MAAM,EAAA,GAAK,qBAAqB,QAAQ,CAAA;AACxC,EAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAOA,+BAAA,EAAe,EAAE,GAAG,OAAO,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;AAAA,EACT;AACF;AAGO,SAAS,UAAU,KAAA,EAAwC;AAChE,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,UAAU,OAAO,MAAA;AAChD,EAAA,MAAM,EAAE,cAAA,EAAgB,eAAA,EAAgB,GAAI,KAAA;AAC5C,EAAA,OAAO,WAAA,CAAY,cAAc,CAAA,IAAK,WAAA,CAAY,eAAe,CAAA,GAAI,EAAE,cAAA,EAAgB,eAAA,EAAgB,GAAI,MAAA;AAC7G;AASO,SAAS,iBAAA,CAAkB,UAA8B,KAAA,EAAoC;AAClG,EAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM,OAAO,MAAA;AAClD,EAAA,IAAI,CAAC,eAAA,CAAgB,QAAQ,CAAA,EAAG;AAC9B,IAAA,OAAO,CAAA,EAAG,YAAY,YAAY,CAAA,iDAAA,EAAoD,eAAc,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,EAClH;AACA,EAAA,OAAO,SAAA,CAAU,KAAK,CAAA,GAAI,MAAA,GAAY,yFAAA;AACxC;AAQO,SAAS,sBAAsB,KAAA,EAAoC;AACxE,EAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM,OAAO,MAAA;AAClD,EAAA,OAAQ,KAAA,CAAgC,OAAA,KAAY,IAAA,GAChD,MAAA,GACA,8CAA8CC,6CAA2B,CAAA,CAAA,CAAA;AAC/E","file":"chunk-F6XIH3TZ.cjs","sourcesContent":["/**\n * Capability lookups for the text-to-speech lane.\n *\n * Every \"does this model do X\" decision on that lane reads the model's `tts`\n * sheet in `MODEL_CATALOG` through these helpers — tag stripping, which voice\n * settings are sent and shown, the language picker, whether neighbouring text\n * is sent. Declare the sheet honestly\n * on the catalog entry and a new model is covered everywhere; do not compare a\n * provider id by hand.\n *\n * \"The text-to-speech lane\" means the models that list the `tts` mode. The\n * dialogue models carry a sheet too, read by `dialogue-capabilities.ts`; a\n * text-to-speech request that names one runs as the fallback model, so these\n * helpers answer for the fallback there.\n */\nimport { MODEL_CATALOG, type TtsCapabilities, type TtsDirectionSheet, type TtsSettingLever } from \"./model-catalog.js\"\nimport { REPLICA_CONSENT_ATTESTATION, type TtsNamedVoice, type TtsReplica } from \"./gemini-tts.js\"\n\n/** Legacy provider ids that are another model under an old name. They have no catalog entry of their own. */\nexport const TTS_PROVIDER_ALIASES: Readonly<Record<string, string>> = {\n elevenlabs: \"elevenlabs-turbo\",\n}\n\n/** The model a request runs on when its provider id is missing or unknown. */\nexport const TTS_FALLBACK_PROVIDER = \"elevenlabs-turbo\"\n\n/**\n * Resolve a legacy alias to the catalog id it runs as. Any other id passes\n * through unchanged. Own properties only: an id that happens to be the name of\n * an inherited object member (`constructor`, `__proto__`, `toString`) is an\n * unknown id like any other, never a function.\n */\nexport function canonicalTtsProvider(provider: string): string {\n return typeof provider === \"string\" && Object.hasOwn(TTS_PROVIDER_ALIASES, provider) ? TTS_PROVIDER_ALIASES[provider]! : provider\n}\n\n/** The capability sheet of a text-to-speech model, or `undefined` when the id is not one. */\nexport function findTtsCapabilities(provider: string | undefined): TtsCapabilities | undefined {\n // `typeof`: node data can be written straight into workflow JSON, so the \"string\" is not guaranteed — and\n // `Object.hasOwn` would coerce an array like [\"elevenlabs-v3\"] into that model's id. A non-string is an unknown id.\n if (typeof provider !== \"string\" || !provider) return undefined\n const id = canonicalTtsProvider(provider)\n if (!Object.hasOwn(MODEL_CATALOG, id)) return undefined\n const entry = MODEL_CATALOG[id]!\n return entry.modes.includes(\"tts\") ? entry.tts : undefined\n}\n\n/**\n * The capability sheet a text-to-speech request will actually run under: a\n * missing or unknown provider id runs as {@link TTS_FALLBACK_PROVIDER}, so it\n * gets that sheet — including its `maxChars` (turbo's 40,000), where\n * `getMaxTtsChars` keeps answering its 5,000 default for such ids.\n */\nexport function getTtsCapabilities(provider: string | undefined): TtsCapabilities {\n return findTtsCapabilities(provider) ?? MODEL_CATALOG[TTS_FALLBACK_PROVIDER]!.tts!\n}\n\n/** The model performs inline `[audio tags]`. false ⇒ strip them before sending. */\nexport function ttsSupportsAudioTags(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).audioTags\n}\n\n/** The model honours SSML `<break time=\"…\"/>` tags. */\nexport function ttsSupportsSsmlBreaks(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).ssmlBreaks\n}\n\n/**\n * The model conditions on neighbouring text (`previous_text` / `next_text`).\n * false ⇒ the provider funnel never puts the fields on the wire, whatever the\n * request carries — the model would reject them.\n */\nexport function ttsSupportsStitching(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).stitching\n}\n\n/** The model honours this voice-setting lever. */\nexport function ttsHasLever(provider: string | undefined, lever: TtsSettingLever): boolean {\n return getTtsCapabilities(provider).levers.includes(lever)\n}\n\n/** The model answers `/v1/text-to-speech/{voice}/with-timestamps` (character timings). */\nexport function ttsSupportsTimestamps(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).timestamps\n}\n\n/** Language codes offered for the model, in catalog order. */\nexport function ttsLanguageCodes(provider: string | undefined): readonly string[] {\n return getTtsCapabilities(provider).languages\n}\n\n/**\n * The named voices the model speaks, or `undefined` when it speaks the\n * ElevenLabs voices (premade, library, clones). See `TtsCapabilities.voices`.\n */\nexport function ttsNamedVoices(provider: string | undefined): readonly TtsNamedVoice[] | undefined {\n return getTtsCapabilities(provider).voices\n}\n\n/**\n * Whether `voice` is one the model can speak: on a model with named voices,\n * one of them by its exact wire name; on any other model, any id (the\n * ElevenLabs voice checks apply there, as before).\n */\nexport function ttsAcceptsVoice(provider: string | undefined, voice: string): boolean {\n const named = ttsNamedVoices(provider)\n return !named || named.some((v) => v.id === voice)\n}\n\n/**\n * The voice a request on a named-voice model runs with: the one it names when\n * the model speaks it, else the model's default. `undefined` on an ElevenLabs\n * model (its own default applies downstream).\n */\nexport function ttsNamedVoiceFor(provider: string | undefined, voice: unknown): string | undefined {\n const caps = getTtsCapabilities(provider)\n if (!caps.voices) return undefined\n return typeof voice === \"string\" && caps.voices.some((v) => v.id === voice) ? voice : caps.defaultVoice\n}\n\n/** The style direction the model takes (`TtsCapabilities.direction`), or `undefined` when it takes none. */\nexport function ttsDirection(provider: string | undefined): TtsDirectionSheet | undefined {\n return getTtsCapabilities(provider).direction\n}\n\n/** The model writes its tone tags `<in angle brackets>` from a closed list (`TtsCapabilities.tagSyntax`). */\nexport function ttsAngleTags(provider: string | undefined): readonly string[] | undefined {\n const caps = getTtsCapabilities(provider)\n return caps.audioTags && caps.tagSyntax === \"angle\" ? (caps.tags ?? []) : undefined\n}\n\n/**\n * The style direction of a request, as the model takes it: each field kept\n * only when the model's sheet names it and the value is one it accepts (a\n * listed choice, or free text within its cap — trimmed, an empty one\n * dropped). What the provider funnel sends and the workflow engine passes on;\n * the REST route rejects instead of dropping (`ttsDirectionProblem`).\n */\nexport interface TtsDirectionValues {\n styleDirection?: string\n pace?: string\n accent?: string\n audioProfile?: string\n}\n\nexport function ttsDirectionFor(provider: string | undefined, values: Readonly<Record<string, unknown>>): TtsDirectionValues {\n const sheet = ttsDirection(provider)\n if (!sheet) return {}\n const text = (value: unknown, max: number | undefined): string | undefined => {\n if (max === undefined || typeof value !== \"string\") return undefined\n const trimmed = value.trim()\n return trimmed && trimmed.length <= max ? trimmed : undefined\n }\n const choice = (value: unknown, choices: readonly string[] | undefined): string | undefined =>\n choices && typeof value === \"string\" && choices.includes(value) ? value : undefined\n const out: TtsDirectionValues = {}\n const style = sheet.styles ? choice(values.styleDirection, sheet.styles) : text(values.styleDirection, sheet.styleMaxChars)\n if (style !== undefined) out.styleDirection = style\n const pace = choice(values.pace, sheet.paces)\n if (pace !== undefined) out.pace = pace\n const accent = choice(values.accent, sheet.accents)\n if (accent !== undefined) out.accent = accent\n const profile = text(values.audioProfile, sheet.audioProfileMaxChars)\n if (profile !== undefined) out.audioProfile = profile\n return out\n}\n\n/**\n * Why a request's style direction cannot run on the model, or `undefined`\n * when it can. Only the fields the model takes are judged; on a model that\n * takes none, or a field it does not take, the value is never sent (as the\n * neighbour text on a model that does not stitch), so it is no problem.\n */\nexport function ttsDirectionProblem(provider: string | undefined, values: Readonly<Record<string, unknown>>): { field: keyof TtsDirectionValues; message: string } | undefined {\n const sheet = ttsDirection(provider)\n if (!sheet) return undefined\n const textProblem = (field: keyof TtsDirectionValues, max: number | undefined) => {\n const value = values[field]\n if (max === undefined || value === undefined) return undefined\n if (typeof value !== \"string\") return { field, message: `${field} must be a string` }\n return value.trim().length > max ? { field, message: `${field} must be at most ${max} characters` } : undefined\n }\n const choiceProblem = (field: keyof TtsDirectionValues, choices: readonly string[] | undefined) => {\n const value = values[field]\n if (!choices || value === undefined || value === \"\") return undefined\n return typeof value === \"string\" && choices.includes(value) ? undefined : { field, message: `${field} must be one of: ${choices.join(\", \")}` }\n }\n return (\n (sheet.styles ? choiceProblem(\"styleDirection\", sheet.styles) : textProblem(\"styleDirection\", sheet.styleMaxChars)) ??\n choiceProblem(\"pace\", sheet.paces) ??\n choiceProblem(\"accent\", sheet.accents) ??\n textProblem(\"audioProfile\", sheet.audioProfileMaxChars)\n )\n}\n\n/** Every voice name a named-voice model speaks (all of them, across models). Built once from the catalog. */\nlet namedVoiceIds: ReadonlySet<string> | undefined\nfunction anyModelsNamedVoice(voice: string): boolean {\n namedVoiceIds ??= new Set(\n Object.values(MODEL_CATALOG).flatMap((m) => (m.modes.includes(\"tts\") ? (m.tts?.voices ?? []).map((v) => v.id) : [])),\n )\n return namedVoiceIds.has(voice)\n}\n\n/**\n * The voice a text-to-speech run on `provider` speaks, when the model and the\n * voice may have been chosen apart — a published app's Model card, a field\n * mapping onto the model, an upstream Character's voice, a preset's voice with\n * a model the caller named (decided 2026-11-13: the editor's model-switch rule,\n * applied wherever the editor is not there to apply it):\n * - a model with named voices (Gemini): the voice when it is one of them, its\n * default voice for any other voice, and none (its default) for none;\n * - an ElevenLabs model: none (the deployment's default) for a voice that only\n * a named-voice model speaks (`Fola`, `Kore`…), else the voice as given.\n * Returns `undefined` for \"no voice named\"; never a voice the model refuses.\n */\nexport function ttsVoiceForModel(provider: string | undefined, voice: unknown): string | undefined {\n const named = typeof voice === \"string\" && voice.length > 0 ? voice : undefined\n const caps = getTtsCapabilities(provider)\n if (caps.voices) {\n if (named === undefined) return undefined\n return caps.voices.some((v) => v.id === named) ? named : caps.defaultVoice\n }\n return named !== undefined && anyModelsNamedVoice(named) ? undefined : named\n}\n\n/** The model clones a speaker's voice for one request (`TtsCapabilities.replica`: Gemini 3.8 Flash). */\nexport function ttsTakesReplica(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).replica === true\n}\n\n/** Every model that takes a one-off clone, in catalog order (for a refusal's sentence). */\nexport function replicaModels(): string[] {\n return Object.values(MODEL_CATALOG).filter((m) => m.modes.includes(\"tts\") && m.tts?.replica === true).map((m) => m.id)\n}\n\n/** Whether `value` is an https link (the only scheme a recording is fetched from). */\nfunction isHttpsLink(value: unknown): value is string {\n if (typeof value !== \"string\") return false\n try {\n return new URL(value).protocol === \"https:\"\n } catch {\n return false\n }\n}\n\n/** A request's one-off clone as the platform reads it: two https links, or undefined when absent or not that shape. */\nexport function replicaOf(value: unknown): TtsReplica | undefined {\n if (!value || typeof value !== \"object\") return undefined\n const { sourceAudioUrl, consentAudioUrl } = value as Record<string, unknown>\n return isHttpsLink(sourceAudioUrl) && isHttpsLink(consentAudioUrl) ? { sourceAudioUrl, consentAudioUrl } : undefined\n}\n\n/**\n * Why a request's one-off clone (`replica`) cannot run on the model, or\n * undefined (none asked, or one it takes). Refused, never dropped: a clone\n * that is not sent is someone else's voice. The recordings themselves (WAV,\n * size, length) are judged where they are fetched (backend\n * `lib/voice-replica.ts`).\n */\nexport function ttsReplicaProblem(provider: string | undefined, value: unknown): string | undefined {\n if (value === undefined || value === null) return undefined\n if (!ttsTakesReplica(provider)) {\n return `${provider ?? \"This model\"} does not clone a voice; a one-off clone runs on ${replicaModels().join(\", \")}`\n }\n return replicaOf(value) ? undefined : \"replica needs sourceAudioUrl and consentAudioUrl, each an https link to a WAV recording\"\n}\n\n/**\n * Why an API or MCP clone lacks its consent, or undefined: a `replica` asked\n * must say `consent: true` — the caller's confirmation of\n * `REPLICA_CONSENT_ATTESTATION`, what the editor's checkbox says (decided\n * 2026-11-13). Refused before anything is read or held.\n */\nexport function replicaConsentProblem(value: unknown): string | undefined {\n if (value === undefined || value === null) return undefined\n return (value as { consent?: unknown }).consent === true\n ? undefined\n : `replica.consent must be true: it confirms \"${REPLICA_CONSENT_ATTESTATION}\"`\n}\n\n"]}
1
+ {"version":3,"sources":["../src/tts-capabilities.ts"],"names":["MODEL_CATALOG","REPLICA_CONSENT_ATTESTATION"],"mappings":";;;;;AAmBO,IAAM,oBAAA,GAAyD;AAAA,EACpE,UAAA,EAAY;AACd;AAGO,IAAM,qBAAA,GAAwB;AAQ9B,SAAS,qBAAqB,QAAA,EAA0B;AAC7D,EAAA,OAAO,OAAO,QAAA,KAAa,QAAA,IAAY,MAAA,CAAO,MAAA,CAAO,sBAAsB,QAAQ,CAAA,GAAI,oBAAA,CAAqB,QAAQ,CAAA,GAAK,QAAA;AAC3H;AAGO,SAAS,oBAAoB,QAAA,EAA2D;AAG7F,EAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,CAAC,UAAU,OAAO,MAAA;AACtD,EAAA,MAAM,EAAA,GAAK,qBAAqB,QAAQ,CAAA;AACxC,EAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAOA,+BAAA,EAAe,EAAE,GAAG,OAAO,MAAA;AAC9C,EAAA,MAAM,KAAA,GAAQA,gCAAc,EAAE,CAAA;AAC9B,EAAA,OAAO,MAAM,KAAA,CAAM,QAAA,CAAS,KAAK,CAAA,GAAI,MAAM,GAAA,GAAM,MAAA;AACnD;AAQO,SAAS,mBAAmB,QAAA,EAA+C;AAChF,EAAA,OAAO,mBAAA,CAAoB,QAAQ,CAAA,IAAKA,+BAAA,CAAc,qBAAqB,CAAA,CAAG,GAAA;AAChF;AAGO,SAAS,qBAAqB,QA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7G;AASO,SAAS,iBAAA,CAAkB,UAA8B,KAAA,EAAoC;AAClG,EAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM,OAAO,MAAA;AAClD,EAAA,IAAI,CAAC,eAAA,CAAgB,QAAQ,CAAA,EAAG;AAC9B,IAAA,OAAO,CAAA,EAAG,YAAY,YAAY,CAAA,iDAAA,EAAoD,eAAc,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,EAClH;AACA,EAAA,OAAO,SAAA,CAAU,KAAK,CAAA,GAAI,MAAA,GAAY,yFAAA;AACxC;AAQO,SAAS,sBAAsB,KAAA,EAAoC;AACxE,EAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,KAAU,IAAA,EAAM,OAAO,MAAA;AAClD,EAAA,OAAQ,KAAA,CAAgC,OAAA,KAAY,IAAA,GAChD,MAAA,GACA,8CAA8CC,6CAA2B,CAAA,CAAA,CAAA;AAC/E","file":"chunk-UJREE6EQ.cjs","sourcesContent":["/**\n * Capability lookups for the text-to-speech lane.\n *\n * Every \"does this model do X\" decision on that lane reads the model's `tts`\n * sheet in `MODEL_CATALOG` through these helpers — tag stripping, which voice\n * settings are sent and shown, the language picker, whether neighbouring text\n * is sent. Declare the sheet honestly\n * on the catalog entry and a new model is covered everywhere; do not compare a\n * provider id by hand.\n *\n * \"The text-to-speech lane\" means the models that list the `tts` mode. The\n * dialogue models carry a sheet too, read by `dialogue-capabilities.ts`; a\n * text-to-speech request that names one runs as the fallback model, so these\n * helpers answer for the fallback there.\n */\nimport { MODEL_CATALOG, type TtsCapabilities, type TtsDirectionSheet, type TtsSettingLever } from \"./model-catalog.js\"\nimport { REPLICA_CONSENT_ATTESTATION, type TtsNamedVoice, type TtsReplica } from \"./gemini-tts.js\"\n\n/** Legacy provider ids that are another model under an old name. They have no catalog entry of their own. */\nexport const TTS_PROVIDER_ALIASES: Readonly<Record<string, string>> = {\n elevenlabs: \"elevenlabs-turbo\",\n}\n\n/** The model a request runs on when its provider id is missing or unknown. */\nexport const TTS_FALLBACK_PROVIDER = \"elevenlabs-turbo\"\n\n/**\n * Resolve a legacy alias to the catalog id it runs as. Any other id passes\n * through unchanged. Own properties only: an id that happens to be the name of\n * an inherited object member (`constructor`, `__proto__`, `toString`) is an\n * unknown id like any other, never a function.\n */\nexport function canonicalTtsProvider(provider: string): string {\n return typeof provider === \"string\" && Object.hasOwn(TTS_PROVIDER_ALIASES, provider) ? TTS_PROVIDER_ALIASES[provider]! : provider\n}\n\n/** The capability sheet of a text-to-speech model, or `undefined` when the id is not one. */\nexport function findTtsCapabilities(provider: string | undefined): TtsCapabilities | undefined {\n // `typeof`: node data can be written straight into workflow JSON, so the \"string\" is not guaranteed — and\n // `Object.hasOwn` would coerce an array like [\"elevenlabs-v3\"] into that model's id. A non-string is an unknown id.\n if (typeof provider !== \"string\" || !provider) return undefined\n const id = canonicalTtsProvider(provider)\n if (!Object.hasOwn(MODEL_CATALOG, id)) return undefined\n const entry = MODEL_CATALOG[id]!\n return entry.modes.includes(\"tts\") ? entry.tts : undefined\n}\n\n/**\n * The capability sheet a text-to-speech request will actually run under: a\n * missing or unknown provider id runs as {@link TTS_FALLBACK_PROVIDER}, so it\n * gets that sheet — including its `maxChars` (turbo's 40,000), where\n * `getMaxTtsChars` keeps answering its 5,000 default for such ids.\n */\nexport function getTtsCapabilities(provider: string | undefined): TtsCapabilities {\n return findTtsCapabilities(provider) ?? MODEL_CATALOG[TTS_FALLBACK_PROVIDER]!.tts!\n}\n\n/** The model performs inline `[audio tags]`. false ⇒ strip them before sending. */\nexport function ttsSupportsAudioTags(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).audioTags\n}\n\n/** The model honours SSML `<break time=\"…\"/>` tags. */\nexport function ttsSupportsSsmlBreaks(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).ssmlBreaks\n}\n\n/**\n * The model conditions on neighbouring text (`previous_text` / `next_text`).\n * false ⇒ the provider funnel never puts the fields on the wire, whatever the\n * request carries — the model would reject them.\n */\nexport function ttsSupportsStitching(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).stitching\n}\n\n/** The model honours this voice-setting lever. */\nexport function ttsHasLever(provider: string | undefined, lever: TtsSettingLever): boolean {\n return getTtsCapabilities(provider).levers.includes(lever)\n}\n\n/** The model answers `/v1/text-to-speech/{voice}/with-timestamps` (character timings). */\nexport function ttsSupportsTimestamps(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).timestamps\n}\n\n/** Language codes offered for the model, in catalog order. */\nexport function ttsLanguageCodes(provider: string | undefined): readonly string[] {\n return getTtsCapabilities(provider).languages\n}\n\n/**\n * The named voices the model speaks, or `undefined` when it speaks the\n * ElevenLabs voices (premade, library, clones). See `TtsCapabilities.voices`.\n */\nexport function ttsNamedVoices(provider: string | undefined): readonly TtsNamedVoice[] | undefined {\n return getTtsCapabilities(provider).voices\n}\n\n/**\n * Whether `voice` is one the model can speak: on a model with named voices,\n * one of them by its exact wire name; on any other model, any id (the\n * ElevenLabs voice checks apply there, as before).\n */\nexport function ttsAcceptsVoice(provider: string | undefined, voice: string): boolean {\n const named = ttsNamedVoices(provider)\n return !named || named.some((v) => v.id === voice)\n}\n\n/**\n * The voice a request on a named-voice model runs with: the one it names when\n * the model speaks it, else the model's default. `undefined` on an ElevenLabs\n * model (its own default applies downstream).\n */\nexport function ttsNamedVoiceFor(provider: string | undefined, voice: unknown): string | undefined {\n const caps = getTtsCapabilities(provider)\n if (!caps.voices) return undefined\n return typeof voice === \"string\" && caps.voices.some((v) => v.id === voice) ? voice : caps.defaultVoice\n}\n\n/** The style direction the model takes (`TtsCapabilities.direction`), or `undefined` when it takes none. */\nexport function ttsDirection(provider: string | undefined): TtsDirectionSheet | undefined {\n return getTtsCapabilities(provider).direction\n}\n\n/** The model writes its tone tags `<in angle brackets>` from a closed list (`TtsCapabilities.tagSyntax`). */\nexport function ttsAngleTags(provider: string | undefined): readonly string[] | undefined {\n const caps = getTtsCapabilities(provider)\n return caps.audioTags && caps.tagSyntax === \"angle\" ? (caps.tags ?? []) : undefined\n}\n\n/**\n * The style direction of a request, as the model takes it: each field kept\n * only when the model's sheet names it and the value is one it accepts (a\n * listed choice, or free text within its cap — trimmed, an empty one\n * dropped). What the provider funnel sends and the workflow engine passes on;\n * the REST route rejects instead of dropping (`ttsDirectionProblem`).\n */\nexport interface TtsDirectionValues {\n styleDirection?: string\n pace?: string\n accent?: string\n audioProfile?: string\n}\n\nexport function ttsDirectionFor(provider: string | undefined, values: Readonly<Record<string, unknown>>): TtsDirectionValues {\n const sheet = ttsDirection(provider)\n if (!sheet) return {}\n const text = (value: unknown, max: number | undefined): string | undefined => {\n if (max === undefined || typeof value !== \"string\") return undefined\n const trimmed = value.trim()\n return trimmed && trimmed.length <= max ? trimmed : undefined\n }\n const choice = (value: unknown, choices: readonly string[] | undefined): string | undefined =>\n choices && typeof value === \"string\" && choices.includes(value) ? value : undefined\n const out: TtsDirectionValues = {}\n const style = sheet.styles ? choice(values.styleDirection, sheet.styles) : text(values.styleDirection, sheet.styleMaxChars)\n if (style !== undefined) out.styleDirection = style\n const pace = choice(values.pace, sheet.paces)\n if (pace !== undefined) out.pace = pace\n const accent = choice(values.accent, sheet.accents)\n if (accent !== undefined) out.accent = accent\n const profile = text(values.audioProfile, sheet.audioProfileMaxChars)\n if (profile !== undefined) out.audioProfile = profile\n return out\n}\n\n/**\n * Why a request's style direction cannot run on the model, or `undefined`\n * when it can. Only the fields the model takes are judged; on a model that\n * takes none, or a field it does not take, the value is never sent (as the\n * neighbour text on a model that does not stitch), so it is no problem.\n */\nexport function ttsDirectionProblem(provider: string | undefined, values: Readonly<Record<string, unknown>>): { field: keyof TtsDirectionValues; message: string } | undefined {\n const sheet = ttsDirection(provider)\n if (!sheet) return undefined\n const textProblem = (field: keyof TtsDirectionValues, max: number | undefined) => {\n const value = values[field]\n if (max === undefined || value === undefined) return undefined\n if (typeof value !== \"string\") return { field, message: `${field} must be a string` }\n return value.trim().length > max ? { field, message: `${field} must be at most ${max} characters` } : undefined\n }\n const choiceProblem = (field: keyof TtsDirectionValues, choices: readonly string[] | undefined) => {\n const value = values[field]\n if (!choices || value === undefined || value === \"\") return undefined\n return typeof value === \"string\" && choices.includes(value) ? undefined : { field, message: `${field} must be one of: ${choices.join(\", \")}` }\n }\n return (\n (sheet.styles ? choiceProblem(\"styleDirection\", sheet.styles) : textProblem(\"styleDirection\", sheet.styleMaxChars)) ??\n choiceProblem(\"pace\", sheet.paces) ??\n choiceProblem(\"accent\", sheet.accents) ??\n textProblem(\"audioProfile\", sheet.audioProfileMaxChars)\n )\n}\n\n/** Every voice name a named-voice model speaks (all of them, across models). Built once from the catalog. */\nlet namedVoiceIds: ReadonlySet<string> | undefined\nfunction anyModelsNamedVoice(voice: string): boolean {\n namedVoiceIds ??= new Set(\n Object.values(MODEL_CATALOG).flatMap((m) => (m.modes.includes(\"tts\") ? (m.tts?.voices ?? []).map((v) => v.id) : [])),\n )\n return namedVoiceIds.has(voice)\n}\n\n/**\n * The voice a text-to-speech run on `provider` speaks, when the model and the\n * voice may have been chosen apart — a published app's Model card, a field\n * mapping onto the model, an upstream Character's voice, a preset's voice with\n * a model the caller named (decided 2026-11-13: the editor's model-switch rule,\n * applied wherever the editor is not there to apply it):\n * - a model with named voices (Gemini): the voice when it is one of them, its\n * default voice for any other voice, and none (its default) for none;\n * - an ElevenLabs model: none (the deployment's default) for a voice that only\n * a named-voice model speaks (`Fola`, `Kore`…), else the voice as given.\n * Returns `undefined` for \"no voice named\"; never a voice the model refuses.\n */\nexport function ttsVoiceForModel(provider: string | undefined, voice: unknown): string | undefined {\n const named = typeof voice === \"string\" && voice.length > 0 ? voice : undefined\n const caps = getTtsCapabilities(provider)\n if (caps.voices) {\n if (named === undefined) return undefined\n return caps.voices.some((v) => v.id === named) ? named : caps.defaultVoice\n }\n return named !== undefined && anyModelsNamedVoice(named) ? undefined : named\n}\n\n/** The model clones a speaker's voice for one request (`TtsCapabilities.replica`: Gemini 3.8 Flash). */\nexport function ttsTakesReplica(provider: string | undefined): boolean {\n return getTtsCapabilities(provider).replica === true\n}\n\n/** Every model that takes a one-off clone, in catalog order (for a refusal's sentence). */\nexport function replicaModels(): string[] {\n return Object.values(MODEL_CATALOG).filter((m) => m.modes.includes(\"tts\") && m.tts?.replica === true).map((m) => m.id)\n}\n\n/** Whether `value` is an https link (the only scheme a recording is fetched from). */\nfunction isHttpsLink(value: unknown): value is string {\n if (typeof value !== \"string\") return false\n try {\n return new URL(value).protocol === \"https:\"\n } catch {\n return false\n }\n}\n\n/** A request's one-off clone as the platform reads it: two https links, or undefined when absent or not that shape. */\nexport function replicaOf(value: unknown): TtsReplica | undefined {\n if (!value || typeof value !== \"object\") return undefined\n const { sourceAudioUrl, consentAudioUrl } = value as Record<string, unknown>\n return isHttpsLink(sourceAudioUrl) && isHttpsLink(consentAudioUrl) ? { sourceAudioUrl, consentAudioUrl } : undefined\n}\n\n/**\n * Why a request's one-off clone (`replica`) cannot run on the model, or\n * undefined (none asked, or one it takes). Refused, never dropped: a clone\n * that is not sent is someone else's voice. The recordings themselves (WAV,\n * size, length) are judged where they are fetched (backend\n * `lib/voice-replica.ts`).\n */\nexport function ttsReplicaProblem(provider: string | undefined, value: unknown): string | undefined {\n if (value === undefined || value === null) return undefined\n if (!ttsTakesReplica(provider)) {\n return `${provider ?? \"This model\"} does not clone a voice; a one-off clone runs on ${replicaModels().join(\", \")}`\n }\n return replicaOf(value) ? undefined : \"replica needs sourceAudioUrl and consentAudioUrl, each an https link to a WAV recording\"\n}\n\n/**\n * Why an API or MCP clone lacks its consent, or undefined: a `replica` asked\n * must say `consent: true` — the caller's confirmation of\n * `REPLICA_CONSENT_ATTESTATION`, what the editor's checkbox says (decided\n * 2026-11-13). Refused before anything is read or held.\n */\nexport function replicaConsentProblem(value: unknown): string | undefined {\n if (value === undefined || value === null) return undefined\n return (value as { consent?: unknown }).consent === true\n ? undefined\n : `replica.consent must be true: it confirms \"${REPLICA_CONSENT_ATTESTATION}\"`\n}\n\n"]}
@@ -1,4 +1,4 @@
1
- import { pricedClipSeconds } from './chunk-SMOO5FAH.js';
1
+ import { pricedClipSeconds } from './chunk-NWNRATS3.js';
2
2
 
3
3
  // src/freecut-protocol.ts
4
4
  var NODARO_LOAD_VIDEO = "NODARO_LOAD_VIDEO";
@@ -733,5 +733,5 @@ var DUBBING_ERROR_CODES = [
733
733
  ];
734
734
 
735
735
  export { AI_PANEL_EDITOR_ANSWERS, AI_PANEL_EDITOR_CAPABILITIES, AI_PANEL_EDITOR_REQUESTS, AI_PANEL_PATH, AI_PANEL_PROTOCOL_VERSION, AUDIO_FX_PRESETS, AUDIO_FX_PRESET_LABELS, AUDIO_FX_PRESET_SET, AUDIO_FX_REVERB_PRESETS, DEFAULT_VIDEO_MASK_PROVIDER, DUBBING_CAPTION_FORMATS, DUBBING_ERROR_CODES, DUBBING_LANGUAGE_STATUSES, DUBBING_SOURCE_LANGUAGE, FREECUT_EXPORT_COMPLETE, FREECUT_EXPORT_PROGRESS, FREECUT_OPS_RESULT, FREECUT_READY, FREECUT_REQUEST_IMPORT, FREECUT_TIMELINE, FREECUT_UNDO_RESULT, GENERATE_MASK_LIMITS, LEGACY_LOTTIE_HOST_REMAP, LOTTIE_OVERLAY_CATALOG, LOTTIE_SLOT_FIELD_PREFIX, MASK_COMPOSITE_AUDIO_SOURCES, MASK_COMPOSITE_BACKGROUND_FITS, MASK_COMPOSITE_BOUNDS, MASK_COMPOSITE_DEFAULTS, MASK_COMPOSITE_FILLS, MASK_COMPOSITE_REMEASURE_SLACK_SEC, MASK_COMPOSITE_UNIT_SEC, NODARO_AI_PANEL_CLOSE, NODARO_AI_PANEL_INIT, NODARO_AI_PANEL_LAYOUT, NODARO_AI_PANEL_READY, NODARO_APPLY_OPS, NODARO_GET_TIMELINE, NODARO_IMPORT_FILES, NODARO_LOAD_TIMELINE, NODARO_LOAD_VIDEO, NODARO_PLAYBACK, NODARO_PRESENCE, NODARO_RESET_PROJECT, NODARO_UNDO_EDIT, VIDEO_FACE_MESH_LAYERS, VIDEO_FACE_MESH_LIMITS, VIDEO_FACE_MESH_LINE_LAYERS, VIDEO_FACE_MESH_PARTS, VIDEO_FACE_MESH_PATH, VIDEO_FACE_MESH_RECIPE, VIDEO_MASK_DEFAULTS, VIDEO_MASK_LIMITS, VIDEO_MASK_PROVIDERS, VIDEO_MASK_RECIPE, aiPanelOffered, applySlots, createAiPanelRelay, deriveLottieSlotFields, describeMaskRegion, describeSlotControl, hexToRgbaArray, humanizeSlotSid, listSlotSids, maskCompositeEffectiveAudioSource, maskCompositeFillOf, maskCompositeLeadHandle, maskCompositeUnits, maskCompositeUsesForeground, normalizeLottieLayers, resolveLottieOverlaySrc, resolveMaskCompositeSettings, resolveVideoMaskProvider, resolveVideoMaskRedetectSec, resolveVideoMaskZone, rgbaArrayToHex, routeAiPanelMessage, videoFaceMeshCreditId, videoFaceMeshCreditIds, videoFaceMeshLayersDrawLines, videoFaceMeshLayersOfParts, videoFaceMeshLayersOn, videoFaceMeshPartsOfLayers, videoMaskBilledSeconds, videoMaskCreditId, videoMaskCreditIds };
736
- //# sourceMappingURL=chunk-CFTXW3ZL.js.map
737
- //# sourceMappingURL=chunk-CFTXW3ZL.js.map
736
+ //# sourceMappingURL=chunk-UVUHVY7F.js.map
737
+ //# sourceMappingURL=chunk-UVUHVY7F.js.map