@nodaro/prompts 1.12.0 → 1.14.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 +389 -194
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +244 -29
- package/dist/index.d.ts +244 -29
- package/dist/index.js +377 -196
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/assemble-image-input-cap.test.ts +37 -13
- package/src/__tests__/assemble-image-input.test.ts +100 -19
- package/src/__tests__/assemble-video-input-cap.test.ts +101 -15
- package/src/__tests__/assemble-video-input.test.ts +167 -33
- package/src/__tests__/direction-hint-token-safety.test.ts +21 -0
- package/src/__tests__/multi-picker-spec.test.ts +21 -1
- package/src/__tests__/person-regional-aesthetic.test.ts +2 -1
- package/src/__tests__/prompt-style-section.test.ts +345 -0
- package/src/__tests__/provider-prompt-doctrine.test.ts +39 -0
- package/src/__tests__/style-section-boundary.test.ts +179 -0
- package/src/__tests__/subject-fold.test.ts +32 -13
- package/src/assemble-image-input.ts +51 -26
- package/src/assemble-video-input.ts +54 -34
- package/src/direction-registry.ts +108 -37
- package/src/gemini-omni-inputs.ts +11 -3
- package/src/held-prop.ts +1 -0
- package/src/hint-shedding.ts +23 -4
- package/src/index.ts +1 -0
- package/src/person.ts +4 -0
- package/src/picker-analyzer-registry.ts +37 -0
- package/src/prompt-builder.ts +84 -27
- package/src/prompt-hint-join.ts +9 -0
- package/src/prompt-style-section.ts +256 -0
- package/src/prompt-wizard-categories.ts +6 -0
- package/src/provider-prompt-doctrine.ts +51 -2
- package/src/setting.ts +1 -0
- package/src/style.ts +1 -0
- package/src/styling.ts +5 -1
- package/src/video-reference-resolver.ts +5 -2
package/src/style.ts
CHANGED
|
@@ -89,6 +89,7 @@ export const STYLES: ReadonlyArray<Style> = [
|
|
|
89
89
|
{ id: "acrylic-paint", label: "Acrylic Paint", description: "Fast-drying opaque acrylic on canvas", promptHint: "rendered as an acrylic painting on canvas, fast-drying opaque pigment with crisp sharp edges, confident quick brush strokes, high-key saturated color and a flatter more graphic finish than traditional oil paint", term: "acrylic painting" },
|
|
90
90
|
{ id: "mixed-media", label: "Mixed Media", description: "Collage + paint + ink hybrid", promptHint: "rendered as a mixed-media artwork combining torn paper collage, acrylic paint, ink and graphite on a layered substrate, heterogeneous textures, visible tape and stitching, and an exuberant hand-assembled studio-art quality" },
|
|
91
91
|
{ id: "manga", label: "Manga", description: "Inked B&W Japanese comic panel", promptHint: "rendered as inked manga panel art, crisp black ink on white with confident line weight variation, screen-tone dot patterns for shading, dramatic speed lines and the distinctly Japanese black-and-white comic aesthetic — separate from full-color anime" },
|
|
92
|
+
{ id: "early-color-photo", label: "Early Color Photo", description: "Prokudin-Gorsky / autochrome early-1900s color", promptHint: "rendered as an early-1900s color photograph in the Prokudin-Gorsky / autochrome tradition — soft three-colour-separation registration, muted dye-toned palette, fine grain and a gentle antique warmth", term: "early autochrome color photograph" },
|
|
92
93
|
] as const
|
|
93
94
|
|
|
94
95
|
const styleById = new Map<string, Style>(STYLES.map((s) => [s.id, s]))
|
package/src/styling.ts
CHANGED
|
@@ -300,6 +300,9 @@ export const STYLINGS: ReadonlyArray<Styling> = [
|
|
|
300
300
|
{ id: "outfit-fairy", label: "Fairy", dimension: "outfit", description: "Fantasy fairy: gauzy wings, flower crown, ethereal dress", promptHint: "wearing a fantasy fairy costume — gauzy translucent wings, a flower crown, and an ethereal flowing dress", term: "fairy costume with wings" },
|
|
301
301
|
{ id: "outfit-mermaid", label: "Mermaid", dimension: "outfit", description: "Fantasy mermaid: scaled tail/skirt, shell top, flowing hair", promptHint: "wearing a fantasy mermaid costume — a scaled tail or fitted scaled skirt, a shell top, and long flowing hair", term: "mermaid costume" },
|
|
302
302
|
{ id: "outfit-pharaoh", label: "Pharaoh Regalia", dimension: "outfit", description: "Ancient Egyptian royalty: usekh collar, pectoral, pleated kilt", promptHint: "wearing ancient Egyptian pharaoh regalia — a broad beaded usekh collar, a jeweled falcon pectoral, and a pleated linen shendyt kilt with golden arm cuffs" },
|
|
303
|
+
{ id: "outfit-workwear-overalls", label: "Workwear Overalls", dimension: "outfit", description: "Denim bib overalls over a plaid flannel shirt", promptHint: "dressed in a farmer's workwear outfit — denim bib overalls over a checked plaid flannel shirt, sturdy and worn-in", term: "denim overalls and plaid shirt" },
|
|
304
|
+
{ id: "outfit-chapan", label: "Chapan Robe", dimension: "outfit", description: "Central Asian long quilted ikat robe", promptHint: "dressed in a traditional Central Asian chapan — a long quilted robe with an ikat-striped weave, tied at the waist with a sash" },
|
|
305
|
+
{ id: "outfit-caftan", label: "Caftan", dimension: "outfit", description: "Long flowing Middle-Eastern / North-African robe", promptHint: "dressed in a long flowing caftan robe, a full-length garment worn across the Middle East and North Africa" },
|
|
303
306
|
|
|
304
307
|
// -------------------- Top (upper-body garment) --------------------
|
|
305
308
|
{ id: "top-tshirt", label: "T-Shirt", dimension: "top", description: "Plain crewneck t-shirt", promptHint: "wearing a fitted plain crewneck t-shirt with short sleeves" },
|
|
@@ -507,6 +510,7 @@ export const STYLING_FIELD_BY_DIMENSION: Record<
|
|
|
507
510
|
* (necklace + earrings + rings), wardrobe-state: 3 (oversized + wet + ripped),
|
|
508
511
|
* hair-state: 2 (wet + windswept). All others single-select (absent → 1). */
|
|
509
512
|
export const MAX_SELECTED_BY_STYLING_DIMENSION: Partial<Record<StylingDimension, number>> = {
|
|
513
|
+
headwear: 2, // a hat layered over a wrap/turban
|
|
510
514
|
jewelry: 3,
|
|
511
515
|
"wardrobe-state": 3,
|
|
512
516
|
"hair-state": 2,
|
|
@@ -520,7 +524,7 @@ export function getStylingDimensionLimit(dimension: StylingDimension): number {
|
|
|
520
524
|
export interface StylingValue {
|
|
521
525
|
makeup?: string
|
|
522
526
|
eyewear?: string
|
|
523
|
-
headwear?: string
|
|
527
|
+
headwear?: string | ReadonlyArray<string>
|
|
524
528
|
/** Hair cut / styling choice — bob, wolf cut, braids, ponytail, etc.
|
|
525
529
|
* Pairs with Person.hair-base (texture + length). */
|
|
526
530
|
hairCut?: string
|
|
@@ -35,6 +35,7 @@ import { buildIdentityLockLine, withForcedIdentityLock } from "./identity-lock.j
|
|
|
35
35
|
import type { ConnectedReference } from "@nodaro/shared"
|
|
36
36
|
import { REF_BINDING } from "./ref-binding.js"
|
|
37
37
|
import { resolveRefIdTokens } from "./ref-id-tokens.js"
|
|
38
|
+
import { insertBeforeStyleSection } from "./prompt-style-section.js"
|
|
38
39
|
|
|
39
40
|
// The binding surface string and the id-addressed token resolver live in their
|
|
40
41
|
// own modules (see them for the contracts); re-exported here so every existing
|
|
@@ -775,8 +776,10 @@ export function resolveVideoReferenceCore(
|
|
|
775
776
|
...extraHybridElementDirectives,
|
|
776
777
|
]
|
|
777
778
|
const lockBlock = lockLines.length > 0 ? `${lockLines.join("\n")}\n\n` : ""
|
|
778
|
-
|
|
779
|
-
|
|
779
|
+
// The trailing lines are scene content, so they extend the BODY: a `[style]`
|
|
780
|
+
// section has no terminator, and appended flat they would read as look
|
|
781
|
+
// clauses under its header instead of as the bindings they are.
|
|
782
|
+
finalPrompt = `${lockBlock}${insertBeforeStyleSection(finalPrompt, trailingLines)}`
|
|
780
783
|
} else {
|
|
781
784
|
const allFallbackLines = [...fallbackDirectiveLines, ...extraDirectiveLines]
|
|
782
785
|
if (allFallbackLines.length > 0) {
|