@nodaro/shared 3.31.0 → 3.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/README.md +17 -0
  2. package/dist/chunk-23FJQTEA.js +1604 -0
  3. package/dist/chunk-23FJQTEA.js.map +1 -0
  4. package/dist/chunk-2NIQO2J3.cjs +54 -0
  5. package/dist/chunk-2NIQO2J3.cjs.map +1 -0
  6. package/dist/chunk-2NQLSLSN.cjs +19 -0
  7. package/dist/chunk-2NQLSLSN.cjs.map +1 -0
  8. package/dist/chunk-2OJIVO7R.cjs +32 -0
  9. package/dist/chunk-2OJIVO7R.cjs.map +1 -0
  10. package/dist/chunk-2RF4Z7KG.cjs +803 -0
  11. package/dist/chunk-2RF4Z7KG.cjs.map +1 -0
  12. package/dist/chunk-3RYKIUAE.js +86 -0
  13. package/dist/chunk-3RYKIUAE.js.map +1 -0
  14. package/dist/chunk-44I73CQS.cjs +194 -0
  15. package/dist/chunk-44I73CQS.cjs.map +1 -0
  16. package/dist/chunk-5PC6JBGJ.cjs +1419 -0
  17. package/dist/chunk-5PC6JBGJ.cjs.map +1 -0
  18. package/dist/chunk-5RU2HCW2.js +30 -0
  19. package/dist/chunk-5RU2HCW2.js.map +1 -0
  20. package/dist/chunk-5RYLK3MQ.js +267 -0
  21. package/dist/chunk-5RYLK3MQ.js.map +1 -0
  22. package/dist/chunk-5THUHJ3E.js +46 -0
  23. package/dist/chunk-5THUHJ3E.js.map +1 -0
  24. package/dist/chunk-6DAWSVX2.cjs +103 -0
  25. package/dist/chunk-6DAWSVX2.cjs.map +1 -0
  26. package/dist/chunk-6WZ2VN7V.js +920 -0
  27. package/dist/chunk-6WZ2VN7V.js.map +1 -0
  28. package/dist/chunk-7G7G42KS.js +86 -0
  29. package/dist/chunk-7G7G42KS.js.map +1 -0
  30. package/dist/chunk-7Z5LUTGU.js +1567 -0
  31. package/dist/chunk-7Z5LUTGU.js.map +1 -0
  32. package/dist/chunk-AINCI23X.js +2171 -0
  33. package/dist/chunk-AINCI23X.js.map +1 -0
  34. package/dist/chunk-BG5D5CZ6.js +1922 -0
  35. package/dist/chunk-BG5D5CZ6.js.map +1 -0
  36. package/dist/chunk-CK3GK34R.js +1381 -0
  37. package/dist/chunk-CK3GK34R.js.map +1 -0
  38. package/dist/chunk-CUH22J4D.js +17 -0
  39. package/dist/chunk-CUH22J4D.js.map +1 -0
  40. package/dist/chunk-D26ENTN2.cjs +1770 -0
  41. package/dist/chunk-D26ENTN2.cjs.map +1 -0
  42. package/dist/chunk-D6GNRSCV.cjs +2017 -0
  43. package/dist/chunk-D6GNRSCV.cjs.map +1 -0
  44. package/dist/chunk-FBV5DF6D.js +95 -0
  45. package/dist/chunk-FBV5DF6D.js.map +1 -0
  46. package/dist/chunk-FG4E7MTG.cjs +4 -0
  47. package/dist/chunk-FG4E7MTG.cjs.map +1 -0
  48. package/dist/chunk-FT5CF6IA.js +42 -0
  49. package/dist/chunk-FT5CF6IA.js.map +1 -0
  50. package/dist/chunk-G6IIVKMO.js +26 -0
  51. package/dist/chunk-G6IIVKMO.js.map +1 -0
  52. package/dist/chunk-HC7VKIV5.cjs +430 -0
  53. package/dist/chunk-HC7VKIV5.cjs.map +1 -0
  54. package/dist/chunk-HGC5JNVA.cjs +1503 -0
  55. package/dist/chunk-HGC5JNVA.cjs.map +1 -0
  56. package/dist/chunk-HKFMXNVQ.cjs +1273 -0
  57. package/dist/chunk-HKFMXNVQ.cjs.map +1 -0
  58. package/dist/chunk-HRXEZ3SX.cjs +526 -0
  59. package/dist/chunk-HRXEZ3SX.cjs.map +1 -0
  60. package/dist/chunk-HSHCCBIV.js +255 -0
  61. package/dist/chunk-HSHCCBIV.js.map +1 -0
  62. package/dist/chunk-HUR6ZJ7S.cjs +159 -0
  63. package/dist/chunk-HUR6ZJ7S.cjs.map +1 -0
  64. package/dist/chunk-J7BMO73N.cjs +114 -0
  65. package/dist/chunk-J7BMO73N.cjs.map +1 -0
  66. package/dist/chunk-JFS3NWZ5.cjs +1714 -0
  67. package/dist/chunk-JFS3NWZ5.cjs.map +1 -0
  68. package/dist/chunk-JL4C5VJ7.cjs +488 -0
  69. package/dist/chunk-JL4C5VJ7.cjs.map +1 -0
  70. package/dist/chunk-JSGIEF6Z.cjs +1087 -0
  71. package/dist/chunk-JSGIEF6Z.cjs.map +1 -0
  72. package/dist/chunk-JWA5SGCS.js +203 -0
  73. package/dist/chunk-JWA5SGCS.js.map +1 -0
  74. package/dist/chunk-K3LLGRK7.cjs +3545 -0
  75. package/dist/chunk-K3LLGRK7.cjs.map +1 -0
  76. package/dist/chunk-KU6S7IYV.cjs +210 -0
  77. package/dist/chunk-KU6S7IYV.cjs.map +1 -0
  78. package/dist/chunk-M36G6SRP.js +447 -0
  79. package/dist/chunk-M36G6SRP.js.map +1 -0
  80. package/dist/chunk-M7GQBRZU.cjs +1963 -0
  81. package/dist/chunk-M7GQBRZU.cjs.map +1 -0
  82. package/dist/chunk-MRXGWL42.cjs +4 -0
  83. package/dist/chunk-MRXGWL42.cjs.map +1 -0
  84. package/dist/chunk-NEJ2PV4C.cjs +211 -0
  85. package/dist/chunk-NEJ2PV4C.cjs.map +1 -0
  86. package/dist/chunk-OTATNBMD.js +141 -0
  87. package/dist/chunk-OTATNBMD.js.map +1 -0
  88. package/dist/chunk-OZSACQ2V.js +471 -0
  89. package/dist/chunk-OZSACQ2V.js.map +1 -0
  90. package/dist/chunk-PHZ23DP3.js +1782 -0
  91. package/dist/chunk-PHZ23DP3.js.map +1 -0
  92. package/dist/chunk-PQHS255G.js +1369 -0
  93. package/dist/chunk-PQHS255G.js.map +1 -0
  94. package/dist/chunk-PRYE7AZQ.cjs +1227 -0
  95. package/dist/chunk-PRYE7AZQ.cjs.map +1 -0
  96. package/dist/chunk-PVJBAPYJ.js +404 -0
  97. package/dist/chunk-PVJBAPYJ.js.map +1 -0
  98. package/dist/chunk-PXFQVLBX.js +776 -0
  99. package/dist/chunk-PXFQVLBX.js.map +1 -0
  100. package/dist/chunk-QA3MVQ32.js +21 -0
  101. package/dist/chunk-QA3MVQ32.js.map +1 -0
  102. package/dist/chunk-QJRP44ZO.js +769 -0
  103. package/dist/chunk-QJRP44ZO.js.map +1 -0
  104. package/dist/chunk-SAW5OK36.cjs +54 -0
  105. package/dist/chunk-SAW5OK36.cjs.map +1 -0
  106. package/dist/chunk-SES6GDBQ.cjs +624 -0
  107. package/dist/chunk-SES6GDBQ.cjs.map +1 -0
  108. package/dist/chunk-SFW3UB2P.js +31 -0
  109. package/dist/chunk-SFW3UB2P.js.map +1 -0
  110. package/dist/chunk-TNPDV7I4.cjs +2346 -0
  111. package/dist/chunk-TNPDV7I4.cjs.map +1 -0
  112. package/dist/chunk-TU33KYKW.cjs +25 -0
  113. package/dist/chunk-TU33KYKW.cjs.map +1 -0
  114. package/dist/chunk-TZBIY5C3.js +187 -0
  115. package/dist/chunk-TZBIY5C3.js.map +1 -0
  116. package/dist/chunk-TZE673G6.js +3 -0
  117. package/dist/chunk-TZE673G6.js.map +1 -0
  118. package/dist/chunk-UCFWI6D4.js +29 -0
  119. package/dist/chunk-UCFWI6D4.js.map +1 -0
  120. package/dist/chunk-UTQSSKSG.js +1164 -0
  121. package/dist/chunk-UTQSSKSG.js.map +1 -0
  122. package/dist/chunk-VA42637J.cjs +287 -0
  123. package/dist/chunk-VA42637J.cjs.map +1 -0
  124. package/dist/chunk-VNQRI2RO.cjs +1047 -0
  125. package/dist/chunk-VNQRI2RO.cjs.map +1 -0
  126. package/dist/chunk-VXPLKQWY.cjs +821 -0
  127. package/dist/chunk-VXPLKQWY.cjs.map +1 -0
  128. package/dist/chunk-WD6HJRBG.cjs +197 -0
  129. package/dist/chunk-WD6HJRBG.cjs.map +1 -0
  130. package/dist/chunk-WDIBOWAA.js +1054 -0
  131. package/dist/chunk-WDIBOWAA.js.map +1 -0
  132. package/dist/chunk-WKOIGLQX.cjs +38 -0
  133. package/dist/chunk-WKOIGLQX.cjs.map +1 -0
  134. package/dist/chunk-WNVQ3SMB.cjs +96 -0
  135. package/dist/chunk-WNVQ3SMB.cjs.map +1 -0
  136. package/dist/chunk-WRSWH7US.cjs +285 -0
  137. package/dist/chunk-WRSWH7US.cjs.map +1 -0
  138. package/dist/chunk-XGFTL5XY.js +181 -0
  139. package/dist/chunk-XGFTL5XY.js.map +1 -0
  140. package/dist/chunk-XNISPHTZ.js +1039 -0
  141. package/dist/chunk-XNISPHTZ.js.map +1 -0
  142. package/dist/chunk-Y2PM3FFL.js +3 -0
  143. package/dist/chunk-Y2PM3FFL.js.map +1 -0
  144. package/dist/chunk-YBPBK5KI.js +1030 -0
  145. package/dist/chunk-YBPBK5KI.js.map +1 -0
  146. package/dist/chunk-YWNYGYI7.cjs +31 -0
  147. package/dist/chunk-YWNYGYI7.cjs.map +1 -0
  148. package/dist/chunk-YYV35XOS.js +122 -0
  149. package/dist/chunk-YYV35XOS.js.map +1 -0
  150. package/dist/chunk-Z2OL5AJD.cjs +133 -0
  151. package/dist/chunk-Z2OL5AJD.cjs.map +1 -0
  152. package/dist/chunk-ZDFHA2EC.js +572 -0
  153. package/dist/chunk-ZDFHA2EC.js.map +1 -0
  154. package/dist/chunk-ZL7UM6PU.cjs +34 -0
  155. package/dist/chunk-ZL7UM6PU.cjs.map +1 -0
  156. package/dist/chunk-ZNZDQAXN.js +175 -0
  157. package/dist/chunk-ZNZDQAXN.js.map +1 -0
  158. package/dist/chunk-ZO5PBBFX.js +3497 -0
  159. package/dist/chunk-ZO5PBBFX.js.map +1 -0
  160. package/dist/chunk-ZRL2UFTH.cjs +1073 -0
  161. package/dist/chunk-ZRL2UFTH.cjs.map +1 -0
  162. package/dist/entries/apps.cjs +155 -0
  163. package/dist/entries/apps.cjs.map +1 -0
  164. package/dist/entries/apps.d.cts +292 -0
  165. package/dist/entries/apps.d.ts +292 -0
  166. package/dist/entries/apps.js +10 -0
  167. package/dist/entries/apps.js.map +1 -0
  168. package/dist/entries/captions.cjs +124 -0
  169. package/dist/entries/captions.cjs.map +1 -0
  170. package/dist/entries/captions.d.cts +354 -0
  171. package/dist/entries/captions.d.ts +354 -0
  172. package/dist/entries/captions.js +3 -0
  173. package/dist/entries/captions.js.map +1 -0
  174. package/dist/entries/catalogs.cjs +165 -0
  175. package/dist/entries/catalogs.cjs.map +1 -0
  176. package/dist/entries/catalogs.d.cts +385 -0
  177. package/dist/entries/catalogs.d.ts +385 -0
  178. package/dist/entries/catalogs.js +4 -0
  179. package/dist/entries/catalogs.js.map +1 -0
  180. package/dist/entries/credits.cjs +596 -0
  181. package/dist/entries/credits.cjs.map +1 -0
  182. package/dist/entries/credits.d.cts +1460 -0
  183. package/dist/entries/credits.d.ts +1460 -0
  184. package/dist/entries/credits.js +11 -0
  185. package/dist/entries/credits.js.map +1 -0
  186. package/dist/entries/edl.cjs +409 -0
  187. package/dist/entries/edl.cjs.map +1 -0
  188. package/dist/entries/edl.d.cts +1199 -0
  189. package/dist/entries/edl.d.ts +1199 -0
  190. package/dist/entries/edl.js +4 -0
  191. package/dist/entries/edl.js.map +1 -0
  192. package/dist/entries/entities.cjs +530 -0
  193. package/dist/entries/entities.cjs.map +1 -0
  194. package/dist/entries/entities.d.cts +1371 -0
  195. package/dist/entries/entities.d.ts +1371 -0
  196. package/dist/entries/entities.js +5 -0
  197. package/dist/entries/entities.js.map +1 -0
  198. package/dist/entries/i18n.cjs +48 -0
  199. package/dist/entries/i18n.cjs.map +1 -0
  200. package/dist/entries/i18n.d.cts +69 -0
  201. package/dist/entries/i18n.d.ts +69 -0
  202. package/dist/entries/i18n.js +3 -0
  203. package/dist/entries/i18n.js.map +1 -0
  204. package/dist/entries/llm-models.cjs +177 -0
  205. package/dist/entries/llm-models.cjs.map +1 -0
  206. package/dist/entries/llm-models.d.cts +435 -0
  207. package/dist/entries/llm-models.d.ts +435 -0
  208. package/dist/entries/llm-models.js +4 -0
  209. package/dist/entries/llm-models.js.map +1 -0
  210. package/dist/entries/media.cjs +335 -0
  211. package/dist/entries/media.cjs.map +1 -0
  212. package/dist/entries/media.d.cts +518 -0
  213. package/dist/entries/media.d.ts +518 -0
  214. package/dist/entries/media.js +6 -0
  215. package/dist/entries/media.js.map +1 -0
  216. package/dist/entries/model-catalog.cjs +259 -0
  217. package/dist/entries/model-catalog.cjs.map +1 -0
  218. package/dist/entries/model-catalog.d.cts +202 -0
  219. package/dist/entries/model-catalog.d.ts +202 -0
  220. package/dist/entries/model-catalog.js +6 -0
  221. package/dist/entries/model-catalog.js.map +1 -0
  222. package/dist/entries/models.cjs +833 -0
  223. package/dist/entries/models.cjs.map +1 -0
  224. package/dist/entries/models.d.cts +287 -0
  225. package/dist/entries/models.d.ts +287 -0
  226. package/dist/entries/models.js +8 -0
  227. package/dist/entries/models.js.map +1 -0
  228. package/dist/entries/nodes.cjs +789 -0
  229. package/dist/entries/nodes.cjs.map +1 -0
  230. package/dist/entries/nodes.d.cts +1600 -0
  231. package/dist/entries/nodes.d.ts +1600 -0
  232. package/dist/entries/nodes.js +16 -0
  233. package/dist/entries/nodes.js.map +1 -0
  234. package/dist/entries/organizations.cjs +80 -0
  235. package/dist/entries/organizations.cjs.map +1 -0
  236. package/dist/entries/organizations.d.cts +466 -0
  237. package/dist/entries/organizations.d.ts +466 -0
  238. package/dist/entries/organizations.js +3 -0
  239. package/dist/entries/organizations.js.map +1 -0
  240. package/dist/entries/pipeline.cjs +594 -0
  241. package/dist/entries/pipeline.cjs.map +1 -0
  242. package/dist/entries/pipeline.d.cts +2617 -0
  243. package/dist/entries/pipeline.d.ts +2617 -0
  244. package/dist/entries/pipeline.js +5 -0
  245. package/dist/entries/pipeline.js.map +1 -0
  246. package/dist/entries/scene3d.cjs +704 -0
  247. package/dist/entries/scene3d.cjs.map +1 -0
  248. package/dist/entries/scene3d.d.cts +4284 -0
  249. package/dist/entries/scene3d.d.ts +4284 -0
  250. package/dist/entries/scene3d.js +3 -0
  251. package/dist/entries/scene3d.js.map +1 -0
  252. package/dist/entries/social.cjs +714 -0
  253. package/dist/entries/social.cjs.map +1 -0
  254. package/dist/entries/social.d.cts +1366 -0
  255. package/dist/entries/social.d.ts +1366 -0
  256. package/dist/entries/social.js +5 -0
  257. package/dist/entries/social.js.map +1 -0
  258. package/dist/entries/types.cjs +13 -0
  259. package/dist/entries/types.cjs.map +1 -0
  260. package/dist/entries/types.d.cts +162 -0
  261. package/dist/entries/types.d.ts +162 -0
  262. package/dist/entries/types.js +4 -0
  263. package/dist/entries/types.js.map +1 -0
  264. package/dist/entries/ugc.cjs +279 -0
  265. package/dist/entries/ugc.cjs.map +1 -0
  266. package/dist/entries/ugc.d.cts +575 -0
  267. package/dist/entries/ugc.d.ts +575 -0
  268. package/dist/entries/ugc.js +6 -0
  269. package/dist/entries/ugc.js.map +1 -0
  270. package/dist/entries/video.cjs +549 -0
  271. package/dist/entries/video.cjs.map +1 -0
  272. package/dist/entries/video.d.cts +1791 -0
  273. package/dist/entries/video.d.ts +1791 -0
  274. package/dist/entries/video.js +8 -0
  275. package/dist/entries/video.js.map +1 -0
  276. package/dist/entries/workflow.cjs +574 -0
  277. package/dist/entries/workflow.cjs.map +1 -0
  278. package/dist/entries/workflow.d.cts +1743 -0
  279. package/dist/entries/workflow.d.ts +1743 -0
  280. package/dist/entries/workflow.js +5 -0
  281. package/dist/entries/workflow.js.map +1 -0
  282. package/dist/fan-out-meta-Bu6VyXcZ.d.cts +19 -0
  283. package/dist/fan-out-meta-Bu6VyXcZ.d.ts +19 -0
  284. package/dist/gemini-omni-voices-zeRXxSbZ.d.cts +174 -0
  285. package/dist/gemini-omni-voices-zeRXxSbZ.d.ts +174 -0
  286. package/dist/image-overlay-layers-CyBfRhxJ.d.cts +208 -0
  287. package/dist/image-overlay-layers-CyBfRhxJ.d.ts +208 -0
  288. package/dist/index.cjs +7747 -27084
  289. package/dist/index.cjs.map +1 -1
  290. package/dist/index.d.cts +32 -24198
  291. package/dist/index.d.ts +32 -24198
  292. package/dist/index.js +40 -25220
  293. package/dist/index.js.map +1 -1
  294. package/dist/model-catalog-V-ZNzRSd.d.cts +651 -0
  295. package/dist/model-catalog-V-ZNzRSd.d.ts +651 -0
  296. package/dist/presentation-types-0ENOCjoj.d.cts +61 -0
  297. package/dist/presentation-types-0ENOCjoj.d.ts +61 -0
  298. package/dist/presentation-utils-D0kxsWf9.d.cts +92 -0
  299. package/dist/presentation-utils-pZwlEAzo.d.ts +92 -0
  300. package/dist/scene-node-types-C3kl_zyK.d.cts +1949 -0
  301. package/dist/scene-node-types-C3kl_zyK.d.ts +1949 -0
  302. package/dist/supported-fonts-CRoF1gOy.d.cts +16 -0
  303. package/dist/supported-fonts-CRoF1gOy.d.ts +16 -0
  304. package/dist/types-BRlFPEru.d.cts +511 -0
  305. package/dist/types-BRlFPEru.d.ts +511 -0
  306. package/dist/types-DffyGSy5.d.cts +67 -0
  307. package/dist/types-DffyGSy5.d.ts +67 -0
  308. package/package.json +102 -1
  309. package/src/__tests__/add-captions-plan.test.ts +6 -2
  310. package/src/__tests__/caption-edge-dash.test.ts +23 -0
  311. package/src/__tests__/fixtures/root-exports.baseline.json +4625 -0
  312. package/src/__tests__/input-field-extra-keys.test.ts +1 -0
  313. package/src/__tests__/model-makers.test.ts +76 -0
  314. package/src/__tests__/no-internal-imports.test.ts +1 -1
  315. package/src/__tests__/node-aspect-ratio.test.ts +25 -0
  316. package/src/__tests__/node-runtime-keys.test.ts +9 -0
  317. package/src/__tests__/package-entries.test.ts +50 -0
  318. package/src/__tests__/pitch-tempo-pricing.test.ts +21 -0
  319. package/src/__tests__/presentation-utils.test.ts +15 -0
  320. package/src/__tests__/preview-gate-use-case.test.ts +151 -0
  321. package/src/__tests__/private-host.test.ts +53 -0
  322. package/src/__tests__/run-continuation.test.ts +7 -1
  323. package/src/__tests__/site-capture-node.test.ts +58 -0
  324. package/src/__tests__/ugc-lane-wires.test.ts +228 -0
  325. package/src/__tests__/ugc-node-wires.test.ts +9 -3
  326. package/src/__tests__/ugc-run-state.test.ts +5 -4
  327. package/src/__tests__/video-analysis-catalog-sync.test.ts +1 -1
  328. package/src/__tests__/video-analysis-pricing.test.ts +6 -6
  329. package/src/__tests__/voice-changer-pro-quote.test.ts +79 -0
  330. package/src/add-captions-plan.ts +9 -3
  331. package/src/caption-edge-dash.ts +33 -0
  332. package/src/component-types.ts +9 -0
  333. package/src/credit-estimators/index.ts +22 -1
  334. package/src/credit-estimators/pitch-tempo.ts +15 -1
  335. package/src/credit-estimators/speech.ts +72 -4
  336. package/src/credit-estimators/unit-quote.ts +52 -0
  337. package/src/credit-estimators/video-sfx.ts +15 -0
  338. package/src/credit-estimators/voice-changer-pro-quote.ts +138 -0
  339. package/src/credit-identifiers.ts +62 -17
  340. package/src/entity-image-handle.ts +2 -0
  341. package/src/entries/apps.ts +63 -0
  342. package/src/entries/captions.ts +34 -0
  343. package/src/entries/catalogs.ts +65 -0
  344. package/src/entries/credits.ts +105 -0
  345. package/src/entries/edl.ts +42 -0
  346. package/src/entries/entities.ts +144 -0
  347. package/src/entries/i18n.ts +31 -0
  348. package/src/entries/llm-models.ts +63 -0
  349. package/src/entries/media.ts +36 -0
  350. package/src/entries/model-catalog.ts +95 -0
  351. package/src/entries/models.ts +266 -0
  352. package/src/entries/nodes.ts +245 -0
  353. package/src/entries/organizations.ts +9 -0
  354. package/src/entries/pipeline.ts +43 -0
  355. package/src/entries/scene3d.ts +27 -0
  356. package/src/entries/social.ts +297 -0
  357. package/src/entries/types.ts +26 -0
  358. package/src/entries/ugc.ts +14 -0
  359. package/src/entries/video.ts +59 -0
  360. package/src/entries/workflow.ts +172 -0
  361. package/src/fan-out-rows.ts +2 -0
  362. package/src/index.ts +25 -1845
  363. package/src/json-kinds.ts +4 -0
  364. package/src/model-catalog.ts +243 -34
  365. package/src/node-mappable-fields.ts +1 -0
  366. package/src/node-run-routes.ts +2 -0
  367. package/src/node-runtime-keys.ts +8 -0
  368. package/src/normalize-node-params.ts +30 -0
  369. package/src/presentation-utils.ts +12 -0
  370. package/src/preview-gate.ts +92 -14
  371. package/src/private-host.ts +89 -59
  372. package/src/producer-types.ts +16 -2
  373. package/src/run-continuation.ts +21 -0
  374. package/src/site-capture-node.ts +82 -0
  375. package/src/ugc-lane-wires.ts +246 -0
  376. package/src/ugc-node-wires.ts +37 -7
  377. package/src/ugc-run-state.ts +5 -3
  378. package/src/video-analysis-pricing.ts +31 -29
