@nodaro/shared 3.30.0 → 3.32.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.
- package/README.md +17 -0
- package/dist/chunk-2NIQO2J3.cjs +54 -0
- package/dist/chunk-2NIQO2J3.cjs.map +1 -0
- package/dist/chunk-2OJIVO7R.cjs +32 -0
- package/dist/chunk-2OJIVO7R.cjs.map +1 -0
- package/dist/chunk-2RF4Z7KG.cjs +803 -0
- package/dist/chunk-2RF4Z7KG.cjs.map +1 -0
- package/dist/chunk-3CUFITU7.js +1905 -0
- package/dist/chunk-3CUFITU7.js.map +1 -0
- package/dist/chunk-3RYKIUAE.js +86 -0
- package/dist/chunk-3RYKIUAE.js.map +1 -0
- package/dist/chunk-44I73CQS.cjs +194 -0
- package/dist/chunk-44I73CQS.cjs.map +1 -0
- package/dist/chunk-5AUSSJIM.cjs +3372 -0
- package/dist/chunk-5AUSSJIM.cjs.map +1 -0
- package/dist/chunk-5PC6JBGJ.cjs +1419 -0
- package/dist/chunk-5PC6JBGJ.cjs.map +1 -0
- package/dist/chunk-5RU2HCW2.js +30 -0
- package/dist/chunk-5RU2HCW2.js.map +1 -0
- package/dist/chunk-5THUHJ3E.js +46 -0
- package/dist/chunk-5THUHJ3E.js.map +1 -0
- package/dist/chunk-5U7VLG43.js +141 -0
- package/dist/chunk-5U7VLG43.js.map +1 -0
- package/dist/chunk-6DAWSVX2.cjs +103 -0
- package/dist/chunk-6DAWSVX2.cjs.map +1 -0
- package/dist/chunk-6DKDOWBL.js +1567 -0
- package/dist/chunk-6DKDOWBL.js.map +1 -0
- package/dist/chunk-6IJOPRZP.cjs +197 -0
- package/dist/chunk-6IJOPRZP.cjs.map +1 -0
- package/dist/chunk-7G7G42KS.js +86 -0
- package/dist/chunk-7G7G42KS.js.map +1 -0
- package/dist/chunk-AINCI23X.js +2171 -0
- package/dist/chunk-AINCI23X.js.map +1 -0
- package/dist/chunk-AROWPFO2.js +773 -0
- package/dist/chunk-AROWPFO2.js.map +1 -0
- package/dist/chunk-AVQK77G6.cjs +2000 -0
- package/dist/chunk-AVQK77G6.cjs.map +1 -0
- package/dist/chunk-C57NEO3X.js +3327 -0
- package/dist/chunk-C57NEO3X.js.map +1 -0
- package/dist/chunk-CK3GK34R.js +1381 -0
- package/dist/chunk-CK3GK34R.js.map +1 -0
- package/dist/chunk-E2TGXG6X.cjs +1770 -0
- package/dist/chunk-E2TGXG6X.cjs.map +1 -0
- package/dist/chunk-EK362Q45.cjs +38 -0
- package/dist/chunk-EK362Q45.cjs.map +1 -0
- package/dist/chunk-FBV5DF6D.js +95 -0
- package/dist/chunk-FBV5DF6D.js.map +1 -0
- package/dist/chunk-FG4E7MTG.cjs +4 -0
- package/dist/chunk-FG4E7MTG.cjs.map +1 -0
- package/dist/chunk-G6IIVKMO.js +26 -0
- package/dist/chunk-G6IIVKMO.js.map +1 -0
- package/dist/chunk-HGC5JNVA.cjs +1503 -0
- package/dist/chunk-HGC5JNVA.cjs.map +1 -0
- package/dist/chunk-HSHCCBIV.js +255 -0
- package/dist/chunk-HSHCCBIV.js.map +1 -0
- package/dist/chunk-IEBZHTPE.js +254 -0
- package/dist/chunk-IEBZHTPE.js.map +1 -0
- package/dist/chunk-ISJDAFKS.js +1604 -0
- package/dist/chunk-ISJDAFKS.js.map +1 -0
- package/dist/chunk-J6KHW2E5.cjs +1963 -0
- package/dist/chunk-J6KHW2E5.cjs.map +1 -0
- package/dist/chunk-J7BMO73N.cjs +114 -0
- package/dist/chunk-J7BMO73N.cjs.map +1 -0
- package/dist/chunk-JL4C5VJ7.cjs +488 -0
- package/dist/chunk-JL4C5VJ7.cjs.map +1 -0
- package/dist/chunk-JSGIEF6Z.cjs +1087 -0
- package/dist/chunk-JSGIEF6Z.cjs.map +1 -0
- package/dist/chunk-JSNV5O2F.cjs +34 -0
- package/dist/chunk-JSNV5O2F.cjs.map +1 -0
- package/dist/chunk-JWA5SGCS.js +203 -0
- package/dist/chunk-JWA5SGCS.js.map +1 -0
- package/dist/chunk-JX5YZ4DH.cjs +430 -0
- package/dist/chunk-JX5YZ4DH.cjs.map +1 -0
- package/dist/chunk-KHCBJ7KD.js +42 -0
- package/dist/chunk-KHCBJ7KD.js.map +1 -0
- package/dist/chunk-KU6S7IYV.cjs +210 -0
- package/dist/chunk-KU6S7IYV.cjs.map +1 -0
- package/dist/chunk-LKAIXWK3.js +181 -0
- package/dist/chunk-LKAIXWK3.js.map +1 -0
- package/dist/chunk-LPW3XNC2.js +471 -0
- package/dist/chunk-LPW3XNC2.js.map +1 -0
- package/dist/chunk-M36G6SRP.js +447 -0
- package/dist/chunk-M36G6SRP.js.map +1 -0
- package/dist/chunk-MRXGWL42.cjs +4 -0
- package/dist/chunk-MRXGWL42.cjs.map +1 -0
- package/dist/chunk-NB72XWXQ.cjs +54 -0
- package/dist/chunk-NB72XWXQ.cjs.map +1 -0
- package/dist/chunk-NEJ2PV4C.cjs +211 -0
- package/dist/chunk-NEJ2PV4C.cjs.map +1 -0
- package/dist/chunk-NT6IJH4L.cjs +273 -0
- package/dist/chunk-NT6IJH4L.cjs.map +1 -0
- package/dist/chunk-O5MP52U2.cjs +526 -0
- package/dist/chunk-O5MP52U2.cjs.map +1 -0
- package/dist/chunk-O7PUQLJ3.cjs +818 -0
- package/dist/chunk-O7PUQLJ3.cjs.map +1 -0
- package/dist/chunk-PQHS255G.js +1369 -0
- package/dist/chunk-PQHS255G.js.map +1 -0
- package/dist/chunk-PRYE7AZQ.cjs +1227 -0
- package/dist/chunk-PRYE7AZQ.cjs.map +1 -0
- package/dist/chunk-Q4CDQ2KO.js +21 -0
- package/dist/chunk-Q4CDQ2KO.js.map +1 -0
- package/dist/chunk-QELDJGDK.cjs +1714 -0
- package/dist/chunk-QELDJGDK.cjs.map +1 -0
- package/dist/chunk-QJRP44ZO.js +769 -0
- package/dist/chunk-QJRP44ZO.js.map +1 -0
- package/dist/chunk-QNGNOU4Z.js +29 -0
- package/dist/chunk-QNGNOU4Z.js.map +1 -0
- package/dist/chunk-RJL7RCEM.cjs +159 -0
- package/dist/chunk-RJL7RCEM.cjs.map +1 -0
- package/dist/chunk-RN3RMBJZ.js +1164 -0
- package/dist/chunk-RN3RMBJZ.js.map +1 -0
- package/dist/chunk-S5DMKUWK.cjs +1273 -0
- package/dist/chunk-S5DMKUWK.cjs.map +1 -0
- package/dist/chunk-SES6GDBQ.cjs +624 -0
- package/dist/chunk-SES6GDBQ.cjs.map +1 -0
- package/dist/chunk-TNPDV7I4.cjs +2346 -0
- package/dist/chunk-TNPDV7I4.cjs.map +1 -0
- package/dist/chunk-TZBIY5C3.js +187 -0
- package/dist/chunk-TZBIY5C3.js.map +1 -0
- package/dist/chunk-TZE673G6.js +3 -0
- package/dist/chunk-TZE673G6.js.map +1 -0
- package/dist/chunk-ULXI7A6Q.cjs +1047 -0
- package/dist/chunk-ULXI7A6Q.cjs.map +1 -0
- package/dist/chunk-VIWSWVAW.js +1782 -0
- package/dist/chunk-VIWSWVAW.js.map +1 -0
- package/dist/chunk-VWGNPMJZ.cjs +19 -0
- package/dist/chunk-VWGNPMJZ.cjs.map +1 -0
- package/dist/chunk-WDIBOWAA.js +1054 -0
- package/dist/chunk-WDIBOWAA.js.map +1 -0
- package/dist/chunk-WNG7HRVA.cjs +25 -0
- package/dist/chunk-WNG7HRVA.cjs.map +1 -0
- package/dist/chunk-WNVQ3SMB.cjs +96 -0
- package/dist/chunk-WNVQ3SMB.cjs.map +1 -0
- package/dist/chunk-WRSWH7US.cjs +285 -0
- package/dist/chunk-WRSWH7US.cjs.map +1 -0
- package/dist/chunk-XAMC4S53.js +17 -0
- package/dist/chunk-XAMC4S53.js.map +1 -0
- package/dist/chunk-XNISPHTZ.js +1039 -0
- package/dist/chunk-XNISPHTZ.js.map +1 -0
- package/dist/chunk-Y2PM3FFL.js +3 -0
- package/dist/chunk-Y2PM3FFL.js.map +1 -0
- package/dist/chunk-YBPBK5KI.js +1030 -0
- package/dist/chunk-YBPBK5KI.js.map +1 -0
- package/dist/chunk-YHRG7UOC.js +31 -0
- package/dist/chunk-YHRG7UOC.js.map +1 -0
- package/dist/chunk-YWNYGYI7.cjs +31 -0
- package/dist/chunk-YWNYGYI7.cjs.map +1 -0
- package/dist/chunk-YYV35XOS.js +122 -0
- package/dist/chunk-YYV35XOS.js.map +1 -0
- package/dist/chunk-Z2OL5AJD.cjs +133 -0
- package/dist/chunk-Z2OL5AJD.cjs.map +1 -0
- package/dist/chunk-Z4AZW6FY.js +920 -0
- package/dist/chunk-Z4AZW6FY.js.map +1 -0
- package/dist/chunk-ZDFHA2EC.js +572 -0
- package/dist/chunk-ZDFHA2EC.js.map +1 -0
- package/dist/chunk-ZNZDQAXN.js +175 -0
- package/dist/chunk-ZNZDQAXN.js.map +1 -0
- package/dist/chunk-ZRL2UFTH.cjs +1073 -0
- package/dist/chunk-ZRL2UFTH.cjs.map +1 -0
- package/dist/chunk-ZT77RY6R.js +404 -0
- package/dist/chunk-ZT77RY6R.js.map +1 -0
- package/dist/entries/apps.cjs +155 -0
- package/dist/entries/apps.cjs.map +1 -0
- package/dist/entries/apps.d.cts +283 -0
- package/dist/entries/apps.d.ts +283 -0
- package/dist/entries/apps.js +10 -0
- package/dist/entries/apps.js.map +1 -0
- package/dist/entries/captions.cjs +124 -0
- package/dist/entries/captions.cjs.map +1 -0
- package/dist/entries/captions.d.cts +354 -0
- package/dist/entries/captions.d.ts +354 -0
- package/dist/entries/captions.js +3 -0
- package/dist/entries/captions.js.map +1 -0
- package/dist/entries/catalogs.cjs +165 -0
- package/dist/entries/catalogs.cjs.map +1 -0
- package/dist/entries/catalogs.d.cts +385 -0
- package/dist/entries/catalogs.d.ts +385 -0
- package/dist/entries/catalogs.js +4 -0
- package/dist/entries/catalogs.js.map +1 -0
- package/dist/entries/credits.cjs +592 -0
- package/dist/entries/credits.cjs.map +1 -0
- package/dist/entries/credits.d.cts +1429 -0
- package/dist/entries/credits.d.ts +1429 -0
- package/dist/entries/credits.js +11 -0
- package/dist/entries/credits.js.map +1 -0
- package/dist/entries/edl.cjs +409 -0
- package/dist/entries/edl.cjs.map +1 -0
- package/dist/entries/edl.d.cts +1199 -0
- package/dist/entries/edl.d.ts +1199 -0
- package/dist/entries/edl.js +4 -0
- package/dist/entries/edl.js.map +1 -0
- package/dist/entries/entities.cjs +530 -0
- package/dist/entries/entities.cjs.map +1 -0
- package/dist/entries/entities.d.cts +1371 -0
- package/dist/entries/entities.d.ts +1371 -0
- package/dist/entries/entities.js +5 -0
- package/dist/entries/entities.js.map +1 -0
- package/dist/entries/i18n.cjs +48 -0
- package/dist/entries/i18n.cjs.map +1 -0
- package/dist/entries/i18n.d.cts +69 -0
- package/dist/entries/i18n.d.ts +69 -0
- package/dist/entries/i18n.js +3 -0
- package/dist/entries/i18n.js.map +1 -0
- package/dist/entries/llm-models.cjs +177 -0
- package/dist/entries/llm-models.cjs.map +1 -0
- package/dist/entries/llm-models.d.cts +435 -0
- package/dist/entries/llm-models.d.ts +435 -0
- package/dist/entries/llm-models.js +4 -0
- package/dist/entries/llm-models.js.map +1 -0
- package/dist/entries/media.cjs +335 -0
- package/dist/entries/media.cjs.map +1 -0
- package/dist/entries/media.d.cts +518 -0
- package/dist/entries/media.d.ts +518 -0
- package/dist/entries/media.js +6 -0
- package/dist/entries/media.js.map +1 -0
- package/dist/entries/model-catalog.cjs +247 -0
- package/dist/entries/model-catalog.cjs.map +1 -0
- package/dist/entries/model-catalog.d.cts +202 -0
- package/dist/entries/model-catalog.d.ts +202 -0
- package/dist/entries/model-catalog.js +6 -0
- package/dist/entries/model-catalog.js.map +1 -0
- package/dist/entries/models.cjs +833 -0
- package/dist/entries/models.cjs.map +1 -0
- package/dist/entries/models.d.cts +287 -0
- package/dist/entries/models.d.ts +287 -0
- package/dist/entries/models.js +8 -0
- package/dist/entries/models.js.map +1 -0
- package/dist/entries/nodes.cjs +789 -0
- package/dist/entries/nodes.cjs.map +1 -0
- package/dist/entries/nodes.d.cts +1600 -0
- package/dist/entries/nodes.d.ts +1600 -0
- package/dist/entries/nodes.js +16 -0
- package/dist/entries/nodes.js.map +1 -0
- package/dist/entries/organizations.cjs +80 -0
- package/dist/entries/organizations.cjs.map +1 -0
- package/dist/entries/organizations.d.cts +466 -0
- package/dist/entries/organizations.d.ts +466 -0
- package/dist/entries/organizations.js +3 -0
- package/dist/entries/organizations.js.map +1 -0
- package/dist/entries/pipeline.cjs +594 -0
- package/dist/entries/pipeline.cjs.map +1 -0
- package/dist/entries/pipeline.d.cts +2617 -0
- package/dist/entries/pipeline.d.ts +2617 -0
- package/dist/entries/pipeline.js +5 -0
- package/dist/entries/pipeline.js.map +1 -0
- package/dist/entries/scene3d.cjs +704 -0
- package/dist/entries/scene3d.cjs.map +1 -0
- package/dist/entries/scene3d.d.cts +4284 -0
- package/dist/entries/scene3d.d.ts +4284 -0
- package/dist/entries/scene3d.js +3 -0
- package/dist/entries/scene3d.js.map +1 -0
- package/dist/entries/social.cjs +714 -0
- package/dist/entries/social.cjs.map +1 -0
- package/dist/entries/social.d.cts +1366 -0
- package/dist/entries/social.d.ts +1366 -0
- package/dist/entries/social.js +5 -0
- package/dist/entries/social.js.map +1 -0
- package/dist/entries/types.cjs +13 -0
- package/dist/entries/types.cjs.map +1 -0
- package/dist/entries/types.d.cts +162 -0
- package/dist/entries/types.d.ts +162 -0
- package/dist/entries/types.js +4 -0
- package/dist/entries/types.js.map +1 -0
- package/dist/entries/ugc.cjs +279 -0
- package/dist/entries/ugc.cjs.map +1 -0
- package/dist/entries/ugc.d.cts +575 -0
- package/dist/entries/ugc.d.ts +575 -0
- package/dist/entries/ugc.js +6 -0
- package/dist/entries/ugc.js.map +1 -0
- package/dist/entries/video.cjs +549 -0
- package/dist/entries/video.cjs.map +1 -0
- package/dist/entries/video.d.cts +1791 -0
- package/dist/entries/video.d.ts +1791 -0
- package/dist/entries/video.js +8 -0
- package/dist/entries/video.js.map +1 -0
- package/dist/entries/workflow.cjs +574 -0
- package/dist/entries/workflow.cjs.map +1 -0
- package/dist/entries/workflow.d.cts +1733 -0
- package/dist/entries/workflow.d.ts +1733 -0
- package/dist/entries/workflow.js +5 -0
- package/dist/entries/workflow.js.map +1 -0
- package/dist/fan-out-meta-Bu6VyXcZ.d.cts +19 -0
- package/dist/fan-out-meta-Bu6VyXcZ.d.ts +19 -0
- package/dist/gemini-omni-voices-zeRXxSbZ.d.cts +174 -0
- package/dist/gemini-omni-voices-zeRXxSbZ.d.ts +174 -0
- package/dist/image-overlay-layers-CyBfRhxJ.d.cts +208 -0
- package/dist/image-overlay-layers-CyBfRhxJ.d.ts +208 -0
- package/dist/index.cjs +7731 -26444
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -23733
- package/dist/index.d.ts +32 -23733
- package/dist/index.js +40 -24641
- package/dist/index.js.map +1 -1
- package/dist/model-catalog-flJYaa-g.d.cts +561 -0
- package/dist/model-catalog-flJYaa-g.d.ts +561 -0
- package/dist/presentation-types-0ENOCjoj.d.cts +61 -0
- package/dist/presentation-types-0ENOCjoj.d.ts +61 -0
- package/dist/presentation-utils-BIqiCzSA.d.cts +90 -0
- package/dist/presentation-utils-BdiObtwq.d.ts +90 -0
- package/dist/scene-node-types-DjenYFLO.d.cts +1949 -0
- package/dist/scene-node-types-DjenYFLO.d.ts +1949 -0
- package/dist/supported-fonts-CRoF1gOy.d.cts +16 -0
- package/dist/supported-fonts-CRoF1gOy.d.ts +16 -0
- package/dist/types-BRlFPEru.d.cts +511 -0
- package/dist/types-BRlFPEru.d.ts +511 -0
- package/dist/types-DffyGSy5.d.cts +67 -0
- package/dist/types-DffyGSy5.d.ts +67 -0
- package/package.json +102 -1
- package/src/__tests__/add-captions-plan.test.ts +6 -2
- package/src/__tests__/caption-edge-dash.test.ts +23 -0
- package/src/__tests__/entity-image-handle.test.ts +61 -1
- package/src/__tests__/fixtures/root-exports.baseline.json +4625 -0
- package/src/__tests__/input-field-extra-keys.test.ts +1 -0
- package/src/__tests__/json-kinds.test.ts +10 -0
- package/src/__tests__/model-seed-capability.test.ts +34 -0
- package/src/__tests__/no-internal-imports.test.ts +1 -1
- package/src/__tests__/node-aspect-ratio.test.ts +25 -0
- package/src/__tests__/node-preset-extract.test.ts +8 -0
- package/src/__tests__/node-run-routes.test.ts +63 -0
- package/src/__tests__/node-runtime-keys.test.ts +70 -0
- package/src/__tests__/package-entries.test.ts +50 -0
- package/src/__tests__/pitch-tempo-pricing.test.ts +21 -0
- package/src/__tests__/presentation-utils.test.ts +14 -0
- package/src/__tests__/preview-gate-use-case.test.ts +151 -0
- package/src/__tests__/producer-types.test.ts +15 -0
- package/src/__tests__/run-continuation.test.ts +7 -1
- package/src/__tests__/seedance-draft.test.ts +74 -0
- package/src/__tests__/site-capture-node.test.ts +58 -0
- package/src/__tests__/ugc-clip-saved-list.test.ts +19 -0
- package/src/__tests__/ugc-lane-wires.test.ts +228 -0
- package/src/__tests__/ugc-node-wires.test.ts +606 -0
- package/src/__tests__/ugc-run-state.test.ts +85 -7
- package/src/__tests__/video-analysis-catalog-sync.test.ts +1 -1
- package/src/__tests__/video-analysis-pricing.test.ts +6 -6
- package/src/__tests__/voice-changer-pro-quote.test.ts +79 -0
- package/src/__tests__/workflow-export-strip.test.ts +14 -0
- package/src/add-captions-plan.ts +9 -3
- package/src/caption-edge-dash.ts +33 -0
- package/src/credit-estimators/index.ts +22 -1
- package/src/credit-estimators/pitch-tempo.ts +15 -1
- package/src/credit-estimators/speech.ts +72 -4
- package/src/credit-estimators/unit-quote.ts +52 -0
- package/src/credit-estimators/video-sfx.ts +15 -0
- package/src/credit-estimators/voice-changer-pro-quote.ts +138 -0
- package/src/entity-image-handle.ts +50 -1
- package/src/entries/apps.ts +63 -0
- package/src/entries/captions.ts +34 -0
- package/src/entries/catalogs.ts +65 -0
- package/src/entries/credits.ts +104 -0
- package/src/entries/edl.ts +42 -0
- package/src/entries/entities.ts +144 -0
- package/src/entries/i18n.ts +31 -0
- package/src/entries/llm-models.ts +63 -0
- package/src/entries/media.ts +36 -0
- package/src/entries/model-catalog.ts +89 -0
- package/src/entries/models.ts +266 -0
- package/src/entries/nodes.ts +245 -0
- package/src/entries/organizations.ts +9 -0
- package/src/entries/pipeline.ts +43 -0
- package/src/entries/scene3d.ts +27 -0
- package/src/entries/social.ts +297 -0
- package/src/entries/types.ts +26 -0
- package/src/entries/ugc.ts +14 -0
- package/src/entries/video.ts +59 -0
- package/src/entries/workflow.ts +172 -0
- package/src/fan-out-rows.ts +2 -0
- package/src/index.ts +25 -1838
- package/src/json-kinds.ts +13 -0
- package/src/model-catalog.ts +97 -36
- package/src/model-constants.ts +3 -0
- package/src/node-mappable-fields.ts +1 -0
- package/src/node-preset-export.ts +2 -2
- package/src/node-preset-extract.ts +6 -4
- package/src/node-run-routes.ts +78 -0
- package/src/node-runtime-keys.ts +50 -1
- package/src/normalize-node-params.ts +30 -0
- package/src/presentation-utils.ts +8 -0
- package/src/preview-gate.ts +92 -14
- package/src/producer-types.ts +26 -2
- package/src/run-continuation.ts +21 -0
- package/src/seedance-draft.ts +64 -0
- package/src/site-capture-node.ts +82 -0
- package/src/social-post.ts +13 -0
- package/src/ugc-lane-wires.ts +246 -0
- package/src/ugc-node-wires.ts +653 -0
- package/src/ugc-run-state.ts +65 -8
- package/src/video-analysis-pricing.ts +31 -29
- package/src/workflow-export.ts +3 -1
package/src/preview-gate.ts
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* The preview stop rule (Track A, decided 2026-10-04): a run stops at a
|
|
3
3
|
* Preview render, and nothing downstream of it runs until Render final.
|
|
4
4
|
*
|
|
5
|
-
* It starts at a render node (`PREVIEW_RENDER_NODE_TYPES`)
|
|
6
|
-
*
|
|
5
|
+
* It starts at a render node (`PREVIEW_RENDER_NODE_TYPES`), or at a use-case
|
|
6
|
+
* node with review on (`REVIEW_HOLDING_USE_CASE_TYPES`, whose own run ends at
|
|
7
|
+
* a Preview), in either of two cases:
|
|
7
8
|
* - the render EXECUTES in this run and its effective quality, after the
|
|
8
9
|
* run's input overrides (`withRunOverrides`), is `proxy`;
|
|
9
10
|
* - the render sits OUTSIDE the run and an item its saved output would hand
|
|
@@ -29,6 +30,19 @@ import { RENDER_NODE_TYPE_IDS } from "./render-nodes.js"
|
|
|
29
30
|
/** Render nodes a run can stop at: every render in the registry (SV18). */
|
|
30
31
|
export const PREVIEW_RENDER_NODE_TYPES: ReadonlySet<string> = new Set(RENDER_NODE_TYPE_IDS)
|
|
31
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Use-case nodes whose review-on run ends at a Preview of their own: what
|
|
35
|
+
* follows them waits for their Render final, exactly as after a render at
|
|
36
|
+
* Preview. They are not render nodes (`PREVIEW_RENDER_NODE_TYPES` stays the
|
|
37
|
+
* renders), so they join the hold here.
|
|
38
|
+
*/
|
|
39
|
+
export const REVIEW_HOLDING_USE_CASE_TYPES: ReadonlySet<string> = new Set(["tighten-episode"])
|
|
40
|
+
|
|
41
|
+
/** A node whose take can be a Preview that holds what follows it. */
|
|
42
|
+
export function isPreviewHoldingType(type: string | null | undefined): boolean {
|
|
43
|
+
return PREVIEW_RENDER_NODE_TYPES.has(type ?? "") || REVIEW_HOLDING_USE_CASE_TYPES.has(type ?? "")
|
|
44
|
+
}
|
|
45
|
+
|
|
32
46
|
/**
|
|
33
47
|
* Stable refusal code: a run with nobody to review it (a trigger, an API or
|
|
34
48
|
* MCP call, a present link, an app run) holds a Preview render. Set the
|
|
@@ -42,6 +56,33 @@ export const PREVIEW_REVIEW_REQUIRED = "preview_review_required"
|
|
|
42
56
|
*/
|
|
43
57
|
export const PREVIEW_RENDER_NESTED = "preview_render_nested"
|
|
44
58
|
|
|
59
|
+
/**
|
|
60
|
+
* The same two refusals when what holds the run is not (only) a render: a
|
|
61
|
+
* use-case node with "Review before render" on. `…_REVIEW_ON`: only such
|
|
62
|
+
* nodes hold it (turn their review off); `…_MIXED`: renders at Preview and
|
|
63
|
+
* such nodes both do. The two codes above stay what a render-held refusal
|
|
64
|
+
* (and every older one) carries. Branch on {@link isPreviewRefusalCode}, never
|
|
65
|
+
* on one code: all six mean "this run stops for a review nobody can give".
|
|
66
|
+
*/
|
|
67
|
+
export const PREVIEW_REVIEW_REQUIRED_REVIEW_ON = "preview_review_required_review_on"
|
|
68
|
+
export const PREVIEW_REVIEW_REQUIRED_MIXED = "preview_review_required_mixed"
|
|
69
|
+
export const PREVIEW_RENDER_NESTED_REVIEW_ON = "preview_render_nested_review_on"
|
|
70
|
+
export const PREVIEW_RENDER_NESTED_MIXED = "preview_render_nested_mixed"
|
|
71
|
+
|
|
72
|
+
const PREVIEW_REFUSAL_CODES: ReadonlySet<string> = new Set([
|
|
73
|
+
PREVIEW_REVIEW_REQUIRED,
|
|
74
|
+
PREVIEW_REVIEW_REQUIRED_REVIEW_ON,
|
|
75
|
+
PREVIEW_REVIEW_REQUIRED_MIXED,
|
|
76
|
+
PREVIEW_RENDER_NESTED,
|
|
77
|
+
PREVIEW_RENDER_NESTED_REVIEW_ON,
|
|
78
|
+
PREVIEW_RENDER_NESTED_MIXED,
|
|
79
|
+
])
|
|
80
|
+
|
|
81
|
+
/** Is `code` a preview refusal — a run that stops for a review nobody can give (any of the six codes)? */
|
|
82
|
+
export function isPreviewRefusalCode(code: unknown): boolean {
|
|
83
|
+
return typeof code === "string" && PREVIEW_REFUSAL_CODES.has(code)
|
|
84
|
+
}
|
|
85
|
+
|
|
45
86
|
/** A node as the stop rule reads it (either engine's graph, or a saved one). */
|
|
46
87
|
export interface PreviewGateNode {
|
|
47
88
|
readonly id: string
|
|
@@ -98,9 +139,10 @@ export interface PreviewGateRun {
|
|
|
98
139
|
}
|
|
99
140
|
|
|
100
141
|
export interface PreviewStops {
|
|
101
|
-
/** Render nodes that execute in this run at Preview quality. */
|
|
142
|
+
/** Render nodes that execute in this run at Preview quality (and review-on use-case nodes). */
|
|
102
143
|
readonly previewRenderIds: readonly string[]
|
|
103
|
-
/** Render nodes outside the run whose saved output hands a Preview on
|
|
144
|
+
/** Render nodes outside the run whose saved output hands a Preview on (and
|
|
145
|
+
* review-on use-case nodes whose saved take is a Preview, stamped `proxy`). */
|
|
104
146
|
readonly savedPreviewRenderIds: readonly string[]
|
|
105
147
|
/** Every node that would consume a preview: never executed in this run. */
|
|
106
148
|
readonly gatedNodeIds: ReadonlySet<string>
|
|
@@ -113,9 +155,21 @@ const dataOf = (n: PreviewGateNode): Data =>
|
|
|
113
155
|
|
|
114
156
|
const isPreviewStamp = (stamp: SavedRenderQualityStamp | null | undefined): boolean => stamp?.quality === "proxy"
|
|
115
157
|
|
|
116
|
-
/**
|
|
158
|
+
/**
|
|
159
|
+
* A node that renders a Preview in this run: a render node whose quality
|
|
160
|
+
* (after any run overrides) is `proxy`, or a use-case node with review on
|
|
161
|
+
* that does not run as its own Render final — the continuation a Render final
|
|
162
|
+
* sets on it for that run only (`useCaseContinue`, render-final, naming the
|
|
163
|
+
* run it finishes), which renders the final and releases what follows.
|
|
164
|
+
*/
|
|
117
165
|
export function rendersAsPreview(node: PreviewGateNode): boolean {
|
|
118
|
-
|
|
166
|
+
const data = dataOf(node)
|
|
167
|
+
if (REVIEW_HOLDING_USE_CASE_TYPES.has(node.type ?? "")) {
|
|
168
|
+
const cont = data.useCaseContinue as { mode?: unknown; jobId?: unknown } | null | undefined
|
|
169
|
+
const rendersFinal = cont?.mode === "render-final" && typeof cont.jobId === "string"
|
|
170
|
+
return data.reviewBeforeRender === true && !rendersFinal
|
|
171
|
+
}
|
|
172
|
+
return PREVIEW_RENDER_NODE_TYPES.has(node.type ?? "") && data.quality === "proxy"
|
|
119
173
|
}
|
|
120
174
|
|
|
121
175
|
const TELEPORT_TYPES: ReadonlySet<string> = new Set(["teleport-send", "teleport-receive"])
|
|
@@ -200,7 +254,7 @@ export function previewStops(
|
|
|
200
254
|
const savedPreviewRenderIds: string[] = []
|
|
201
255
|
const seeds: string[] = []
|
|
202
256
|
for (const n of nodes) {
|
|
203
|
-
if (!
|
|
257
|
+
if (!isPreviewHoldingType(n.type)) continue
|
|
204
258
|
const kids = children.get(n.id) ?? []
|
|
205
259
|
if (executes(n.id)) {
|
|
206
260
|
if (!rendersAsPreview(n)) continue
|
|
@@ -258,21 +312,45 @@ export const RUN_OVERRIDE_CLEARED_FIELDS = [
|
|
|
258
312
|
"generatedText",
|
|
259
313
|
] as const
|
|
260
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Node fields set for ONE run only, by that run's input override: a use-case
|
|
317
|
+
* node's continuation of an earlier run (`useCaseContinue` — a Render final, a
|
|
318
|
+
* Continue). Never saved (`TRANSIENT_RUNTIME_KEYS`); one found on a saved graph
|
|
319
|
+
* is stale, and every reader ignores it — the server's engine drops it before
|
|
320
|
+
* its override merge, and `withRunOverrides` before its own.
|
|
321
|
+
*/
|
|
322
|
+
export const RUN_ONLY_NODE_FIELDS = ["useCaseContinue"] as const
|
|
323
|
+
|
|
324
|
+
/** `data` without its saved run-only fields, or `data` itself when it holds none. */
|
|
325
|
+
function withoutRunOnlyFields(data: Data): Data {
|
|
326
|
+
if (!RUN_ONLY_NODE_FIELDS.some((key) => key in data)) return data
|
|
327
|
+
const kept: Record<string, unknown> = { ...data }
|
|
328
|
+
for (const key of RUN_ONLY_NODE_FIELDS) delete kept[key]
|
|
329
|
+
return kept
|
|
330
|
+
}
|
|
331
|
+
|
|
261
332
|
/**
|
|
262
333
|
* The graph a run executes once its input overrides (`{ [nodeId]: fields }`)
|
|
263
|
-
* are merged: the same
|
|
264
|
-
*
|
|
265
|
-
*
|
|
334
|
+
* are merged: the same merge as the server's — a node's saved run-only fields
|
|
335
|
+
* (`RUN_ONLY_NODE_FIELDS`) dropped first, so only THIS run's override can set
|
|
336
|
+
* one; then the shallow merge, clearing the overridden node's saved results.
|
|
337
|
+
* Never mutates; a node with no override and no saved run-only field is
|
|
338
|
+
* returned as is. Render final is a run with `{ [renderId]: { quality: "final" } }`.
|
|
339
|
+
*
|
|
340
|
+
* Apply it ONCE, to the saved graph: on a graph it already produced it would
|
|
341
|
+
* drop the continuation that run's override set. With no overrides it is the
|
|
342
|
+
* saved graph as a plain run reads it.
|
|
266
343
|
*/
|
|
267
344
|
export function withRunOverrides<N extends PreviewGateNode>(
|
|
268
345
|
nodes: readonly N[],
|
|
269
346
|
overrides: Readonly<Record<string, Readonly<Record<string, unknown>>>> | undefined,
|
|
270
347
|
): N[] {
|
|
271
|
-
if (!overrides) return [...nodes]
|
|
272
348
|
return nodes.map((n) => {
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
const
|
|
349
|
+
const saved = dataOf(n)
|
|
350
|
+
const data = withoutRunOnlyFields(saved)
|
|
351
|
+
const fields = overrides?.[n.id]
|
|
352
|
+
if (!fields) return data === saved ? n : { ...n, data }
|
|
353
|
+
const merged = mergeNodeInputOverrides(n.type ?? undefined, { ...data }, { ...fields })
|
|
276
354
|
for (const key of RUN_OVERRIDE_CLEARED_FIELDS) delete merged[key]
|
|
277
355
|
return { ...n, data: merged }
|
|
278
356
|
})
|
package/src/producer-types.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* a connection from a node type that the backend would happily route at
|
|
15
15
|
* execution time (the prior drift bug, see issue 1 of the Task 4.1 review).
|
|
16
16
|
*/
|
|
17
|
+
import { UGC_PRIMARY_HANDLE } from "./ugc-node-wires.js"
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Source node types whose primary output is a video URL.
|
|
@@ -104,6 +105,12 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
104
105
|
// Video Overlay: timed image layers over a video in one local FFmpeg pass
|
|
105
106
|
// (the base audio copied) — emits a video URL on `video-out`.
|
|
106
107
|
"video-overlay",
|
|
108
|
+
// UGC Clip: renders one clip of a UGC video from its ticket — emits a video
|
|
109
|
+
// URL on `video-out` (one per fan-out iteration).
|
|
110
|
+
"ugc-clip",
|
|
111
|
+
// UGC Finish: the video's clips, finished, as one ordered list — a registered producer, so a
|
|
112
|
+
// Bundle edge into Combine Videos routes each one as a video, in order.
|
|
113
|
+
"ugc-finish-clips",
|
|
107
114
|
])
|
|
108
115
|
|
|
109
116
|
/**
|
|
@@ -177,6 +184,9 @@ export const DYNAMIC_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
177
184
|
// voice-changer/dubbing precedent. Asserted in producer-types.test.ts (the
|
|
178
185
|
// suite does not fail on omission).
|
|
179
186
|
"apply-edl",
|
|
187
|
+
// Tighten Episode (podcast use-case node): the episode is video OR audio by
|
|
188
|
+
// its `output` setting (an audio recording forces audio) — runtime-decided.
|
|
189
|
+
"tighten-episode",
|
|
180
190
|
])
|
|
181
191
|
|
|
182
192
|
/**
|
|
@@ -312,6 +322,12 @@ export const FAN_OUT_EACH_HANDLES: Readonly<Record<string, { readonly each: read
|
|
|
312
322
|
// every clip (the master clock, renamed), so that handle stays one value
|
|
313
323
|
// (decided 2026-10-04).
|
|
314
324
|
"camera-switch": { each: ["edl"], primary: "edl" },
|
|
325
|
+
// UGC Clips: one ticket per clip on `clips` (each); `plan-out` and
|
|
326
|
+
// `transcript` carry one value. Not a FAN_OUT_EACH_TYPES member — every
|
|
327
|
+
// handle of such a member would fan out. Its one run writes the tickets as
|
|
328
|
+
// its list (`listResults`, the editor's `__listResults`). The pip an edge
|
|
329
|
+
// with no handle reads is the UGC wires' own (UGC_PRIMARY_HANDLE).
|
|
330
|
+
"ugc-clips": { each: ["clips"], primary: UGC_PRIMARY_HANDLE["ugc-clips"]! },
|
|
315
331
|
}
|
|
316
332
|
|
|
317
333
|
/**
|
|
@@ -325,12 +341,17 @@ export const FAN_OUT_ALL_OR_NOTHING_TYPES: ReadonlySet<string> = new Set(["ugc-c
|
|
|
325
341
|
/**
|
|
326
342
|
* Nodes whose saved list is the list their last run PRODUCED — `__listResults`
|
|
327
343
|
* (Extract Field's JSON value on `generatedJson`) — and never a history in
|
|
328
|
-
* `generatedResults`: Extract Field and
|
|
344
|
+
* `generatedResults`: Extract Field, JSON Process and Site Capture. No run of the first two writes
|
|
329
345
|
* one; earlier builds' server runs did (the run's text, the links of a list of
|
|
330
346
|
* links), and both engines' list readers leave it out for these two (decided
|
|
331
347
|
* 2026-10-05). Single source of truth for the backend engine and the editor.
|
|
332
348
|
*/
|
|
333
|
-
export const OWN_LIST_NODE_TYPES: ReadonlySet<string> = new Set([
|
|
349
|
+
export const OWN_LIST_NODE_TYPES: ReadonlySet<string> = new Set([
|
|
350
|
+
"extract-field",
|
|
351
|
+
"json-process",
|
|
352
|
+
// Site Capture: its stills, in page order — the last capture's, never every capture's (site-capture-node.ts).
|
|
353
|
+
"site-capture",
|
|
354
|
+
])
|
|
334
355
|
|
|
335
356
|
/** Whether a node's saved list is its own `__listResults`, never a history. */
|
|
336
357
|
export function ownsItsList(nodeType: string | null | undefined): boolean {
|
|
@@ -399,6 +420,9 @@ export const FAN_IN_TARGETS: Readonly<Record<string, "*" | readonly string[]>> =
|
|
|
399
420
|
// the union of the clips' spans — the pack's EDLs fold onto its `edl` wire
|
|
400
421
|
// instead of running one detection job (and one minimum charge) per clip.
|
|
401
422
|
"speaker-frames": ["edl"],
|
|
423
|
+
// UGC Finish: ONE run over every clip of the video, in clip order — the finish plans its
|
|
424
|
+
// cut and its sound over all of them at once, so it is never run once per clip.
|
|
425
|
+
"ugc-finish-clips": ["clips"],
|
|
402
426
|
}
|
|
403
427
|
|
|
404
428
|
export function isFanInNodeType(nodeType: string | undefined | null): boolean {
|
package/src/run-continuation.ts
CHANGED
|
@@ -27,6 +27,25 @@ export const CONTINUATION_NOT_COMPLETED = "continuation_not_completed"
|
|
|
27
27
|
* on the execution's output. */
|
|
28
28
|
export const CONTINUATION_SUBSET_REQUIRED = "continuation_subset_required"
|
|
29
29
|
|
|
30
|
+
/** A continue-from-failed run (use-case nodes) needs an execution that ended
|
|
31
|
+
* `failed`: a completed run has nothing to resume, a running one is not over. */
|
|
32
|
+
export const CONTINUATION_NOT_FAILED = "continuation_not_failed"
|
|
33
|
+
|
|
34
|
+
/** A continue-from-failed (use-case nodes) of a run a later continuation of
|
|
35
|
+
* it has superseded — that later one failed too: continue it instead. */
|
|
36
|
+
export const CONTINUATION_SUPERSEDED = "continuation_superseded"
|
|
37
|
+
|
|
38
|
+
/** A continue-from-failed (use-case nodes) of a failed run whose wrapper is not
|
|
39
|
+
* settled yet (its fee not yet refunded): ask again in a moment. A retry
|
|
40
|
+
* answer, not a refusal — outside `RUN_CONTINUATION_CODES`. */
|
|
41
|
+
export const CONTINUATION_SETTLING = "continuation_settling"
|
|
42
|
+
|
|
43
|
+
/** A Render final (use-case nodes) of a preview with the very edit a COMPLETED
|
|
44
|
+
* final of it already rendered (decided 2026-10-13): nothing would change, so
|
|
45
|
+
* nothing runs — the answer names that final. A changed edit renders again. */
|
|
46
|
+
export const RENDER_FINAL_ALREADY_RENDERED = "render_final_already_rendered"
|
|
47
|
+
export const RENDER_FINAL_ALREADY_RENDERED_MESSAGE = "Already rendered with this edit."
|
|
48
|
+
|
|
30
49
|
/** Every continuation refusal code. */
|
|
31
50
|
export const RUN_CONTINUATION_CODES = [
|
|
32
51
|
CONTINUATION_NOT_FOUND,
|
|
@@ -34,6 +53,8 @@ export const RUN_CONTINUATION_CODES = [
|
|
|
34
53
|
CONTINUATION_VERSION_MISMATCH,
|
|
35
54
|
CONTINUATION_NOT_COMPLETED,
|
|
36
55
|
CONTINUATION_SUBSET_REQUIRED,
|
|
56
|
+
CONTINUATION_NOT_FAILED,
|
|
57
|
+
CONTINUATION_SUPERSEDED,
|
|
37
58
|
] as const
|
|
38
59
|
|
|
39
60
|
export type RunContinuationCode = (typeof RUN_CONTINUATION_CODES)[number]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seedance 2.5 Draft mode — the single source of truth for which models offer a
|
|
3
|
+
* draft, what a draft renders at, and how its 1080p finalize is priced.
|
|
4
|
+
*
|
|
5
|
+
* A DRAFT is an ordinary Seedance 2.5 run with the provider's draft flag set: it
|
|
6
|
+
* renders at 480p only and costs exactly what a normal 480p run of the same
|
|
7
|
+
* shape costs. The FINALIZE ("Seedance 2.5 HD (from draft)", a Video Upscale
|
|
8
|
+
* provider) re-renders that same take — same seed, prompt, references and
|
|
9
|
+
* timing — at 1080p, frame for frame, at the draft's own length. Nothing
|
|
10
|
+
* creative is re-sent: the finalize names the draft's provider task and nothing
|
|
11
|
+
* else.
|
|
12
|
+
*
|
|
13
|
+
* Every surface (generation routes, the workflow engine, MCP, the editor's
|
|
14
|
+
* toggle) gates on {@link isSeedanceDraftCapable}; never hand-list the model.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Models that accept the draft flag. */
|
|
18
|
+
export const SEEDANCE_DRAFT_MODELS = ["seedance-2-5"] as const
|
|
19
|
+
export type SeedanceDraftModel = typeof SEEDANCE_DRAFT_MODELS[number]
|
|
20
|
+
|
|
21
|
+
export function isSeedanceDraftCapable(provider: string | undefined): provider is SeedanceDraftModel {
|
|
22
|
+
return !!provider && (SEEDANCE_DRAFT_MODELS as readonly string[]).includes(provider)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The only resolution a draft renders at. Any other value is coerced to it. */
|
|
26
|
+
export const SEEDANCE_DRAFT_RESOLUTION = "480p"
|
|
27
|
+
|
|
28
|
+
/** The Video Upscale provider that finalizes a draft. */
|
|
29
|
+
export const SEEDANCE_DRAFT_FINALIZE_PROVIDER = "seedance-2-5-hd"
|
|
30
|
+
|
|
31
|
+
/** The only resolution a finalize renders at. */
|
|
32
|
+
export const SEEDANCE_DRAFT_FINALIZE_RESOLUTION = "1080p"
|
|
33
|
+
|
|
34
|
+
/** Shortest / longest output the finalize price ladder is seeded for. */
|
|
35
|
+
export const SEEDANCE_DRAFT_FINALIZE_MIN_SEC = 4
|
|
36
|
+
export const SEEDANCE_DRAFT_FINALIZE_MAX_SEC = 30
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Whole seconds the finalize bills for a measured draft length.
|
|
40
|
+
*
|
|
41
|
+
* A container reports a hair over the nominal length (4.04 s for a 4 s clip), so
|
|
42
|
+
* the seconds round UP only past a quarter second — the same rule the Seedance
|
|
43
|
+
* auto-duration settlement uses — and land on the seeded ladder (4–30 s).
|
|
44
|
+
*/
|
|
45
|
+
export function seedanceDraftFinalizeBillableSec(measuredSec: number): number {
|
|
46
|
+
const whole = Math.max(1, Math.ceil(measuredSec - 0.25))
|
|
47
|
+
return Math.min(SEEDANCE_DRAFT_FINALIZE_MAX_SEC, Math.max(SEEDANCE_DRAFT_FINALIZE_MIN_SEC, whole))
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The credit identifier a finalize reserves under.
|
|
52
|
+
*
|
|
53
|
+
* Same encoding as the Seedance 2.5 generation ladder: one row per OUTPUT second
|
|
54
|
+
* (`seedance-2-5-hd:{N}s`), and a `-ref` twin for a draft that had a reference
|
|
55
|
+
* VIDEO. As on the generation lane, the `-ref` row encodes the per-second rate
|
|
56
|
+
* only; a reference run bills `rate × (input + output)` seconds, which the
|
|
57
|
+
* reservation computes from the 8 s `-ref` row (see the backend's
|
|
58
|
+
* `seedanceDraftFinalizeRefBaseCredits`). Reference IMAGES do not change the
|
|
59
|
+
* rate — only a reference video does.
|
|
60
|
+
*/
|
|
61
|
+
export function seedanceDraftFinalizeCreditId(durationSec: number, hasRefVideo: boolean): string {
|
|
62
|
+
const n = seedanceDraftFinalizeBillableSec(durationSec)
|
|
63
|
+
return `${SEEDANCE_DRAFT_FINALIZE_PROVIDER}:${n}s${hasRefVideo ? "-ref" : ""}`
|
|
64
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site Capture node — the wire contract both engines read.
|
|
3
|
+
*
|
|
4
|
+
* The node runs `POST /v1/site-capture` (a web page captured the way a phone
|
|
5
|
+
* shows it: a full-page image, up to 8 section stills in page order, a section
|
|
6
|
+
* map and the page's exact figures) and polls its job. What it hands on is read
|
|
7
|
+
* from that job's output here, once, so the editor and a server run cannot
|
|
8
|
+
* disagree:
|
|
9
|
+
* - `image`: the stills, in page order. The first still is the pip's single
|
|
10
|
+
* value; every still is its list (an "each" wire runs once per still, a
|
|
11
|
+
* Bundle wire takes them all). The full-page image is never one of them.
|
|
12
|
+
* - `json`: the capture's output as the route returns it.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export const SITE_CAPTURE_NODE_TYPE = "site-capture" as const
|
|
16
|
+
|
|
17
|
+
/** The stills a capture may return — the route's `maxStills` bounds. */
|
|
18
|
+
export const SITE_CAPTURE_STILLS = { min: 3, max: 8, default: 8 } as const
|
|
19
|
+
|
|
20
|
+
/** A node's `maxStills`, clamped to the route's bounds; anything else is the default. */
|
|
21
|
+
export function siteCaptureMaxStills(value: unknown): number {
|
|
22
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return SITE_CAPTURE_STILLS.default
|
|
23
|
+
return Math.min(SITE_CAPTURE_STILLS.max, Math.max(SITE_CAPTURE_STILLS.min, Math.round(value)))
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The page a run captures: the address typed on the node, else the first web
|
|
28
|
+
* address in the text wired into it (a Text node, a list item), else that
|
|
29
|
+
* text's first word, which the route normalises ("example.com") or refuses.
|
|
30
|
+
*/
|
|
31
|
+
export function siteCapturePageUrl(typed: unknown, upstream?: string | null): string {
|
|
32
|
+
const own = typeof typed === "string" ? typed.trim() : ""
|
|
33
|
+
if (own.length > 0) return own
|
|
34
|
+
const text = typeof upstream === "string" ? upstream.trim() : ""
|
|
35
|
+
if (text.length === 0) return ""
|
|
36
|
+
const link = text.match(/https?:\/\/[^\s<>"'`]+/i)
|
|
37
|
+
if (link) return link[0].replace(/[),.;:!?]+$/, "")
|
|
38
|
+
return text.split(/\s+/)[0] ?? ""
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** One still of a capture, as its output lists it. */
|
|
42
|
+
export interface SiteCaptureStill {
|
|
43
|
+
readonly url: string
|
|
44
|
+
readonly index: number
|
|
45
|
+
readonly label: string
|
|
46
|
+
readonly category: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The stills of a capture's output, in page order; none when it holds none. */
|
|
50
|
+
export function siteCaptureStills(output: unknown): SiteCaptureStill[] {
|
|
51
|
+
if (!output || typeof output !== "object" || Array.isArray(output)) return []
|
|
52
|
+
const raw = (output as { stills?: unknown }).stills
|
|
53
|
+
if (!Array.isArray(raw)) return []
|
|
54
|
+
return raw
|
|
55
|
+
.filter((s): s is Record<string, unknown> => !!s && typeof s === "object" && typeof (s as { url?: unknown }).url === "string" && (s as { url: string }).url.length > 0)
|
|
56
|
+
.map((s, i) => ({
|
|
57
|
+
url: s.url as string,
|
|
58
|
+
index: typeof s.index === "number" ? s.index : i,
|
|
59
|
+
label: typeof s.label === "string" ? s.label : "",
|
|
60
|
+
category: typeof s.category === "string" ? s.category : "other",
|
|
61
|
+
}))
|
|
62
|
+
.sort((a, b) => a.index - b.index)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The still URLs of a capture's output, in page order. */
|
|
66
|
+
export function siteCaptureStillUrls(output: unknown): string[] {
|
|
67
|
+
return siteCaptureStills(output).map((s) => s.url)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* What a capture hands on: `json` (the output itself), `imageUrl` (the first
|
|
72
|
+
* still) and `listResults` (every still, in page order). Nothing for an output
|
|
73
|
+
* that is not an object.
|
|
74
|
+
*/
|
|
75
|
+
export function siteCaptureNodeOutputs(output: unknown): { json?: Record<string, unknown>; imageUrl?: string; listResults?: string[] } {
|
|
76
|
+
if (!output || typeof output !== "object" || Array.isArray(output)) return {}
|
|
77
|
+
const urls = siteCaptureStillUrls(output)
|
|
78
|
+
return {
|
|
79
|
+
json: output as Record<string, unknown>,
|
|
80
|
+
...(urls.length > 0 ? { imageUrl: urls[0], listResults: urls } : {}),
|
|
81
|
+
}
|
|
82
|
+
}
|
package/src/social-post.ts
CHANGED
|
@@ -22,6 +22,19 @@ export const SOCIAL_POST_NODE_TYPES = new Set([
|
|
|
22
22
|
"publish-social",
|
|
23
23
|
])
|
|
24
24
|
|
|
25
|
+
/** The platform each per-platform social post node publishes to. The unified
|
|
26
|
+
* `publish-social` node is absent on purpose: its platform comes from the
|
|
27
|
+
* chosen connection (`data.platform`). */
|
|
28
|
+
export const SOCIAL_POST_NODE_PLATFORM: Readonly<Record<string, string>> = Object.freeze({
|
|
29
|
+
"instagram-post": "instagram",
|
|
30
|
+
"tiktok-post": "tiktok",
|
|
31
|
+
"youtube-upload": "youtube",
|
|
32
|
+
"linkedin-post": "linkedin",
|
|
33
|
+
"x-post": "x",
|
|
34
|
+
"facebook-post": "facebook",
|
|
35
|
+
"telegram-post": "telegram",
|
|
36
|
+
})
|
|
37
|
+
|
|
25
38
|
/** Instagram carousel limits per Meta Graph API.
|
|
26
39
|
* Meta's documented limit is 10 items; sending >10 fails at container
|
|
27
40
|
* creation with "(#100) too little or too many attachments". */
|