@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.
- package/README.md +17 -0
- package/dist/chunk-23FJQTEA.js +1604 -0
- package/dist/chunk-23FJQTEA.js.map +1 -0
- package/dist/chunk-2NIQO2J3.cjs +54 -0
- package/dist/chunk-2NIQO2J3.cjs.map +1 -0
- package/dist/chunk-2NQLSLSN.cjs +19 -0
- package/dist/chunk-2NQLSLSN.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-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-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-5RYLK3MQ.js +267 -0
- package/dist/chunk-5RYLK3MQ.js.map +1 -0
- package/dist/chunk-5THUHJ3E.js +46 -0
- package/dist/chunk-5THUHJ3E.js.map +1 -0
- package/dist/chunk-6DAWSVX2.cjs +103 -0
- package/dist/chunk-6DAWSVX2.cjs.map +1 -0
- package/dist/chunk-6WZ2VN7V.js +920 -0
- package/dist/chunk-6WZ2VN7V.js.map +1 -0
- package/dist/chunk-7G7G42KS.js +86 -0
- package/dist/chunk-7G7G42KS.js.map +1 -0
- package/dist/chunk-7Z5LUTGU.js +1567 -0
- package/dist/chunk-7Z5LUTGU.js.map +1 -0
- package/dist/chunk-AINCI23X.js +2171 -0
- package/dist/chunk-AINCI23X.js.map +1 -0
- package/dist/chunk-BG5D5CZ6.js +1922 -0
- package/dist/chunk-BG5D5CZ6.js.map +1 -0
- package/dist/chunk-CK3GK34R.js +1381 -0
- package/dist/chunk-CK3GK34R.js.map +1 -0
- package/dist/chunk-CUH22J4D.js +17 -0
- package/dist/chunk-CUH22J4D.js.map +1 -0
- package/dist/chunk-D26ENTN2.cjs +1770 -0
- package/dist/chunk-D26ENTN2.cjs.map +1 -0
- package/dist/chunk-D6GNRSCV.cjs +2017 -0
- package/dist/chunk-D6GNRSCV.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-FT5CF6IA.js +42 -0
- package/dist/chunk-FT5CF6IA.js.map +1 -0
- package/dist/chunk-G6IIVKMO.js +26 -0
- package/dist/chunk-G6IIVKMO.js.map +1 -0
- package/dist/chunk-HC7VKIV5.cjs +430 -0
- package/dist/chunk-HC7VKIV5.cjs.map +1 -0
- package/dist/chunk-HGC5JNVA.cjs +1503 -0
- package/dist/chunk-HGC5JNVA.cjs.map +1 -0
- package/dist/chunk-HKFMXNVQ.cjs +1273 -0
- package/dist/chunk-HKFMXNVQ.cjs.map +1 -0
- package/dist/chunk-HRXEZ3SX.cjs +526 -0
- package/dist/chunk-HRXEZ3SX.cjs.map +1 -0
- package/dist/chunk-HSHCCBIV.js +255 -0
- package/dist/chunk-HSHCCBIV.js.map +1 -0
- package/dist/chunk-HUR6ZJ7S.cjs +159 -0
- package/dist/chunk-HUR6ZJ7S.cjs.map +1 -0
- package/dist/chunk-J7BMO73N.cjs +114 -0
- package/dist/chunk-J7BMO73N.cjs.map +1 -0
- package/dist/chunk-JFS3NWZ5.cjs +1714 -0
- package/dist/chunk-JFS3NWZ5.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-JWA5SGCS.js +203 -0
- package/dist/chunk-JWA5SGCS.js.map +1 -0
- package/dist/chunk-K3LLGRK7.cjs +3545 -0
- package/dist/chunk-K3LLGRK7.cjs.map +1 -0
- package/dist/chunk-KU6S7IYV.cjs +210 -0
- package/dist/chunk-KU6S7IYV.cjs.map +1 -0
- package/dist/chunk-M36G6SRP.js +447 -0
- package/dist/chunk-M36G6SRP.js.map +1 -0
- package/dist/chunk-M7GQBRZU.cjs +1963 -0
- package/dist/chunk-M7GQBRZU.cjs.map +1 -0
- package/dist/chunk-MRXGWL42.cjs +4 -0
- package/dist/chunk-MRXGWL42.cjs.map +1 -0
- package/dist/chunk-NEJ2PV4C.cjs +211 -0
- package/dist/chunk-NEJ2PV4C.cjs.map +1 -0
- package/dist/chunk-OTATNBMD.js +141 -0
- package/dist/chunk-OTATNBMD.js.map +1 -0
- package/dist/chunk-OZSACQ2V.js +471 -0
- package/dist/chunk-OZSACQ2V.js.map +1 -0
- package/dist/chunk-PHZ23DP3.js +1782 -0
- package/dist/chunk-PHZ23DP3.js.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-PVJBAPYJ.js +404 -0
- package/dist/chunk-PVJBAPYJ.js.map +1 -0
- package/dist/chunk-PXFQVLBX.js +776 -0
- package/dist/chunk-PXFQVLBX.js.map +1 -0
- package/dist/chunk-QA3MVQ32.js +21 -0
- package/dist/chunk-QA3MVQ32.js.map +1 -0
- package/dist/chunk-QJRP44ZO.js +769 -0
- package/dist/chunk-QJRP44ZO.js.map +1 -0
- package/dist/chunk-SAW5OK36.cjs +54 -0
- package/dist/chunk-SAW5OK36.cjs.map +1 -0
- package/dist/chunk-SES6GDBQ.cjs +624 -0
- package/dist/chunk-SES6GDBQ.cjs.map +1 -0
- package/dist/chunk-SFW3UB2P.js +31 -0
- package/dist/chunk-SFW3UB2P.js.map +1 -0
- package/dist/chunk-TNPDV7I4.cjs +2346 -0
- package/dist/chunk-TNPDV7I4.cjs.map +1 -0
- package/dist/chunk-TU33KYKW.cjs +25 -0
- package/dist/chunk-TU33KYKW.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-UCFWI6D4.js +29 -0
- package/dist/chunk-UCFWI6D4.js.map +1 -0
- package/dist/chunk-UTQSSKSG.js +1164 -0
- package/dist/chunk-UTQSSKSG.js.map +1 -0
- package/dist/chunk-VA42637J.cjs +287 -0
- package/dist/chunk-VA42637J.cjs.map +1 -0
- package/dist/chunk-VNQRI2RO.cjs +1047 -0
- package/dist/chunk-VNQRI2RO.cjs.map +1 -0
- package/dist/chunk-VXPLKQWY.cjs +821 -0
- package/dist/chunk-VXPLKQWY.cjs.map +1 -0
- package/dist/chunk-WD6HJRBG.cjs +197 -0
- package/dist/chunk-WD6HJRBG.cjs.map +1 -0
- package/dist/chunk-WDIBOWAA.js +1054 -0
- package/dist/chunk-WDIBOWAA.js.map +1 -0
- package/dist/chunk-WKOIGLQX.cjs +38 -0
- package/dist/chunk-WKOIGLQX.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-XGFTL5XY.js +181 -0
- package/dist/chunk-XGFTL5XY.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-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-ZDFHA2EC.js +572 -0
- package/dist/chunk-ZDFHA2EC.js.map +1 -0
- package/dist/chunk-ZL7UM6PU.cjs +34 -0
- package/dist/chunk-ZL7UM6PU.cjs.map +1 -0
- package/dist/chunk-ZNZDQAXN.js +175 -0
- package/dist/chunk-ZNZDQAXN.js.map +1 -0
- package/dist/chunk-ZO5PBBFX.js +3497 -0
- package/dist/chunk-ZO5PBBFX.js.map +1 -0
- package/dist/chunk-ZRL2UFTH.cjs +1073 -0
- package/dist/chunk-ZRL2UFTH.cjs.map +1 -0
- package/dist/entries/apps.cjs +155 -0
- package/dist/entries/apps.cjs.map +1 -0
- package/dist/entries/apps.d.cts +292 -0
- package/dist/entries/apps.d.ts +292 -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 +596 -0
- package/dist/entries/credits.cjs.map +1 -0
- package/dist/entries/credits.d.cts +1460 -0
- package/dist/entries/credits.d.ts +1460 -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 +259 -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 +1743 -0
- package/dist/entries/workflow.d.ts +1743 -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 +7747 -27084
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -24198
- package/dist/index.d.ts +32 -24198
- package/dist/index.js +40 -25220
- package/dist/index.js.map +1 -1
- package/dist/model-catalog-V-ZNzRSd.d.cts +651 -0
- package/dist/model-catalog-V-ZNzRSd.d.ts +651 -0
- package/dist/presentation-types-0ENOCjoj.d.cts +61 -0
- package/dist/presentation-types-0ENOCjoj.d.ts +61 -0
- package/dist/presentation-utils-D0kxsWf9.d.cts +92 -0
- package/dist/presentation-utils-pZwlEAzo.d.ts +92 -0
- package/dist/scene-node-types-C3kl_zyK.d.cts +1949 -0
- package/dist/scene-node-types-C3kl_zyK.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__/fixtures/root-exports.baseline.json +4625 -0
- package/src/__tests__/input-field-extra-keys.test.ts +1 -0
- package/src/__tests__/model-makers.test.ts +76 -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-runtime-keys.test.ts +9 -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 +15 -0
- package/src/__tests__/preview-gate-use-case.test.ts +151 -0
- package/src/__tests__/private-host.test.ts +53 -0
- package/src/__tests__/run-continuation.test.ts +7 -1
- package/src/__tests__/site-capture-node.test.ts +58 -0
- package/src/__tests__/ugc-lane-wires.test.ts +228 -0
- package/src/__tests__/ugc-node-wires.test.ts +9 -3
- package/src/__tests__/ugc-run-state.test.ts +5 -4
- 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/add-captions-plan.ts +9 -3
- package/src/caption-edge-dash.ts +33 -0
- package/src/component-types.ts +9 -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/credit-identifiers.ts +62 -17
- package/src/entity-image-handle.ts +2 -0
- 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 +105 -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 +95 -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 -1845
- package/src/json-kinds.ts +4 -0
- package/src/model-catalog.ts +243 -34
- package/src/node-mappable-fields.ts +1 -0
- package/src/node-run-routes.ts +2 -0
- package/src/node-runtime-keys.ts +8 -0
- package/src/normalize-node-params.ts +30 -0
- package/src/presentation-utils.ts +12 -0
- package/src/preview-gate.ts +92 -14
- package/src/private-host.ts +89 -59
- package/src/producer-types.ts +16 -2
- package/src/run-continuation.ts +21 -0
- package/src/site-capture-node.ts +82 -0
- package/src/ugc-lane-wires.ts +246 -0
- package/src/ugc-node-wires.ts +37 -7
- package/src/ugc-run-state.ts +5 -3
- package/src/video-analysis-pricing.ts +31 -29
|
@@ -85,6 +85,7 @@ export const NODE_MAPPABLE_FIELDS: Readonly<Record<string, readonly string[]>> =
|
|
|
85
85
|
"creature": ["creatureName", "description"],
|
|
86
86
|
"location": ["locationName", "description"],
|
|
87
87
|
"web-scrape": ["query", "url", "target"],
|
|
88
|
+
"site-capture": ["url"],
|
|
88
89
|
"meta-ads-scrape": ["query", "pageUrls"],
|
|
89
90
|
"instagram-scrape": ["targets"],
|
|
90
91
|
// Content Recipe's material arrives on its `in` wire and the post link on
|
package/src/node-run-routes.ts
CHANGED
|
@@ -43,6 +43,8 @@ export const NODE_RUN_ROUTES: Readonly<Record<string, string>> = Object.freeze({
|
|
|
43
43
|
"ugc-clips": "/v1/ugc/clips",
|
|
44
44
|
"ugc-clip": "/v1/ugc/clip",
|
|
45
45
|
"ugc-cards": "/v1/ugc/cards",
|
|
46
|
+
// UGC Finish: the finish job over a speech-first video's clips (an English video passes through with no call).
|
|
47
|
+
"ugc-finish-clips": "/v1/ugc/finish",
|
|
46
48
|
// Every social post node publishes through the one route; the body's
|
|
47
49
|
// `platform` says where (SOCIAL_POST_NODE_PLATFORM).
|
|
48
50
|
...Object.fromEntries([...SOCIAL_POST_NODE_TYPES].map((type) => [type, SOCIAL_PUBLISH_ROUTE])),
|
package/src/node-runtime-keys.ts
CHANGED
|
@@ -155,6 +155,12 @@ export const EXECUTION_DATA_KEYS: ReadonlySet<string> = new Set([
|
|
|
155
155
|
// A fan-out's notes rows, every fan-out's (row-aligned with __listResults):
|
|
156
156
|
// a row's warnings and length. A RESULT: persisted.
|
|
157
157
|
"__listResultMeta",
|
|
158
|
+
// A use-case node's continuation of one of its runs (Tighten Episode): set
|
|
159
|
+
// for ONE run only, as that run's input override (an app's or the editor's
|
|
160
|
+
// Render final, the canvas Continue's run option). Never saved — also in
|
|
161
|
+
// TRANSIENT_RUNTIME_KEYS — so a saved one can never turn a later plain run
|
|
162
|
+
// into a continuation of an old run.
|
|
163
|
+
"useCaseContinue",
|
|
158
164
|
])
|
|
159
165
|
|
|
160
166
|
/**
|
|
@@ -236,6 +242,8 @@ export const TRANSIENT_RUNTIME_KEYS: ReadonlySet<string> = new Set([
|
|
|
236
242
|
// body, a Telegram message and its post). Never saved: the workflow is not
|
|
237
243
|
// where a message's content is kept — runs are, under their retention.
|
|
238
244
|
"__triggerData",
|
|
245
|
+
// A use-case node's continuation: one run's override, never config (above).
|
|
246
|
+
"useCaseContinue",
|
|
239
247
|
])
|
|
240
248
|
|
|
241
249
|
/**
|
|
@@ -74,6 +74,36 @@ export const AUTO_ASPECT_AT_RUN_NODE_TYPES: ReadonlySet<string> = new Set([
|
|
|
74
74
|
"generate-image",
|
|
75
75
|
])
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* The image nodes whose aspect-ratio dropdown leads with the photo "Auto" tile
|
|
79
|
+
* (Generate Image and Modify Image: `withPhotoAuto` in the editor). On these an
|
|
80
|
+
* UNSET ratio IS Auto — the dropdown shows Auto for it, and both engines send
|
|
81
|
+
* "auto" for it — so what the editor shows is what the run asks for.
|
|
82
|
+
*
|
|
83
|
+
* It used to send nothing, which handed the ratio to the provider's own
|
|
84
|
+
* default (16:9 on nearly every model) while the panel displayed "Auto" or the
|
|
85
|
+
* model's first listed ratio: a 3:4 photo through Modify Image came back 16:9
|
|
86
|
+
* (#2009). "auto" then resolves exactly as a chosen Auto does — natively on a
|
|
87
|
+
* model that lists it, else to the model's ratio nearest the photo, else (no
|
|
88
|
+
* photo) the model's first listed ratio.
|
|
89
|
+
*/
|
|
90
|
+
export const PHOTO_AUTO_ASPECT_NODE_TYPES: ReadonlySet<string> = new Set([
|
|
91
|
+
"generate-image",
|
|
92
|
+
"modify-image",
|
|
93
|
+
])
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The aspect ratio a node asks for: its stored value, or "auto" when it is
|
|
97
|
+
* unset on a photo-Auto node (`PHOTO_AUTO_ASPECT_NODE_TYPES`). Every other node
|
|
98
|
+
* type gets its value back unchanged (undefined stays undefined).
|
|
99
|
+
*/
|
|
100
|
+
export function nodeAspectRatio(nodeType: "generate-image" | "modify-image", aspectRatio: unknown): string
|
|
101
|
+
export function nodeAspectRatio(nodeType: string | undefined, aspectRatio: unknown): string | undefined
|
|
102
|
+
export function nodeAspectRatio(nodeType: string | undefined, aspectRatio: unknown): string | undefined {
|
|
103
|
+
if (typeof aspectRatio === "string" && aspectRatio.trim() !== "") return aspectRatio
|
|
104
|
+
return nodeType !== undefined && PHOTO_AUTO_ASPECT_NODE_TYPES.has(nodeType) ? "auto" : undefined
|
|
105
|
+
}
|
|
106
|
+
|
|
77
107
|
export interface NodeParamAdjustment extends ModelInputAdjustment {
|
|
78
108
|
nodeId: string
|
|
79
109
|
provider: string
|
|
@@ -158,6 +158,9 @@ const VIDEO_OUTPUT_TYPES = new Set([
|
|
|
158
158
|
// audio-only cut still plays in a video element). Asserted in
|
|
159
159
|
// producer-types.test.ts.
|
|
160
160
|
...RENDER_NODE_TYPE_IDS,
|
|
161
|
+
// Tighten Episode: a published app shows the episode as media, never as data
|
|
162
|
+
// (it is not a render, so RENDER_NODE_TYPE_IDS does not bring it).
|
|
163
|
+
"tighten-episode",
|
|
161
164
|
])
|
|
162
165
|
|
|
163
166
|
const AUDIO_OUTPUT_TYPES = new Set([
|
|
@@ -415,6 +418,8 @@ export const INPUT_FIELD_MAP: Record<string, InputFieldSchema> = {
|
|
|
415
418
|
*/
|
|
416
419
|
export const INPUT_FIELD_EXTRA_KEYS: Readonly<Record<string, readonly InputFieldSchema[]>> = {
|
|
417
420
|
"ugc-creator": [{ key: "gender", type: "select" }, { key: "photoUrl", type: "image-url" }],
|
|
421
|
+
// The script's language: changes together with UGC_OVERRIDABLE_FIELDS["ugc-script"] and UgcScriptData.language.
|
|
422
|
+
"ugc-script": [{ key: "language", type: "select" }],
|
|
418
423
|
}
|
|
419
424
|
|
|
420
425
|
/** The extra override fields of a node type (none for most types). */
|
|
@@ -452,6 +457,8 @@ const MEDIA_INPUT_FIELD_TYPES: ReadonlySet<InputFieldSchema["type"]> = new Set([
|
|
|
452
457
|
*
|
|
453
458
|
* An override sent under a renamed exposed-field key (an app published before
|
|
454
459
|
* the rename) lands on the node's current field — `canonicalizeOverrideKeys`.
|
|
460
|
+
*
|
|
461
|
+
* An override of `null` clears the field: the merged node has no such key.
|
|
455
462
|
*/
|
|
456
463
|
export function mergeNodeInputOverrides(
|
|
457
464
|
nodeType: string | undefined,
|
|
@@ -462,6 +469,11 @@ export function mergeNodeInputOverrides(
|
|
|
462
469
|
// A Video URL node on a new link sheds what was fetched for the old one.
|
|
463
470
|
const base = nodeType === "youtube-video" ? dropStaleVideoLinkFields(data, incoming) : data
|
|
464
471
|
const merged: Record<string, unknown> = { ...base, ...incoming }
|
|
472
|
+
// A null override CLEARS the field: the run has no value there, neither null nor the saved one. JSON cannot
|
|
473
|
+
// carry `undefined`, so this is how a run says "unset" (an app card clearing a lever the chosen model lacks).
|
|
474
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
475
|
+
if (value === null) delete merged[key]
|
|
476
|
+
}
|
|
465
477
|
const schema = nodeType ? INPUT_FIELD_MAP[nodeType] : undefined
|
|
466
478
|
if (
|
|
467
479
|
schema &&
|
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/private-host.ts
CHANGED
|
@@ -8,74 +8,104 @@
|
|
|
8
8
|
* Literal hosts only. A name that RESOLVES to a private address is caught where
|
|
9
9
|
* the connection is made (`safeFetch` re-validates the resolved IP); nothing
|
|
10
10
|
* here does DNS.
|
|
11
|
+
*
|
|
12
|
+
* The documentation blocks (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24,
|
|
13
|
+
* 2001:db8::/32) are deliberately NOT refused: no network routes them, so they
|
|
14
|
+
* are no SSRF target, and this same rule decides which client addresses the
|
|
15
|
+
* server trusts and keys rate limits on (client-address.ts, hosting-ranges.ts),
|
|
16
|
+
* where they stand in for public addresses.
|
|
11
17
|
*/
|
|
12
18
|
|
|
19
|
+
function isPrivateOrReservedIPv4(a: number, b: number, c: number): boolean {
|
|
20
|
+
if (a === 0) return true // 0.0.0.0/8 "this network"
|
|
21
|
+
if (a === 127) return true // 127.0.0.0/8 loopback
|
|
22
|
+
if (a === 10) return true // 10.0.0.0/8 private
|
|
23
|
+
if (a === 172 && b >= 16 && b <= 31) return true // 172.16.0.0/12 private
|
|
24
|
+
if (a === 192 && b === 168) return true // 192.168.0.0/16 private
|
|
25
|
+
if (a === 169 && b === 254) return true // 169.254.0.0/16 link-local + AWS/GCP metadata
|
|
26
|
+
if (a === 100 && b >= 64 && b <= 127) return true // 100.64.0.0/10 CGN
|
|
27
|
+
if (a === 198 && (b === 18 || b === 19)) return true // 198.18.0.0/15 benchmarking
|
|
28
|
+
if (a === 192 && b === 0 && c === 0) return true // 192.0.0.0/24 IETF protocol assignments (DS-Lite, NAT64 discovery)
|
|
29
|
+
if (a >= 224) return true // 224.0.0.0/4 multicast + 240.0.0.0/4 reserved + 255.255.255.255
|
|
30
|
+
return false
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The IPv4 address carried in two 16-bit groups. */
|
|
34
|
+
function embeddedIPv4IsPrivate(hi: number, lo: number): boolean {
|
|
35
|
+
return isPrivateOrReservedIPv4(hi >> 8, hi & 0xff, lo >> 8)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The eight 16-bit groups of an IPv6 address, or null when `ip` is not one.
|
|
40
|
+
* Reads `::` compression, a dotted IPv4 tail (`::ffff:127.0.0.1`) and a zone
|
|
41
|
+
* suffix (`fe80::1%eth0`).
|
|
42
|
+
*/
|
|
43
|
+
function ipv6Groups(ip: string): number[] | null {
|
|
44
|
+
let text = ip.toLowerCase()
|
|
45
|
+
const zone = text.indexOf("%")
|
|
46
|
+
if (zone >= 0) text = text.slice(0, zone)
|
|
47
|
+
if (!text.includes(":") || !/^[0-9a-f:.]+$/.test(text)) return null
|
|
48
|
+
|
|
49
|
+
const lastColon = text.lastIndexOf(":")
|
|
50
|
+
const last = text.slice(lastColon + 1)
|
|
51
|
+
if (last.includes(".")) {
|
|
52
|
+
const parts = last.split(".")
|
|
53
|
+
if (parts.length !== 4 || parts.some((p) => !/^\d{1,3}$/.test(p) || Number(p) > 255)) return null
|
|
54
|
+
const [a, b, c, d] = parts.map(Number) as [number, number, number, number]
|
|
55
|
+
text = `${text.slice(0, lastColon + 1)}${((a << 8) | b).toString(16)}:${((c << 8) | d).toString(16)}`
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const halves = text.split("::")
|
|
59
|
+
if (halves.length > 2) return null
|
|
60
|
+
const groupsOf = (part: string) => (part === "" ? [] : part.split(":"))
|
|
61
|
+
const head = groupsOf(halves[0] ?? "")
|
|
62
|
+
const tail = halves.length === 2 ? groupsOf(halves[1] ?? "") : []
|
|
63
|
+
if ([...head, ...tail].some((g) => !/^[0-9a-f]{1,4}$/.test(g))) return null
|
|
64
|
+
if (halves.length === 1) {
|
|
65
|
+
return head.length === 8 ? head.map((g) => parseInt(g, 16)) : null
|
|
66
|
+
}
|
|
67
|
+
const missing = 8 - head.length - tail.length
|
|
68
|
+
if (missing < 1) return null
|
|
69
|
+
return [...head, ...Array<string>(missing).fill("0"), ...tail].map((g) => parseInt(g, 16))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function isPrivateOrReservedIPv6(g: number[]): boolean {
|
|
73
|
+
const zeroThrough = (n: number) => g.slice(0, n).every((x) => x === 0)
|
|
74
|
+
const [g0 = 0, g1 = 0, g2 = 0, g3 = 0, , g5 = 0, g6 = 0, g7 = 0] = g
|
|
75
|
+
if (zeroThrough(8)) return true // :: unspecified
|
|
76
|
+
if (zeroThrough(7) && g7 === 1) return true // ::1 loopback
|
|
77
|
+
if (zeroThrough(5) && g5 === 0xffff) return embeddedIPv4IsPrivate(g6, g7) // ::ffff:0:0/96 IPv4-mapped
|
|
78
|
+
if (zeroThrough(6)) return embeddedIPv4IsPrivate(g6, g7) // ::/96 IPv4-compatible (deprecated)
|
|
79
|
+
if (g0 === 0x64 && g1 === 0xff9b && g.slice(2, 6).every((x) => x === 0)) {
|
|
80
|
+
return embeddedIPv4IsPrivate(g6, g7) // 64:ff9b::/96 NAT64: the IPv4 it reaches
|
|
81
|
+
}
|
|
82
|
+
if (g0 === 0x64 && g1 === 0xff9b && g2 === 1) return true // 64:ff9b:1::/48 local-use NAT64
|
|
83
|
+
if (g0 === 0x2002) return embeddedIPv4IsPrivate(g1, g2) // 2002::/16 6to4: the IPv4 it reaches
|
|
84
|
+
if (g0 === 0x2001 && g1 === 0) return true // 2001::/32 Teredo
|
|
85
|
+
if ((g0 & 0xfe00) === 0xfc00) return true // fc00::/7 unique-local
|
|
86
|
+
if ((g0 & 0xffc0) === 0xfe80) return true // fe80::/10 link-local (fe80:: to febf::)
|
|
87
|
+
if ((g0 & 0xffc0) === 0xfec0) return true // fec0::/10 site-local (deprecated)
|
|
88
|
+
if ((g0 & 0xff00) === 0xff00) return true // ff00::/8 multicast
|
|
89
|
+
return false
|
|
90
|
+
}
|
|
91
|
+
|
|
13
92
|
/**
|
|
14
93
|
* True if the IP belongs to a range we refuse to connect to from server-side
|
|
15
|
-
* fetches. Covers IPv4 loopback/private/link-local/cloud-metadata/
|
|
16
|
-
*
|
|
94
|
+
* fetches. Covers IPv4 loopback/private/link-local/cloud-metadata/CGN/
|
|
95
|
+
* multicast/reserved, the equivalent IPv6 classes, and every
|
|
96
|
+
* IPv6 form that carries an IPv4 address (mapped, compatible, NAT64, 6to4 —
|
|
97
|
+
* judged by the IPv4 they reach). Something with a colon that is not a valid
|
|
98
|
+
* IPv6 address is refused (fail closed); anything else that is not an IP (a
|
|
99
|
+
* host name) is not refused here.
|
|
17
100
|
*/
|
|
18
101
|
export function isPrivateOrReservedIP(ip: string): boolean {
|
|
19
102
|
const v4 = ip.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/)
|
|
20
103
|
if (v4) {
|
|
21
|
-
|
|
22
|
-
const b = Number(v4[2])
|
|
23
|
-
if (a === 0) return true // 0.0.0.0/8 "this network"
|
|
24
|
-
if (a === 127) return true // 127.0.0.0/8 loopback
|
|
25
|
-
if (a === 10) return true // 10.0.0.0/8 private
|
|
26
|
-
if (a === 172 && b >= 16 && b <= 31) return true // 172.16.0.0/12 private
|
|
27
|
-
if (a === 192 && b === 168) return true // 192.168.0.0/16 private
|
|
28
|
-
if (a === 169 && b === 254) return true // 169.254.0.0/16 link-local + AWS/GCP metadata
|
|
29
|
-
if (a === 100 && b >= 64 && b <= 127) return true // 100.64.0.0/10 CGN
|
|
30
|
-
if (a === 198 && (b === 18 || b === 19)) return true // 198.18.0.0/15 benchmarking
|
|
31
|
-
if (a >= 224) return true // 224.0.0.0/4 multicast + 240.0.0.0/4 reserved + 255.255.255.255
|
|
32
|
-
return false
|
|
33
|
-
}
|
|
34
|
-
// IPv6. Hostnames from URL parsing come without brackets.
|
|
35
|
-
const lower = ip.toLowerCase()
|
|
36
|
-
if (lower === "::" || lower === "::1") return true // unspecified / loopback
|
|
37
|
-
if (lower.startsWith("fe80:") || lower.startsWith("fe80::")) return true // link-local fe80::/10
|
|
38
|
-
if (/^f[cd]/.test(lower)) return true // unique-local fc00::/7
|
|
39
|
-
if (lower.startsWith("ff")) return true // multicast ff00::/8
|
|
40
|
-
if (lower.startsWith("::ffff:")) {
|
|
41
|
-
// IPv4-mapped IPv6. WHATWG URL parsing normalises the dotted-quad tail
|
|
42
|
-
// into two hex quads (`::ffff:127.0.0.1` → `::ffff:7f00:1`), so handle
|
|
43
|
-
// both forms.
|
|
44
|
-
const tail = lower.slice(7)
|
|
45
|
-
if (tail.includes(".")) {
|
|
46
|
-
return isPrivateOrReservedIP(tail)
|
|
47
|
-
}
|
|
48
|
-
const parts = tail.split(":")
|
|
49
|
-
if (parts.length === 2) {
|
|
50
|
-
const hi = parseInt(parts[0] || "0", 16)
|
|
51
|
-
const lo = parseInt(parts[1] || "0", 16)
|
|
52
|
-
if (Number.isFinite(hi) && Number.isFinite(lo)) {
|
|
53
|
-
const ipv4 = `${(hi >> 8) & 0xff}.${hi & 0xff}.${(lo >> 8) & 0xff}.${lo & 0xff}`
|
|
54
|
-
return isPrivateOrReservedIP(ipv4)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
// Unrecognisable mapped form — fail closed, treat as reserved.
|
|
58
|
-
return true
|
|
104
|
+
return isPrivateOrReservedIPv4(Number(v4[1]), Number(v4[2]), Number(v4[3]))
|
|
59
105
|
}
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// hex quads (`::7f00:1`), exactly like the ::ffff: case above — handle both,
|
|
64
|
-
// or the canonical hex form silently fails open.
|
|
65
|
-
const tail = lower.slice(2)
|
|
66
|
-
if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(tail)) {
|
|
67
|
-
return isPrivateOrReservedIP(tail)
|
|
68
|
-
}
|
|
69
|
-
const parts = tail.split(":")
|
|
70
|
-
if (parts.length === 2 && /^[0-9a-f]{1,4}$/.test(parts[0]) && /^[0-9a-f]{1,4}$/.test(parts[1])) {
|
|
71
|
-
const hi = parseInt(parts[0], 16)
|
|
72
|
-
const lo = parseInt(parts[1], 16)
|
|
73
|
-
if (Number.isFinite(hi) && Number.isFinite(lo)) {
|
|
74
|
-
return isPrivateOrReservedIP(`${(hi >> 8) & 0xff}.${hi & 0xff}.${(lo >> 8) & 0xff}.${lo & 0xff}`)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return false
|
|
106
|
+
if (!ip.includes(":")) return false
|
|
107
|
+
const groups = ipv6Groups(ip)
|
|
108
|
+
return groups === null ? true : isPrivateOrReservedIPv6(groups)
|
|
79
109
|
}
|
|
80
110
|
|
|
81
111
|
/**
|
package/src/producer-types.ts
CHANGED
|
@@ -108,6 +108,9 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
108
108
|
// UGC Clip: renders one clip of a UGC video from its ticket — emits a video
|
|
109
109
|
// URL on `video-out` (one per fan-out iteration).
|
|
110
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",
|
|
111
114
|
])
|
|
112
115
|
|
|
113
116
|
/**
|
|
@@ -181,6 +184,9 @@ export const DYNAMIC_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
181
184
|
// voice-changer/dubbing precedent. Asserted in producer-types.test.ts (the
|
|
182
185
|
// suite does not fail on omission).
|
|
183
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",
|
|
184
190
|
])
|
|
185
191
|
|
|
186
192
|
/**
|
|
@@ -335,12 +341,17 @@ export const FAN_OUT_ALL_OR_NOTHING_TYPES: ReadonlySet<string> = new Set(["ugc-c
|
|
|
335
341
|
/**
|
|
336
342
|
* Nodes whose saved list is the list their last run PRODUCED — `__listResults`
|
|
337
343
|
* (Extract Field's JSON value on `generatedJson`) — and never a history in
|
|
338
|
-
* `generatedResults`: Extract Field and
|
|
344
|
+
* `generatedResults`: Extract Field, JSON Process and Site Capture. No run of the first two writes
|
|
339
345
|
* one; earlier builds' server runs did (the run's text, the links of a list of
|
|
340
346
|
* links), and both engines' list readers leave it out for these two (decided
|
|
341
347
|
* 2026-10-05). Single source of truth for the backend engine and the editor.
|
|
342
348
|
*/
|
|
343
|
-
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
|
+
])
|
|
344
355
|
|
|
345
356
|
/** Whether a node's saved list is its own `__listResults`, never a history. */
|
|
346
357
|
export function ownsItsList(nodeType: string | null | undefined): boolean {
|
|
@@ -409,6 +420,9 @@ export const FAN_IN_TARGETS: Readonly<Record<string, "*" | readonly string[]>> =
|
|
|
409
420
|
// the union of the clips' spans — the pack's EDLs fold onto its `edl` wire
|
|
410
421
|
// instead of running one detection job (and one minimum charge) per clip.
|
|
411
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"],
|
|
412
426
|
}
|
|
413
427
|
|
|
414
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,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
|
+
}
|