@nodaro/prompts 1.29.0 → 1.30.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/index.cjs +148 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -2
- package/dist/index.d.ts +35 -2
- package/dist/index.js +144 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/caption-treatments.test.ts +155 -0
- package/src/__tests__/creator-presets.test.ts +151 -0
- package/src/__tests__/factory-presets.test.ts +63 -0
- package/src/caption-treatments.ts +109 -0
- package/src/factory-presets/sfx.ts +21 -0
- package/src/factory-presets/text.ts +29 -0
- package/src/factory-presets/video-edit.ts +14 -0
- package/src/factory-presets/voice.ts +14 -0
- package/src/index.ts +1 -0
package/dist/index.cjs
CHANGED
|
@@ -45643,6 +45643,20 @@ var VOICE_DESIGN_PRESETS = [
|
|
|
45643
45643
|
group: "Narration & Character",
|
|
45644
45644
|
data: { voiceDescription: "A calm, soft-spoken meditation guide with a slow, breathy, reassuring delivery." }
|
|
45645
45645
|
},
|
|
45646
|
+
{
|
|
45647
|
+
id: "voice-design/casual-creator-female",
|
|
45648
|
+
name: "Casual Creator (female)",
|
|
45649
|
+
description: "Relaxed, warm, everyday.",
|
|
45650
|
+
group: "Narration & Character",
|
|
45651
|
+
data: { voiceDescription: "An adult woman in her late twenties talking casually to the viewer as if telling a friend about something she tried: relaxed, warm and upbeat, a natural conversational pace with small pauses, a light neutral American accent, recorded close and dry in a quiet room, never polished or announcer-like." }
|
|
45652
|
+
},
|
|
45653
|
+
{
|
|
45654
|
+
id: "voice-design/casual-creator-male",
|
|
45655
|
+
name: "Casual Creator (male)",
|
|
45656
|
+
description: "Relaxed, warm, everyday.",
|
|
45657
|
+
group: "Narration & Character",
|
|
45658
|
+
data: { voiceDescription: "An adult man in his late twenties talking casually to the viewer as if telling a friend about something he tried: relaxed, warm and upbeat, a natural conversational pace with small pauses, a light neutral American accent, recorded close and dry in a quiet room, never polished or announcer-like." }
|
|
45659
|
+
},
|
|
45646
45660
|
// ── Professional & Assistant ─────────────────────────────────────────────
|
|
45647
45661
|
{
|
|
45648
45662
|
id: "voice-design/hype-announcer",
|
|
@@ -45750,6 +45764,27 @@ var TEXT_TO_AUDIO_PRESETS = [
|
|
|
45750
45764
|
group: "Ambiences (loopable)",
|
|
45751
45765
|
data: { provider: "elevenlabs-sfx", duration: 22, loop: true, promptInfluence: 0.5, prompt: "low sci-fi ambient drone, ominous spaceship hum" }
|
|
45752
45766
|
},
|
|
45767
|
+
{
|
|
45768
|
+
id: "text-to-audio/living-room-tone",
|
|
45769
|
+
name: "Living Room Tone",
|
|
45770
|
+
description: "Quiet, lived-in room.",
|
|
45771
|
+
group: "Ambiences (loopable)",
|
|
45772
|
+
data: { provider: "elevenlabs-sfx", duration: 22, loop: true, promptInfluence: 0.4, prompt: "quiet living room room tone, faint air and a soft distant household hum, steady and even, an empty room at rest" }
|
|
45773
|
+
},
|
|
45774
|
+
{
|
|
45775
|
+
id: "text-to-audio/kitchen-hum",
|
|
45776
|
+
name: "Kitchen Hum",
|
|
45777
|
+
description: "Fridge hum in a still kitchen.",
|
|
45778
|
+
group: "Ambiences (loopable)",
|
|
45779
|
+
data: { provider: "elevenlabs-sfx", duration: 22, loop: true, promptInfluence: 0.4, prompt: "home kitchen room tone, a low steady refrigerator hum with faint air, calm and continuous, an empty kitchen at rest" }
|
|
45780
|
+
},
|
|
45781
|
+
{
|
|
45782
|
+
id: "text-to-audio/cafe-murmur",
|
|
45783
|
+
name: "Caf\xE9 Murmur",
|
|
45784
|
+
description: "Soft, indistinct caf\xE9 chatter.",
|
|
45785
|
+
group: "Ambiences (loopable)",
|
|
45786
|
+
data: { provider: "elevenlabs-sfx", duration: 22, loop: true, promptInfluence: 0.4, prompt: "caf\xE9 background ambience, a soft indistinct murmur of distant conversation and the occasional faint cup clink, steady and even, no clear words" }
|
|
45787
|
+
},
|
|
45753
45788
|
// ── UI & Stingers ────────────────────────────────────────────────────────
|
|
45754
45789
|
{
|
|
45755
45790
|
id: "text-to-audio/ui-click",
|
|
@@ -45905,6 +45940,16 @@ var LLM_CHAT_PRESETS = [
|
|
|
45905
45940
|
temperature: 0.7
|
|
45906
45941
|
}
|
|
45907
45942
|
},
|
|
45943
|
+
{
|
|
45944
|
+
id: "llm-chat/hook-generator",
|
|
45945
|
+
name: "Hook Generator",
|
|
45946
|
+
description: "10 opening lines for a talking-to-camera video.",
|
|
45947
|
+
group: "Writing & Marketing",
|
|
45948
|
+
data: {
|
|
45949
|
+
systemPrompt: "You write opening lines for short vertical videos in which one person talks straight to the camera about a product, a site or an idea. Given the user's topic, write 10 different opening lines.\n\nEvery line:\n- is one short spoken clause of at most 8 words;\n- leads with the payload the viewer can check: a number, a price, a time saved, a before and after, a contrast with the usual way, or a named result;\n- opens on the claim itself \u2014 no greeting, no filler word, no introduction of the product before the claim;\n- sounds said, not written: plain words, contractions welcome, no hashtags, no emoji, no stage directions;\n- spells the product or brand exactly as the user gives it and writes numbers as digits.\n\nVary the angle across the 10: a surprising number, a price, time saved, a mistake to avoid, a before and after, a contrast, a named result, a direct question. Write in the language the user writes in. Return only the numbered list, one line each.",
|
|
45950
|
+
temperature: 0.9
|
|
45951
|
+
}
|
|
45952
|
+
},
|
|
45908
45953
|
// ── Utility ──────────────────────────────────────────────────────────────
|
|
45909
45954
|
{
|
|
45910
45955
|
id: "llm-chat/prompt-enhancer",
|
|
@@ -46086,6 +46131,16 @@ var IMAGE_TO_TEXT_PRESETS = [
|
|
|
46086
46131
|
group: "Extraction",
|
|
46087
46132
|
data: { detailLevel: "detailed", customPrompt: "Write a compelling e-commerce product description based on this product image." }
|
|
46088
46133
|
},
|
|
46134
|
+
{
|
|
46135
|
+
id: "image-to-text/site-screenshot-summary",
|
|
46136
|
+
name: "Site Screenshot Summary",
|
|
46137
|
+
description: "Section, headings and figures from a web page.",
|
|
46138
|
+
group: "Extraction",
|
|
46139
|
+
data: {
|
|
46140
|
+
detailLevel: "structured",
|
|
46141
|
+
customPrompt: 'Describe this website screenshot as five labelled lines. Section: which part of the site it is (for example the top of the home page, a feature, how it works, reviews, pricing, sign-up, navigation or footer). Headings: every heading exactly as written. Figures: every number, price, rating and date exactly as written, each with what it refers to. Brand: the product or company name exactly as spelled. First look: what a viewer notices first, in one sentence. Write "none" on a line with nothing to report.'
|
|
46142
|
+
}
|
|
46143
|
+
},
|
|
46089
46144
|
// ── Creative ─────────────────────────────────────────────────────────────
|
|
46090
46145
|
{
|
|
46091
46146
|
id: "image-to-text/scene-description",
|
|
@@ -46197,6 +46252,20 @@ var ADD_CAPTIONS_PRESETS = [
|
|
|
46197
46252
|
description: "Subtitles along the top.",
|
|
46198
46253
|
group: "Caption Styles",
|
|
46199
46254
|
data: { style: "subtitle", position: "top", fontSize: 36, color: "#FFFFFF", autoTranscribe: true }
|
|
46255
|
+
},
|
|
46256
|
+
{
|
|
46257
|
+
id: "add-captions/hook-plate",
|
|
46258
|
+
name: "Hook Plate",
|
|
46259
|
+
description: "Your opening line as a bold plate near the top.",
|
|
46260
|
+
group: "Caption Styles",
|
|
46261
|
+
data: { style: "subtitle", look: "clean", position: "top", positionY: 20, fontSize: 32, fontWeight: 800, maxWordsPerLine: 4, color: "#111111", backgroundColor: "#FFFFFF", autoTranscribe: false }
|
|
46262
|
+
},
|
|
46263
|
+
{
|
|
46264
|
+
id: "add-captions/body-captions",
|
|
46265
|
+
name: "Body Captions",
|
|
46266
|
+
description: "Word-by-word captions under the face.",
|
|
46267
|
+
group: "Caption Styles",
|
|
46268
|
+
data: { style: "word-highlight", look: "outline", position: "bottom", positionY: 72, fontSize: 32, maxWordsPerLine: 3, color: "#FFFFFF", autoTranscribe: true }
|
|
46200
46269
|
}
|
|
46201
46270
|
];
|
|
46202
46271
|
var COMBINE_VIDEOS_PRESETS = [
|
|
@@ -46758,6 +46827,80 @@ function getFactoryPresets(nodeType) {
|
|
|
46758
46827
|
return FACTORY_PRESETS[nodeType] ?? [];
|
|
46759
46828
|
}
|
|
46760
46829
|
|
|
46830
|
+
// src/caption-treatments.ts
|
|
46831
|
+
var HOOK_PLATE_PRESET_ID = "add-captions/hook-plate";
|
|
46832
|
+
var BODY_CAPTIONS_PRESET_ID = "add-captions/body-captions";
|
|
46833
|
+
var CAPTION_LEVERS_BY_LANGUAGE = {
|
|
46834
|
+
he: { fontFamily: "Rubik", uppercase: false }
|
|
46835
|
+
};
|
|
46836
|
+
var CAPTION_SEGMENT_LEVER_KEYS = [
|
|
46837
|
+
"style",
|
|
46838
|
+
"position",
|
|
46839
|
+
"fontSize",
|
|
46840
|
+
"color",
|
|
46841
|
+
"backgroundColor",
|
|
46842
|
+
"look",
|
|
46843
|
+
"fontFamily",
|
|
46844
|
+
"fontWeight",
|
|
46845
|
+
"strokeColor",
|
|
46846
|
+
"strokeWidth",
|
|
46847
|
+
"highlightColor",
|
|
46848
|
+
"uppercase",
|
|
46849
|
+
"positionY",
|
|
46850
|
+
"animate",
|
|
46851
|
+
"maxWordsPerLine"
|
|
46852
|
+
];
|
|
46853
|
+
var LEVER_KEYS = new Set(CAPTION_SEGMENT_LEVER_KEYS);
|
|
46854
|
+
function pickLevers(source) {
|
|
46855
|
+
const out = {};
|
|
46856
|
+
if (!source) return out;
|
|
46857
|
+
for (const [k, v] of Object.entries(source)) if (LEVER_KEYS.has(k) && v !== void 0 && v !== null) out[k] = v;
|
|
46858
|
+
return out;
|
|
46859
|
+
}
|
|
46860
|
+
function presetLevers(id) {
|
|
46861
|
+
const preset = ADD_CAPTIONS_PRESETS.find((p) => p.id === id);
|
|
46862
|
+
if (!preset) throw new Error(`The ${id} caption preset is missing from the catalog.`);
|
|
46863
|
+
return pickLevers(preset.data);
|
|
46864
|
+
}
|
|
46865
|
+
var PLATE_LEVERS = presetLevers(HOOK_PLATE_PRESET_ID);
|
|
46866
|
+
var BODY_LEVERS = presetLevers(BODY_CAPTIONS_PRESET_ID);
|
|
46867
|
+
function languageLevers(tag) {
|
|
46868
|
+
if (typeof tag !== "string") return {};
|
|
46869
|
+
const primary = tag.trim().split(/[-_]/)[0].toLowerCase();
|
|
46870
|
+
return Object.hasOwn(CAPTION_LEVERS_BY_LANGUAGE, primary) ? CAPTION_LEVERS_BY_LANGUAGE[primary] : {};
|
|
46871
|
+
}
|
|
46872
|
+
var isTime = (n) => typeof n === "number" && Number.isFinite(n);
|
|
46873
|
+
function hookPlateCaptionSegments(plan, opts = {}) {
|
|
46874
|
+
const hookEnd = plan.hookEndMs;
|
|
46875
|
+
if (!isTime(hookEnd) || hookEnd < 0) return { segments: [], dropped: ["hook", "body"] };
|
|
46876
|
+
const language = languageLevers(plan.language);
|
|
46877
|
+
const limit = typeof plan.videoDurationMs === "number" ? plan.videoDurationMs : Number.POSITIVE_INFINITY;
|
|
46878
|
+
const segments = [];
|
|
46879
|
+
const dropped = [];
|
|
46880
|
+
const plateEnd = Math.min(hookEnd, limit);
|
|
46881
|
+
if (plateEnd > 0 && typeof plan.hookText === "string" && /\S/.test(plan.hookText)) {
|
|
46882
|
+
segments.push({ startMs: 0, endMs: plateEnd, text: plan.hookText, ...PLATE_LEVERS, ...language });
|
|
46883
|
+
} else {
|
|
46884
|
+
dropped.push("hook");
|
|
46885
|
+
}
|
|
46886
|
+
const bodyEnd = Math.min(plan.bodyEndMs, limit);
|
|
46887
|
+
const words = Array.isArray(plan.captions) ? plan.captions : [];
|
|
46888
|
+
const chosen = pickLevers(opts.bodyLevers);
|
|
46889
|
+
const bodyLevers = Object.keys(chosen).length > 0 ? chosen : BODY_LEVERS;
|
|
46890
|
+
if (bodyEnd > hookEnd && words.length > 0) {
|
|
46891
|
+
segments.push({
|
|
46892
|
+
startMs: hookEnd,
|
|
46893
|
+
endMs: bodyEnd,
|
|
46894
|
+
captions: words.map((w) => ({ text: w.text, startMs: w.startMs, endMs: w.endMs })),
|
|
46895
|
+
...bodyLevers,
|
|
46896
|
+
...language
|
|
46897
|
+
});
|
|
46898
|
+
} else {
|
|
46899
|
+
dropped.push("body");
|
|
46900
|
+
}
|
|
46901
|
+
return { segments, dropped };
|
|
46902
|
+
}
|
|
46903
|
+
|
|
46761
46904
|
// src/style-presets.ts
|
|
46762
46905
|
var STYLE_PRESETS = [
|
|
46763
46906
|
{
|
|
@@ -47446,6 +47589,7 @@ exports.BACKDROPS = BACKDROPS;
|
|
|
47446
47589
|
exports.BACKDROP_CATEGORY_LABELS = BACKDROP_CATEGORY_LABELS;
|
|
47447
47590
|
exports.BACKDROP_CATEGORY_ORDER = BACKDROP_CATEGORY_ORDER;
|
|
47448
47591
|
exports.BACKDROP_IDS = BACKDROP_IDS;
|
|
47592
|
+
exports.BODY_CAPTIONS_PRESET_ID = BODY_CAPTIONS_PRESET_ID;
|
|
47449
47593
|
exports.BRAND_PRESETS = BRAND_PRESETS;
|
|
47450
47594
|
exports.BRAND_PRESET_IDS = BRAND_PRESET_IDS;
|
|
47451
47595
|
exports.BRAND_PRESET_META = BRAND_PRESET_META;
|
|
@@ -47455,6 +47599,8 @@ exports.CAMERA_MOTIONS = CAMERA_MOTIONS;
|
|
|
47455
47599
|
exports.CAMERA_MOTION_CATEGORY_LABELS = CAMERA_MOTION_CATEGORY_LABELS;
|
|
47456
47600
|
exports.CAMERA_MOTION_CATEGORY_ORDER = CAMERA_MOTION_CATEGORY_ORDER;
|
|
47457
47601
|
exports.CAMERA_MOTION_IDS = CAMERA_MOTION_IDS;
|
|
47602
|
+
exports.CAPTION_LEVERS_BY_LANGUAGE = CAPTION_LEVERS_BY_LANGUAGE;
|
|
47603
|
+
exports.CAPTION_SEGMENT_LEVER_KEYS = CAPTION_SEGMENT_LEVER_KEYS;
|
|
47458
47604
|
exports.CHARACTER_ART_FAMILIES = CHARACTER_ART_FAMILIES;
|
|
47459
47605
|
exports.CHARACTER_ART_FILES = CHARACTER_ART_FILES;
|
|
47460
47606
|
exports.CHARACTER_ART_PATH = CHARACTER_ART_PATH;
|
|
@@ -47512,6 +47658,7 @@ exports.HELD_PROPS = HELD_PROPS;
|
|
|
47512
47658
|
exports.HELD_PROP_CATEGORY_LABELS = HELD_PROP_CATEGORY_LABELS;
|
|
47513
47659
|
exports.HELD_PROP_CATEGORY_ORDER = HELD_PROP_CATEGORY_ORDER;
|
|
47514
47660
|
exports.HELD_PROP_IDS = HELD_PROP_IDS;
|
|
47661
|
+
exports.HOOK_PLATE_PRESET_ID = HOOK_PLATE_PRESET_ID;
|
|
47515
47662
|
exports.IMAGE_HINT_MODE_DEFAULT = IMAGE_HINT_MODE_DEFAULT;
|
|
47516
47663
|
exports.IMAGE_REFERENCE_PROMPT_DOCTRINE = IMAGE_REFERENCE_PROMPT_DOCTRINE;
|
|
47517
47664
|
exports.IMAGE_WIZARD_CATEGORIES = IMAGE_WIZARD_CATEGORIES;
|
|
@@ -48005,6 +48152,7 @@ exports.groupFactoryPresets = groupFactoryPresets;
|
|
|
48005
48152
|
exports.hasCatalogPacksFor = hasCatalogPacksFor;
|
|
48006
48153
|
exports.hasScene3DLayoutScopingLine = hasScene3DLayoutScopingLine;
|
|
48007
48154
|
exports.hasUpstreamCharacter = hasUpstreamCharacter;
|
|
48155
|
+
exports.hookPlateCaptionSegments = hookPlateCaptionSegments;
|
|
48008
48156
|
exports.identityRefsSentence = identityRefsSentence;
|
|
48009
48157
|
exports.insertBeforeStyleSection = insertBeforeStyleSection;
|
|
48010
48158
|
exports.isAnalyzablePicker = isAnalyzablePicker;
|