@@ -0,0 +1,228 @@
1
+ /**
2
+ * The UGC wires of a video whose clips are cut from one recorded speech: UGC Clips' prelude, the
3
+ * script's language, the Script (sized) output that carries the finish call, and UGC Finish. The
4
+ * URLs and texts are placeholders; nothing here reads what a call says.
5
+ */
6
+ import { describe, expect, it } from "vitest"
7
+ import {
8
+ FAN_IN_TARGETS,
9
+ UGC_FINISH_CLIPS_TYPE,
10
+ UGC_NODE_MESSAGES,
11
+ UGC_NODE_TYPES,
12
+ UGC_OVERRIDABLE_FIELDS,
13
+ UGC_PRELUDE_ROUTES,
14
+ UGC_PRIMARY_HANDLE,
15
+ VIDEO_PRODUCER_TYPES,
16
+ defaultEdgeOutputMode,
17
+ getInputFieldExtraKeys,
18
+ isFanInEdge,
19
+ isFanInNodeType,
20
+ ugcClipsOutputs,
21
+ ugcClipsPhase,
22
+ ugcClipsPhase2Body,
23
+ ugcFinishOutputs,
24
+ ugcFinishPlan,
25
+ ugcFinishWired,
26
+ ugcLaneNeedsFinish,
27
+ ugcPrelude,
28
+ ugcPreludeOutput,
29
+ ugcRenderHoldBody,
30
+ ugcRenderHoldVerdict,
31
+ ugcRunEstimateInput,
32
+ ugcScriptBody,
33
+ } from "../index.js"
34
+
35
+ const PHASE1 = {
36
+ errors: [],
37
+ lane: "segmented-reference",
38
+ phase: 1,
39
+ speech: { tool: "generate_speech", args: { text: "one two three", model: "speech-model", language_code: "xx", voice_id: "voice-1", voice_type: "library" } },
40
+ align: { tool: "forced_alignment", args: { transcript: "one two three" } },
41
+ split: { tool: "ugc_split_speech", args: { plan: { v: 1, hook: "one" } } },
42
+ }
43
+ const SEGMENTS = [{ index: 1, text: "one two" }, { index: 2, text: "three" }]
44
+ const PHASE2 = {
45
+ errors: [],
46
+ phase: 2,
47
+ tickets: [{ v: 1, index: 0, durationSec: 7 }, { v: 1, index: 1, durationSec: 7 }],
48
+ sizedPlan: { hook: "one", clipBreaks: [], clipDurations: [14] },
49
+ transcript: "one two three",
50
+ hasCards: false,
51
+ speechCheckCall: { tool: "transcribe", args: { language: "xx" } },
52
+ finish: { tool: "ugc_finish_clips", args: { segments: SEGMENTS } },
53
+ }
54
+
55
+ describe("the script's language", () => {
56
+ it("the node's choice goes to the script route; none, or one this app does not know, is English", () => {
57
+ const body = (language: unknown) => (ugcScriptBody({ site: "Acme", screenshots: [], language }) as { body: Record<string, unknown> }).body.language
58
+ expect(body("he")).toBe("he")
59
+ expect(body("en")).toBe("en")
60
+ expect(body(undefined)).toBe("en")
61
+ expect(body("fr")).toBe("en")
62
+ })
63
+ it("is an overridable field and an extra app-input key, together", () => {
64
+ expect(UGC_OVERRIDABLE_FIELDS["ugc-script"]).toContain("language")
65
+ expect(getInputFieldExtraKeys("ugc-script")).toEqual([{ key: "language", type: "select" }])
66
+ })
67
+ })
68
+
69
+ describe("UGC Clips' prelude", () => {
70
+ it("reads an answer's phase: 1 runs the prelude, 2 the clips, none is one call", () => {
71
+ expect(ugcClipsPhase(PHASE1)).toBe(1)
72
+ expect(ugcClipsPhase(PHASE2)).toBe(2)
73
+ expect(ugcClipsPhase({ tickets: [] })).toBeNull()
74
+ })
75
+ it("maps the three calls to the routes their MCP tools dispatch to, argument by argument", () => {
76
+ const p = ugcPrelude(PHASE1)
77
+ if ("error" in p) throw new Error(p.error)
78
+ expect(p.speech).toEqual({ text: "one two three", voice: "voice-1", voiceType: "library", provider: "speech-model", languageCode: "xx" })
79
+ expect(p.alignment("https://cdn.example/s.mp3")).toEqual({ transcript: "one two three", audioUrl: "https://cdn.example/s.mp3" })
80
+ expect(p.split("https://cdn.example/s.mp3", [{ word: "one", start: 0, end: 1 }])).toEqual({
81
+ plan: { v: 1, hook: "one" }, audioUrl: "https://cdn.example/s.mp3", alignment: [{ word: "one", start: 0, end: 1 }],
82
+ })
83
+ expect(UGC_PRELUDE_ROUTES).toEqual({
84
+ speech: { path: "/v1/text-to-speech", jobType: "text-to-speech" },
85
+ alignment: { path: "/v1/forced-alignment", jobType: "forced-alignment" },
86
+ split: { path: "/v1/ugc/segments", jobType: "ugc-segments" },
87
+ })
88
+ })
89
+ it("an answer missing a call, or naming another tool, is the newer-app sentence", () => {
90
+ expect(ugcPrelude({ ...PHASE1, align: undefined })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
91
+ expect(ugcPrelude({ ...PHASE1, speech: { tool: "generate_dialogue", args: { text: "x" } } })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
92
+ expect(ugcPrelude({ ...PHASE1, split: { tool: "ugc_split_speech", args: {} } })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
93
+ })
94
+ it("reads each step's job output: the speech's audio, the word timings, the segments", () => {
95
+ expect(ugcPreludeOutput("speech", { audioUrl: "https://cdn.example/s.mp3" })).toEqual({ value: "https://cdn.example/s.mp3" })
96
+ expect(ugcPreludeOutput("alignment", { alignment: [{ word: "a" }] })).toEqual({ value: [{ word: "a" }] })
97
+ expect(ugcPreludeOutput("split", { segments: SEGMENTS })).toEqual({ value: SEGMENTS })
98
+ for (const [step, out] of [["speech", {}], ["alignment", { alignment: [] }], ["split", undefined]] as const) {
99
+ expect(ugcPreludeOutput(step, out as never)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
100
+ }
101
+ })
102
+ it("the second call is the first call's body with the segments", () => {
103
+ expect(ugcClipsPhase2Body({ plan: { v: 1 }, surface: "canvas", userId: "u" }, SEGMENTS)).toEqual({ plan: { v: 1 }, surface: "canvas", userId: "u", segments: SEGMENTS })
104
+ })
105
+ it("the phase-2 answer's Script (sized) output carries the finish call's arguments; an answer without one is unchanged", () => {
106
+ const read = ugcClipsOutputs(PHASE2)
107
+ if ("error" in read) throw new Error(read.error)
108
+ expect(JSON.parse(read.outputs["plan-out"]!)).toEqual({ v: 1, plan: PHASE2.sizedPlan, transcribeArgs: { language: "xx" }, finish: { segments: SEGMENTS } })
109
+ const { finish: _f, phase: _p, ...english } = PHASE2
110
+ const en = ugcClipsOutputs(english)
111
+ if ("error" in en) throw new Error(en.error)
112
+ expect(JSON.parse(en.outputs["plan-out"]!)).toEqual({ v: 1, plan: PHASE2.sizedPlan, transcribeArgs: { language: "xx" } })
113
+ })
114
+ it("says the clips go through UGC Finish's job exactly when its plan-out carries the finish call (the quote prices it then)", () => {
115
+ const read = ugcClipsOutputs(PHASE2)
116
+ if ("error" in read) throw new Error(read.error)
117
+ expect(read.finishes).toBe(true)
118
+ expect("finish" in JSON.parse(read.outputs["plan-out"]!)).toBe(true)
119
+ const { finish: _f, phase: _p, ...english } = PHASE2
120
+ const en = ugcClipsOutputs(english)
121
+ if ("error" in en) throw new Error(en.error)
122
+ expect(en.finishes).toBe(false)
123
+ // A finish with no arguments is not carried, so it is not priced either.
124
+ const bare = ugcClipsOutputs({ ...PHASE2, finish: { tool: "ugc_finish_clips" } })
125
+ if ("error" in bare) throw new Error(bare.error)
126
+ expect([bare.finishes, "finish" in JSON.parse(bare.outputs["plan-out"]!)]).toEqual([false, false])
127
+ })
128
+ it("is refused before anything is spent when no UGC Finish reads this UGC Clips' Script (sized) output", () => {
129
+ const nodes = [{ id: "clips", type: "ugc-clips" }, { id: "fin", type: UGC_FINISH_CLIPS_TYPE }, { id: "join", type: "combine-videos" }]
130
+ const wired = [{ source: "clips", target: "fin", sourceHandle: "plan-out", targetHandle: "plan" }]
131
+ expect(ugcFinishWired(wired, nodes, "clips")).toBe(true)
132
+ expect(ugcLaneNeedsFinish(wired, nodes, "clips")).toBeNull()
133
+ // Another UGC Clips' finish, another output, or no UGC Finish at all: refused.
134
+ expect(ugcLaneNeedsFinish(wired, nodes, "other")).toBe(UGC_NODE_MESSAGES.needsFinish)
135
+ expect(ugcLaneNeedsFinish([{ ...wired[0]!, sourceHandle: "transcript" }], nodes, "clips")).toBe(UGC_NODE_MESSAGES.needsFinish)
136
+ expect(ugcLaneNeedsFinish([{ ...wired[0]!, target: "join" }], nodes, "clips")).toBe(UGC_NODE_MESSAGES.needsFinish)
137
+ })
138
+ })
139
+
140
+ describe("UGC Finish", () => {
141
+ const PLAN_OUT_EN = JSON.stringify({ v: 1, plan: { hook: "h" }, transcribeArgs: {} })
142
+ const PLAN_OUT_LANE = JSON.stringify({ v: 1, plan: { hook: "h" }, transcribeArgs: {}, finish: { segments: SEGMENTS } })
143
+ const CLIPS = ["https://cdn.example/1.mp4", "https://cdn.example/2.mp4"]
144
+
145
+ it("is a registered UGC node, a video producer, and folds its clips into one run (never fanned out)", () => {
146
+ expect(UGC_NODE_TYPES.has(UGC_FINISH_CLIPS_TYPE)).toBe(true)
147
+ expect(VIDEO_PRODUCER_TYPES.has(UGC_FINISH_CLIPS_TYPE)).toBe(true)
148
+ expect(FAN_IN_TARGETS[UGC_FINISH_CLIPS_TYPE]).toEqual(["clips"])
149
+ expect(isFanInNodeType(UGC_FINISH_CLIPS_TYPE)).toBe(true)
150
+ expect(isFanInEdge(UGC_FINISH_CLIPS_TYPE, "clips")).toBe(true)
151
+ expect(isFanInEdge(UGC_FINISH_CLIPS_TYPE, "plan")).toBe(false)
152
+ expect(UGC_PRIMARY_HANDLE[UGC_FINISH_CLIPS_TYPE]).toBe("video-out")
153
+ // Its output is one value per edge by default; a Bundle edge hands on the whole list.
154
+ expect(defaultEdgeOutputMode(UGC_FINISH_CLIPS_TYPE, "video-out")).toBe("last")
155
+ })
156
+ it("English (no finish call on the plan): the clips pass through as they came — no call, no job", () => {
157
+ expect(ugcFinishPlan({ planOutWire: PLAN_OUT_EN, clipUrls: CLIPS })).toEqual({ kind: "pass", clips: CLIPS })
158
+ })
159
+ it("the segmented lane: the finish job's body — the segments as they came, one roll per clip, in order", () => {
160
+ expect(ugcFinishPlan({ planOutWire: PLAN_OUT_LANE, clipUrls: CLIPS })).toEqual({
161
+ kind: "job", path: "/v1/ugc/finish",
162
+ body: { segments: SEGMENTS, clips: [{ clip: 1, rolls: [CLIPS[0]] }, { clip: 2, rolls: [CLIPS[1]] }] },
163
+ })
164
+ })
165
+ it("refuses before any call: no clips, no plan, or a clip count that is not the segment count", () => {
166
+ expect(ugcFinishPlan({ planOutWire: PLAN_OUT_LANE, clipUrls: [] })).toEqual({ error: UGC_NODE_MESSAGES.finishNeedsClips })
167
+ expect(ugcFinishPlan({ planOutWire: undefined, clipUrls: CLIPS })).toEqual({ error: UGC_NODE_MESSAGES.needsPlanOut })
168
+ expect(ugcFinishPlan({ planOutWire: PLAN_OUT_LANE, clipUrls: CLIPS.slice(0, 1) })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
169
+ })
170
+ it("a finished job → the clips in clip order with their real length; a dry finish's warning rides every clip", () => {
171
+ const out = ugcFinishOutputs({
172
+ ready: true,
173
+ clips: [{ clip: 2, url: "https://cdn.example/f2.mp4", sec: 5.2 }, { clip: 1, url: "https://cdn.example/f1.mp4", sec: 6.1 }],
174
+ warnings: [{ code: "ACOUSTICS_SKIPPED", cause: null, reason: "r" }],
175
+ })
176
+ expect(out).toEqual({
177
+ clips: [
178
+ { url: "https://cdn.example/f1.mp4", meta: { warnings: ["ACOUSTICS_SKIPPED"], durationSec: 6.1 } },
179
+ { url: "https://cdn.example/f2.mp4", meta: { warnings: ["ACOUSTICS_SKIPPED"], durationSec: 5.2 } },
180
+ ],
181
+ })
182
+ })
183
+ it("ready: false fails with its sentence; a clip list with a gap is never handed on", () => {
184
+ expect(ugcFinishOutputs({ ready: false, reroll: [2], failed: [] })).toEqual({ error: UGC_NODE_MESSAGES.finishNotReady })
185
+ expect(ugcFinishOutputs({ ready: true, clips: [{ clip: 1, url: "u1" }, { clip: 3, url: "u3" }] })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
186
+ expect(ugcFinishOutputs(undefined)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
187
+ })
188
+ })
189
+
190
+ describe("the hold check once the speech is split", () => {
191
+ const T = { v: 1, index: 0, durationSec: 7, video: { tool: "generate_video", args: {} } }
192
+ const PLAN = { v: 1, hook: "h", language: "he", targetDurationSec: 20, beats: [{ screenshot: { slot: 1 } }, { screenshot: { slot: 2 } }, { screenshot: "x" }, "not a beat"] }
193
+ const INPUT = { targetDurationSec: 20, screenshotCount: 2, source: "sampled", language: "he" } as const
194
+
195
+ it("reads the video's estimate input from the plan UGC Clips was sent (or its wire): length, screenshot cards, language", () => {
196
+ expect(ugcRunEstimateInput(PLAN)).toEqual({ runEstimate: INPUT })
197
+ expect(ugcRunEstimateInput(JSON.stringify(PLAN))).toEqual({ runEstimate: INPUT })
198
+ // A plan with no beats has no cards to count.
199
+ const { beats: _b, ...noBeats } = PLAN
200
+ expect(ugcRunEstimateInput(noBeats)).toEqual({ runEstimate: { ...INPUT, screenshotCount: 0 } })
201
+ })
202
+ it("never guesses: a plan with no length, an English or unknown language, or no plan → the newer-app sentence", () => {
203
+ const { targetDurationSec: _t, ...noLength } = PLAN
204
+ for (const plan of [noLength, { ...PLAN, targetDurationSec: 2 }, { ...PLAN, language: "en" }, { ...PLAN, language: "xx" }, { ...PLAN, language: undefined }, undefined, "not json"]) {
205
+ expect(ugcRunEstimateInput(plan), JSON.stringify(plan)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
206
+ }
207
+ })
208
+ it("asks the quote for the clips handed on, with that input", () => {
209
+ expect(ugcRenderHoldBody({ runEstimate: INPUT, tickets: [T], hasCards: true, finishes: true })).toEqual({
210
+ path: "/v1/ugc/quote",
211
+ body: { tickets: [T], hasCards: true, finishes: true, runEstimate: INPUT },
212
+ })
213
+ // No finish call → no `finishes` key.
214
+ expect(ugcRenderHoldBody({ runEstimate: INPUT, tickets: [T], hasCards: false, finishes: false })).toEqual({
215
+ path: "/v1/ugc/quote",
216
+ body: { tickets: [T], hasCards: false, runEstimate: INPUT },
217
+ })
218
+ for (const tickets of [[], undefined, "x"]) expect(ugcRenderHoldBody({ runEstimate: INPUT, tickets, hasCards: false, finishes: true })).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
219
+ })
220
+ it("goes on at or under what the run was checked for; over it, the over-hold sentence; without both figures, the newer-app sentence", () => {
221
+ expect(ugcRenderHoldVerdict({ ceiling: 2400, runHold: 2400 })).toEqual({ ok: true })
222
+ expect(ugcRenderHoldVerdict({ ceiling: 0, runHold: 1 })).toEqual({ ok: true })
223
+ expect(ugcRenderHoldVerdict({ ceiling: 2401, runHold: 2400 })).toEqual({ error: UGC_NODE_MESSAGES.overHold })
224
+ for (const answer of [undefined, null, [], {}, { ceiling: 1 }, { runHold: 1 }, { ceiling: "1", runHold: 2 }, { ceiling: 1, runHold: Number.NaN }, { ceiling: -1, runHold: 2 }]) {
225
+ expect(ugcRenderHoldVerdict(answer), JSON.stringify(answer)).toEqual({ error: UGC_NODE_MESSAGES.newerApp })
226
+ }
227
+ })
228
+ })
@@ -6,6 +6,7 @@ import {
6
6
  ugcAwaitsPick, ugcCreatorBody, ugcCreatorCallsToRender, ugcCreatorCandidate, ugcCreatorCandidates, ugcCreatorOutputs, ugcCreatorPick, ugcFailure,
7
7
  ugcKeptOutputs, ugcPipValue, ugcScriptBody, ugcScriptOutputs, ugcScriptResult, type UgcCreatorCandidateCalls,
8
8
  } from "../ugc-node-wires.js"
9
+ import { ugcFinishOutputs, ugcFinishPlan, ugcLaneNeedsFinish, ugcRenderHoldVerdict } from "../ugc-lane-wires.js"
9
10
 
10
11
  const ticket = (i: number) => ({ v: 1, index: i, durationSec: 12, video: { tool: "t", args: {} } })
11
12
 
@@ -159,9 +160,9 @@ describe("UGC wires: the module surface", () => {
159
160
  expect(shared.UGC_SCRIPT_DEFAULT_TARGET_SEC).toBe(UGC_SCRIPT_DEFAULT_TARGET_SEC)
160
161
  expect(shared.UGC_PRIMARY_HANDLE).toBe(UGC_PRIMARY_HANDLE)
161
162
  })
162
- it("names a primary handle for exactly the five UGC types", () => {
163
+ it("names a primary handle for exactly the UGC types", () => {
163
164
  expect(Object.keys(UGC_PRIMARY_HANDLE).sort()).toEqual([...UGC_NODE_TYPES].sort())
164
- expect(UGC_PRIMARY_HANDLE).toEqual({ "ugc-creator": "creator", "ugc-script": "plan", "ugc-clips": "clips", "ugc-clip": "video-out", "ugc-cards": "layerPlan" })
165
+ expect(UGC_PRIMARY_HANDLE).toEqual({ "ugc-creator": "creator", "ugc-script": "plan", "ugc-clips": "clips", "ugc-clip": "video-out", "ugc-cards": "layerPlan", "ugc-finish-clips": "video-out" })
165
166
  })
166
167
  it("lists the eight screenshot slots in card order", () => {
167
168
  expect(UGC_SCREENSHOT_HANDLES).toEqual(["screenshot", "screenshot2", "screenshot3", "screenshot4", "screenshot5", "screenshot6", "screenshot7", "screenshot8"])
@@ -331,12 +332,13 @@ describe("ugcClipsBody / ugcClipsOutputs: the remaining rules", () => {
331
332
  expect(ugcClipsOutputs({ ...ok, transcript: undefined })).toEqual({ error: UGC_NEWER_APP_MESSAGE })
332
333
  expect(ugcClipsOutputs({ errors: [{}] })).toEqual({ error: UGC_NEWER_APP_MESSAGE })
333
334
  })
334
- it("hands on the first ticket, the plan-out, the transcript and whether there are cards", () => {
335
+ it("hands on the first ticket, the plan-out, the transcript, whether there are cards and whether the clips go through UGC Finish's job", () => {
335
336
  const ok = ugcClipsOutputs({ errors: [], tickets: [ticket(0), ticket(1)], sizedPlan: { p: 1 }, transcript: "a b", hasCards: true })
336
337
  expect(ok).toEqual({
337
338
  outputs: { clips: JSON.stringify(ticket(0)), "plan-out": JSON.stringify({ v: 1, plan: { p: 1 }, transcribeArgs: {} }), transcript: "a b" },
338
339
  tickets: [JSON.stringify(ticket(0)), JSON.stringify(ticket(1))],
339
340
  hasCards: true,
341
+ finishes: false,
340
342
  })
341
343
  const none = ugcClipsOutputs({ tickets: [ticket(0)], sizedPlan: {}, transcript: "a", speechCheckCall: { tool: "transcribe", args: null } })
342
344
  expect("hasCards" in none && none.hasCards).toBe(false)
@@ -585,6 +587,10 @@ describe("UGC_NODE_MESSAGES: every fixed sentence a UGC node fails with, by id",
585
587
  needsTicket: ugcClipBody({ ticketWire: undefined }),
586
588
  needsVideo: ugcCardsJobs({ planOutWire: PLAN_OUT, transcript: "a" }),
587
589
  needsTranscript: ugcCardsJobs({ planOutWire: PLAN_OUT, videoUrl: "https://cdn.example/v.mp4" }),
590
+ needsFinish: ugcLaneNeedsFinish([], [], "clips"),
591
+ finishNeedsClips: ugcFinishPlan({ planOutWire: PLAN_OUT, clipUrls: [] }),
592
+ finishNotReady: ugcFinishOutputs({ ready: false, reroll: [1], failed: [] }),
593
+ overHold: ugcRenderHoldVerdict({ ceiling: 2, runHold: 1 }),
588
594
  }
589
595
  for (const [id, answer] of Object.entries(answers)) {
590
596
  const said = typeof answer === "string" ? answer : (answer as { error?: unknown }).error
@@ -6,8 +6,8 @@ import {
6
6
  } from "../ugc-run-state.js"
7
7
 
8
8
  describe("UGC run state", () => {
9
- it("covers exactly the five UGC types", () => {
10
- const five = ["ugc-cards", "ugc-clip", "ugc-clips", "ugc-creator", "ugc-script"]
9
+ it("covers exactly the six UGC types", () => {
10
+ const five = ["ugc-cards", "ugc-clip", "ugc-clips", "ugc-creator", "ugc-finish-clips", "ugc-script"]
11
11
  expect([...UGC_NODE_TYPES].sort()).toEqual(five)
12
12
  expect(Object.keys(UGC_NODE_RUN_STATE_KEYS).sort()).toEqual(five)
13
13
  expect(Object.keys(UGC_OVERRIDABLE_FIELDS).sort()).toEqual(five)
@@ -90,8 +90,9 @@ describe("UGC run state", () => {
90
90
  { nodeId: "script", nodeType: "ugc-script", field: "keepResult" },
91
91
  { nodeId: "clip", nodeType: "ugc-clip", field: "rerender" },
92
92
  ])
93
- // A future field is refused without anyone listing it.
94
- expect(findUgcLockedFields(nodes, { script: { language: "he" } })).toEqual([{ nodeId: "script", nodeType: "ugc-script", field: "language" }])
93
+ // The script's language is a choice a run may set; a future field is refused without anyone listing it.
94
+ expect(findUgcLockedFields(nodes, { script: { language: "he" } })).toEqual([])
95
+ expect(findUgcLockedFields(nodes, { script: { voice: "x" } })).toEqual([{ nodeId: "script", nodeType: "ugc-script", field: "voice" }])
95
96
  })
96
97
 
97
98
  it("ignores non-UGC nodes and missing inputs", () => {
@@ -164,7 +164,7 @@ describe("bare video-analysis node-type credit id", () => {
164
164
  // that prompt again, moving the pin 8_482 -> 8_706, and 357 wrote 2076:
165
165
  // the transition vocabulary v2 doctrine (twelve named values; absent =
166
166
  // nothing asserted) grew it once more, moving the pin 8_706 -> 9_082.
167
- expect(ceiling).toBe(2081)
167
+ expect(ceiling).toBe(2076)
168
168
  })
169
169
 
170
170
  it("the bare id still bounds the default tier at the ceiling bucket", () => {
@@ -194,10 +194,10 @@ describe("video-audit-pricing", () => {
194
194
  it("videoAuditCreditsForBucket: table lookup by resolved bucket + family, snapping a raw duration onto the ladder", () => {
195
195
  expect(videoAuditCreditsForBucket(60, false)).toBe(215)
196
196
  expect(videoAuditCreditsForBucket(60, true)).toBe(396)
197
- expect(videoAuditCreditsForBucket(180, false)).toBe(291)
198
- expect(videoAuditCreditsForBucket(360, false)).toBe(664)
199
- expect(videoAuditCreditsForBucket(600, false)).toBe(1075)
200
- expect(videoAuditCreditsForBucket(600, true)).toBe(1924)
197
+ expect(videoAuditCreditsForBucket(180, false)).toBe(290)
198
+ expect(videoAuditCreditsForBucket(360, false)).toBe(663)
199
+ expect(videoAuditCreditsForBucket(600, false)).toBe(1073)
200
+ expect(videoAuditCreditsForBucket(600, true)).toBe(1921)
201
201
  // Not just exact ladder values — a raw duration snaps up to its bucket.
202
202
  expect(videoAuditCreditsForBucket(70, false)).toBe(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:180s"])
203
203
  expect(videoAuditCreditsForBucket(9999, true)).toBe(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"])
@@ -238,8 +238,8 @@ describe("video-audit-pricing", () => {
238
238
  // 600s bucket here, same convention as VIDEO_ANALYSIS_BUCKET_CREDITS).
239
239
  expect(Object.keys(VIDEO_AUDIT_BUCKET_CREDITS)).toHaveLength(8)
240
240
  // Bare-id values quoted in the task/catalog must equal each family's 600s ceiling.
241
- expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:600s"]).toBe(1075)
242
- expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"]).toBe(1924)
241
+ expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:600s"]).toBe(1073)
242
+ expect(VIDEO_AUDIT_BUCKET_CREDITS["video-audit:auto:600s"]).toBe(1921)
243
243
  })
244
244
 
245
245
  it("auto family = base family + the gemini-3-flash (legacy fast tier) row at the same bucket, exactly — single-source, never hand-added", () => {
@@ -0,0 +1,79 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { parseVoiceChangerProQuoteCreditId, voiceChangerProQuoteCreditId } from "../credit-estimators/voice-changer-pro-quote.js"
3
+
4
+ describe("the whole-convert quote id", () => {
5
+ it("writes one slot per changed speaker, a missing measure as the bare kind", () => {
6
+ expect(
7
+ voiceChangerProQuoteCreditId([
8
+ { kind: "sts", seconds: 26.76 },
9
+ { kind: "respeak", chars: 1200 },
10
+ { kind: "sts", seconds: null },
11
+ { kind: "respeak", chars: 0 },
12
+ ]),
13
+ ).toBe("voice-changer-pro:sts-26.76,respeak-1200,sts,respeak")
14
+ })
15
+
16
+ it("reads back exactly what it wrote, per kind and in order", () => {
17
+ const id = voiceChangerProQuoteCreditId([
18
+ { kind: "respeak", chars: 87 },
19
+ { kind: "sts", seconds: 2 + 1 / 3 },
20
+ { kind: "sts", seconds: null },
21
+ { kind: "respeak", chars: null },
22
+ ])
23
+ expect(parseVoiceChangerProQuoteCreditId(id)).toEqual({
24
+ stsSlotSeconds: [2 + 1 / 3, null],
25
+ respeakChars: [87, null],
26
+ respeakEngines: [null, null],
27
+ respeakTranslated: [false, false],
28
+ })
29
+ })
30
+
31
+ it("names a v4 slot's engine, and a translated v4 slot as such; v3 keeps the id it always had", () => {
32
+ expect(
33
+ voiceChangerProQuoteCreditId([
34
+ { kind: "respeak", chars: 1200, engine: "v4" },
35
+ { kind: "respeak", chars: 1200, engine: "v4", translated: true },
36
+ { kind: "respeak", chars: 1200, engine: "v3" },
37
+ { kind: "respeak", chars: null, engine: "v4", translated: true },
38
+ { kind: "respeak", chars: null, engine: "v4" },
39
+ ]),
40
+ ).toBe("voice-changer-pro:respeak-v4-1200,respeak-v4t-1200,respeak-1200,respeak-v4t,respeak-v4")
41
+ })
42
+
43
+ it("never writes a translated v3 slot: only v4 speaks a translation, as the convert route reads it", () => {
44
+ expect(voiceChangerProQuoteCreditId([{ kind: "respeak", chars: 500, engine: "v3", translated: true }])).toBe(
45
+ "voice-changer-pro:respeak-500",
46
+ )
47
+ expect(voiceChangerProQuoteCreditId([{ kind: "respeak", chars: 500, translated: true }])).toBe("voice-changer-pro:respeak-500")
48
+ })
49
+
50
+ it("reads each Re-speak slot's engine and translation back, index-aligned with its characters", () => {
51
+ expect(parseVoiceChangerProQuoteCreditId("voice-changer-pro:respeak-v4t-900,sts-12,respeak-v3-40,respeak,respeak-v4")).toEqual({
52
+ stsSlotSeconds: [12],
53
+ respeakChars: [900, 40, null, null],
54
+ respeakEngines: ["v4", "v3", null, "v4"],
55
+ respeakTranslated: [true, false, false, false],
56
+ })
57
+ })
58
+
59
+ it.each([
60
+ "voice-changer-pro",
61
+ "voice-changer-pro:",
62
+ "voice-changer-pro-respeak:sts-10",
63
+ "voice-changer-pro:sts-0",
64
+ "voice-changer-pro:sts--3",
65
+ "voice-changer-pro:sts-1e3",
66
+ "voice-changer-pro:sts-10,",
67
+ "voice-changer-pro:lipsync-3",
68
+ "voice-changer-pro:3u",
69
+ "voice-changer-pro:respeak-v3t-100",
70
+ "voice-changer-pro:respeak-v5-100",
71
+ "voice-changer-pro:respeak-v4-",
72
+ "voice-changer-pro:respeak-v4-0",
73
+ "voice-changer-pro:respeak:v4-100",
74
+ "voice-changer-pro:sts-v4-10",
75
+ "voice-changer-pro:respeak-100-v4",
76
+ ])("is not %s", (id) => {
77
+ expect(parseVoiceChangerProQuoteCreditId(id)).toBeUndefined()
78
+ })
79
+ })
@@ -39,10 +39,16 @@ export function styleCaptionPlan(
39
39
  const parsed = parseCaptionPlan(raw)
40
40
  if ("error" in parsed) return { error: parsed.error }
41
41
  const bodyLevers = captionPlanBodyLevers(nodeData, styler.leverKeys)
42
- const { segments } = styler.segmentsFor(parsed.plan, bodyLevers ? { bodyLevers } : undefined)
43
- for (let i = 0; i < segments.length; i++) {
44
- const r = captionSegmentInputSchema.safeParse(segments[i])
42
+ const styled = styler.segmentsFor(parsed.plan, bodyLevers ? { bodyLevers } : undefined).segments
43
+ // The PARSED segments go on, never the helper's raw ones: the route's schema
44
+ // fills each word entry's defaults (`timestampMs` / `confidence` → null), and a
45
+ // DAG payload never passes the route, so returning the raw list sent a server
46
+ // run word entries the add-captions route itself would have completed.
47
+ const segments: Record<string, unknown>[] = []
48
+ for (let i = 0; i < styled.length; i++) {
49
+ const r = captionSegmentInputSchema.safeParse(styled[i])
45
50
  if (!r.success) return { error: `Caption plan: segment ${i + 1}: ${r.error.issues[0]?.message ?? "invalid"}.` }
51
+ segments.push(r.data)
46
52
  }
47
53
  const overlap = findSegmentOverlap(segments as { startMs: number; endMs: number }[])
48
54
  if (overlap) return { error: `Caption plan: ${overlap}.` }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * A caption line never starts or ends on a lone dash.
3
+ *
4
+ * A speech engine times a dash written between two spaces ("Nodaro — every model")
5
+ * as a token of its own, and forced alignment keeps it. Inside a line the dash
6
+ * reads as written; at a line's edge — the line breaks right after it, or the
7
+ * next line opens with it — it reads as a stray mark. The display drops such a
8
+ * token from the edge of the line it lands on; the words keep their own timings.
9
+ *
10
+ * One rule for every place that breaks captions into lines: the render's line
11
+ * grouping (word-timed captions) and the wrap of a static text block.
12
+ */
13
+
14
+ /** Dash characters only: hyphen-minus, the Unicode hyphens and dashes (U+2010–U+2015), minus, the Hebrew maqaf, and their small/full-width forms. */
15
+ const BARE_DASH = /^[-‐-―−־﹘﹣-]+$/u
16
+
17
+ /** True when the token, trimmed, is nothing but dash characters ("—", "–", "-"). A hyphenated word ("ה-AI", "re-run") is not. */
18
+ export function isBareDashToken(text: string): boolean {
19
+ return BARE_DASH.test(text.trim())
20
+ }
21
+
22
+ /**
23
+ * The items with every lone-dash token at either end removed (a copy; the input
24
+ * is never mutated). A line holding nothing but dashes comes back empty — the
25
+ * caller drops it rather than show it.
26
+ */
27
+ export function trimEdgeDashTokens<T>(items: readonly T[], textOf: (item: T) => string): T[] {
28
+ let start = 0
29
+ let end = items.length
30
+ while (start < end && isBareDashToken(textOf(items[start]!))) start++
31
+ while (end > start && isBareDashToken(textOf(items[end - 1]!))) end--
32
+ return items.slice(start, end)
33
+ }
@@ -18,6 +18,15 @@ export interface ExposedSetting {
18
18
  /** Full option list with labels for select fields (preferred over allowedValues). */
19
19
  options?: Array<{ value: string; label: string }>
20
20
  defaultValue: unknown
21
+ /**
22
+ * Set when the setting is one of the node's quick settings (the editor's bottom-bar levers): the node type,
23
+ * so the consuming workflow can render the same control, and the node's own lever values its choices depend
24
+ * on (its model, Draft, …), so the control offers what that model takes. Never prompts or results.
25
+ */
26
+ quick?: {
27
+ nodeType: string
28
+ context?: Record<string, string | number | boolean>
29
+ }
21
30
  }
22
31
 
23
32
  export interface ComponentMetadata {
@@ -14,7 +14,7 @@ export {
14
14
  imageOverlayCredits,
15
15
  } from "./image-overlay.js"
16
16
 
17
- export { VIDEO_SFX_PRICING, videoSfxCreditId } from "./video-sfx.js"
17
+ export { VIDEO_SFX_PRICING, videoSfxCreditId, videoSfxQuoteCreditId } from "./video-sfx.js"
18
18
 
19
19
  export {
20
20
  TEXT_TO_AUDIO_PRICING,
@@ -49,13 +49,34 @@ export {
49
49
  speechUnitCreditId,
50
50
  speechPriceUnits,
51
51
  speechCredits,
52
+ speechQuoteCreditId,
53
+ parseSpeechQuoteCreditId,
54
+ isSpeechLengthPriceId,
55
+ speechLengthPriceModel,
56
+ type SpeechQuoteCreditIdParts,
52
57
  } from "./speech.js"
53
58
 
59
+ export {
60
+ unitQuoteCreditId,
61
+ parseUnitQuoteCreditId,
62
+ type UnitQuoteCreditIdParts,
63
+ } from "./unit-quote.js"
64
+
65
+ export {
66
+ VOICE_CHANGER_PRO_QUOTE_RATE_ID,
67
+ voiceChangerProQuoteCreditId,
68
+ parseVoiceChangerProQuoteCreditId,
69
+ type VoiceChangerProQuoteSlot,
70
+ type VoiceChangerProQuoteCreditIdParts,
71
+ type VoiceChangerProQuoteRespeakEngine,
72
+ } from "./voice-changer-pro-quote.js"
73
+
54
74
  export {
55
75
  PITCH_TEMPO_PRICING,
56
76
  PITCH_TEMPO_LIMITS,
57
77
  pitchTempoStartedMinutes,
58
78
  pitchTempoCreditId,
79
+ pitchTempoQuoteCreditId,
59
80
  parsePitchTempoCreditId,
60
81
  pitchTempoBaseCredits,
61
82
  semitonesToPitchRatio,
@@ -36,7 +36,8 @@ export const PITCH_TEMPO_LIMITS = {
36
36
  /**
37
37
  * Started minutes of an input of `durationSec` seconds: ceil(sec / 60), at
38
38
  * least 1, at most 30. An unknown or non-positive length counts as one minute
39
- * (what the editor quotes before it knows the length; a run always measures).
39
+ * here; a quote of an unknown length names 30 instead
40
+ * ({@link pitchTempoQuoteCreditId}), and a run always measures.
40
41
  */
41
42
  export function pitchTempoStartedMinutes(durationSec: number | null | undefined): number {
42
43
  if (typeof durationSec !== "number" || !Number.isFinite(durationSec) || durationSec <= 0) return 1
@@ -48,6 +49,19 @@ export function pitchTempoCreditId(durationSec: number | null | undefined): stri
48
49
  return `pitch-tempo:${pitchTempoStartedMinutes(durationSec)}m`
49
50
  }
50
51
 
52
+ /**
53
+ * The id a QUOTE names for an input of `durationSec` seconds — every estimate
54
+ * before a run. A known length is the id its run reserves
55
+ * ({@link pitchTempoCreditId}). An UNKNOWN length is the 30-minute id
56
+ * (decided 2026-10-13): a run measures the file before it reserves and refuses
57
+ * one it cannot measure or one over 30 minutes, so 30 minutes is the most any
58
+ * run can be charged and the quote is never below the charge.
59
+ */
60
+ export function pitchTempoQuoteCreditId(durationSec: number | null | undefined): string {
61
+ const known = typeof durationSec === "number" && Number.isFinite(durationSec) && durationSec > 0
62
+ return pitchTempoCreditId(known ? durationSec : PITCH_TEMPO_PRICING.MAX_DURATION_SEC)
63
+ }
64
+
51
65
  /** The minutes of a `pitch-tempo:<N>m` id (1 ≤ N ≤ 30), or `undefined` for any other id. */
52
66
  export function parsePitchTempoCreditId(id: string): { minutes: number } | undefined {
53
67
  const m = /^pitch-tempo:(\d+)m$/.exec(id)