@nodaro/shared 3.31.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 -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-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__/fixtures/root-exports.baseline.json +4625 -0
- package/src/__tests__/input-field-extra-keys.test.ts +1 -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__/preview-gate-use-case.test.ts +151 -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/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 +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 +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 -1845
- package/src/json-kinds.ts +4 -0
- package/src/model-catalog.ts +36 -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 +5 -0
- package/src/preview-gate.ts +92 -14
- 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
|
@@ -0,0 +1,1381 @@
|
|
|
1
|
+
import { DEFAULT_LABEL_BY_SOURCE } from './chunk-5RU2HCW2.js';
|
|
2
|
+
|
|
3
|
+
// src/featured-entities.ts
|
|
4
|
+
var FEATURED_ENTITIES = {
|
|
5
|
+
character: [
|
|
6
|
+
{
|
|
7
|
+
id: "detective",
|
|
8
|
+
label: "Grizzled Detective",
|
|
9
|
+
description: "A weathered private detective in his 50s, stubble, rumpled trench coat, tired but sharp eyes, film-noir presence"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: "barista",
|
|
13
|
+
label: "Cheerful Barista",
|
|
14
|
+
description: "A cheerful young barista with curly hair, apron over a casual shirt, warm welcoming smile, energetic and approachable"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "elder",
|
|
18
|
+
label: "Wise Elder",
|
|
19
|
+
description: "A wise elderly mentor with long grey hair and beard, flowing robes, calm knowing expression, gentle authority"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "adventurer",
|
|
23
|
+
label: "Young Adventurer",
|
|
24
|
+
description: "A young adventurer in practical travel gear with a worn backpack, determined expression, sun-weathered skin"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "scientist",
|
|
28
|
+
label: "Focused Scientist",
|
|
29
|
+
description: "A focused scientist in a white lab coat, glasses, hair tied back, intelligent and intense demeanor"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "child",
|
|
33
|
+
label: "Curious Kid",
|
|
34
|
+
description: "A curious 8-year-old child with bright eyes and colorful casual clothes, playful and full of wonder"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
location: [
|
|
38
|
+
{
|
|
39
|
+
id: "alley",
|
|
40
|
+
label: "Cyberpunk Alley",
|
|
41
|
+
description: "A neon-lit cyberpunk alley at night, wet pavement reflecting signs, drifting steam, dense layered urban detail"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "cafe",
|
|
45
|
+
label: "Cozy Caf\xE9",
|
|
46
|
+
description: "A cozy coffee shop interior, warm wood surfaces, soft pendant lighting, hanging plants, a few relaxed patrons"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "forest",
|
|
50
|
+
label: "Misty Forest",
|
|
51
|
+
description: "A misty ancient forest at dawn, tall trees, shafts of light through fog, ferns underfoot, ethereal stillness"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "office",
|
|
55
|
+
label: "Modern Office",
|
|
56
|
+
description: "A sleek modern office with glass walls, a city skyline view, minimal furniture, bright natural daylight"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "beach",
|
|
60
|
+
label: "Golden Beach",
|
|
61
|
+
description: "A tranquil tropical beach at golden hour, soft rolling waves, leaning palm trees, warm low sun"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "bridge",
|
|
65
|
+
label: "Spaceship Bridge",
|
|
66
|
+
description: "A futuristic spaceship bridge, glowing control panels, a vast viewport onto a star field, cool blue light"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
object: [
|
|
70
|
+
{
|
|
71
|
+
id: "watch",
|
|
72
|
+
label: "Vintage Pocket Watch",
|
|
73
|
+
description: "An ornate vintage gold pocket watch, intricate engraving, slightly worn, on a fine chain"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "sword",
|
|
77
|
+
label: "Enchanted Sword",
|
|
78
|
+
description: "A glowing enchanted sword, faint runes etched along the blade, ornate hilt wrapped in leather"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "robot",
|
|
82
|
+
label: "Retro Robot",
|
|
83
|
+
description: "A friendly retro-futuristic robot companion, rounded brushed-metal chassis, a single expressive lens eye"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "book",
|
|
87
|
+
label: "Ancient Spellbook",
|
|
88
|
+
description: "An ancient leather-bound spellbook, gilded page edges, embossed cover, a faint mysterious glow"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "car",
|
|
92
|
+
label: "Classic Convertible",
|
|
93
|
+
description: "A sleek classic convertible sports car, polished chrome trim, vivid glossy paint, whitewall tires"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
};
|
|
97
|
+
function getFeaturedEntities(type) {
|
|
98
|
+
return FEATURED_ENTITIES[type] ?? [];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/ancestor-refs.ts
|
|
102
|
+
var IMAGE_REF_TYPES = /* @__PURE__ */ new Set([
|
|
103
|
+
"upload-image",
|
|
104
|
+
"face",
|
|
105
|
+
"character",
|
|
106
|
+
"object",
|
|
107
|
+
"creature",
|
|
108
|
+
"location",
|
|
109
|
+
"generate-image",
|
|
110
|
+
"edit-image",
|
|
111
|
+
"image-to-image"
|
|
112
|
+
]);
|
|
113
|
+
var PASSTHROUGH_TYPES = /* @__PURE__ */ new Set([
|
|
114
|
+
"ai-writer",
|
|
115
|
+
"llm-chat",
|
|
116
|
+
"split-text",
|
|
117
|
+
"combine-text",
|
|
118
|
+
"text-prompt",
|
|
119
|
+
"list"
|
|
120
|
+
]);
|
|
121
|
+
function collectAncestorRefs(nodeId, nodes, edges, getImageUrl, visited = /* @__PURE__ */ new Set()) {
|
|
122
|
+
if (visited.has(nodeId)) return [];
|
|
123
|
+
visited.add(nodeId);
|
|
124
|
+
const refs = [];
|
|
125
|
+
const incoming = edges.filter((e) => e.target === nodeId);
|
|
126
|
+
for (const edge of incoming) {
|
|
127
|
+
const src = nodes.find((n) => n.id === edge.source);
|
|
128
|
+
if (!src) continue;
|
|
129
|
+
if (IMAGE_REF_TYPES.has(src.type)) {
|
|
130
|
+
const url = getImageUrl(src);
|
|
131
|
+
if (url?.trim()) refs.push(url.trim());
|
|
132
|
+
}
|
|
133
|
+
if (PASSTHROUGH_TYPES.has(src.type)) {
|
|
134
|
+
refs.push(...collectAncestorRefs(src.id, nodes, edges, getImageUrl, visited));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return refs;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/character-usage-mode.ts
|
|
141
|
+
var USAGE_MODES = [
|
|
142
|
+
"identical",
|
|
143
|
+
"face",
|
|
144
|
+
"face-pose",
|
|
145
|
+
"pose",
|
|
146
|
+
"emotion",
|
|
147
|
+
"style",
|
|
148
|
+
"name",
|
|
149
|
+
"none"
|
|
150
|
+
];
|
|
151
|
+
var DEFAULT_USAGE_MODE = "identical";
|
|
152
|
+
function isUsageMode(s) {
|
|
153
|
+
return USAGE_MODES.includes(s);
|
|
154
|
+
}
|
|
155
|
+
function usageModeDirective(mode) {
|
|
156
|
+
switch (mode) {
|
|
157
|
+
case "identical":
|
|
158
|
+
return "The subject must remain exactly the same person \u2014 preserve 100% facial identity, bone structure, skin tone, proportions, and all unique features. Do not alter eyes, nose, mouth, or facial shape. Maintain natural skin texture, including pores and imperfections.";
|
|
159
|
+
case "face":
|
|
160
|
+
return "Take ONLY the facial features and expression \u2014 preserve 100% facial identity, bone structure, skin tone, and all unique features. Do not alter eyes, nose, mouth, or facial shape. Maintain natural skin texture, including pores and imperfections. Adopt clothing, hair styling, and posture from the rest of the prompt.";
|
|
161
|
+
case "face-pose":
|
|
162
|
+
return "Take the facial features AND body pose \u2014 preserve 100% facial identity, bone structure, skin tone, and all unique features. Do not alter eyes, nose, mouth, or facial shape. Maintain natural skin texture. Adopt clothing and styling from the rest of the prompt.";
|
|
163
|
+
case "pose":
|
|
164
|
+
return "Take only the body pose and posture \u2014 do not copy facial identity, features, or skin. Adopt face, clothing, hair, and all other details from the rest of the prompt.";
|
|
165
|
+
case "emotion":
|
|
166
|
+
return "Take only the emotional expression \u2014 preserve 100% facial identity and all unique features unchanged. Adopt face shape, clothing, body, and pose from the rest of the prompt; transfer only the emotional cue.";
|
|
167
|
+
case "style":
|
|
168
|
+
return "Take only the visual style and tone (lighting, color grade, atmosphere). Do not copy the subject's identity, clothing, or pose.";
|
|
169
|
+
case "name":
|
|
170
|
+
case "none":
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function usageModeLabel(mode) {
|
|
175
|
+
switch (mode) {
|
|
176
|
+
case "identical":
|
|
177
|
+
return "Identical";
|
|
178
|
+
case "face":
|
|
179
|
+
return "Face only";
|
|
180
|
+
case "face-pose":
|
|
181
|
+
return "Face + Pose";
|
|
182
|
+
case "pose":
|
|
183
|
+
return "Pose only";
|
|
184
|
+
case "emotion":
|
|
185
|
+
return "Emotion only";
|
|
186
|
+
case "style":
|
|
187
|
+
return "Style only";
|
|
188
|
+
case "name":
|
|
189
|
+
return "Name only";
|
|
190
|
+
case "none":
|
|
191
|
+
return "None";
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function usageModeIncludesName(mode) {
|
|
195
|
+
return mode !== "none";
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/extra-refs.ts
|
|
199
|
+
function expandExtraRefsToConnectedReferences(extras, lookupCharacterContext) {
|
|
200
|
+
if (!extras || extras.length === 0) return [];
|
|
201
|
+
const out = [];
|
|
202
|
+
for (let i = 0; i < extras.length; i++) {
|
|
203
|
+
const r = extras[i];
|
|
204
|
+
if (!r || !r.url) continue;
|
|
205
|
+
const description = (r.description ?? "").trim();
|
|
206
|
+
if (r.characterSlug) {
|
|
207
|
+
const ctx = lookupCharacterContext?.(r.characterSlug);
|
|
208
|
+
const effectiveMode = r.usageMode ?? ctx?.defaultUsageMode ?? DEFAULT_USAGE_MODE;
|
|
209
|
+
const displayName = ctx?.displayName || r.characterSlug;
|
|
210
|
+
out.push({
|
|
211
|
+
id: `extra_${i}`,
|
|
212
|
+
defaultName: r.variantDisplayName ? `${displayName} / ${r.variantDisplayName}` : displayName,
|
|
213
|
+
source: "wired-character",
|
|
214
|
+
description,
|
|
215
|
+
url: r.url,
|
|
216
|
+
characterSlug: r.characterSlug,
|
|
217
|
+
variantSlug: r.variantSlug,
|
|
218
|
+
characterCanonicalDescription: ctx?.canonicalDescription ?? null,
|
|
219
|
+
variantDescription: description.length > 0 ? description : null,
|
|
220
|
+
variantDisplayName: r.variantDisplayName,
|
|
221
|
+
defaultUsageMode: effectiveMode,
|
|
222
|
+
// Node-default role (Character Node Role+Lock): stamped ONLY when the
|
|
223
|
+
// extra carries no per-ref `usageMode` override — the override wins
|
|
224
|
+
// (it's already folded into `defaultUsageMode` above, and
|
|
225
|
+
// `resolveDefaultRole` would otherwise let the role beat it).
|
|
226
|
+
defaultRole: r.usageMode ? void 0 : ctx?.defaultRole,
|
|
227
|
+
// Node's mapped identity-lock (`characterLockToRefLock`) — orthogonal
|
|
228
|
+
// to the role; the hybrid renderers emit its line via
|
|
229
|
+
// `buildIdentityLockLine`.
|
|
230
|
+
identityLock: ctx?.identityLock,
|
|
231
|
+
isExtraRef: true
|
|
232
|
+
});
|
|
233
|
+
} else {
|
|
234
|
+
const effectiveMode = r.usageMode;
|
|
235
|
+
out.push({
|
|
236
|
+
id: `extra_${i}`,
|
|
237
|
+
defaultName: `Image ${i + 1}`,
|
|
238
|
+
source: "manual",
|
|
239
|
+
description,
|
|
240
|
+
url: r.url,
|
|
241
|
+
defaultUsageMode: effectiveMode,
|
|
242
|
+
isExtraRef: true
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// src/surround.ts
|
|
250
|
+
var SURROUND_DIRECTIONS = ["right", "left", "up", "down"];
|
|
251
|
+
var DEFAULT_CARRIED_FRACTION = 0.5;
|
|
252
|
+
var TILT_CARRIED_FRACTION = 0.12;
|
|
253
|
+
function isTiltDirection(direction) {
|
|
254
|
+
return direction === "up" || direction === "down";
|
|
255
|
+
}
|
|
256
|
+
function defaultCarriedFraction(direction) {
|
|
257
|
+
return isTiltDirection(direction) ? TILT_CARRIED_FRACTION : DEFAULT_CARRIED_FRACTION;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// src/object-aspect-defaults.ts
|
|
261
|
+
var OBJECT_ASPECT_OPTIONS = ["1:1", "3:4", "16:9", "9:16", "4:3"];
|
|
262
|
+
var OBJECT_ASPECT_DEFAULTS = {
|
|
263
|
+
angles: "1:1",
|
|
264
|
+
materials: "1:1",
|
|
265
|
+
variations: "1:1",
|
|
266
|
+
// Motion clips are 1:1 because objects rotate in place. Switch to "16:9" if
|
|
267
|
+
// future motion variants pan through a scene (e.g., drone-orbit with horizon).
|
|
268
|
+
motion: "1:1",
|
|
269
|
+
custom: "1:1"
|
|
270
|
+
};
|
|
271
|
+
function isObjectAspectRatio(s) {
|
|
272
|
+
return OBJECT_ASPECT_OPTIONS.includes(s);
|
|
273
|
+
}
|
|
274
|
+
function resolveObjectAspectRatio(opts) {
|
|
275
|
+
if (opts.explicit && isObjectAspectRatio(opts.explicit)) {
|
|
276
|
+
return opts.explicit;
|
|
277
|
+
}
|
|
278
|
+
if (opts.nodeOverride && isObjectAspectRatio(opts.nodeOverride)) {
|
|
279
|
+
return opts.nodeOverride;
|
|
280
|
+
}
|
|
281
|
+
return OBJECT_ASPECT_DEFAULTS[opts.assetType];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// src/character-mention-slug.ts
|
|
285
|
+
function characterMentionSlug(name) {
|
|
286
|
+
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
287
|
+
}
|
|
288
|
+
function parseCharacterMentionToken(text, _knownCharacterSlugs) {
|
|
289
|
+
if (!text.startsWith("@")) return null;
|
|
290
|
+
let rest = text.slice(1);
|
|
291
|
+
if (rest.length === 0 || !/^[a-z]/.test(rest)) return null;
|
|
292
|
+
let lockField = {};
|
|
293
|
+
if (rest.endsWith("~nolock")) {
|
|
294
|
+
rest = rest.slice(0, -"~nolock".length);
|
|
295
|
+
lockField = { lock: false };
|
|
296
|
+
} else if (rest.endsWith("~lock")) {
|
|
297
|
+
rest = rest.slice(0, -"~lock".length);
|
|
298
|
+
lockField = { lock: true };
|
|
299
|
+
}
|
|
300
|
+
const parts = rest.split(":");
|
|
301
|
+
if (parts.length < 2 || parts.length > 4) return null;
|
|
302
|
+
const [characterSlug, indexStr, third, fourth] = parts;
|
|
303
|
+
if (!/^[a-z][a-z0-9-]*$/.test(characterSlug)) return null;
|
|
304
|
+
if (!/^\d+$/.test(indexStr)) return null;
|
|
305
|
+
const imageIndex = parseInt(indexStr, 10);
|
|
306
|
+
if (!Number.isInteger(imageIndex) || imageIndex < 1) return null;
|
|
307
|
+
if (parts.length === 2) {
|
|
308
|
+
return { characterSlug, imageIndex, variantSlug: null, usageMode: null, ...lockField };
|
|
309
|
+
}
|
|
310
|
+
if (parts.length === 3) {
|
|
311
|
+
if (!/^[a-z][a-z0-9-]*$/.test(third)) return null;
|
|
312
|
+
if (isUsageMode(third)) {
|
|
313
|
+
return { characterSlug, imageIndex, variantSlug: null, usageMode: third, ...lockField };
|
|
314
|
+
}
|
|
315
|
+
return { characterSlug, imageIndex, variantSlug: third, usageMode: null, ...lockField };
|
|
316
|
+
}
|
|
317
|
+
if (parts.length === 4) {
|
|
318
|
+
if (!/^[a-z][a-z0-9-]*$/.test(third)) return null;
|
|
319
|
+
if (!/^[a-z][a-z0-9-]*$/.test(fourth)) return null;
|
|
320
|
+
if (isUsageMode(fourth)) {
|
|
321
|
+
return { characterSlug, imageIndex, variantSlug: third, usageMode: fourth, ...lockField };
|
|
322
|
+
}
|
|
323
|
+
return { characterSlug, imageIndex, variantSlug: third, usageMode: null, role: fourth, ...lockField };
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
function findCharacterMentionTokens(prompt, knownCharacterSlugs) {
|
|
328
|
+
const tokens = [];
|
|
329
|
+
const regex = /(?:^|[^a-zA-Z0-9])(@[a-z][a-z0-9-]*:\d+(?::[a-z][a-z0-9-]*)?(?::[a-z][a-z0-9-]*)?(?:~(?:no)?lock(?![a-z0-9-]))?)/g;
|
|
330
|
+
const knownSet = new Set(knownCharacterSlugs);
|
|
331
|
+
for (const match of prompt.matchAll(regex)) {
|
|
332
|
+
const token = match[1];
|
|
333
|
+
const offset = (match.index ?? 0) + (match[0].length - token.length);
|
|
334
|
+
const parsed = parseCharacterMentionToken(token);
|
|
335
|
+
if (parsed && knownSet.has(parsed.characterSlug)) {
|
|
336
|
+
tokens.push({ token, ...parsed, offset });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return tokens;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// src/character-variant-assets.ts
|
|
343
|
+
var CHARACTER_VARIANT_ASSET_BUCKETS = [
|
|
344
|
+
"expressions",
|
|
345
|
+
"poses",
|
|
346
|
+
"motions",
|
|
347
|
+
"angles",
|
|
348
|
+
"bodyAngles",
|
|
349
|
+
"lightingVariations",
|
|
350
|
+
"outfitVariations",
|
|
351
|
+
"detailCloseups"
|
|
352
|
+
];
|
|
353
|
+
function characterVariantAssetArrays(data) {
|
|
354
|
+
const out = {};
|
|
355
|
+
for (const bucket of CHARACTER_VARIANT_ASSET_BUCKETS) {
|
|
356
|
+
const value = data?.[bucket];
|
|
357
|
+
out[bucket] = Array.isArray(value) ? value : [];
|
|
358
|
+
}
|
|
359
|
+
return out;
|
|
360
|
+
}
|
|
361
|
+
function characterSheetRefItems(sheets) {
|
|
362
|
+
if (!Array.isArray(sheets)) return [];
|
|
363
|
+
return sheets.flatMap((s) => {
|
|
364
|
+
const sheet = s;
|
|
365
|
+
if (!sheet || typeof sheet.url !== "string" || !sheet.url) return [];
|
|
366
|
+
const type = typeof sheet.type === "string" && sheet.type ? sheet.type : "sheet";
|
|
367
|
+
const skin = typeof sheet.skin === "string" && sheet.skin ? ` ${sheet.skin}` : "";
|
|
368
|
+
return [{ name: `${type}${skin}`, url: sheet.url }];
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
var BOARD_SHIM_KEY = "studioBoard";
|
|
372
|
+
var BOARD_SHIM_PREFIX = "studioBoard:";
|
|
373
|
+
function characterBoardItems(data) {
|
|
374
|
+
const column = Array.isArray(data?.boards) ? data.boards.flatMap((b) => {
|
|
375
|
+
const board = b;
|
|
376
|
+
if (!board || typeof board.url !== "string" || !board.url) return [];
|
|
377
|
+
return [{ name: typeof board.name === "string" && board.name ? board.name : "board", url: board.url }];
|
|
378
|
+
}) : [];
|
|
379
|
+
const map = data?.selectedAssetByVariant ?? {};
|
|
380
|
+
const shim = [];
|
|
381
|
+
const legacy = map[BOARD_SHIM_KEY];
|
|
382
|
+
if (typeof legacy === "string" && legacy) shim.push({ name: "board", url: legacy });
|
|
383
|
+
for (const [k, v] of Object.entries(map)) {
|
|
384
|
+
if (k.startsWith(BOARD_SHIM_PREFIX) && typeof v === "string" && v) {
|
|
385
|
+
shim.push({ name: k.slice(BOARD_SHIM_PREFIX.length) || "board", url: v });
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
const haveNames = new Set(column.map((b) => b.name.toLowerCase()));
|
|
389
|
+
return [...column, ...shim.filter((b) => !haveNames.has(b.name.toLowerCase()))];
|
|
390
|
+
}
|
|
391
|
+
function characterMentionableAssetArrays(data) {
|
|
392
|
+
return {
|
|
393
|
+
...characterVariantAssetArrays(data),
|
|
394
|
+
sheets: characterSheetRefItems(data?.sheets),
|
|
395
|
+
boards: characterBoardItems(data)
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
var CHARACTER_PICKER_DISPLAY_ORDER = [
|
|
399
|
+
"boards",
|
|
400
|
+
"sheets",
|
|
401
|
+
...CHARACTER_VARIANT_ASSET_BUCKETS
|
|
402
|
+
];
|
|
403
|
+
function characterBucketDisplayRank(bucket) {
|
|
404
|
+
if (bucket === void 0) return -1;
|
|
405
|
+
const i = CHARACTER_PICKER_DISPLAY_ORDER.indexOf(bucket);
|
|
406
|
+
return i === -1 ? CHARACTER_PICKER_DISPLAY_ORDER.length : i;
|
|
407
|
+
}
|
|
408
|
+
function sortCharacterEntriesForDisplay(items) {
|
|
409
|
+
const out = [];
|
|
410
|
+
let i = 0;
|
|
411
|
+
while (i < items.length) {
|
|
412
|
+
const slug = items[i].characterSlug;
|
|
413
|
+
if (!slug) {
|
|
414
|
+
out.push(items[i]);
|
|
415
|
+
i++;
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
let j = i;
|
|
419
|
+
while (j < items.length && items[j].characterSlug === slug) j++;
|
|
420
|
+
const run = items.slice(i, j);
|
|
421
|
+
const ranked = run.map((it, k) => ({ it, k, r: characterBucketDisplayRank(it.bucket) })).sort((a, b) => a.r - b.r || a.k - b.k).map((x) => x.it);
|
|
422
|
+
out.push(...ranked);
|
|
423
|
+
i = j;
|
|
424
|
+
}
|
|
425
|
+
return out;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/location-mention-slug.ts
|
|
429
|
+
var LOCATION_USAGE_MODES = [
|
|
430
|
+
"identical",
|
|
431
|
+
"style",
|
|
432
|
+
"layout",
|
|
433
|
+
"none"
|
|
434
|
+
];
|
|
435
|
+
var DEFAULT_LOCATION_USAGE_MODE = "identical";
|
|
436
|
+
function isLocationUsageMode(s) {
|
|
437
|
+
return LOCATION_USAGE_MODES.includes(s);
|
|
438
|
+
}
|
|
439
|
+
function locationUsageModeLabel(mode) {
|
|
440
|
+
switch (mode) {
|
|
441
|
+
case "identical":
|
|
442
|
+
return "Match exactly";
|
|
443
|
+
case "style":
|
|
444
|
+
return "Style / mood only";
|
|
445
|
+
case "layout":
|
|
446
|
+
return "Layout / framing only";
|
|
447
|
+
case "none":
|
|
448
|
+
return "No textual bias";
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function locationMentionSlug(name) {
|
|
452
|
+
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
453
|
+
}
|
|
454
|
+
function parseLocationMentionToken(text) {
|
|
455
|
+
if (!text.startsWith("@")) return null;
|
|
456
|
+
let rest = text.slice(1);
|
|
457
|
+
if (rest.length === 0 || !/^[a-z]/.test(rest)) return null;
|
|
458
|
+
let lockField = {};
|
|
459
|
+
if (rest.endsWith("~nolock")) {
|
|
460
|
+
rest = rest.slice(0, -"~nolock".length);
|
|
461
|
+
lockField = { lock: false };
|
|
462
|
+
} else if (rest.endsWith("~lock")) {
|
|
463
|
+
rest = rest.slice(0, -"~lock".length);
|
|
464
|
+
lockField = { lock: true };
|
|
465
|
+
}
|
|
466
|
+
const parts = rest.split(":");
|
|
467
|
+
if (parts.length < 2 || parts.length > 4) return null;
|
|
468
|
+
const [locationSlug, indexStr, third, fourth] = parts;
|
|
469
|
+
if (!/^[a-z][a-z0-9-]*$/.test(locationSlug)) return null;
|
|
470
|
+
if (!/^\d+$/.test(indexStr)) return null;
|
|
471
|
+
const imageIndex = parseInt(indexStr, 10);
|
|
472
|
+
if (!Number.isInteger(imageIndex) || imageIndex < 1) return null;
|
|
473
|
+
if (parts.length === 2) {
|
|
474
|
+
return {
|
|
475
|
+
locationSlug,
|
|
476
|
+
imageIndex,
|
|
477
|
+
bucket: null,
|
|
478
|
+
variant: null,
|
|
479
|
+
usageMode: null,
|
|
480
|
+
...lockField
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
if (parts.length === 3) {
|
|
484
|
+
if (third.includes("/")) {
|
|
485
|
+
const slashAt = third.indexOf("/");
|
|
486
|
+
const bucket = third.slice(0, slashAt);
|
|
487
|
+
const variant = third.slice(slashAt + 1);
|
|
488
|
+
if (!/^[a-z][a-z0-9-]*$/.test(bucket)) return null;
|
|
489
|
+
if (!/^[a-z][a-z0-9-]*$/.test(variant)) return null;
|
|
490
|
+
return { locationSlug, imageIndex, bucket, variant, usageMode: null, ...lockField };
|
|
491
|
+
}
|
|
492
|
+
if (!/^[a-z][a-z0-9-]*$/.test(third)) return null;
|
|
493
|
+
if (isLocationUsageMode(third)) {
|
|
494
|
+
return {
|
|
495
|
+
locationSlug,
|
|
496
|
+
imageIndex,
|
|
497
|
+
bucket: null,
|
|
498
|
+
variant: null,
|
|
499
|
+
usageMode: third,
|
|
500
|
+
...lockField
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
return {
|
|
504
|
+
locationSlug,
|
|
505
|
+
imageIndex,
|
|
506
|
+
bucket: null,
|
|
507
|
+
variant: null,
|
|
508
|
+
usageMode: null,
|
|
509
|
+
role: third,
|
|
510
|
+
...lockField
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
if (parts.length === 4) {
|
|
514
|
+
if (!third.includes("/")) return null;
|
|
515
|
+
const slashAt = third.indexOf("/");
|
|
516
|
+
const bucket = third.slice(0, slashAt);
|
|
517
|
+
const variant = third.slice(slashAt + 1);
|
|
518
|
+
if (!/^[a-z][a-z0-9-]*$/.test(bucket)) return null;
|
|
519
|
+
if (!/^[a-z][a-z0-9-]*$/.test(variant)) return null;
|
|
520
|
+
if (!/^[a-z][a-z0-9-]*$/.test(fourth)) return null;
|
|
521
|
+
if (isLocationUsageMode(fourth)) {
|
|
522
|
+
return { locationSlug, imageIndex, bucket, variant, usageMode: fourth, ...lockField };
|
|
523
|
+
}
|
|
524
|
+
return { locationSlug, imageIndex, bucket, variant, usageMode: null, role: fourth, ...lockField };
|
|
525
|
+
}
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
function findLocationMentionTokens(prompt, knownLocationSlugs) {
|
|
529
|
+
const tokens = [];
|
|
530
|
+
const segment = "(?:[a-z][a-z0-9-]*\\/[a-z][a-z0-9-]*|[a-z][a-z0-9-]*)";
|
|
531
|
+
const regex = new RegExp(
|
|
532
|
+
`(?:^|[^a-zA-Z0-9])(@[a-z][a-z0-9-]*:\\d+(?::${segment})?(?::${segment})?(?:~(?:no)?lock(?![a-z0-9-]))?)`,
|
|
533
|
+
"g"
|
|
534
|
+
);
|
|
535
|
+
const knownSet = new Set(knownLocationSlugs);
|
|
536
|
+
for (const match of prompt.matchAll(regex)) {
|
|
537
|
+
const token = match[1];
|
|
538
|
+
const offset = (match.index ?? 0) + (match[0].length - token.length);
|
|
539
|
+
const parsed = parseLocationMentionToken(token);
|
|
540
|
+
if (parsed && knownSet.has(parsed.locationSlug)) {
|
|
541
|
+
tokens.push({ token, ...parsed, offset });
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return tokens;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// src/mention-token-grammar.ts
|
|
548
|
+
var MENTION_SLUG_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
549
|
+
function mentionNameSlug(name) {
|
|
550
|
+
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
551
|
+
}
|
|
552
|
+
function parseMentionToken(text) {
|
|
553
|
+
if (!text.startsWith("@")) return null;
|
|
554
|
+
let rest = text.slice(1);
|
|
555
|
+
if (rest.length === 0 || !/^[a-z]/.test(rest)) return null;
|
|
556
|
+
let lockField = {};
|
|
557
|
+
if (rest.endsWith("~nolock")) {
|
|
558
|
+
rest = rest.slice(0, -"~nolock".length);
|
|
559
|
+
lockField = { lock: false };
|
|
560
|
+
} else if (rest.endsWith("~lock")) {
|
|
561
|
+
rest = rest.slice(0, -"~lock".length);
|
|
562
|
+
lockField = { lock: true };
|
|
563
|
+
}
|
|
564
|
+
const parts = rest.split(":");
|
|
565
|
+
if (parts.length < 2 || parts.length > 3) return null;
|
|
566
|
+
const [slug, indexStr, third] = parts;
|
|
567
|
+
if (!MENTION_SLUG_PATTERN.test(slug)) return null;
|
|
568
|
+
if (!/^\d+$/.test(indexStr)) return null;
|
|
569
|
+
const index = parseInt(indexStr, 10);
|
|
570
|
+
if (!Number.isInteger(index) || index < 1) return null;
|
|
571
|
+
if (parts.length === 2) return { slug, index, ...lockField };
|
|
572
|
+
if (!MENTION_SLUG_PATTERN.test(third)) return null;
|
|
573
|
+
return { slug, index, role: third, ...lockField };
|
|
574
|
+
}
|
|
575
|
+
var MENTION_TOKEN_REGEX = /(?:^|[^a-zA-Z0-9])(@[a-z][a-z0-9-]*:\d+(?::[a-z][a-z0-9-]*)?(?:~(?:no)?lock(?![a-z0-9-]))?)(?![:a-z0-9-])/g;
|
|
576
|
+
function findMentionTokens(prompt, knownSlugs) {
|
|
577
|
+
const tokens = [];
|
|
578
|
+
const regex = new RegExp(MENTION_TOKEN_REGEX.source, "g");
|
|
579
|
+
const knownSet = new Set(knownSlugs);
|
|
580
|
+
for (const match of prompt.matchAll(regex)) {
|
|
581
|
+
const token = match[1];
|
|
582
|
+
const offset = (match.index ?? 0) + (match[0].length - token.length);
|
|
583
|
+
if (/^\/[a-z]/.test(prompt.slice(offset + token.length))) continue;
|
|
584
|
+
const parsed = parseMentionToken(token);
|
|
585
|
+
if (parsed && knownSet.has(parsed.slug)) {
|
|
586
|
+
tokens.push({ token, ...parsed, offset });
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return tokens;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// src/image-mention-slug.ts
|
|
593
|
+
function imageMentionSlug(name) {
|
|
594
|
+
return mentionNameSlug(name);
|
|
595
|
+
}
|
|
596
|
+
function parseImageMentionToken(text) {
|
|
597
|
+
const parsed = parseMentionToken(text);
|
|
598
|
+
if (!parsed) return null;
|
|
599
|
+
return {
|
|
600
|
+
imageSlug: parsed.slug,
|
|
601
|
+
imageIndex: parsed.index,
|
|
602
|
+
...parsed.role !== void 0 ? { role: parsed.role } : {},
|
|
603
|
+
...parsed.lock !== void 0 ? { lock: parsed.lock } : {}
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function findImageMentionTokens(prompt, knownImageSlugs) {
|
|
607
|
+
return findMentionTokens(prompt, knownImageSlugs).map((t2) => ({
|
|
608
|
+
token: t2.token,
|
|
609
|
+
imageSlug: t2.slug,
|
|
610
|
+
imageIndex: t2.index,
|
|
611
|
+
...t2.role !== void 0 ? { role: t2.role } : {},
|
|
612
|
+
...t2.lock !== void 0 ? { lock: t2.lock } : {},
|
|
613
|
+
offset: t2.offset
|
|
614
|
+
}));
|
|
615
|
+
}
|
|
616
|
+
function imageMentionSlugForRef(r) {
|
|
617
|
+
if (r.source !== "wired-image" && r.source !== "manual") return null;
|
|
618
|
+
if (r.isExtraRef === true) return null;
|
|
619
|
+
if (!r.url || !r.defaultName) return null;
|
|
620
|
+
const slug = imageMentionSlug(r.defaultName);
|
|
621
|
+
return MENTION_SLUG_PATTERN.test(slug) ? slug : null;
|
|
622
|
+
}
|
|
623
|
+
function knownImageSlugsFromRefs(refs) {
|
|
624
|
+
const out = /* @__PURE__ */ new Set();
|
|
625
|
+
for (const r of refs) {
|
|
626
|
+
const slug = imageMentionSlugForRef(r);
|
|
627
|
+
if (slug) out.add(slug);
|
|
628
|
+
}
|
|
629
|
+
return [...out];
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// src/entity-mention-slug.ts
|
|
633
|
+
function entityMentionSlug(name) {
|
|
634
|
+
return mentionNameSlug(name);
|
|
635
|
+
}
|
|
636
|
+
function parseEntityMentionToken(text) {
|
|
637
|
+
const parsed = parseMentionToken(text);
|
|
638
|
+
if (!parsed) return null;
|
|
639
|
+
return {
|
|
640
|
+
entitySlug: parsed.slug,
|
|
641
|
+
entityIndex: parsed.index,
|
|
642
|
+
...parsed.role !== void 0 ? { role: parsed.role } : {},
|
|
643
|
+
...parsed.lock !== void 0 ? { lock: parsed.lock } : {}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function findEntityMentionTokens(prompt, knownEntitySlugs) {
|
|
647
|
+
return findMentionTokens(prompt, knownEntitySlugs).map((t2) => ({
|
|
648
|
+
token: t2.token,
|
|
649
|
+
entitySlug: t2.slug,
|
|
650
|
+
entityIndex: t2.index,
|
|
651
|
+
...t2.role !== void 0 ? { role: t2.role } : {},
|
|
652
|
+
...t2.lock !== void 0 ? { lock: t2.lock } : {},
|
|
653
|
+
offset: t2.offset
|
|
654
|
+
}));
|
|
655
|
+
}
|
|
656
|
+
function entityMentionSlugForRef(r) {
|
|
657
|
+
if (r.source !== "wired-creature" && r.source !== "wired-object") return null;
|
|
658
|
+
if (r.isExtraRef === true) return null;
|
|
659
|
+
if (!r.url || !r.defaultName) return null;
|
|
660
|
+
const slug = entityMentionSlug(r.defaultName);
|
|
661
|
+
return MENTION_SLUG_PATTERN.test(slug) ? slug : null;
|
|
662
|
+
}
|
|
663
|
+
function knownEntitySlugsFromRefs(refs) {
|
|
664
|
+
const out = /* @__PURE__ */ new Set();
|
|
665
|
+
for (const r of refs) {
|
|
666
|
+
const slug = entityMentionSlugForRef(r);
|
|
667
|
+
if (slug) out.add(slug);
|
|
668
|
+
}
|
|
669
|
+
return [...out];
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// src/to-connected-references.ts
|
|
673
|
+
function toConnectedReference(entity) {
|
|
674
|
+
if (entity.kind === "character") {
|
|
675
|
+
return {
|
|
676
|
+
id: entity.id,
|
|
677
|
+
defaultName: entity.name,
|
|
678
|
+
source: "wired-character",
|
|
679
|
+
url: entity.url ?? "",
|
|
680
|
+
characterSlug: characterMentionSlug(entity.name),
|
|
681
|
+
variantSlug: entity.variant,
|
|
682
|
+
characterCanonicalDescription: null,
|
|
683
|
+
variantDescription: null,
|
|
684
|
+
variantDisplayName: entity.variant ?? "canonical"
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
if (entity.kind === "image") {
|
|
688
|
+
return {
|
|
689
|
+
id: entity.id,
|
|
690
|
+
defaultName: entity.name,
|
|
691
|
+
source: "wired-image",
|
|
692
|
+
url: entity.url ?? "",
|
|
693
|
+
...entity.description ? { description: entity.description } : {}
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
if (entity.kind === "creature") {
|
|
697
|
+
return {
|
|
698
|
+
id: entity.id,
|
|
699
|
+
defaultName: entity.name,
|
|
700
|
+
source: "wired-creature",
|
|
701
|
+
url: entity.url ?? "",
|
|
702
|
+
...entity.description ? { description: entity.description } : {}
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
return {
|
|
706
|
+
id: entity.id,
|
|
707
|
+
defaultName: entity.name,
|
|
708
|
+
source: "wired-location",
|
|
709
|
+
url: entity.url ?? "",
|
|
710
|
+
locationSlug: locationMentionSlug(entity.name),
|
|
711
|
+
locationCanonicalDescription: null,
|
|
712
|
+
locationVariantBucket: void 0,
|
|
713
|
+
locationVariantSlug: entity.variant,
|
|
714
|
+
locationVariantDisplayName: entity.variant ?? "canonical"
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
function toConnectedReferences(entities) {
|
|
718
|
+
return entities.map(toConnectedReference);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// src/character-aspect-defaults.ts
|
|
722
|
+
var CHARACTER_ASPECT_OPTIONS = ["1:1", "3:4", "16:9", "9:16"];
|
|
723
|
+
var CHARACTER_ASPECT_DEFAULTS = {
|
|
724
|
+
portrait: "3:4",
|
|
725
|
+
// Legacy `angles` was head angles — keep its default aligned with `headAngles`.
|
|
726
|
+
angles: "3:4",
|
|
727
|
+
headAngles: "3:4",
|
|
728
|
+
// Full-body framings:
|
|
729
|
+
poses: "9:16",
|
|
730
|
+
bodyAngles: "9:16",
|
|
731
|
+
motions: "9:16",
|
|
732
|
+
// Expressions are head-and-shoulders — square framing matches the existing
|
|
733
|
+
// expression card grid and avoids cutting off forehead/chin.
|
|
734
|
+
expressions: "1:1",
|
|
735
|
+
// Lighting variations are framed like portraits (3:4) — they're full-body in
|
|
736
|
+
// the prompt but the user usually wants to see the lighting on the face.
|
|
737
|
+
lighting: "3:4"
|
|
738
|
+
};
|
|
739
|
+
function isCharacterAspectRatio(s) {
|
|
740
|
+
return CHARACTER_ASPECT_OPTIONS.includes(s);
|
|
741
|
+
}
|
|
742
|
+
function resolveCharacterAspectRatio(opts) {
|
|
743
|
+
if (opts.explicit && isCharacterAspectRatio(opts.explicit)) {
|
|
744
|
+
return opts.explicit;
|
|
745
|
+
}
|
|
746
|
+
if (opts.nodeOverride && isCharacterAspectRatio(opts.nodeOverride)) {
|
|
747
|
+
return opts.nodeOverride;
|
|
748
|
+
}
|
|
749
|
+
return CHARACTER_ASPECT_DEFAULTS[opts.assetType];
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// src/entity-aspect-defaults.ts
|
|
753
|
+
var ENTITY_ASPECT_DEFAULTS = {
|
|
754
|
+
// Locations are environments → landscape framing everywhere.
|
|
755
|
+
location: {
|
|
756
|
+
timeOfDay: "16:9",
|
|
757
|
+
weather: "16:9",
|
|
758
|
+
seasons: "16:9",
|
|
759
|
+
angles: "16:9",
|
|
760
|
+
lighting: "16:9",
|
|
761
|
+
atmosphereMotions: "16:9"
|
|
762
|
+
},
|
|
763
|
+
// Creatures (animals): turnaround angles & condition variations read square;
|
|
764
|
+
// full-body poses read taller (portrait); motion clips are vertical.
|
|
765
|
+
creature: {
|
|
766
|
+
angles: "1:1",
|
|
767
|
+
poses: "3:4",
|
|
768
|
+
variations: "1:1",
|
|
769
|
+
motion: "9:16"
|
|
770
|
+
},
|
|
771
|
+
// Objects/props: product turnarounds, materials, and condition variants are
|
|
772
|
+
// square; motion clips are vertical.
|
|
773
|
+
object: {
|
|
774
|
+
angles: "1:1",
|
|
775
|
+
materials: "1:1",
|
|
776
|
+
variations: "1:1",
|
|
777
|
+
motion: "9:16"
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
var RATIO_RE = /^\d+:\d+$/;
|
|
781
|
+
function resolveEntityAspect(opts) {
|
|
782
|
+
if (opts.explicit && RATIO_RE.test(opts.explicit)) return opts.explicit;
|
|
783
|
+
if (opts.nodeOverride && RATIO_RE.test(opts.nodeOverride)) return opts.nodeOverride;
|
|
784
|
+
return ENTITY_ASPECT_DEFAULTS[opts.entity]?.[opts.assetType] ?? "1:1";
|
|
785
|
+
}
|
|
786
|
+
function aspectRatioToNumber(ratio) {
|
|
787
|
+
const m = /^(\d+):(\d+)$/.exec(ratio.trim());
|
|
788
|
+
if (!m) return 1;
|
|
789
|
+
const w = Number(m[1]);
|
|
790
|
+
const h = Number(m[2]);
|
|
791
|
+
return w > 0 && h > 0 ? w / h : 1;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// src/reference-sheet/types.ts
|
|
795
|
+
var SHEET_TYPES = ["turnaround", "variation-board", "detail", "full-reference"];
|
|
796
|
+
var SHEET_SKINS = ["studio", "cinematic", "blueprint", "illustrated"];
|
|
797
|
+
var SHEET_ASPECTS = ["landscape", "square", "story"];
|
|
798
|
+
var OUTPUT_FORMATS = ["still", "motion"];
|
|
799
|
+
var SECTION_KINDS = [
|
|
800
|
+
"header",
|
|
801
|
+
"head-turnaround",
|
|
802
|
+
"body-turnaround",
|
|
803
|
+
"turnaround",
|
|
804
|
+
"coverage",
|
|
805
|
+
"expression-board",
|
|
806
|
+
"pose-board",
|
|
807
|
+
"material-board",
|
|
808
|
+
"variation-board",
|
|
809
|
+
"environment-board",
|
|
810
|
+
"detail-board",
|
|
811
|
+
"wardrobe-board",
|
|
812
|
+
"palette",
|
|
813
|
+
"scale",
|
|
814
|
+
"notes"
|
|
815
|
+
];
|
|
816
|
+
var SHEET_BACKGROUNDS = ["grey", "white", "transparent", "in-context"];
|
|
817
|
+
var MAX_PANELS_PER_SHEET = 24;
|
|
818
|
+
var MAX_CUSTOM_ENTRIES_PER_BOARD = 12;
|
|
819
|
+
|
|
820
|
+
// src/entity-asset-types.ts
|
|
821
|
+
var CHARACTER_STYLES = ["realistic", "anime", "3d-pixar", "illustration"];
|
|
822
|
+
var CHARACTER_ASSET_TYPES = [
|
|
823
|
+
"expressions",
|
|
824
|
+
"poses",
|
|
825
|
+
"lighting",
|
|
826
|
+
"angles",
|
|
827
|
+
"headAngles",
|
|
828
|
+
"bodyAngles",
|
|
829
|
+
"custom"
|
|
830
|
+
];
|
|
831
|
+
var CHARACTER_ATTACH_COLUMNS = [
|
|
832
|
+
"expressions",
|
|
833
|
+
"poses",
|
|
834
|
+
"angles",
|
|
835
|
+
"body_angles",
|
|
836
|
+
"lighting_variations",
|
|
837
|
+
// Reference-sheet buckets (migration 200). `sheets` holds composited
|
|
838
|
+
// reference sheets; `detail_closeups` holds macro close-up panels;
|
|
839
|
+
// `outfit_variations` holds wardrobe panels (character-only — objects and
|
|
840
|
+
// locations don't have an outfit dimension).
|
|
841
|
+
"sheets",
|
|
842
|
+
"detail_closeups",
|
|
843
|
+
"outfit_variations",
|
|
844
|
+
// Named composite reference boards (migration 250) — identity-collage
|
|
845
|
+
// sheets auto-attached by the ffmpeg image-collage worker.
|
|
846
|
+
"boards"
|
|
847
|
+
];
|
|
848
|
+
var CHARACTER_ASSET_VARIANTS = {
|
|
849
|
+
expressions: [
|
|
850
|
+
"neutral",
|
|
851
|
+
"smile",
|
|
852
|
+
"angry",
|
|
853
|
+
"surprised",
|
|
854
|
+
"sad",
|
|
855
|
+
"talking",
|
|
856
|
+
"laughing",
|
|
857
|
+
"disgusted",
|
|
858
|
+
"fearful",
|
|
859
|
+
"smirk",
|
|
860
|
+
"crying"
|
|
861
|
+
],
|
|
862
|
+
poses: [
|
|
863
|
+
"standing",
|
|
864
|
+
"walking",
|
|
865
|
+
"sitting",
|
|
866
|
+
"running",
|
|
867
|
+
"crouching",
|
|
868
|
+
"pointing",
|
|
869
|
+
"fighting stance",
|
|
870
|
+
"jumping",
|
|
871
|
+
"turning"
|
|
872
|
+
],
|
|
873
|
+
lighting: ["daylight", "night", "dramatic"],
|
|
874
|
+
angles: ["front", "3/4 left", "left profile", "right profile", "3/4 right", "back", "above", "below"],
|
|
875
|
+
headAngles: ["front", "3/4 left", "left profile", "right profile", "3/4 right", "above", "below", "back"],
|
|
876
|
+
bodyAngles: ["front", "3/4 left", "left profile", "right profile", "3/4 right", "back", "above", "below"]
|
|
877
|
+
};
|
|
878
|
+
var LOCATION_ASSET_TYPES = [
|
|
879
|
+
"timeOfDay",
|
|
880
|
+
"weather",
|
|
881
|
+
"seasons",
|
|
882
|
+
"angles",
|
|
883
|
+
"lighting",
|
|
884
|
+
"custom"
|
|
885
|
+
];
|
|
886
|
+
var LOCATION_ATTACH_COLUMNS = [
|
|
887
|
+
"time_of_day",
|
|
888
|
+
"weather",
|
|
889
|
+
"seasons",
|
|
890
|
+
"angles",
|
|
891
|
+
"lighting",
|
|
892
|
+
"atmosphere_motions",
|
|
893
|
+
// Reference-sheet buckets (migration 200). Locations get `sheets` +
|
|
894
|
+
// `detail_closeups` (no `outfit_variations` — that's character-only).
|
|
895
|
+
"sheets",
|
|
896
|
+
"detail_closeups"
|
|
897
|
+
];
|
|
898
|
+
var LOCATION_ASSET_VARIANTS = {
|
|
899
|
+
timeOfDay: ["dawn", "morning", "noon", "afternoon", "golden hour", "dusk", "blue hour", "night", "midnight"],
|
|
900
|
+
weather: ["clear", "cloudy", "light rain", "heavy rain", "storm", "snow", "blizzard", "fog", "mist"],
|
|
901
|
+
seasons: ["spring", "summer", "autumn", "winter"],
|
|
902
|
+
angles: ["wide", "medium", "closeup", "aerial", "low-angle", "eye-level", "bird's-eye", "dutch tilt"],
|
|
903
|
+
lighting: ["soft natural", "harsh sunlight", "golden", "blue hour", "neon", "candlelit", "cinematic", "dramatic chiaroscuro"]
|
|
904
|
+
};
|
|
905
|
+
var LOCATION_REFERENCE_PHOTO_KINDS = [
|
|
906
|
+
"wide",
|
|
907
|
+
"interior",
|
|
908
|
+
"exterior",
|
|
909
|
+
"detail",
|
|
910
|
+
"moodBoard",
|
|
911
|
+
"other"
|
|
912
|
+
];
|
|
913
|
+
var LOCATION_REFERENCE_PHOTO_KIND_LABELS = {
|
|
914
|
+
wide: "wide-angle reference",
|
|
915
|
+
interior: "interior reference",
|
|
916
|
+
exterior: "exterior reference",
|
|
917
|
+
detail: "detail reference",
|
|
918
|
+
moodBoard: "mood-board reference",
|
|
919
|
+
other: "reference"
|
|
920
|
+
};
|
|
921
|
+
function locationReferencePhotoKindLabel(kind) {
|
|
922
|
+
return LOCATION_REFERENCE_PHOTO_KIND_LABELS[kind];
|
|
923
|
+
}
|
|
924
|
+
var CHARACTER_REFERENCE_PHOTO_KINDS = [
|
|
925
|
+
"frontFace",
|
|
926
|
+
"sideLeft",
|
|
927
|
+
"sideRight",
|
|
928
|
+
"threeQuarterLeft",
|
|
929
|
+
"threeQuarterRight",
|
|
930
|
+
"frontBody",
|
|
931
|
+
"other"
|
|
932
|
+
];
|
|
933
|
+
var PLACEHOLDER_CHARACTER_NAME = "Untitled character";
|
|
934
|
+
var OBJECT_ASSET_TYPES = [
|
|
935
|
+
"angles",
|
|
936
|
+
"materials",
|
|
937
|
+
"variations",
|
|
938
|
+
"motion",
|
|
939
|
+
"custom"
|
|
940
|
+
];
|
|
941
|
+
var OBJECT_ATTACH_COLUMNS = [
|
|
942
|
+
"angles",
|
|
943
|
+
"materials",
|
|
944
|
+
"variations",
|
|
945
|
+
"motion_clips",
|
|
946
|
+
// Reference-sheet buckets (migration 200). Objects get `sheets` +
|
|
947
|
+
// `detail_closeups` (no `outfit_variations` — that's character-only).
|
|
948
|
+
"sheets",
|
|
949
|
+
"detail_closeups"
|
|
950
|
+
];
|
|
951
|
+
var CREATURE_ATTACH_COLUMNS = [
|
|
952
|
+
"angles",
|
|
953
|
+
"poses",
|
|
954
|
+
"variations",
|
|
955
|
+
"motion_clips",
|
|
956
|
+
"sheets",
|
|
957
|
+
"detail_closeups"
|
|
958
|
+
];
|
|
959
|
+
var OBJECT_ASSET_VARIANTS = {
|
|
960
|
+
angles: ["front", "side", "top", "back", "three-quarter"],
|
|
961
|
+
materials: ["wood", "metal", "glass", "plastic", "fabric", "stone"],
|
|
962
|
+
variations: ["clean", "weathered", "damaged", "ornate", "minimal"]
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
// src/reference-sheet/catalog.ts
|
|
966
|
+
var DETAIL_VARIANTS = {
|
|
967
|
+
character: ["eyes", "hands", "hair detail"],
|
|
968
|
+
object: ["texture", "material detail", "key part"],
|
|
969
|
+
location: ["architectural detail", "material detail", "focal element"]
|
|
970
|
+
};
|
|
971
|
+
var WARDROBE_VARIANTS = ["base look", "alternate look", "sporty"];
|
|
972
|
+
var BOARD_VARIANTS = {
|
|
973
|
+
character: {
|
|
974
|
+
headAngles: CHARACTER_ASSET_VARIANTS.headAngles,
|
|
975
|
+
bodyAngles: CHARACTER_ASSET_VARIANTS.bodyAngles,
|
|
976
|
+
expressions: CHARACTER_ASSET_VARIANTS.expressions,
|
|
977
|
+
poses: CHARACTER_ASSET_VARIANTS.poses,
|
|
978
|
+
lighting: CHARACTER_ASSET_VARIANTS.lighting,
|
|
979
|
+
detail: DETAIL_VARIANTS.character,
|
|
980
|
+
wardrobe: WARDROBE_VARIANTS
|
|
981
|
+
},
|
|
982
|
+
object: {
|
|
983
|
+
angles: OBJECT_ASSET_VARIANTS.angles,
|
|
984
|
+
materials: OBJECT_ASSET_VARIANTS.materials,
|
|
985
|
+
variations: OBJECT_ASSET_VARIANTS.variations,
|
|
986
|
+
detail: DETAIL_VARIANTS.object
|
|
987
|
+
},
|
|
988
|
+
location: {
|
|
989
|
+
angles: LOCATION_ASSET_VARIANTS.angles,
|
|
990
|
+
timeOfDay: LOCATION_ASSET_VARIANTS.timeOfDay,
|
|
991
|
+
weather: LOCATION_ASSET_VARIANTS.weather,
|
|
992
|
+
seasons: LOCATION_ASSET_VARIANTS.seasons,
|
|
993
|
+
lighting: LOCATION_ASSET_VARIANTS.lighting,
|
|
994
|
+
detail: DETAIL_VARIANTS.location
|
|
995
|
+
}
|
|
996
|
+
};
|
|
997
|
+
var STRUCTURAL_SECTIONS = /* @__PURE__ */ new Set(["header", "palette", "scale", "notes"]);
|
|
998
|
+
var SECTION_BOARD = {
|
|
999
|
+
header: null,
|
|
1000
|
+
palette: null,
|
|
1001
|
+
scale: null,
|
|
1002
|
+
notes: null,
|
|
1003
|
+
"head-turnaround": "headAngles",
|
|
1004
|
+
"body-turnaround": "bodyAngles",
|
|
1005
|
+
turnaround: "angles",
|
|
1006
|
+
coverage: "angles",
|
|
1007
|
+
"expression-board": "expressions",
|
|
1008
|
+
"pose-board": "poses",
|
|
1009
|
+
"material-board": "materials",
|
|
1010
|
+
"variation-board": "variations",
|
|
1011
|
+
"environment-board": null,
|
|
1012
|
+
// requires explicit section.board (timeOfDay|weather|seasons)
|
|
1013
|
+
"detail-board": "detail",
|
|
1014
|
+
"wardrobe-board": "wardrobe"
|
|
1015
|
+
};
|
|
1016
|
+
var ENTITY_SECTIONS = {
|
|
1017
|
+
character: [
|
|
1018
|
+
"header",
|
|
1019
|
+
"head-turnaround",
|
|
1020
|
+
"body-turnaround",
|
|
1021
|
+
"expression-board",
|
|
1022
|
+
"pose-board",
|
|
1023
|
+
"detail-board",
|
|
1024
|
+
"wardrobe-board",
|
|
1025
|
+
"palette",
|
|
1026
|
+
"scale",
|
|
1027
|
+
"notes"
|
|
1028
|
+
],
|
|
1029
|
+
object: [
|
|
1030
|
+
"header",
|
|
1031
|
+
"turnaround",
|
|
1032
|
+
"material-board",
|
|
1033
|
+
"variation-board",
|
|
1034
|
+
"detail-board",
|
|
1035
|
+
"palette",
|
|
1036
|
+
"scale",
|
|
1037
|
+
"notes"
|
|
1038
|
+
],
|
|
1039
|
+
location: ["header", "coverage", "environment-board", "detail-board", "palette", "scale", "notes"]
|
|
1040
|
+
};
|
|
1041
|
+
var sec = (kind, extra = {}) => ({ kind, ...extra });
|
|
1042
|
+
var DEFAULT_SECTIONS = {
|
|
1043
|
+
character: {
|
|
1044
|
+
turnaround: [sec("header"), sec("head-turnaround")],
|
|
1045
|
+
"variation-board": [sec("header"), sec("expression-board")],
|
|
1046
|
+
detail: [sec("header"), sec("detail-board")],
|
|
1047
|
+
"full-reference": [
|
|
1048
|
+
sec("header"),
|
|
1049
|
+
sec("head-turnaround"),
|
|
1050
|
+
sec("expression-board"),
|
|
1051
|
+
sec("body-turnaround"),
|
|
1052
|
+
sec("pose-board"),
|
|
1053
|
+
sec("detail-board"),
|
|
1054
|
+
sec("wardrobe-board"),
|
|
1055
|
+
sec("palette"),
|
|
1056
|
+
sec("notes")
|
|
1057
|
+
]
|
|
1058
|
+
},
|
|
1059
|
+
object: {
|
|
1060
|
+
turnaround: [sec("header"), sec("turnaround")],
|
|
1061
|
+
"variation-board": [sec("header"), sec("material-board")],
|
|
1062
|
+
detail: [sec("header"), sec("detail-board")],
|
|
1063
|
+
"full-reference": [
|
|
1064
|
+
sec("header"),
|
|
1065
|
+
sec("turnaround"),
|
|
1066
|
+
sec("material-board"),
|
|
1067
|
+
sec("variation-board"),
|
|
1068
|
+
sec("detail-board"),
|
|
1069
|
+
sec("palette"),
|
|
1070
|
+
sec("notes")
|
|
1071
|
+
]
|
|
1072
|
+
},
|
|
1073
|
+
location: {
|
|
1074
|
+
turnaround: [sec("header"), sec("coverage")],
|
|
1075
|
+
"variation-board": [sec("header"), sec("environment-board", { board: "timeOfDay" })],
|
|
1076
|
+
detail: [sec("header"), sec("detail-board")],
|
|
1077
|
+
"full-reference": [
|
|
1078
|
+
sec("header"),
|
|
1079
|
+
sec("coverage"),
|
|
1080
|
+
sec("environment-board", { board: "timeOfDay" }),
|
|
1081
|
+
sec("environment-board", { board: "weather" }),
|
|
1082
|
+
sec("detail-board"),
|
|
1083
|
+
sec("palette"),
|
|
1084
|
+
sec("notes")
|
|
1085
|
+
]
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
var DEFAULT_PANEL_COUNT = 4;
|
|
1089
|
+
var BOARD_TO_COLUMN = {
|
|
1090
|
+
character: { headAngles: "angles", bodyAngles: "body_angles", expressions: "expressions", poses: "poses", lighting: "lighting_variations", detail: "detail_closeups", wardrobe: "outfit_variations" },
|
|
1091
|
+
object: { angles: "angles", materials: "materials", variations: "variations", detail: "detail_closeups" },
|
|
1092
|
+
location: { angles: "angles", timeOfDay: "time_of_day", weather: "weather", seasons: "seasons", lighting: "lighting", detail: "detail_closeups" }
|
|
1093
|
+
};
|
|
1094
|
+
var MOTION_COLUMN = {
|
|
1095
|
+
character: "motions",
|
|
1096
|
+
object: "motion_clips",
|
|
1097
|
+
location: "atmosphere_motions"
|
|
1098
|
+
};
|
|
1099
|
+
var BOARD_TO_ASSET_TYPE = {
|
|
1100
|
+
character: { headAngles: "headAngles", bodyAngles: "bodyAngles", expressions: "expressions", poses: "poses", lighting: "lighting", detail: "custom", wardrobe: "custom" },
|
|
1101
|
+
object: { angles: "angles", materials: "materials", variations: "variations", detail: "custom" },
|
|
1102
|
+
location: { angles: "angles", timeOfDay: "timeOfDay", weather: "weather", seasons: "seasons", lighting: "lighting", detail: "custom" }
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
// src/reference-sheet/panel-plan.ts
|
|
1106
|
+
function resolveBoard(entityKind, section) {
|
|
1107
|
+
if (STRUCTURAL_SECTIONS.has(section.kind)) return null;
|
|
1108
|
+
const board = section.board ?? SECTION_BOARD[section.kind];
|
|
1109
|
+
if (!board || !BOARD_VARIANTS[entityKind][board]) {
|
|
1110
|
+
throw new Error(
|
|
1111
|
+
`Section "${section.kind}" has no resolvable board for ${entityKind} (board=${board ?? "?"}) \u2014 board sections like environment-board require an explicit section.board valid for the entity`
|
|
1112
|
+
);
|
|
1113
|
+
}
|
|
1114
|
+
return board;
|
|
1115
|
+
}
|
|
1116
|
+
function planSheetPanels(entityKind, sections, _flavour) {
|
|
1117
|
+
const panels = [];
|
|
1118
|
+
for (const section of sections) {
|
|
1119
|
+
const board = resolveBoard(entityKind, section);
|
|
1120
|
+
if (board === null) continue;
|
|
1121
|
+
const customs = (section.entries ?? []).filter((e) => e.kind === "custom");
|
|
1122
|
+
if (customs.length > MAX_CUSTOM_ENTRIES_PER_BOARD) {
|
|
1123
|
+
throw new Error(`Too many custom entries on ${section.kind} (${customs.length} > ${MAX_CUSTOM_ENTRIES_PER_BOARD})`);
|
|
1124
|
+
}
|
|
1125
|
+
if (section.entries && section.entries.length > 0) {
|
|
1126
|
+
for (const e of section.entries) {
|
|
1127
|
+
if (e.kind === "custom") {
|
|
1128
|
+
panels.push({ section: section.kind, board, variant: e.label, label: e.label, custom: true, prompt: e.prompt });
|
|
1129
|
+
} else {
|
|
1130
|
+
panels.push({ section: section.kind, board, variant: e.variant, label: e.variant, custom: false });
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
} else {
|
|
1134
|
+
const available = BOARD_VARIANTS[entityKind][board];
|
|
1135
|
+
const count = Math.max(0, Math.min(section.panelCount ?? DEFAULT_PANEL_COUNT, available.length));
|
|
1136
|
+
for (const variant of available.slice(0, count)) {
|
|
1137
|
+
panels.push({ section: section.kind, board, variant, label: variant, custom: false });
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
if (panels.length > MAX_PANELS_PER_SHEET) {
|
|
1142
|
+
throw new Error(`Sheet plan has too many panels (${panels.length} > MAX_PANELS_PER_SHEET=${MAX_PANELS_PER_SHEET})`);
|
|
1143
|
+
}
|
|
1144
|
+
return panels;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// src/reference-sheet/panel-prompts.ts
|
|
1148
|
+
function buildPanelPrompt(entityKind, board, variant, name) {
|
|
1149
|
+
if (board === "detail") {
|
|
1150
|
+
return `Extreme close-up macro detail of ${name}'s ${variant}, sharp focus on the ${variant}, neutral background, no text.`;
|
|
1151
|
+
}
|
|
1152
|
+
if (board === "wardrobe") {
|
|
1153
|
+
return `Full-body view of ${name} wearing the "${variant}" outfit, consistent character, neutral studio background, no text.`;
|
|
1154
|
+
}
|
|
1155
|
+
return `${name}, ${variant}. Consistent character, neutral background, no text.`;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// src/reference-sheet/plan-generation.ts
|
|
1159
|
+
function resolveSheetSections(entityKind, type, sections) {
|
|
1160
|
+
const base = sections?.length ? sections : DEFAULT_SECTIONS[entityKind][type] ?? [];
|
|
1161
|
+
return base.map((s) => ({ ...s }));
|
|
1162
|
+
}
|
|
1163
|
+
function matchVariant(items, variant) {
|
|
1164
|
+
return items.find((it) => it?.name === variant && typeof it?.url === "string" && it.url.length > 0);
|
|
1165
|
+
}
|
|
1166
|
+
function planSheetGeneration(entityKind, sections, flavour, bucketsByColumn, name) {
|
|
1167
|
+
const plan = planSheetPanels(entityKind, sections);
|
|
1168
|
+
const presentUrls = [];
|
|
1169
|
+
const missing = [];
|
|
1170
|
+
for (const p of plan) {
|
|
1171
|
+
const column = BOARD_TO_COLUMN[entityKind][p.board];
|
|
1172
|
+
const items = (column ? bucketsByColumn[column] : void 0) ?? [];
|
|
1173
|
+
const match = matchVariant(items, p.variant);
|
|
1174
|
+
if (match?.url) {
|
|
1175
|
+
presentUrls.push(match.url);
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1178
|
+
const assetType = BOARD_TO_ASSET_TYPE[entityKind][p.board] ?? "custom";
|
|
1179
|
+
const userPrompt = p.custom ? p.prompt : assetType === "custom" ? buildPanelPrompt(entityKind, p.board, p.variant, name) : void 0;
|
|
1180
|
+
missing.push({ assetType, variant: p.variant, attachToColumn: column, attachName: p.variant, userPrompt });
|
|
1181
|
+
}
|
|
1182
|
+
return { presentUrls, missing };
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// src/reference-sheet/credit-id.ts
|
|
1186
|
+
function referenceSheetCreditId(flavour) {
|
|
1187
|
+
return flavour?.outputFormat === "motion" ? "reference-sheet:assembly-motion" : "reference-sheet:assembly";
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// src/reference-sheet/presets.ts
|
|
1191
|
+
var presetEntries = (vs) => vs.map((variant) => ({ kind: "preset", variant }));
|
|
1192
|
+
var SHEET_PRESETS = [
|
|
1193
|
+
{
|
|
1194
|
+
id: "studio-main",
|
|
1195
|
+
label: "Studio \xB7 Main",
|
|
1196
|
+
description: "Clean turnaround for AI video reference \u2014 head (front, profiles, back) + body (front, side, back).",
|
|
1197
|
+
type: "turnaround",
|
|
1198
|
+
skin: "studio",
|
|
1199
|
+
aspect: "landscape",
|
|
1200
|
+
baseSections: [
|
|
1201
|
+
{ kind: "head-turnaround", entries: presetEntries(["front", "left profile", "right profile", "back"]) },
|
|
1202
|
+
{ kind: "body-turnaround", entries: presetEntries(["front", "left profile", "back"]) }
|
|
1203
|
+
]
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
id: "studio-extended",
|
|
1207
|
+
label: "Studio \xB7 Extended",
|
|
1208
|
+
description: "Full turnaround \u2014 adds above/below and 3/4 angles for maximum coverage.",
|
|
1209
|
+
type: "full-reference",
|
|
1210
|
+
skin: "studio",
|
|
1211
|
+
aspect: "landscape",
|
|
1212
|
+
baseSections: [
|
|
1213
|
+
{ kind: "head-turnaround", entries: presetEntries(["front", "3/4 left", "left profile", "right profile", "3/4 right", "above", "below", "back"]) },
|
|
1214
|
+
{ kind: "body-turnaround", entries: presetEntries(["front", "3/4 left", "left profile", "right profile", "back", "above", "below"]) }
|
|
1215
|
+
]
|
|
1216
|
+
}
|
|
1217
|
+
];
|
|
1218
|
+
var PRESET_LABELS = {
|
|
1219
|
+
"studio-main": "Studio \xB7 Main",
|
|
1220
|
+
"studio-extended": "Studio \xB7 Extended"
|
|
1221
|
+
};
|
|
1222
|
+
var ALA_CARTE_BOARDS = [
|
|
1223
|
+
{ id: "expressions", label: "Expressions", panelCount: 4, section: { kind: "expression-board" } },
|
|
1224
|
+
{ id: "poses", label: "Poses", panelCount: 4, section: { kind: "pose-board" } },
|
|
1225
|
+
{ id: "wardrobe", label: "Wardrobe", panelCount: 3, section: { kind: "wardrobe-board" } },
|
|
1226
|
+
{ id: "detail", label: "Detail", panelCount: 3, section: { kind: "detail-board" } },
|
|
1227
|
+
{ id: "palette", label: "Palette", panelCount: 0, section: { kind: "palette" } }
|
|
1228
|
+
];
|
|
1229
|
+
|
|
1230
|
+
// src/reference-sheet/cost.ts
|
|
1231
|
+
function estimateSheetCost(entityKind, sections, flavour, buckets, name, perPanelCost, assemblyCost) {
|
|
1232
|
+
try {
|
|
1233
|
+
const { presentUrls, missing } = planSheetGeneration(entityKind, sections, flavour, buckets, name);
|
|
1234
|
+
const prepareCost = missing.length * perPanelCost;
|
|
1235
|
+
return { present: presentUrls.length, missing, prepareCost, assemblyCost, total: prepareCost + assemblyCost, overflow: false };
|
|
1236
|
+
} catch {
|
|
1237
|
+
return { present: 0, missing: [], prepareCost: 0, assemblyCost, total: assemblyCost, overflow: true };
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// src/reference-board-templates.ts
|
|
1242
|
+
var REFERENCE_BOARD_PROVIDERS = [
|
|
1243
|
+
"nano-banana-pro",
|
|
1244
|
+
"gpt-image-2",
|
|
1245
|
+
"gpt-image-2-5-flare",
|
|
1246
|
+
"gpt-image-2-5-sunburst"
|
|
1247
|
+
];
|
|
1248
|
+
var ANTI_RIGID = "Editorial reference-board layout, dark near-black background, thin yellow neon accent light, faint film-grain overlay, production-grade design UI. Organized but not rigidly locked: panels may shift position from generation to generation while staying readable, balanced and premium. Works cleanly in different aspect ratios without depending on a fixed left-column structure. All on-image labels in ENGLISH.";
|
|
1249
|
+
var PALETTE = "A COLOR PALETTE panel: 6 swatches with HEX codes derived from the dominant tones.";
|
|
1250
|
+
var CAPTION = (kind) => `Bottom caption: "Use this ${kind} board as a visual reference for consistent depiction across all generations." Bottom-right tags: STYLE \xB7 Modern \xB7 Realistic \xB7 Cinematic. Style: photorealistic, no illustration. 8K, fine grain, cinematic color grading.`;
|
|
1251
|
+
var subj = (ctx, fallback) => ctx.description?.trim() ? ctx.description.trim() : fallback;
|
|
1252
|
+
var characterFullBoard = (ctx) => `Create a single high-resolution, densely packed character reference sheet titled "CHARACTER BOARD" using the attached photo as the single source of truth for face, hair, eyes, skin tone and body proportions of ${subj(ctx, "the attached person")}. The same person appears in every panel \u2014 same age, same features. ${ANTI_RIGID} Include a large hero portrait + metadata block: NAME \xB7 AGE \xB7 HEIGHT \xB7 BUILD \xB7 HAIR \xB7 EYES \xB7 FEATURES \xB7 OUTFIT \xB7 CHARACTER \xB7 MOOD. Six panels: VIEWS (front \xB7 3/4 \xB7 side \xB7 back) \xB7 EXPRESSIONS (5 headshots) \xB7 DETAILS (face/eyes, hand, outfit macro) \xB7 OUTFIT FLAT-LAYS (5 isolated product shots) \xB7 LIGHTING/MOOD (4 lighting setups) \xB7 ${PALETTE} ${CAPTION("character")}`;
|
|
1253
|
+
var locationFullBoard = (ctx) => `Create a single high-resolution, densely packed location reference sheet titled "LOCATION BOARD" using the attached photo as the single source of truth for architecture, atmosphere, lighting, materials and color of ${subj(ctx, "the attached location")}. The space is identical across every panel \u2014 same place, materials, era. ${ANTI_RIGID} Include a hero establishing shot + metadata block: NAME \xB7 TYPE \xB7 ERA \xB7 SCALE \xB7 ARCHITECTURE \xB7 MATERIALS \xB7 ATMOSPHERE \xB7 DEFAULT TIME \xB7 DEFAULT WEATHER \xB7 PURPOSE. Six panels: VIEWS (wide \xB7 mid \xB7 tight \xB7 alt \xB7 overhead) \xB7 TIME OF DAY (dawn \xB7 noon \xB7 dusk \xB7 night) \xB7 DETAILS (material, architectural) \xB7 SET DRESSING / PROPS (5 studies) \xB7 WEATHER/MOOD (clear \xB7 overcast \xB7 rain \xB7 fog) \xB7 ${PALETTE} ${CAPTION("location")}`;
|
|
1254
|
+
var objectFullBoard = (ctx) => `Create a single high-resolution, densely packed object reference sheet titled "OBJECT BOARD" using the attached photo as the single source of truth for shape, materials, finish and proportions of ${subj(ctx, "the attached object")}. The object is identical across every panel. ${ANTI_RIGID} Include a hero shot + metadata block: NAME \xB7 TYPE \xB7 SCALE \xB7 MATERIALS \xB7 FINISH \xB7 KEY FEATURES \xB7 FUNCTION \xB7 MOOD. Six panels: VIEWS (front \xB7 3/4 \xB7 side \xB7 back \xB7 top) \xB7 MATERIALS (close studies) \xB7 DETAILS (key part macros) \xB7 VARIATIONS (color/finish options) \xB7 LIGHTING/MOOD (4 setups) \xB7 ${PALETTE} ${CAPTION("object")}`;
|
|
1255
|
+
var t = (entityKind, slug, label, build) => ({ id: `${entityKind}/${slug}`, entityKind, label, build });
|
|
1256
|
+
var REFERENCE_BOARD_TEMPLATES = [
|
|
1257
|
+
t("character", "full-board", "Full Board \u2014 hero + 6 panels + palette", characterFullBoard),
|
|
1258
|
+
t("location", "full-board", "Full Board \u2014 hero + 6 panels + palette", locationFullBoard),
|
|
1259
|
+
t("object", "full-board", "Full Board \u2014 hero + 6 panels + palette", objectFullBoard)
|
|
1260
|
+
];
|
|
1261
|
+
function listBoardTemplates(kind) {
|
|
1262
|
+
return REFERENCE_BOARD_TEMPLATES.filter((x) => x.entityKind === kind);
|
|
1263
|
+
}
|
|
1264
|
+
function buildBoardPrompt(templateId, ctx) {
|
|
1265
|
+
const tpl = REFERENCE_BOARD_TEMPLATES.find((x) => x.id === templateId);
|
|
1266
|
+
if (!tpl) throw new Error(`Unknown reference-board template: ${templateId}`);
|
|
1267
|
+
return tpl.build(ctx);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// src/entity-image-handle.ts
|
|
1271
|
+
var ENTITY_IMAGE_HANDLE_TYPES = /* @__PURE__ */ new Set([
|
|
1272
|
+
"character",
|
|
1273
|
+
"location",
|
|
1274
|
+
"object",
|
|
1275
|
+
"creature"
|
|
1276
|
+
]);
|
|
1277
|
+
var AGGREGATE_LANE_SOURCE_TYPES = /* @__PURE__ */ new Set(["group", "collect"]);
|
|
1278
|
+
var AGGREGATE_LANE_EFFECTIVE_TYPE = {
|
|
1279
|
+
"out-image": "upload-image",
|
|
1280
|
+
"out-video": "upload-video",
|
|
1281
|
+
"out-audio": "upload-audio",
|
|
1282
|
+
"out-text": "list"
|
|
1283
|
+
};
|
|
1284
|
+
var SCRAPER_HANDLE_EFFECTIVE_TYPE = {
|
|
1285
|
+
text: "combine-text",
|
|
1286
|
+
image: "upload-image",
|
|
1287
|
+
video: "upload-video"
|
|
1288
|
+
};
|
|
1289
|
+
var SCRAPER_SOURCE_TYPES = /* @__PURE__ */ new Set(["meta-ads-scrape", "instagram-scrape"]);
|
|
1290
|
+
var OUTPUT_PIP_EFFECTIVE_TYPES = Object.freeze({
|
|
1291
|
+
// UGC Creator's `image`: the creator's first image, for any image input.
|
|
1292
|
+
"ugc-creator": Object.freeze({ image: "upload-image" }),
|
|
1293
|
+
// Site Capture's `image`: its section stills — the first on a plain wire, each or all on an Each / Bundle wire.
|
|
1294
|
+
"site-capture": Object.freeze({ image: "upload-image" }),
|
|
1295
|
+
// The UGC nodes' plain-text pips — the script's product category, the clips'
|
|
1296
|
+
// transcript, the cards' Notes — are one text each (`combine-text`: one
|
|
1297
|
+
// string, not a list): they reach text and prompt inputs, never a JSON input.
|
|
1298
|
+
"ugc-script": Object.freeze({ category: "combine-text" }),
|
|
1299
|
+
"ugc-clips": Object.freeze({ transcript: "combine-text" }),
|
|
1300
|
+
"ugc-cards": Object.freeze({ report: "combine-text" })
|
|
1301
|
+
});
|
|
1302
|
+
var own = (table, key) => Object.hasOwn(table, key) ? table[key] : void 0;
|
|
1303
|
+
function outputPipSourceType(rawSourceType, sourceHandleId) {
|
|
1304
|
+
const type = rawSourceType ?? "";
|
|
1305
|
+
const pips = own(OUTPUT_PIP_EFFECTIVE_TYPES, type);
|
|
1306
|
+
return (pips && typeof sourceHandleId === "string" ? own(pips, sourceHandleId) : void 0) ?? type;
|
|
1307
|
+
}
|
|
1308
|
+
function resolveEffectiveSourceType(rawSourceType, sourceHandleId) {
|
|
1309
|
+
if (sourceHandleId === "image" && ENTITY_IMAGE_HANDLE_TYPES.has(rawSourceType ?? "")) {
|
|
1310
|
+
return "upload-image";
|
|
1311
|
+
}
|
|
1312
|
+
const pipType = outputPipSourceType(rawSourceType, sourceHandleId);
|
|
1313
|
+
if (pipType !== (rawSourceType ?? "")) return pipType;
|
|
1314
|
+
if (AGGREGATE_LANE_SOURCE_TYPES.has(rawSourceType ?? "")) {
|
|
1315
|
+
const effective = AGGREGATE_LANE_EFFECTIVE_TYPE[sourceHandleId ?? ""];
|
|
1316
|
+
if (effective) return effective;
|
|
1317
|
+
}
|
|
1318
|
+
if (SCRAPER_SOURCE_TYPES.has(rawSourceType ?? "")) {
|
|
1319
|
+
const effective = SCRAPER_HANDLE_EFFECTIVE_TYPE[sourceHandleId ?? ""];
|
|
1320
|
+
if (effective) return effective;
|
|
1321
|
+
}
|
|
1322
|
+
return rawSourceType ?? "";
|
|
1323
|
+
}
|
|
1324
|
+
function sourceRefKey(nodeId, sourceHandleId, rawSourceType) {
|
|
1325
|
+
return sourceHandleId === "image" && ENTITY_IMAGE_HANDLE_TYPES.has(rawSourceType ?? "") ? `${nodeId}::image` : nodeId;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
// src/reference-roles.ts
|
|
1329
|
+
var REFERENCE_ROLE_PRESETS = {
|
|
1330
|
+
"wired-character": ["ref-only", "person", "face", "clothes", "hair", "pose", "expression", "style"],
|
|
1331
|
+
"wired-face": ["face", "person", "expression", "style"],
|
|
1332
|
+
// "location" sits second, mirroring wired-character's ref-only/person order —
|
|
1333
|
+
// it is this source's default. "background" keeps its place for the genuine
|
|
1334
|
+
// backdrop case (see DEFAULT_LABEL_BY_SOURCE for why it stopped being default).
|
|
1335
|
+
"wired-location": ["ref-only", "location", "background", "atmosphere", "as-is", "empty background", "layout", "lighting", "style"],
|
|
1336
|
+
"wired-object": ["object", "shape", "material", "color", "texture", "style"],
|
|
1337
|
+
"wired-creature": ["creature", "anatomy", "markings", "pose", "color", "style"],
|
|
1338
|
+
"wired-image": ["object", "person", "face", "clothes", "background", "style", "pose", "texture"],
|
|
1339
|
+
"manual": ["object", "person", "face", "clothes", "background", "style", "pose", "texture"]
|
|
1340
|
+
};
|
|
1341
|
+
function defaultRoleForSource(source) {
|
|
1342
|
+
return DEFAULT_LABEL_BY_SOURCE[source];
|
|
1343
|
+
}
|
|
1344
|
+
function roleToPhrase(role, binding) {
|
|
1345
|
+
const r = role.trim();
|
|
1346
|
+
if (!r) return binding;
|
|
1347
|
+
switch (r) {
|
|
1348
|
+
case "ref-only":
|
|
1349
|
+
return binding;
|
|
1350
|
+
case "as-is":
|
|
1351
|
+
return `${binding}, used as-is`;
|
|
1352
|
+
case "empty background":
|
|
1353
|
+
return `the background from ${binding} (without its foreground objects)`;
|
|
1354
|
+
default:
|
|
1355
|
+
return `the ${r} from ${binding}`;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
function normalizeRoleSlug(slug) {
|
|
1359
|
+
const s = slug.trim();
|
|
1360
|
+
if (!s) return s;
|
|
1361
|
+
for (const preset of REFERENCE_ROLE_PRESETS["wired-location"]) {
|
|
1362
|
+
if (preset.toLowerCase().replace(/\s+/g, "-") === s) return preset;
|
|
1363
|
+
}
|
|
1364
|
+
return s;
|
|
1365
|
+
}
|
|
1366
|
+
function firstSightExtraRole(segment, source) {
|
|
1367
|
+
const s = (segment ?? "").trim();
|
|
1368
|
+
return s && REFERENCE_ROLE_PRESETS[source].includes(s) ? s : defaultRoleForSource(source);
|
|
1369
|
+
}
|
|
1370
|
+
function resolveDefaultRole(defaultRole, defaultUsageMode, source) {
|
|
1371
|
+
const explicit = defaultRole?.trim();
|
|
1372
|
+
if (explicit) return explicit;
|
|
1373
|
+
return firstSightExtraRole(defaultUsageMode, source);
|
|
1374
|
+
}
|
|
1375
|
+
function sanitizeRole(raw) {
|
|
1376
|
+
return raw.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/^[^a-z]+/, "").slice(0, 32).replace(/-+/g, "-").replace(/-$/, "");
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
export { AGGREGATE_LANE_SOURCE_TYPES, ALA_CARTE_BOARDS, BOARD_TO_ASSET_TYPE, BOARD_TO_COLUMN, BOARD_VARIANTS, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_ASSET_TYPES, CHARACTER_ASSET_VARIANTS, CHARACTER_ATTACH_COLUMNS, CHARACTER_PICKER_DISPLAY_ORDER, CHARACTER_REFERENCE_PHOTO_KINDS, CHARACTER_STYLES, CHARACTER_VARIANT_ASSET_BUCKETS, CREATURE_ATTACH_COLUMNS, DEFAULT_CARRIED_FRACTION, DEFAULT_LOCATION_USAGE_MODE, DEFAULT_PANEL_COUNT, DEFAULT_SECTIONS, DEFAULT_USAGE_MODE, DETAIL_VARIANTS, ENTITY_ASPECT_DEFAULTS, ENTITY_IMAGE_HANDLE_TYPES, ENTITY_SECTIONS, FEATURED_ENTITIES, IMAGE_REF_TYPES, LOCATION_ASSET_TYPES, LOCATION_ASSET_VARIANTS, LOCATION_ATTACH_COLUMNS, LOCATION_REFERENCE_PHOTO_KINDS, LOCATION_REFERENCE_PHOTO_KIND_LABELS, LOCATION_USAGE_MODES, MAX_CUSTOM_ENTRIES_PER_BOARD, MAX_PANELS_PER_SHEET, MOTION_COLUMN, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ASSET_VARIANTS, OBJECT_ATTACH_COLUMNS, OUTPUT_FORMATS, OUTPUT_PIP_EFFECTIVE_TYPES, PASSTHROUGH_TYPES, PLACEHOLDER_CHARACTER_NAME, PRESET_LABELS, REFERENCE_BOARD_PROVIDERS, REFERENCE_BOARD_TEMPLATES, REFERENCE_ROLE_PRESETS, SECTION_BOARD, SECTION_KINDS, SHEET_ASPECTS, SHEET_BACKGROUNDS, SHEET_PRESETS, SHEET_SKINS, SHEET_TYPES, STRUCTURAL_SECTIONS, SURROUND_DIRECTIONS, TILT_CARRIED_FRACTION, USAGE_MODES, WARDROBE_VARIANTS, aspectRatioToNumber, buildBoardPrompt, buildPanelPrompt, characterBoardItems, characterBucketDisplayRank, characterMentionSlug, characterMentionableAssetArrays, characterSheetRefItems, characterVariantAssetArrays, collectAncestorRefs, defaultCarriedFraction, defaultRoleForSource, entityMentionSlug, entityMentionSlugForRef, estimateSheetCost, expandExtraRefsToConnectedReferences, findCharacterMentionTokens, findEntityMentionTokens, findImageMentionTokens, findLocationMentionTokens, firstSightExtraRole, getFeaturedEntities, imageMentionSlug, imageMentionSlugForRef, isCharacterAspectRatio, isLocationUsageMode, isObjectAspectRatio, isTiltDirection, isUsageMode, knownEntitySlugsFromRefs, knownImageSlugsFromRefs, listBoardTemplates, locationMentionSlug, locationReferencePhotoKindLabel, locationUsageModeLabel, matchVariant, normalizeRoleSlug, outputPipSourceType, parseCharacterMentionToken, parseEntityMentionToken, parseImageMentionToken, parseLocationMentionToken, planSheetGeneration, planSheetPanels, presetEntries, referenceSheetCreditId, resolveCharacterAspectRatio, resolveDefaultRole, resolveEffectiveSourceType, resolveEntityAspect, resolveObjectAspectRatio, resolveSheetSections, roleToPhrase, sanitizeRole, sortCharacterEntriesForDisplay, sourceRefKey, toConnectedReference, toConnectedReferences, usageModeDirective, usageModeIncludesName, usageModeLabel };
|
|
1380
|
+
//# sourceMappingURL=chunk-CK3GK34R.js.map
|
|
1381
|
+
//# sourceMappingURL=chunk-CK3GK34R.js.map
|