@nodaro/prompts 1.38.0 → 1.40.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/dist/chunk-2EW5B7ZV.cjs +86 -0
- package/dist/chunk-2EW5B7ZV.cjs.map +1 -0
- package/dist/chunk-2P26SZX5.cjs +414 -0
- package/dist/chunk-2P26SZX5.cjs.map +1 -0
- package/dist/{chunk-7XKHDXCL.cjs → chunk-3U7X6JZN.cjs} +13 -12
- package/dist/chunk-3U7X6JZN.cjs.map +1 -0
- package/dist/chunk-4GKTOVFM.cjs +8 -0
- package/dist/chunk-4GKTOVFM.cjs.map +1 -0
- package/dist/{chunk-HRBBNODV.js → chunk-6GVFJLDL.js} +4 -3
- package/dist/chunk-6GVFJLDL.js.map +1 -0
- package/dist/{chunk-LVSH7K7R.cjs → chunk-C3NHNECH.cjs} +165 -88
- package/dist/chunk-C3NHNECH.cjs.map +1 -0
- package/dist/{chunk-CEPVQQVO.js → chunk-C46256GZ.js} +43 -5
- package/dist/chunk-C46256GZ.js.map +1 -0
- package/dist/{chunk-JKCR6WRZ.cjs → chunk-DQFQJECU.cjs} +43 -5
- package/dist/chunk-DQFQJECU.cjs.map +1 -0
- package/dist/{chunk-QDEWBBUR.js → chunk-DUXX6CBX.js} +12 -143
- package/dist/chunk-DUXX6CBX.js.map +1 -0
- package/dist/chunk-EAYEZXWT.js +388 -0
- package/dist/chunk-EAYEZXWT.js.map +1 -0
- package/dist/chunk-GILUVQQJ.js +6 -0
- package/dist/chunk-GILUVQQJ.js.map +1 -0
- package/dist/{chunk-KIYNOOPJ.js → chunk-GTDKDD7Y.js} +12 -6
- package/dist/chunk-GTDKDD7Y.js.map +1 -0
- package/dist/{chunk-QBEZMR2F.js → chunk-HQTHDTHN.js} +137 -62
- package/dist/chunk-HQTHDTHN.js.map +1 -0
- package/dist/{chunk-TLVX5PXD.cjs → chunk-IUCNJAHW.cjs} +13 -7
- package/dist/chunk-IUCNJAHW.cjs.map +1 -0
- package/dist/{chunk-ZFIXQRBZ.cjs → chunk-LXPKTI2K.cjs} +12 -83
- package/dist/chunk-LXPKTI2K.cjs.map +1 -0
- package/dist/{chunk-CVPB2N3Z.cjs → chunk-LZ53F5BN.cjs} +103 -5
- package/dist/chunk-LZ53F5BN.cjs.map +1 -0
- package/dist/{chunk-4FDNVNJE.js → chunk-N6VMPG5S.js} +12 -79
- package/dist/chunk-N6VMPG5S.js.map +1 -0
- package/dist/{chunk-LK2CZK5U.cjs → chunk-PWWM7Q3T.cjs} +7 -7
- package/dist/{chunk-LK2CZK5U.cjs.map → chunk-PWWM7Q3T.cjs.map} +1 -1
- package/dist/{chunk-N7TOWXDJ.js → chunk-QDUTMOF4.js} +3 -3
- package/dist/{chunk-N7TOWXDJ.js.map → chunk-QDUTMOF4.js.map} +1 -1
- package/dist/{chunk-NO6XHX4R.js → chunk-RB2F5JQF.js} +100 -7
- package/dist/chunk-RB2F5JQF.js.map +1 -0
- package/dist/{chunk-MENBHEAY.cjs → chunk-WRM52ZBN.cjs} +19 -161
- package/dist/chunk-WRM52ZBN.cjs.map +1 -0
- package/dist/chunk-YS6HOWMW.js +80 -0
- package/dist/chunk-YS6HOWMW.js.map +1 -0
- package/dist/entries/assembly.cjs +34 -25
- package/dist/entries/assembly.d.cts +121 -37
- package/dist/entries/assembly.d.ts +121 -37
- package/dist/entries/assembly.js +5 -4
- package/dist/entries/doctrine.cjs +46 -46
- package/dist/entries/doctrine.d.cts +3 -3
- package/dist/entries/doctrine.d.ts +3 -3
- package/dist/entries/doctrine.js +1 -1
- package/dist/entries/picker-catalogs.cjs +42 -42
- package/dist/entries/picker-catalogs.js +3 -3
- package/dist/entries/presets.cjs +49 -26
- package/dist/entries/presets.d.cts +53 -1
- package/dist/entries/presets.d.ts +53 -1
- package/dist/entries/presets.js +4 -1
- package/dist/entries/prompt-builder.cjs +135 -98
- package/dist/entries/prompt-builder.d.cts +22 -11
- package/dist/entries/prompt-builder.d.ts +22 -11
- package/dist/entries/prompt-builder.js +4 -3
- package/dist/entries/prompt-fields.cjs +41 -40
- package/dist/entries/prompt-fields.d.cts +2 -1
- package/dist/entries/prompt-fields.d.ts +2 -1
- package/dist/entries/prompt-fields.js +2 -1
- package/dist/index.cjs +339 -273
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -9
- package/dist/{subject-registry-BUswuEVD.d.cts → subject-registry-CQi_CZfJ.d.cts} +78 -9
- package/dist/{subject-registry-D7V8PEG-.d.ts → subject-registry-DFiGx49v.d.ts} +78 -9
- package/package.json +2 -2
- package/src/__tests__/assemble-image-input-style-references.test.ts +173 -0
- package/src/__tests__/catalog-id-guard.test.ts +30 -0
- package/src/__tests__/factory-preset-previews.test.ts +123 -0
- package/src/__tests__/factory-preset-references.test.ts +222 -0
- package/src/__tests__/factory-presets-prototype-keys.test.ts +43 -0
- package/src/__tests__/frame-reference-slots.test.ts +43 -0
- package/src/__tests__/gemini-omni-inputs.test.ts +12 -10
- package/src/__tests__/provider-prompt-doctrine.test.ts +14 -0
- package/src/__tests__/user-direction-refs.test.ts +180 -0
- package/src/__tests__/veo-i2v-inputs.test.ts +16 -11
- package/src/assemble-image-input.ts +114 -13
- package/src/catalog-id-guard.ts +18 -2
- package/src/color-names.ts +192 -0
- package/src/direction-registry.ts +66 -5
- package/src/entries/assembly.ts +1 -0
- package/src/entries/prompt-builder.ts +2 -0
- package/src/factory-presets/generate-image.ts +29 -0
- package/src/factory-presets/index.ts +6 -1
- package/src/factory-presets/preview-files.generated.ts +4 -0
- package/src/factory-presets/previews.ts +40 -0
- package/src/factory-presets/references.ts +81 -0
- package/src/factory-presets/shared-image.ts +4 -0
- package/src/factory-presets/types.ts +8 -0
- package/src/frame-reference-slots.ts +92 -0
- package/src/gemini-omni-inputs.ts +23 -22
- package/src/image-reference-doctrine.ts +3 -3
- package/src/image-token-pattern.ts +13 -0
- package/src/node-prompt-fields.ts +5 -3
- package/src/own-entry.ts +11 -0
- package/src/prompt-builder.ts +4 -5
- package/src/prompt-style-section.ts +3 -3
- package/src/prompt-wizard-categories.ts +2 -0
- package/src/provider-prompt-doctrine.ts +45 -3
- package/src/ref-binding.ts +28 -3
- package/src/resolve-prompt.ts +2 -1
- package/src/seedance-2-inputs.ts +15 -40
- package/src/user-direction-refs.ts +110 -0
- package/src/veo-i2v-inputs.ts +24 -17
- package/src/video-reference-resolver.ts +1 -1
- package/dist/chunk-4FDNVNJE.js.map +0 -1
- package/dist/chunk-7XKHDXCL.cjs.map +0 -1
- package/dist/chunk-CEPVQQVO.js.map +0 -1
- package/dist/chunk-CVPB2N3Z.cjs.map +0 -1
- package/dist/chunk-HRBBNODV.js.map +0 -1
- package/dist/chunk-JKCR6WRZ.cjs.map +0 -1
- package/dist/chunk-KIYNOOPJ.js.map +0 -1
- package/dist/chunk-LVSH7K7R.cjs.map +0 -1
- package/dist/chunk-MENBHEAY.cjs.map +0 -1
- package/dist/chunk-NO6XHX4R.js.map +0 -1
- package/dist/chunk-QBEZMR2F.js.map +0 -1
- package/dist/chunk-QDEWBBUR.js.map +0 -1
- package/dist/chunk-TLVX5PXD.cjs.map +0 -1
- package/dist/chunk-UJKFHPZ7.js +0 -37
- package/dist/chunk-UJKFHPZ7.js.map +0 -1
- package/dist/chunk-W5SCZIOB.cjs +0 -43
- package/dist/chunk-W5SCZIOB.cjs.map +0 -1
- package/dist/chunk-ZFIXQRBZ.cjs.map +0 -1
|
@@ -1,145 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunk4GKTOVFM_cjs = require('./chunk-4GKTOVFM.cjs');
|
|
3
4
|
var chunkUXDKZVNN_cjs = require('./chunk-UXDKZVNN.cjs');
|
|
4
5
|
var chunk2NJTFCKQ_cjs = require('./chunk-2NJTFCKQ.cjs');
|
|
5
|
-
var
|
|
6
|
+
var chunk2P26SZX5_cjs = require('./chunk-2P26SZX5.cjs');
|
|
6
7
|
var chunkMQEXFCNU_cjs = require('./chunk-MQEXFCNU.cjs');
|
|
7
8
|
var chunk3UEA3UHQ_cjs = require('./chunk-3UEA3UHQ.cjs');
|
|
8
9
|
var chunkK6NT635Z_cjs = require('./chunk-K6NT635Z.cjs');
|
|
9
10
|
var models = require('@nodaro/shared/models');
|
|
10
11
|
var entities = require('@nodaro/shared/entities');
|
|
11
12
|
|
|
12
|
-
// src/direction-registry.ts
|
|
13
|
-
var perId = (full, compact) => (ids, mode) => {
|
|
14
|
-
const out = [];
|
|
15
|
-
for (const id of ids) {
|
|
16
|
-
const frag = mode === "compact" ? compact(id) : full(id);
|
|
17
|
-
if (frag.length > 0) out.push(frag);
|
|
18
|
-
}
|
|
19
|
-
return out;
|
|
20
|
-
};
|
|
21
|
-
var viaListBuilder = (build) => (ids, mode) => build(ids.length === 1 ? ids[0] : [...ids], mode).filter((s) => s.length > 0);
|
|
22
|
-
var viaStringBuilder = (build) => (ids, mode) => {
|
|
23
|
-
const s = build(ids.length === 1 ? ids[0] : [...ids], mode);
|
|
24
|
-
return s.length > 0 ? [s] : [];
|
|
25
|
-
};
|
|
26
|
-
var viaMood = (ids, mode) => chunkMQEXFCNU_cjs.buildMoodHints({ mood: ids.length === 1 ? ids[0] : [...ids] }, mode).filter(
|
|
27
|
-
(s) => s.length > 0
|
|
28
|
-
);
|
|
29
|
-
var framing = perId(chunkMQEXFCNU_cjs.getFramingPromptHint, chunkMQEXFCNU_cjs.getFramingTerm);
|
|
30
|
-
var lighting = perId(chunkMQEXFCNU_cjs.getLightingPromptHint, chunkMQEXFCNU_cjs.getLightingTerm);
|
|
31
|
-
var exposure = perId(chunkMQEXFCNU_cjs.getExposurePromptHint, chunkMQEXFCNU_cjs.getExposureTerm);
|
|
32
|
-
var temporal = perId(chunkMQEXFCNU_cjs.getTemporalPromptHint, chunkMQEXFCNU_cjs.getTemporalTerm);
|
|
33
|
-
var DIRECTION_FIELDS = [
|
|
34
|
-
{ key: "cameraMotion", surface: "video", family: "motion", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getCameraMotionPromptHint, chunkMQEXFCNU_cjs.getCameraMotionTerm) },
|
|
35
|
-
// Composition (the Framing catalog, one row per category).
|
|
36
|
-
{ key: "shotSize", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
37
|
-
{ key: "angle", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
38
|
-
{ key: "coverage", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
39
|
-
{ key: "composition", surface: "both", family: "look", maxPicks: 2, render: framing },
|
|
40
|
-
{ key: "vantage", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
41
|
-
{ key: "pose", surface: "both", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getPosePromptHint, chunkMQEXFCNU_cjs.getPoseTerm) },
|
|
42
|
-
{ key: "compositionEffect", surface: "both", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getCompositionEffectPromptHint, chunkMQEXFCNU_cjs.getCompositionEffectTerm) },
|
|
43
|
-
// Camera.
|
|
44
|
-
{ key: "cameraFormat", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getCameraFormatPromptHint, chunkMQEXFCNU_cjs.getCameraFormatTerm) },
|
|
45
|
-
{ key: "lens", surface: "both", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getLensPromptHint, chunkMQEXFCNU_cjs.getLensTerm) },
|
|
46
|
-
// Exposure (stills only — a video's exposure rides its own temporal levers).
|
|
47
|
-
{ key: "aperture", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
48
|
-
{ key: "shutterSpeed", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
49
|
-
{ key: "isoValue", surface: "image", family: "look", maxPicks: 1, render: exposure },
|
|
50
|
-
// Light (the Lighting catalog, one row per category).
|
|
51
|
-
{ key: "timeOfDay", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
52
|
-
{ key: "lightingStyle", surface: "both", family: "look", maxPicks: 2, render: lighting },
|
|
53
|
-
{ key: "lightingDirection", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
54
|
-
{ key: "lightingRatio", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
55
|
-
{ key: "colorTemperature", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
56
|
-
{ key: "colorLook", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getColorLookPromptHint, chunkMQEXFCNU_cjs.getColorLookTerm) },
|
|
57
|
-
{ key: "atmosphere", surface: "both", family: "look", maxPicks: 2, render: viaListBuilder(chunkMQEXFCNU_cjs.buildAtmosphereHints) },
|
|
58
|
-
{ key: "postProcess", surface: "image", family: "look", maxPicks: 2, render: viaListBuilder(chunkMQEXFCNU_cjs.buildPostProcessHints) },
|
|
59
|
-
// Style.
|
|
60
|
-
{ key: "style", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getStylePromptHint, chunkMQEXFCNU_cjs.getStyleTerm) },
|
|
61
|
-
{ key: "mood", surface: "both", family: "look", maxPicks: 2, render: viaMood },
|
|
62
|
-
{ key: "aesthetic", surface: "both", family: "look", maxPicks: 2, render: viaStringBuilder(chunkMQEXFCNU_cjs.buildAestheticHints) },
|
|
63
|
-
{ key: "photoGenre", surface: "image", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getPhotoGenrePromptHint, chunkMQEXFCNU_cjs.getPhotoGenreTerm) },
|
|
64
|
-
{ key: "photographer", surface: "image", family: "look", maxPicks: 2, render: viaStringBuilder(chunkMQEXFCNU_cjs.buildPhotographerHints) },
|
|
65
|
-
{ key: "renderQuality", surface: "image", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getRenderQualityPromptHint, chunkMQEXFCNU_cjs.getRenderQualityTerm) },
|
|
66
|
-
// Scene.
|
|
67
|
-
{ key: "setting", surface: "both", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getSettingPromptHint, chunkMQEXFCNU_cjs.getSettingTerm) },
|
|
68
|
-
{ key: "era", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getEraPromptHint, chunkMQEXFCNU_cjs.getEraTerm) },
|
|
69
|
-
{ key: "backdrop", surface: "both", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getBackdropPromptHint, chunkMQEXFCNU_cjs.getBackdropTerm) },
|
|
70
|
-
// Motion & time.
|
|
71
|
-
{ key: "actionFx", surface: "video", family: "motion", maxPicks: 2, render: viaListBuilder(chunkMQEXFCNU_cjs.buildActionFxHints) },
|
|
72
|
-
{ key: "temporalSpeed", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
73
|
-
{ key: "temporalFreeze", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
74
|
-
{ key: "temporalDirection", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
75
|
-
{ key: "temporalShutter", surface: "video", family: "motion", maxPicks: 1, render: temporal },
|
|
76
|
-
{ key: "transition", surface: "video", family: "motion", maxPicks: 2, render: chunkMQEXFCNU_cjs.renderTransitionBases },
|
|
77
|
-
{ key: "loopSubject", surface: "video", family: "motion", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getLoopSubjectPromptHint, chunkMQEXFCNU_cjs.getLoopSubjectTerm) },
|
|
78
|
-
// ── LEGACY BLOCK — see the table doc above. Placed LAST, in today's exact
|
|
79
|
-
// `composePromptText` order, so every pre-registry caller is byte-identical.
|
|
80
|
-
{ key: "framingId", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
81
|
-
{ key: "framingAngleId", surface: "both", family: "look", maxPicks: 1, render: framing },
|
|
82
|
-
{ key: "lightingId", surface: "both", family: "look", maxPicks: 1, render: lighting },
|
|
83
|
-
{ key: "lensId", surface: "both", family: "look", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getLensPromptHint, chunkMQEXFCNU_cjs.getLensTerm) },
|
|
84
|
-
{ key: "cameraFormatId", surface: "both", family: "look", styleGroup: "film", maxPicks: 1, render: perId(chunkMQEXFCNU_cjs.getCameraFormatPromptHint, chunkMQEXFCNU_cjs.getCameraFormatTerm) }
|
|
85
|
-
];
|
|
86
|
-
var DIRECTION_SPECS = DIRECTION_FIELDS;
|
|
87
|
-
var DIRECTION_KEYS = DIRECTION_FIELDS.map((f) => f.key);
|
|
88
|
-
var FILM_STYLE_KEYS = DIRECTION_SPECS.filter(
|
|
89
|
-
(f) => f.styleGroup === "film"
|
|
90
|
-
).map((f) => f.key);
|
|
91
|
-
var IMAGE_HINT_MODE_DEFAULT = "full";
|
|
92
|
-
var VIDEO_HINT_MODE_DEFAULT = { look: "full", motion: "compact" };
|
|
93
|
-
function modeForFamily(mode, family) {
|
|
94
|
-
return typeof mode === "string" ? mode : family === "motion" ? mode.motion : mode.look;
|
|
95
|
-
}
|
|
96
|
-
var DIRECTION_ARRAY_CEILING = 8;
|
|
97
|
-
var DIRECTION_ID_MAX_CHARS = 100;
|
|
98
|
-
function normalizeDirectionIds(value, maxPicks) {
|
|
99
|
-
const ids = [];
|
|
100
|
-
if (typeof value === "string") {
|
|
101
|
-
if (value) ids.push(value);
|
|
102
|
-
} else if (Array.isArray(value)) {
|
|
103
|
-
for (const v of value) {
|
|
104
|
-
if (ids.length >= maxPicks) break;
|
|
105
|
-
if (typeof v === "string" && v && !ids.includes(v)) ids.push(v);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return ids.slice(0, maxPicks);
|
|
109
|
-
}
|
|
110
|
-
function directionFieldsForSurface(surface) {
|
|
111
|
-
return DIRECTION_SPECS.filter((f) => f.surface === "both" || f.surface === surface);
|
|
112
|
-
}
|
|
113
|
-
function renderDirectionHintClauses(direction, opts) {
|
|
114
|
-
if (!direction) return [];
|
|
115
|
-
const mode = opts.mode ?? "full";
|
|
116
|
-
const out = [];
|
|
117
|
-
const seen = /* @__PURE__ */ new Set();
|
|
118
|
-
for (const spec of DIRECTION_SPECS) {
|
|
119
|
-
if (spec.surface !== "both" && spec.surface !== opts.surface) continue;
|
|
120
|
-
const ids = normalizeDirectionIds(
|
|
121
|
-
direction[spec.key],
|
|
122
|
-
spec.maxPicks
|
|
123
|
-
);
|
|
124
|
-
if (ids.length === 0) continue;
|
|
125
|
-
for (const hint of spec.render(ids, modeForFamily(mode, spec.family))) {
|
|
126
|
-
if (hint.length > 0 && !seen.has(hint)) {
|
|
127
|
-
seen.add(hint);
|
|
128
|
-
out.push({
|
|
129
|
-
key: spec.key,
|
|
130
|
-
family: spec.family,
|
|
131
|
-
...spec.styleGroup !== void 0 ? { styleGroup: spec.styleGroup } : {},
|
|
132
|
-
text: hint
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return out;
|
|
138
|
-
}
|
|
139
|
-
function renderDirectionHints(direction, opts) {
|
|
140
|
-
return renderDirectionHintClauses(direction, opts).map((c) => c.text);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
13
|
// src/prompt-style-section.ts
|
|
144
14
|
var STYLE_SECTION_HEADER = "[style]:";
|
|
145
15
|
var STYLE_SECTION_GAP = "\n\n";
|
|
@@ -176,7 +46,7 @@ function asBodyClauses(texts) {
|
|
|
176
46
|
return texts.map((text) => ({ text, slot: "body" }));
|
|
177
47
|
}
|
|
178
48
|
function partitionStyleClauses(direction, opts) {
|
|
179
|
-
return renderDirectionHintClauses(direction, opts).map((clause) => ({
|
|
49
|
+
return chunk2P26SZX5_cjs.renderDirectionHintClauses(direction, opts).map((clause) => ({
|
|
180
50
|
text: clause.text,
|
|
181
51
|
slot: styleSlotFor(clause)
|
|
182
52
|
}));
|
|
@@ -1520,7 +1390,6 @@ var STRICT_DEFAULT_SOURCES = /* @__PURE__ */ new Set([
|
|
|
1520
1390
|
"wired-creature",
|
|
1521
1391
|
"wired-location"
|
|
1522
1392
|
]);
|
|
1523
|
-
var IMAGE_TOKEN_PATTERN = /\{image:(\d+)(?::([^}\n]+))?\}/gi;
|
|
1524
1393
|
function tokenFinalSlot(n, refs, finalIndexByUrl) {
|
|
1525
1394
|
const ref = refs[n - 1];
|
|
1526
1395
|
return ref?.url ? finalIndexByUrl.get(ref.url) : void 0;
|
|
@@ -1530,7 +1399,7 @@ function hasImageAt(n, count) {
|
|
|
1530
1399
|
}
|
|
1531
1400
|
function dropUnwiredImageTokens(prompt, isWired) {
|
|
1532
1401
|
let dropped = false;
|
|
1533
|
-
const out = prompt.replace(IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1402
|
+
const out = prompt.replace(chunk4GKTOVFM_cjs.IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1534
1403
|
if (isWired(parseInt(num, 10))) return match;
|
|
1535
1404
|
dropped = true;
|
|
1536
1405
|
return unboundReferenceTokenText(label);
|
|
@@ -1544,7 +1413,7 @@ function defaultFidelityForSource(source) {
|
|
|
1544
1413
|
function collectIdentities(prompt, refs, meta) {
|
|
1545
1414
|
const seen = /* @__PURE__ */ new Set();
|
|
1546
1415
|
const mentions = [];
|
|
1547
|
-
for (const m of prompt.matchAll(IMAGE_TOKEN_PATTERN)) {
|
|
1416
|
+
for (const m of prompt.matchAll(chunk4GKTOVFM_cjs.IMAGE_TOKEN_PATTERN)) {
|
|
1548
1417
|
const n = parseInt(m[1], 10);
|
|
1549
1418
|
if (n < 1 || n > refs.length) continue;
|
|
1550
1419
|
const label = (m[2] ?? "").trim();
|
|
@@ -1686,14 +1555,14 @@ function buildNonCharacterDirectives(prompt, nonCharacterRefs, identityMeta, fin
|
|
|
1686
1555
|
return lines.join("\n");
|
|
1687
1556
|
}
|
|
1688
1557
|
function expandImageRefTokens(prompt, imageCount) {
|
|
1689
|
-
return prompt.replace(IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1558
|
+
return prompt.replace(chunk4GKTOVFM_cjs.IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1690
1559
|
const n = parseInt(num, 10);
|
|
1691
1560
|
if (n < 1 || n > imageCount) return match;
|
|
1692
1561
|
return label ? `Image ${n} (${label})` : `Image ${n}`;
|
|
1693
1562
|
});
|
|
1694
1563
|
}
|
|
1695
1564
|
function expandImageRefTokensForRefs(prompt, refs, finalIndexByUrl) {
|
|
1696
|
-
return prompt.replace(IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1565
|
+
return prompt.replace(chunk4GKTOVFM_cjs.IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1697
1566
|
const finalIdx = tokenFinalSlot(parseInt(num, 10), refs, finalIndexByUrl);
|
|
1698
1567
|
if (!finalIdx) return match;
|
|
1699
1568
|
return label ? `Image ${finalIdx} (${label})` : `Image ${finalIdx}`;
|
|
@@ -1708,7 +1577,7 @@ function hybridRolePhrase(label, letter) {
|
|
|
1708
1577
|
}
|
|
1709
1578
|
function expandImageRefTokensHybrid(prompt, refs, finalIndexByUrl) {
|
|
1710
1579
|
const splices = [];
|
|
1711
|
-
for (const m of prompt.matchAll(IMAGE_TOKEN_PATTERN)) {
|
|
1580
|
+
for (const m of prompt.matchAll(chunk4GKTOVFM_cjs.IMAGE_TOKEN_PATTERN)) {
|
|
1712
1581
|
const finalIdx = tokenFinalSlot(parseInt(m[1], 10), refs, finalIndexByUrl);
|
|
1713
1582
|
if (!finalIdx) continue;
|
|
1714
1583
|
splices.push({
|
|
@@ -1739,7 +1608,7 @@ function buildIdentityDirectives(prompt, refs, meta = [], suppressedCanonicalLoc
|
|
|
1739
1608
|
return collectIdentities(prompt, refs, meta).map((id) => buildIdentityDirective(id, suppressedCanonicalLocationIds)).filter((s) => s.length > 0).join("\n");
|
|
1740
1609
|
}
|
|
1741
1610
|
function expandImagePositionRefs(prompt, imageCount, names) {
|
|
1742
|
-
return prompt.replace(IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1611
|
+
return prompt.replace(chunk4GKTOVFM_cjs.IMAGE_TOKEN_PATTERN, (match, num, label) => {
|
|
1743
1612
|
const n = parseInt(num, 10);
|
|
1744
1613
|
if (!hasImageAt(n, imageCount)) return match;
|
|
1745
1614
|
if (label) return `Image ${n} (${label})`;
|
|
@@ -1957,12 +1826,12 @@ var viaFragmentBuilder = (build) => (subject, mode) => {
|
|
|
1957
1826
|
const clause = build(subject, mode).filter((s) => s.length > 0).join(", ");
|
|
1958
1827
|
return clause.length > 0 ? [clause] : [];
|
|
1959
1828
|
};
|
|
1960
|
-
var
|
|
1961
|
-
var
|
|
1829
|
+
var viaListBuilder = (build) => (ids, mode) => build(ids.length === 1 ? ids[0] : [...ids], mode).filter((s) => s.length > 0);
|
|
1830
|
+
var viaStringBuilder = (build) => (ids, mode) => {
|
|
1962
1831
|
const s = build(ids.length === 1 ? ids[0] : [...ids], mode);
|
|
1963
1832
|
return s.length > 0 ? [s] : [];
|
|
1964
1833
|
};
|
|
1965
|
-
var
|
|
1834
|
+
var perId = (full, compact) => (ids, mode) => {
|
|
1966
1835
|
const out = [];
|
|
1967
1836
|
for (const id of ids) {
|
|
1968
1837
|
const frag = mode === "compact" ? compact(id) : full(id);
|
|
@@ -1973,9 +1842,9 @@ var perId2 = (full, compact) => (ids, mode) => {
|
|
|
1973
1842
|
var SUBJECT_FIELDS = [
|
|
1974
1843
|
{ key: "person", kind: "group", surface: "both", render: viaFragmentBuilder(chunkK6NT635Z_cjs.buildPersonHints) },
|
|
1975
1844
|
{ key: "styling", kind: "group", surface: "both", render: viaFragmentBuilder(chunkMQEXFCNU_cjs.buildStylingHints) },
|
|
1976
|
-
{ key: "heldProp", kind: "ids", surface: "both", maxPicks: 2, render:
|
|
1977
|
-
{ key: "material", kind: "ids", surface: "both", maxPicks: 2, render:
|
|
1978
|
-
{ key: "animal", kind: "ids", surface: "both", maxPicks: 1, render:
|
|
1845
|
+
{ key: "heldProp", kind: "ids", surface: "both", maxPicks: 2, render: viaListBuilder(chunkMQEXFCNU_cjs.buildHeldPropHints) },
|
|
1846
|
+
{ key: "material", kind: "ids", surface: "both", maxPicks: 2, render: viaStringBuilder(chunkMQEXFCNU_cjs.buildMaterialHints) },
|
|
1847
|
+
{ key: "animal", kind: "ids", surface: "both", maxPicks: 1, render: perId(chunk2P26SZX5_cjs.curatedAnimalPromptHint, chunk2P26SZX5_cjs.curatedAnimalTerm) }
|
|
1979
1848
|
];
|
|
1980
1849
|
var SUBJECT_FOLD_KEYS = SUBJECT_FIELDS.map((f) => f.key);
|
|
1981
1850
|
var IDS_ROWS = SUBJECT_FIELDS.filter((f) => f.kind === "ids");
|
|
@@ -2004,8 +1873,8 @@ function getRegisteredSubjectKeys() {
|
|
|
2004
1873
|
}
|
|
2005
1874
|
var SUBJECT_IMAGE_HINT_MODE_DEFAULT = "full";
|
|
2006
1875
|
var SUBJECT_VIDEO_HINT_MODE_DEFAULT = "compact";
|
|
2007
|
-
var SUBJECT_ARRAY_CEILING = DIRECTION_ARRAY_CEILING;
|
|
2008
|
-
var SUBJECT_ID_MAX_CHARS = DIRECTION_ID_MAX_CHARS;
|
|
1876
|
+
var SUBJECT_ARRAY_CEILING = chunk2P26SZX5_cjs.DIRECTION_ARRAY_CEILING;
|
|
1877
|
+
var SUBJECT_ID_MAX_CHARS = chunk2P26SZX5_cjs.DIRECTION_ID_MAX_CHARS;
|
|
2009
1878
|
var MAX_SUBJECT_KEYS = 128;
|
|
2010
1879
|
var SUBJECT_KEY_MAX_CHARS = 64;
|
|
2011
1880
|
function normalizeIds(value, maxPicks) {
|
|
@@ -2079,12 +1948,6 @@ function renderSubjectHints(subject, opts) {
|
|
|
2079
1948
|
|
|
2080
1949
|
exports.ANGLE_LABELS = ANGLE_LABELS;
|
|
2081
1950
|
exports.ASPECT_RATIO_LABELS = ASPECT_RATIO_LABELS;
|
|
2082
|
-
exports.DIRECTION_ARRAY_CEILING = DIRECTION_ARRAY_CEILING;
|
|
2083
|
-
exports.DIRECTION_FIELDS = DIRECTION_FIELDS;
|
|
2084
|
-
exports.DIRECTION_ID_MAX_CHARS = DIRECTION_ID_MAX_CHARS;
|
|
2085
|
-
exports.DIRECTION_KEYS = DIRECTION_KEYS;
|
|
2086
|
-
exports.FILM_STYLE_KEYS = FILM_STYLE_KEYS;
|
|
2087
|
-
exports.IMAGE_HINT_MODE_DEFAULT = IMAGE_HINT_MODE_DEFAULT;
|
|
2088
1951
|
exports.MAX_SUBJECT_KEYS = MAX_SUBJECT_KEYS;
|
|
2089
1952
|
exports.MOVEMENT_LABELS = MOVEMENT_LABELS;
|
|
2090
1953
|
exports.SCENE_PROMPT_MAX_LENGTH = SCENE_PROMPT_MAX_LENGTH;
|
|
@@ -2100,7 +1963,6 @@ exports.SUBJECT_IMAGE_HINT_MODE_DEFAULT = SUBJECT_IMAGE_HINT_MODE_DEFAULT;
|
|
|
2100
1963
|
exports.SUBJECT_KEYS = SUBJECT_KEYS;
|
|
2101
1964
|
exports.SUBJECT_KEY_MAX_CHARS = SUBJECT_KEY_MAX_CHARS;
|
|
2102
1965
|
exports.SUBJECT_VIDEO_HINT_MODE_DEFAULT = SUBJECT_VIDEO_HINT_MODE_DEFAULT;
|
|
2103
|
-
exports.VIDEO_HINT_MODE_DEFAULT = VIDEO_HINT_MODE_DEFAULT;
|
|
2104
1966
|
exports.appendReferenceLines = appendReferenceLines;
|
|
2105
1967
|
exports.applyReferenceOrderToVideo = applyReferenceOrderToVideo;
|
|
2106
1968
|
exports.asBodyClauses = asBodyClauses;
|
|
@@ -2111,19 +1973,15 @@ exports.buildImagePromptWithOverflow = buildImagePromptWithOverflow;
|
|
|
2111
1973
|
exports.buildReferenceBlocks = buildReferenceBlocks;
|
|
2112
1974
|
exports.buildScenePrompt = buildScenePrompt;
|
|
2113
1975
|
exports.composeSectionedPrompt = composeSectionedPrompt;
|
|
2114
|
-
exports.directionFieldsForSurface = directionFieldsForSurface;
|
|
2115
1976
|
exports.endsInsideStyleSection = endsInsideStyleSection;
|
|
2116
1977
|
exports.expandImagePositionRefs = expandImagePositionRefs;
|
|
2117
1978
|
exports.expandImageRefTokens = expandImageRefTokens;
|
|
2118
1979
|
exports.getRegisteredSubjectKeys = getRegisteredSubjectKeys;
|
|
2119
1980
|
exports.insertBeforeStyleSection = insertBeforeStyleSection;
|
|
2120
|
-
exports.modeForFamily = modeForFamily;
|
|
2121
1981
|
exports.normalizeSubjectFields = normalizeSubjectFields;
|
|
2122
1982
|
exports.partitionStyleClauses = partitionStyleClauses;
|
|
2123
1983
|
exports.referenceDescriptionLine = referenceDescriptionLine;
|
|
2124
1984
|
exports.renderDescribedReferenceLines = renderDescribedReferenceLines;
|
|
2125
|
-
exports.renderDirectionHintClauses = renderDirectionHintClauses;
|
|
2126
|
-
exports.renderDirectionHints = renderDirectionHints;
|
|
2127
1985
|
exports.renderReferenceCaptionLines = renderReferenceCaptionLines;
|
|
2128
1986
|
exports.renderStructuredFields = renderStructuredFields;
|
|
2129
1987
|
exports.renderStyleSection = renderStyleSection;
|
|
@@ -2138,5 +1996,5 @@ exports.subjectFieldsForSurface = subjectFieldsForSurface;
|
|
|
2138
1996
|
exports.tidyReferenceTokenGaps = tidyReferenceTokenGaps;
|
|
2139
1997
|
exports.truncateText = truncateText;
|
|
2140
1998
|
exports.unboundReferenceTokenText = unboundReferenceTokenText;
|
|
2141
|
-
//# sourceMappingURL=chunk-
|
|
2142
|
-
//# sourceMappingURL=chunk-
|
|
1999
|
+
//# sourceMappingURL=chunk-WRM52ZBN.cjs.map
|
|
2000
|
+
//# sourceMappingURL=chunk-WRM52ZBN.cjs.map
|