@nodaro/shared 3.64.0 → 3.66.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-J6B7J73J.cjs → chunk-23IKLMRL.cjs} +49 -49
- package/dist/{chunk-J6B7J73J.cjs.map → chunk-23IKLMRL.cjs.map} +1 -1
- package/dist/chunk-27HA6YOL.cjs +377 -0
- package/dist/chunk-27HA6YOL.cjs.map +1 -0
- package/dist/{chunk-OOZW2MM6.cjs → chunk-37ZSFS6A.cjs} +9 -9
- package/dist/{chunk-OOZW2MM6.cjs.map → chunk-37ZSFS6A.cjs.map} +1 -1
- package/dist/{chunk-AZNZ5WNZ.cjs → chunk-3L7GMQ4M.cjs} +142 -45
- package/dist/chunk-3L7GMQ4M.cjs.map +1 -0
- package/dist/{chunk-SXHHLZ22.js → chunk-3QJ3UR5Z.js} +9 -9
- package/dist/{chunk-SXHHLZ22.js.map → chunk-3QJ3UR5Z.js.map} +1 -1
- package/dist/chunk-3YWZ5SOZ.js +164 -0
- package/dist/chunk-3YWZ5SOZ.js.map +1 -0
- package/dist/{chunk-TTGZ2L3O.js → chunk-5GG4CG4Y.js} +3 -3
- package/dist/{chunk-TTGZ2L3O.js.map → chunk-5GG4CG4Y.js.map} +1 -1
- package/dist/{chunk-3KTWYYCN.js → chunk-5IZHECUP.js} +3 -3
- package/dist/{chunk-3KTWYYCN.js.map → chunk-5IZHECUP.js.map} +1 -1
- package/dist/{chunk-Q2Y4JHF7.js → chunk-5J2LIQYU.js} +5 -5
- package/dist/{chunk-Q2Y4JHF7.js.map → chunk-5J2LIQYU.js.map} +1 -1
- package/dist/{chunk-SHH2T4CR.js → chunk-5LWYX4GV.js} +3 -3
- package/dist/{chunk-SHH2T4CR.js.map → chunk-5LWYX4GV.js.map} +1 -1
- package/dist/{chunk-7AJGUI7L.cjs → chunk-5NVGKXJV.cjs} +34 -17
- package/dist/chunk-5NVGKXJV.cjs.map +1 -0
- package/dist/{chunk-D4KWNDPH.cjs → chunk-66QSUUB4.cjs} +12 -12
- package/dist/{chunk-D4KWNDPH.cjs.map → chunk-66QSUUB4.cjs.map} +1 -1
- package/dist/{chunk-KHH54GRP.cjs → chunk-6ET3KDO4.cjs} +15 -338
- package/dist/chunk-6ET3KDO4.cjs.map +1 -0
- package/dist/{chunk-ZI3QDUHO.js → chunk-AT53ZQUC.js} +3 -3
- package/dist/{chunk-ZI3QDUHO.js.map → chunk-AT53ZQUC.js.map} +1 -1
- package/dist/chunk-BMDOPJBP.cjs +185 -0
- package/dist/chunk-BMDOPJBP.cjs.map +1 -0
- package/dist/{chunk-PJJAZQVZ.js → chunk-BNR5FKL5.js} +3 -3
- package/dist/{chunk-PJJAZQVZ.js.map → chunk-BNR5FKL5.js.map} +1 -1
- package/dist/{chunk-5OBTGNUQ.cjs → chunk-E62W5I6A.cjs} +298 -2
- package/dist/chunk-E62W5I6A.cjs.map +1 -0
- package/dist/{chunk-GTWUS6MQ.cjs → chunk-EFYWV2V5.cjs} +61 -61
- package/dist/{chunk-GTWUS6MQ.cjs.map → chunk-EFYWV2V5.cjs.map} +1 -1
- package/dist/chunk-F6XIH3TZ.cjs +168 -0
- package/dist/chunk-F6XIH3TZ.cjs.map +1 -0
- package/dist/{chunk-NIAFR5EE.js → chunk-FGBGKBML.js} +32 -3
- package/dist/chunk-FGBGKBML.js.map +1 -0
- package/dist/{chunk-YQV53HRR.cjs → chunk-G2G7XGFU.cjs} +7 -7
- package/dist/{chunk-YQV53HRR.cjs.map → chunk-G2G7XGFU.cjs.map} +1 -1
- package/dist/{chunk-7KQ6W5DS.js → chunk-GF7ZA26H.js} +4 -4
- package/dist/{chunk-7KQ6W5DS.js.map → chunk-GF7ZA26H.js.map} +1 -1
- package/dist/{chunk-SPAHI7DY.cjs → chunk-GNLA5NTT.cjs} +4 -4
- package/dist/{chunk-SPAHI7DY.cjs.map → chunk-GNLA5NTT.cjs.map} +1 -1
- package/dist/{chunk-VPTA4Z7G.js → chunk-GTBW2KAY.js} +5 -5
- package/dist/{chunk-VPTA4Z7G.js.map → chunk-GTBW2KAY.js.map} +1 -1
- package/dist/{chunk-CHS2SIP6.cjs → chunk-HTDKEYMY.cjs} +90 -76
- package/dist/chunk-HTDKEYMY.cjs.map +1 -0
- package/dist/{chunk-EXEVT6D2.cjs → chunk-IWUW3YPM.cjs} +5 -5
- package/dist/{chunk-EXEVT6D2.cjs.map → chunk-IWUW3YPM.cjs.map} +1 -1
- package/dist/{chunk-ACZZHHFZ.cjs → chunk-JTYCJ5OL.cjs} +44 -22
- package/dist/chunk-JTYCJ5OL.cjs.map +1 -0
- package/dist/{chunk-HDPJNNMF.cjs → chunk-M5QY464F.cjs} +21 -21
- package/dist/{chunk-HDPJNNMF.cjs.map → chunk-M5QY464F.cjs.map} +1 -1
- package/dist/{chunk-DZ4IOP3Q.js → chunk-MVXZP6VB.js} +281 -3
- package/dist/chunk-MVXZP6VB.js.map +1 -0
- package/dist/{chunk-Y4GCJJPF.cjs → chunk-NYZQOIXJ.cjs} +35 -2
- package/dist/chunk-NYZQOIXJ.cjs.map +1 -0
- package/dist/{chunk-KB2SQAR3.js → chunk-OFQ6CU6S.js} +3 -3
- package/dist/{chunk-KB2SQAR3.js.map → chunk-OFQ6CU6S.js.map} +1 -1
- package/dist/{chunk-36VWLB4J.js → chunk-OXBU5AGH.js} +3 -3
- package/dist/{chunk-36VWLB4J.js.map → chunk-OXBU5AGH.js.map} +1 -1
- package/dist/{chunk-CHTZZRAL.cjs → chunk-OXTF4Y3P.cjs} +6 -6
- package/dist/{chunk-CHTZZRAL.cjs.map → chunk-OXTF4Y3P.cjs.map} +1 -1
- package/dist/{chunk-3AYM47GW.js → chunk-PAUWEWTY.js} +99 -9
- package/dist/chunk-PAUWEWTY.js.map +1 -0
- package/dist/{chunk-FHGRKQVZ.cjs → chunk-PGDR7CO3.cjs} +8 -8
- package/dist/{chunk-FHGRKQVZ.cjs.map → chunk-PGDR7CO3.cjs.map} +1 -1
- package/dist/{chunk-W6VJAUGM.cjs → chunk-PJAJCFLP.cjs} +94 -37
- package/dist/chunk-PJAJCFLP.cjs.map +1 -0
- package/dist/{chunk-IYSOVS7O.js → chunk-RVQW623D.js} +31 -13
- package/dist/chunk-RVQW623D.js.map +1 -0
- package/dist/{chunk-TPQJKS7D.js → chunk-SCDE676D.js} +21 -7
- package/dist/{chunk-CHS2SIP6.cjs.map → chunk-SCDE676D.js.map} +1 -1
- package/dist/chunk-SW5ZD7BO.js +143 -0
- package/dist/chunk-SW5ZD7BO.js.map +1 -0
- package/dist/{chunk-T2OVDF2M.cjs → chunk-T4GIHHXY.cjs} +6 -6
- package/dist/{chunk-T2OVDF2M.cjs.map → chunk-T4GIHHXY.cjs.map} +1 -1
- package/dist/{chunk-QYU7J5EQ.js → chunk-V6OXSXIX.js} +29 -18
- package/dist/chunk-V6OXSXIX.js.map +1 -0
- package/dist/{chunk-W7KHHNZR.js → chunk-VBP4DH37.js} +61 -9
- package/dist/chunk-VBP4DH37.js.map +1 -0
- package/dist/{chunk-67CMMTLN.cjs → chunk-WZG6GZIL.cjs} +4 -4
- package/dist/{chunk-67CMMTLN.cjs.map → chunk-WZG6GZIL.cjs.map} +1 -1
- package/dist/{chunk-O4RPXBDZ.cjs → chunk-X2YHKP4D.cjs} +8 -8
- package/dist/{chunk-O4RPXBDZ.cjs.map → chunk-X2YHKP4D.cjs.map} +1 -1
- package/dist/{chunk-OBOOHG3N.js → chunk-XEPKONJC.js} +3 -3
- package/dist/{chunk-OBOOHG3N.js.map → chunk-XEPKONJC.js.map} +1 -1
- package/dist/{chunk-O7RZRUMZ.js → chunk-XJWED257.js} +14 -309
- package/dist/chunk-XJWED257.js.map +1 -0
- package/dist/chunk-XSSLNINL.js +346 -0
- package/dist/chunk-XSSLNINL.js.map +1 -0
- package/dist/{chunk-4IUE2JB7.js → chunk-Z77M7Q2R.js} +3 -3
- package/dist/{chunk-4IUE2JB7.js.map → chunk-Z77M7Q2R.js.map} +1 -1
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/captions.d.cts +1 -1
- package/dist/entries/captions.d.ts +1 -1
- package/dist/entries/credits.cjs +230 -214
- package/dist/entries/credits.d.cts +51 -14
- package/dist/entries/credits.d.ts +51 -14
- package/dist/entries/credits.js +10 -10
- package/dist/entries/entities.cjs +202 -193
- package/dist/entries/entities.d.cts +44 -9
- package/dist/entries/entities.d.ts +44 -9
- package/dist/entries/entities.js +2 -1
- package/dist/entries/llm-models.cjs +86 -62
- package/dist/entries/llm-models.d.cts +46 -15
- package/dist/entries/llm-models.d.ts +46 -15
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +79 -63
- package/dist/entries/media.d.cts +154 -1
- package/dist/entries/media.d.ts +154 -1
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +175 -119
- package/dist/entries/model-catalog.d.cts +4 -54
- package/dist/entries/model-catalog.d.ts +4 -54
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +503 -358
- package/dist/entries/models.d.cts +86 -7
- package/dist/entries/models.d.ts +86 -7
- package/dist/entries/models.js +6 -5
- package/dist/entries/nodes.cjs +212 -212
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +153 -153
- package/dist/entries/pipeline.d.cts +3 -3
- package/dist/entries/pipeline.d.ts +3 -3
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +174 -145
- package/dist/entries/video.d.cts +119 -2
- package/dist/entries/video.d.ts +119 -2
- package/dist/entries/video.js +7 -6
- package/dist/entries/workflow.d.cts +1 -1
- package/dist/entries/workflow.d.ts +1 -1
- package/dist/index.cjs +2086 -1793
- package/dist/index.d.cts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +24 -23
- package/dist/{model-catalog-Cf9fkEUp.d.ts → model-catalog-B-aQnUS8.d.cts} +186 -2
- package/dist/{model-catalog-Cf9fkEUp.d.cts → model-catalog-B-aQnUS8.d.ts} +186 -2
- package/dist/{model-constants-C_Nyft_i.d.cts → model-constants-BstsUup6.d.cts} +105 -6
- package/dist/{model-constants-BxjiWVQ9.d.ts → model-constants-DZ3tPGFO.d.ts} +105 -6
- package/dist/tts-capabilities-BJ4N8MIB.d.ts +133 -0
- package/dist/tts-capabilities-Cf_4nu1Z.d.cts +133 -0
- package/package.json +1 -1
- package/src/__tests__/dialogue-capabilities.test.ts +167 -6
- package/src/__tests__/extend-providers.test.ts +87 -0
- package/src/__tests__/flux-3-klein.test.ts +51 -3
- package/src/__tests__/image-run-limit.test.ts +96 -0
- package/src/__tests__/kling4-catalog.test.ts +1 -1
- package/src/__tests__/llm-models.test.ts +41 -4
- package/src/__tests__/seedream-5-5.test.ts +17 -0
- package/src/__tests__/speech-pricing.test.ts +62 -1
- package/src/__tests__/tts-capabilities.test.ts +160 -4
- package/src/__tests__/video-analysis-pricing.test.ts +13 -1
- package/src/__tests__/video-subjects.test.ts +209 -0
- package/src/__tests__/wired-character-names.test.ts +142 -0
- package/src/credit-estimators/index.ts +4 -0
- package/src/credit-estimators/speech.ts +57 -9
- package/src/credit-identifiers.ts +48 -13
- package/src/dialogue-capabilities.ts +220 -3
- package/src/dubbing-structure.ts +186 -0
- package/src/entries/entities.ts +2 -0
- package/src/entries/llm-models.ts +7 -0
- package/src/entries/media.ts +3 -1
- package/src/entries/model-catalog.ts +17 -0
- package/src/entries/models.ts +43 -0
- package/src/entries/video.ts +8 -1
- package/src/gemini-tts.ts +144 -0
- package/src/llm-models.ts +71 -21
- package/src/model-catalog.ts +283 -2
- package/src/model-constants.ts +167 -8
- package/src/tts-capabilities.ts +193 -1
- package/src/video-analysis-pricing.ts +11 -0
- package/src/video-character-refs.ts +165 -3
- package/src/wired-character-names.ts +134 -18
- package/src/wired-character-video-subjects.ts +63 -0
- package/dist/chunk-3AYM47GW.js.map +0 -1
- package/dist/chunk-5OBTGNUQ.cjs.map +0 -1
- package/dist/chunk-6YIV37V7.js +0 -31
- package/dist/chunk-6YIV37V7.js.map +0 -1
- package/dist/chunk-7AJGUI7L.cjs.map +0 -1
- package/dist/chunk-ACZZHHFZ.cjs.map +0 -1
- package/dist/chunk-AZNZ5WNZ.cjs.map +0 -1
- package/dist/chunk-DZ4IOP3Q.js.map +0 -1
- package/dist/chunk-IYSOVS7O.js.map +0 -1
- package/dist/chunk-KHH54GRP.cjs.map +0 -1
- package/dist/chunk-NIAFR5EE.js.map +0 -1
- package/dist/chunk-O7RZRUMZ.js.map +0 -1
- package/dist/chunk-QYU7J5EQ.js.map +0 -1
- package/dist/chunk-S3UGLZSF.js +0 -42
- package/dist/chunk-S3UGLZSF.js.map +0 -1
- package/dist/chunk-TPQJKS7D.js.map +0 -1
- package/dist/chunk-TQW3R44P.cjs +0 -38
- package/dist/chunk-TQW3R44P.cjs.map +0 -1
- package/dist/chunk-VZ6TE23U.cjs +0 -54
- package/dist/chunk-VZ6TE23U.cjs.map +0 -1
- package/dist/chunk-W6VJAUGM.cjs.map +0 -1
- package/dist/chunk-W7KHHNZR.js.map +0 -1
- package/dist/chunk-Y4GCJJPF.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_LABEL_BY_SOURCE } from './chunk-5RU2HCW2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { DEFAULT_USAGE_MODE, characterMentionSlug } from './chunk-XSSLNINL.js';
|
|
3
3
|
|
|
4
4
|
// src/featured-entities.ts
|
|
5
5
|
var FEATURED_ENTITIES = {
|
|
@@ -142,64 +142,6 @@ function collectAncestorRefs(nodeId, nodes, edges, getImageUrl, visited = /* @__
|
|
|
142
142
|
return refs;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
// src/character-usage-mode.ts
|
|
146
|
-
var USAGE_MODES = [
|
|
147
|
-
"identical",
|
|
148
|
-
"face",
|
|
149
|
-
"face-pose",
|
|
150
|
-
"pose",
|
|
151
|
-
"emotion",
|
|
152
|
-
"style",
|
|
153
|
-
"name",
|
|
154
|
-
"none"
|
|
155
|
-
];
|
|
156
|
-
var DEFAULT_USAGE_MODE = "identical";
|
|
157
|
-
function isUsageMode(s) {
|
|
158
|
-
return USAGE_MODES.includes(s);
|
|
159
|
-
}
|
|
160
|
-
function usageModeDirective(mode) {
|
|
161
|
-
switch (mode) {
|
|
162
|
-
case "identical":
|
|
163
|
-
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.";
|
|
164
|
-
case "face":
|
|
165
|
-
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.";
|
|
166
|
-
case "face-pose":
|
|
167
|
-
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.";
|
|
168
|
-
case "pose":
|
|
169
|
-
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.";
|
|
170
|
-
case "emotion":
|
|
171
|
-
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.";
|
|
172
|
-
case "style":
|
|
173
|
-
return "Take only the visual style and tone (lighting, color grade, atmosphere). Do not copy the subject's identity, clothing, or pose.";
|
|
174
|
-
case "name":
|
|
175
|
-
case "none":
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function usageModeLabel(mode) {
|
|
180
|
-
switch (mode) {
|
|
181
|
-
case "identical":
|
|
182
|
-
return "Identical";
|
|
183
|
-
case "face":
|
|
184
|
-
return "Face only";
|
|
185
|
-
case "face-pose":
|
|
186
|
-
return "Face + Pose";
|
|
187
|
-
case "pose":
|
|
188
|
-
return "Pose only";
|
|
189
|
-
case "emotion":
|
|
190
|
-
return "Emotion only";
|
|
191
|
-
case "style":
|
|
192
|
-
return "Style only";
|
|
193
|
-
case "name":
|
|
194
|
-
return "Name only";
|
|
195
|
-
case "none":
|
|
196
|
-
return "None";
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function usageModeIncludesName(mode) {
|
|
200
|
-
return mode !== "none";
|
|
201
|
-
}
|
|
202
|
-
|
|
203
145
|
// src/extra-refs.ts
|
|
204
146
|
function expandExtraRefsToConnectedReferences(extras, lookupCharacterContext) {
|
|
205
147
|
if (!extras || extras.length === 0) return [];
|
|
@@ -286,243 +228,6 @@ function resolveObjectAspectRatio(opts) {
|
|
|
286
228
|
return OBJECT_ASPECT_DEFAULTS[opts.assetType];
|
|
287
229
|
}
|
|
288
230
|
|
|
289
|
-
// src/character-mention-slug.ts
|
|
290
|
-
function characterMentionSlug(name) {
|
|
291
|
-
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
292
|
-
}
|
|
293
|
-
function parseCharacterMentionToken(text2, _knownCharacterSlugs) {
|
|
294
|
-
if (!text2.startsWith("@")) return null;
|
|
295
|
-
let rest = text2.slice(1);
|
|
296
|
-
if (rest.length === 0 || !/^[a-z]/.test(rest)) return null;
|
|
297
|
-
let lockField = {};
|
|
298
|
-
if (rest.endsWith("~nolock")) {
|
|
299
|
-
rest = rest.slice(0, -"~nolock".length);
|
|
300
|
-
lockField = { lock: false };
|
|
301
|
-
} else if (rest.endsWith("~lock")) {
|
|
302
|
-
rest = rest.slice(0, -"~lock".length);
|
|
303
|
-
lockField = { lock: true };
|
|
304
|
-
}
|
|
305
|
-
const parts = rest.split(":");
|
|
306
|
-
if (parts.length < 2 || parts.length > 4) return null;
|
|
307
|
-
const [characterSlug, indexStr, third, fourth] = parts;
|
|
308
|
-
if (!/^[a-z][a-z0-9-]*$/.test(characterSlug)) return null;
|
|
309
|
-
if (!/^\d+$/.test(indexStr)) return null;
|
|
310
|
-
const imageIndex = parseInt(indexStr, 10);
|
|
311
|
-
if (!Number.isInteger(imageIndex) || imageIndex < 1) return null;
|
|
312
|
-
if (parts.length === 2) {
|
|
313
|
-
return { characterSlug, imageIndex, variantSlug: null, usageMode: null, ...lockField };
|
|
314
|
-
}
|
|
315
|
-
if (parts.length === 3) {
|
|
316
|
-
if (!/^[a-z][a-z0-9-]*$/.test(third)) return null;
|
|
317
|
-
if (isUsageMode(third)) {
|
|
318
|
-
return { characterSlug, imageIndex, variantSlug: null, usageMode: third, ...lockField };
|
|
319
|
-
}
|
|
320
|
-
return { characterSlug, imageIndex, variantSlug: third, usageMode: null, ...lockField };
|
|
321
|
-
}
|
|
322
|
-
if (parts.length === 4) {
|
|
323
|
-
if (!/^[a-z][a-z0-9-]*$/.test(third)) return null;
|
|
324
|
-
if (!/^[a-z][a-z0-9-]*$/.test(fourth)) return null;
|
|
325
|
-
if (isUsageMode(fourth)) {
|
|
326
|
-
return { characterSlug, imageIndex, variantSlug: third, usageMode: fourth, ...lockField };
|
|
327
|
-
}
|
|
328
|
-
return { characterSlug, imageIndex, variantSlug: third, usageMode: null, role: fourth, ...lockField };
|
|
329
|
-
}
|
|
330
|
-
return null;
|
|
331
|
-
}
|
|
332
|
-
function findCharacterMentionTokens(prompt, knownCharacterSlugs) {
|
|
333
|
-
const tokens = [];
|
|
334
|
-
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;
|
|
335
|
-
const knownSet = new Set(knownCharacterSlugs);
|
|
336
|
-
for (const match of prompt.matchAll(regex)) {
|
|
337
|
-
const token = match[1];
|
|
338
|
-
const offset = (match.index ?? 0) + (match[0].length - token.length);
|
|
339
|
-
const parsed = parseCharacterMentionToken(token);
|
|
340
|
-
if (parsed && knownSet.has(parsed.characterSlug)) {
|
|
341
|
-
tokens.push({ token, ...parsed, offset });
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
return tokens;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// src/wired-character-names.ts
|
|
348
|
-
var CHARACTER_NODE_DEFAULT_LABEL = "Character Asset";
|
|
349
|
-
var CHARACTER_NODE_RETIRED_DEFAULT_LABELS = ["Character"];
|
|
350
|
-
var UNNAMED_CHARACTER_NAME_PREFIX = "Character";
|
|
351
|
-
var text = (v) => typeof v === "string" ? v.trim() : "";
|
|
352
|
-
function characterOwnName(data) {
|
|
353
|
-
const d = data ?? {};
|
|
354
|
-
const name = text(d.characterName);
|
|
355
|
-
if (name) return name;
|
|
356
|
-
const label = text(d.label);
|
|
357
|
-
if (!label || label === CHARACTER_NODE_DEFAULT_LABEL || CHARACTER_NODE_RETIRED_DEFAULT_LABELS.includes(label)) return "";
|
|
358
|
-
return label;
|
|
359
|
-
}
|
|
360
|
-
function wiredCharacterNames(sources) {
|
|
361
|
-
const order = [];
|
|
362
|
-
const seen = /* @__PURE__ */ new Set();
|
|
363
|
-
for (const s of sources) {
|
|
364
|
-
if (seen.has(s.key) || resolveEffectiveSourceType(s.type, s.sourceHandle) !== "character") continue;
|
|
365
|
-
seen.add(s.key);
|
|
366
|
-
order.push({ key: s.key, own: characterOwnName(s.data) });
|
|
367
|
-
}
|
|
368
|
-
const taken = /* @__PURE__ */ new Set();
|
|
369
|
-
for (const { own } of order) {
|
|
370
|
-
const slug = characterMentionSlug(own);
|
|
371
|
-
if (slug) taken.add(slug);
|
|
372
|
-
}
|
|
373
|
-
const out = /* @__PURE__ */ new Map();
|
|
374
|
-
let next = 1;
|
|
375
|
-
for (const { key, own } of order) {
|
|
376
|
-
const ownSlug = characterMentionSlug(own);
|
|
377
|
-
if (ownSlug) {
|
|
378
|
-
out.set(key, { name: own, slug: ownSlug, unnamed: false });
|
|
379
|
-
continue;
|
|
380
|
-
}
|
|
381
|
-
while (taken.has(numberedSlug(next))) next++;
|
|
382
|
-
const slug = numberedSlug(next);
|
|
383
|
-
taken.add(slug);
|
|
384
|
-
out.set(key, own ? { name: own, slug, unnamed: false } : { name: `${UNNAMED_CHARACTER_NAME_PREFIX} ${next}`, slug, unnamed: true });
|
|
385
|
-
next++;
|
|
386
|
-
}
|
|
387
|
-
return out;
|
|
388
|
-
}
|
|
389
|
-
var numberedSlug = (n) => characterMentionSlug(`${UNNAMED_CHARACTER_NAME_PREFIX} ${n}`);
|
|
390
|
-
var RETIRED_CHARACTER_MENTION_SLUGS = [
|
|
391
|
-
characterMentionSlug(CHARACTER_NODE_DEFAULT_LABEL),
|
|
392
|
-
...CHARACTER_NODE_RETIRED_DEFAULT_LABELS.map(characterMentionSlug)
|
|
393
|
-
];
|
|
394
|
-
function aliasRetiredCharacterMentions(text2, names) {
|
|
395
|
-
if (!text2 || !text2.includes("@")) return text2;
|
|
396
|
-
let lone;
|
|
397
|
-
for (const n of names.values()) {
|
|
398
|
-
if (!n.unnamed) continue;
|
|
399
|
-
if (lone) return text2;
|
|
400
|
-
lone = n;
|
|
401
|
-
}
|
|
402
|
-
if (!lone) return text2;
|
|
403
|
-
const slugs = new Set([...names.values()].map((n) => n.slug));
|
|
404
|
-
let out = text2;
|
|
405
|
-
for (const retired of RETIRED_CHARACTER_MENTION_SLUGS) {
|
|
406
|
-
if (slugs.has(retired)) continue;
|
|
407
|
-
out = out.replace(new RegExp(`(^|[^a-zA-Z0-9])@${retired}(?=:\\d)`, "g"), `$1@${lone.slug}`);
|
|
408
|
-
}
|
|
409
|
-
return out;
|
|
410
|
-
}
|
|
411
|
-
function wiredCharacterNamesOf(consumerId, nodes, edges) {
|
|
412
|
-
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
413
|
-
const sources = [];
|
|
414
|
-
for (const e of edges) {
|
|
415
|
-
if (e.target !== consumerId) continue;
|
|
416
|
-
const n = byId.get(e.source);
|
|
417
|
-
if (!n) continue;
|
|
418
|
-
sources.push({ key: n.id, type: n.type, sourceHandle: e.sourceHandle, data: n.data });
|
|
419
|
-
}
|
|
420
|
-
return wiredCharacterNames(sources);
|
|
421
|
-
}
|
|
422
|
-
function wiredCharacterKey(names, nodeId, data) {
|
|
423
|
-
return names.get(nodeId)?.slug || characterMentionSlug(characterOwnName(data)) || `node:${nodeId}`;
|
|
424
|
-
}
|
|
425
|
-
function wiredCharacterBySlug(names, slug) {
|
|
426
|
-
if (!slug) return void 0;
|
|
427
|
-
for (const [key, named] of names) if (named.slug === slug) return { key, named };
|
|
428
|
-
return void 0;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// src/entity-image-url.ts
|
|
432
|
-
function entityImageUrl(data) {
|
|
433
|
-
const d = data ?? {};
|
|
434
|
-
const str = (v) => typeof v === "string" && v ? v : void 0;
|
|
435
|
-
const results = Array.isArray(d.generatedResults) ? d.generatedResults : [];
|
|
436
|
-
const active = typeof d.activeResultIndex === "number" ? d.activeResultIndex : 0;
|
|
437
|
-
return str(d.defaultAssetUrl) || str(results[active]?.url) || str(d.sourceImageUrl);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
// src/character-variant-assets.ts
|
|
441
|
-
var CHARACTER_VARIANT_ASSET_BUCKETS = [
|
|
442
|
-
"expressions",
|
|
443
|
-
"poses",
|
|
444
|
-
"motions",
|
|
445
|
-
"angles",
|
|
446
|
-
"bodyAngles",
|
|
447
|
-
"lightingVariations",
|
|
448
|
-
"outfitVariations",
|
|
449
|
-
"detailCloseups"
|
|
450
|
-
];
|
|
451
|
-
function characterVariantAssetArrays(data) {
|
|
452
|
-
const out = {};
|
|
453
|
-
for (const bucket of CHARACTER_VARIANT_ASSET_BUCKETS) {
|
|
454
|
-
const value = data?.[bucket];
|
|
455
|
-
out[bucket] = Array.isArray(value) ? value : [];
|
|
456
|
-
}
|
|
457
|
-
return out;
|
|
458
|
-
}
|
|
459
|
-
function characterSheetRefItems(sheets) {
|
|
460
|
-
if (!Array.isArray(sheets)) return [];
|
|
461
|
-
return sheets.flatMap((s) => {
|
|
462
|
-
const sheet = s;
|
|
463
|
-
if (!sheet || typeof sheet.url !== "string" || !sheet.url) return [];
|
|
464
|
-
const type = typeof sheet.type === "string" && sheet.type ? sheet.type : "sheet";
|
|
465
|
-
const skin = typeof sheet.skin === "string" && sheet.skin ? ` ${sheet.skin}` : "";
|
|
466
|
-
return [{ name: `${type}${skin}`, url: sheet.url }];
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
var BOARD_SHIM_KEY = "studioBoard";
|
|
470
|
-
var BOARD_SHIM_PREFIX = "studioBoard:";
|
|
471
|
-
function characterBoardItems(data) {
|
|
472
|
-
const column = Array.isArray(data?.boards) ? data.boards.flatMap((b) => {
|
|
473
|
-
const board = b;
|
|
474
|
-
if (!board || typeof board.url !== "string" || !board.url) return [];
|
|
475
|
-
return [{ name: typeof board.name === "string" && board.name ? board.name : "board", url: board.url }];
|
|
476
|
-
}) : [];
|
|
477
|
-
const map = data?.selectedAssetByVariant ?? {};
|
|
478
|
-
const shim = [];
|
|
479
|
-
const legacy = map[BOARD_SHIM_KEY];
|
|
480
|
-
if (typeof legacy === "string" && legacy) shim.push({ name: "board", url: legacy });
|
|
481
|
-
for (const [k, v] of Object.entries(map)) {
|
|
482
|
-
if (k.startsWith(BOARD_SHIM_PREFIX) && typeof v === "string" && v) {
|
|
483
|
-
shim.push({ name: k.slice(BOARD_SHIM_PREFIX.length) || "board", url: v });
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
const haveNames = new Set(column.map((b) => b.name.toLowerCase()));
|
|
487
|
-
return [...column, ...shim.filter((b) => !haveNames.has(b.name.toLowerCase()))];
|
|
488
|
-
}
|
|
489
|
-
function characterMentionableAssetArrays(data) {
|
|
490
|
-
return {
|
|
491
|
-
...characterVariantAssetArrays(data),
|
|
492
|
-
sheets: characterSheetRefItems(data?.sheets),
|
|
493
|
-
boards: characterBoardItems(data)
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
var CHARACTER_PICKER_DISPLAY_ORDER = [
|
|
497
|
-
"boards",
|
|
498
|
-
"sheets",
|
|
499
|
-
...CHARACTER_VARIANT_ASSET_BUCKETS
|
|
500
|
-
];
|
|
501
|
-
function characterBucketDisplayRank(bucket) {
|
|
502
|
-
if (bucket === void 0) return -1;
|
|
503
|
-
const i = CHARACTER_PICKER_DISPLAY_ORDER.indexOf(bucket);
|
|
504
|
-
return i === -1 ? CHARACTER_PICKER_DISPLAY_ORDER.length : i;
|
|
505
|
-
}
|
|
506
|
-
function sortCharacterEntriesForDisplay(items) {
|
|
507
|
-
const out = [];
|
|
508
|
-
let i = 0;
|
|
509
|
-
while (i < items.length) {
|
|
510
|
-
const slug = items[i].characterSlug;
|
|
511
|
-
if (!slug) {
|
|
512
|
-
out.push(items[i]);
|
|
513
|
-
i++;
|
|
514
|
-
continue;
|
|
515
|
-
}
|
|
516
|
-
let j = i;
|
|
517
|
-
while (j < items.length && items[j].characterSlug === slug) j++;
|
|
518
|
-
const run = items.slice(i, j);
|
|
519
|
-
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);
|
|
520
|
-
out.push(...ranked);
|
|
521
|
-
i = j;
|
|
522
|
-
}
|
|
523
|
-
return out;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
231
|
// src/location-mention-slug.ts
|
|
527
232
|
var LOCATION_USAGE_MODES = [
|
|
528
233
|
"identical",
|
|
@@ -549,9 +254,9 @@ function locationUsageModeLabel(mode) {
|
|
|
549
254
|
function locationMentionSlug(name) {
|
|
550
255
|
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
551
256
|
}
|
|
552
|
-
function parseLocationMentionToken(
|
|
553
|
-
if (!
|
|
554
|
-
let rest =
|
|
257
|
+
function parseLocationMentionToken(text) {
|
|
258
|
+
if (!text.startsWith("@")) return null;
|
|
259
|
+
let rest = text.slice(1);
|
|
555
260
|
if (rest.length === 0 || !/^[a-z]/.test(rest)) return null;
|
|
556
261
|
let lockField = {};
|
|
557
262
|
if (rest.endsWith("~nolock")) {
|
|
@@ -647,9 +352,9 @@ var MENTION_SLUG_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
|
647
352
|
function mentionNameSlug(name) {
|
|
648
353
|
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
649
354
|
}
|
|
650
|
-
function parseMentionToken(
|
|
651
|
-
if (!
|
|
652
|
-
let rest =
|
|
355
|
+
function parseMentionToken(text) {
|
|
356
|
+
if (!text.startsWith("@")) return null;
|
|
357
|
+
let rest = text.slice(1);
|
|
653
358
|
if (rest.length === 0 || !/^[a-z]/.test(rest)) return null;
|
|
654
359
|
let lockField = {};
|
|
655
360
|
if (rest.endsWith("~nolock")) {
|
|
@@ -691,8 +396,8 @@ function findMentionTokens(prompt, knownSlugs) {
|
|
|
691
396
|
function imageMentionSlug(name) {
|
|
692
397
|
return mentionNameSlug(name);
|
|
693
398
|
}
|
|
694
|
-
function parseImageMentionToken(
|
|
695
|
-
const parsed = parseMentionToken(
|
|
399
|
+
function parseImageMentionToken(text) {
|
|
400
|
+
const parsed = parseMentionToken(text);
|
|
696
401
|
if (!parsed) return null;
|
|
697
402
|
return {
|
|
698
403
|
imageSlug: parsed.slug,
|
|
@@ -731,8 +436,8 @@ function knownImageSlugsFromRefs(refs) {
|
|
|
731
436
|
function entityMentionSlug(name) {
|
|
732
437
|
return mentionNameSlug(name);
|
|
733
438
|
}
|
|
734
|
-
function parseEntityMentionToken(
|
|
735
|
-
const parsed = parseMentionToken(
|
|
439
|
+
function parseEntityMentionToken(text) {
|
|
440
|
+
const parsed = parseMentionToken(text);
|
|
736
441
|
if (!parsed) return null;
|
|
737
442
|
return {
|
|
738
443
|
entitySlug: parsed.slug,
|
|
@@ -1424,6 +1129,6 @@ function sanitizeRole(raw) {
|
|
|
1424
1129
|
return raw.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/^[^a-z]+/, "").slice(0, 32).replace(/-+/g, "-").replace(/-$/, "");
|
|
1425
1130
|
}
|
|
1426
1131
|
|
|
1427
|
-
export { 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,
|
|
1428
|
-
//# sourceMappingURL=chunk-
|
|
1429
|
-
//# sourceMappingURL=chunk-
|
|
1132
|
+
export { 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_REFERENCE_PHOTO_KINDS, CHARACTER_STYLES, CREATURE_ATTACH_COLUMNS, DEFAULT_CARRIED_FRACTION, DEFAULT_LOCATION_USAGE_MODE, DEFAULT_PANEL_COUNT, DEFAULT_SECTIONS, DETAIL_VARIANTS, ENTITY_ASPECT_DEFAULTS, ENTITY_SECTIONS, FEATURED_ENTITIES, IMAGE_REF_TYPES, IMAGE_TO_IMAGE_ATTACH_COLUMNS, KEEPER_CATALOG_CATEGORY_MAX, KEEPER_CATALOG_SORT_MAX, 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, 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, WARDROBE_VARIANTS, aspectRatioToNumber, buildBoardPrompt, buildPanelPrompt, collectAncestorRefs, defaultCarriedFraction, defaultRoleForSource, entityMentionSlug, entityMentionSlugForRef, estimateSheetCost, expandExtraRefsToConnectedReferences, findEntityMentionTokens, findImageMentionTokens, findLocationMentionTokens, firstSightExtraRole, getFeaturedEntities, imageMentionSlug, imageMentionSlugForRef, isCharacterAspectRatio, isLocationUsageMode, isObjectAspectRatio, isTiltDirection, knownEntitySlugsFromRefs, knownImageSlugsFromRefs, listBoardTemplates, locationMentionSlug, locationReferencePhotoKindLabel, locationUsageModeLabel, matchVariant, normalizeRoleSlug, parseEntityMentionToken, parseImageMentionToken, parseLocationMentionToken, planSheetGeneration, planSheetPanels, presetEntries, referenceSheetCreditId, resolveCharacterAspectRatio, resolveDefaultRole, resolveEntityAspect, resolveObjectAspectRatio, resolveSheetSections, roleToPhrase, sanitizeRole, toConnectedReference, toConnectedReferences };
|
|
1133
|
+
//# sourceMappingURL=chunk-XJWED257.js.map
|
|
1134
|
+
//# sourceMappingURL=chunk-XJWED257.js.map
|