@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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/age-floor.ts","../src/parameter-prompt-hint.ts"],"names":[],"mappings":";;;;;;;AAoCO,IAAM,0BAA0B,CAAC,SAAA,EAAW,MAAA,EAAQ,MAAA,EAAQ,eAAe,kBAAkB;AAGpG,IAAM,0BAAA,GAAkD,IAAI,GAAA,CAAI,uBAAuB,CAAA;AAMvF,SAAS,UAAU,OAAA,EAAqD;AACtE,EAAA,IAAI,QAAQ,IAAA,KAAS,QAAA,EAAU,OAAO,OAAA,CAAQ,WA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AA,CAAK,IAAI,CAAA,CAAE,IAAA,EAAK;AAAA,IAC/B;AACE,MAAA,OAAO,EAAA;AAAA;AAEb","file":"chunk-N7TOWXDJ.js","sourcesContent":["/**\n * The minor-age floor — Layer 1 of spec 2026-09-01-app-reports-triage-design.md\n * §3.3 (W1-a). Content-free: this module decides WHICH catalog entries a minor\n * subject may not carry; the clause a deployment appends lives in its\n * registered PromptPolicy (backend/src/lib/prompt-policies/), never here.\n *\n * `ADULT_ONLY_FLAG`, `ADULT_AGE_IDS`, `MINOR_IMPLYING_TYPE_IDS` and\n * `isMinorAge` live in the import-free leaf `age-signal.ts` and are\n * re-exported here unchanged — this module's own catalog-funnel imports\n * (`person-packs.js`, `picker-catalogs.js`) are exactly what `person.ts` /\n * `styling.ts` must NOT reach through, on pain of reopening the\n * person → age-floor → picker-catalogs load-time cycle (see `age-signal.ts`'s\n * header). `person.ts` / `styling.ts` import `isMinorAge` from\n * `age-signal.ts` directly instead of from here.\n */\n\nimport { getRegisteredPeople } from \"./person-packs.js\"\nimport { getRegisteredPickerCatalogs, type PickerCatalog, type PickerOption } from \"./picker-catalogs.js\"\nimport { isMinorAge, ADULT_AGE_IDS, MINOR_IMPLYING_TYPE_IDS } from \"./age-signal.js\"\n\nexport { ADULT_ONLY_FLAG, ADULT_AGE_IDS, MINOR_IMPLYING_TYPE_IDS, isMinorAge } from \"./age-signal.js\"\n\n/** Shape shared by every catalog entry the floor reads. */\nexport interface AdultOnlyEntry {\n readonly id: string\n readonly promptHint: string\n readonly term?: string\n readonly adultOnly?: true\n}\n\n/** The picker catalogs (by `catalogId`) this floor sweeps beside person.\n * Exported because it is the SINGLE source of truth for two things that used\n * to be maintained by hand and drifted: which catalogs `getAdultOnlyEntries`\n * sweeps for the flag, and which analyzer keys `FLOORED_PICKER_KEYS` strips\n * flagged ids out of (a `photo-genre` swept for the flag but absent from the\n * strip list let `glamour-portrait` survive on a minor). */\nexport const ADULT_SWEPT_CATALOG_IDS = [\"styling\", \"mood\", \"pose\", \"photo-genre\", \"character-motion\"] as const\n\n/** Membership form of the list above (the sweep does one lookup per catalog). */\nconst ADULT_SWEPT_CATALOG_ID_SET: ReadonlySet<string> = new Set(ADULT_SWEPT_CATALOG_IDS)\n\n/** Flatten a catalog's options regardless of shape: single-dim catalogs carry\n * `options` directly, multi-dim ones carry `dimensions[].options` (mirrors\n * `applyDeny` in catalog-packs.ts, the other consumer that has to handle\n * both shapes). */\nfunction optionsOf(catalog: PickerCatalog): ReadonlyArray<PickerOption> {\n if (catalog.kind === \"single\") return catalog.options ?? []\n return (catalog.dimensions ?? []).flatMap((d) => d.options)\n}\n\n/** Every entry, across the swept catalogs, that carries the flag. Reads every\n * catalog through the pack-composed funnel — `getRegisteredPeople()` for\n * person, `getRegisteredPickerCatalogs()` for styling/mood/pose/photo-genre —\n * so a pack-added or pack-replaced entry is included. */\nexport function getAdultOnlyEntries(): ReadonlyArray<AdultOnlyEntry> {\n const catalogEntries = getRegisteredPickerCatalogs()\n .filter((c) => ADULT_SWEPT_CATALOG_ID_SET.has(c.catalogId))\n .flatMap(optionsOf)\n const all: ReadonlyArray<AdultOnlyEntry> = [...getRegisteredPeople(), ...catalogEntries]\n return all.filter((e) => e.adultOnly === true)\n}\n\n/** The set of flagged ids (fast membership for the collectors). */\nexport function getAdultOnlyIds(): ReadonlySet<string> {\n return new Set(getAdultOnlyEntries().map((e) => e.id))\n}\n\n/**\n * The pre-rework `promptHint` of every `adultOnly` entry the spec\n * (2026-09-01-app-reports-triage-design §3.3) listed for rewording — including\n * `eye-state-half-lidded` and `feature-collarbone-visible`, which the W1-b\n * harness initially left byte-identical (0/10 and 0/22 render rate under\n * either wording) and a 2026-09-03 replay then found renderable wordings for\n * — plus the hard-coded midriff+navel fold clause. These strings are permanently part of the strip\n * set: a consumer that has not bumped `@nodaro/prompts` still emits them, and\n * the client-assembled `seedPrompt` path is exactly how the 2026-07-30\n * minor-age prompts reached a provider. Retiring can only ever cause an EXTRA\n * strip, and only for a subject `isMinorAge` has already judged a minor — so\n * the list only grows, never shrinks.\n *\n * `promptHint` ONLY, for the same reason `getAdultOnlyHintStrings` gives:\n * `term` is short display vocabulary and the composed-catalog projection\n * back-fills a derived `term` for every option, so terms collide with benign\n * everyday text. Assembled prompts and client seedPrompts are built from\n * hints, never from terms. The three W1-b entries that are NOT flagged —\n * `texture-dewy`, `texture-baby-soft`, `eye-state-staring-camera` (spec\n * §3.3's \"deliberately not flagged\" list) — are absent: their old wording\n * never belonged to the floor.\n *\n * 15 flagged hints + the fold literal = 16.\n */\nexport const RETIRED_ADULT_ONLY_HINT_STRINGS: ReadonlyArray<string> = [\n // bust-very-full\n \"very full bust\",\n // silhouette-hourglass\n \"hourglass silhouette\",\n // waist-defined\n \"defined waist\",\n // lip-state-glossy\n \"with high-shine glossy wet-look lips\",\n // lip-state-parted\n \"with lips slightly parted, taking a soft breath\",\n // lip-state-bitten\n \"playfully biting the lower lip\",\n // eye-state-half-lidded\n \"with heavy half-lidded sleepy eyes\",\n // texture-glistening\n \"with glistening skin, sweat or oil catching the light\",\n // texture-shower-fresh-wet\n \"with just-out-of-the-shower wet skin, water beading on the surface and rolling in slow droplets down the curves of the body\",\n // feature-bare-shoulders\n \"with bare shoulders exposed, the line of the collarbone and shoulder muscles uncovered\",\n // feature-collarbone-visible\n \"with a prominent collarbone clearly defined and catching the light\",\n // feature-midriff-visible\n \"wearing a cropped style with the midriff visible\",\n // state-fitted — the 2026-07-30 incident clause\n \"the clothing fitted and form-conscious, hugging the contours of the body\",\n // state-wet\n \"the clothing soaked and wet, the fabric clinging to the body and dripping water\",\n // pose `biting-lip` (the lip-state-bitten twin)\n \"biting the lower lip with a subtle playful expression\",\n // the hard-coded midriff+navel fold in emitIndependentFragments — not any\n // entry's hint, so retiring it ADDS a needle for a clause that really is\n // emitted verbatim.\n \"wearing a cropped style, midriff and navel visible\",\n]\n\n/** Every full prompt-hint string a flagged entry can inject, lower-cased,\n * longest first — the backend policy strips text that contains any of them\n * (Layer 2), which is how flagged wording arriving inside free text (a\n * client-assembled seedPrompt) is caught. Seeded with\n * `RETIRED_ADULT_ONLY_HINT_STRINGS` so a catalog rewording can never narrow\n * the strip set for a consumer still shipping the pre-rephrase wording.\n *\n * `promptHint` ONLY, deliberately — `term` is analyzer/UI vocabulary\n * (compact-mode display), and `picker-catalogs.ts`'s composed-catalog\n * projection back-fills a `term` for EVERY option via `deriveTerm(label)`\n * when no explicit term was authored (e.g. \"lounging\", \"cropped top\",\n * \"school uniform\", \"lying down\"). Those short, generic derived terms are\n * exactly the kind of everyday word that collides with unrelated, benign\n * text and over-strips it. Assembled prompts and client seedPrompts are\n * built from HINTS, never from terms, so hints are the only strings that\n * can actually arrive verbatim in free text — terms don't need to be (and\n * must not be) swept here. */\nexport function getAdultOnlyHintStrings(): ReadonlyArray<string> {\n const out = new Set<string>(RETIRED_ADULT_ONLY_HINT_STRINGS)\n for (const e of getAdultOnlyEntries()) {\n if (e.promptHint) out.add(e.promptHint.toLowerCase())\n }\n return [...out].filter((s) => s.length >= 8).sort((a, b) => b.length - a.length)\n}\n\n/**\n * Every full prompt-hint string that DESCRIBES A MINOR — the mirror of\n * `getAdultOnlyHintStrings`, and the needle list for the TEXT signal below.\n *\n * Why a text signal exists at all: `isMinorAge` reads the structured picker\n * value, and the P0 arrival path does not have one. A thin client can create a\n * character row carrying only `{nodeId, name, projectId}` and send the picker\n * selection as an already-assembled `seedPrompt`, so `row.person === null`\n * while the prompt itself says \"a young child around 5 years old\". That client\n * assembles the text FROM THESE HINTS, which is exactly why the catalog is the\n * drift-proof needle list: a new minor age entry is swept the day it is added,\n * with no second list to remember.\n *\n * Selection is DERIVED, never hand-listed: an `age` entry is a minor unless its\n * id is in the `ADULT_AGE_IDS` allow-list (so a new age id is inside the floor\n * by default — same ratchet as `isMinorAge`), plus every `type` entry named by\n * `MINOR_IMPLYING_TYPE_IDS`. Read through the pack-composed funnel\n * (`getRegisteredPeople()`), so a deployment pack's entries are swept too.\n *\n * `promptHint` ONLY — never `term` and never `label`, for the same reason\n * `getAdultOnlyHintStrings` gives: `term` is short display vocabulary\n * (\"in their teens\" as a compact chip) and the composed-catalog projection\n * back-fills a derived `term` for every option, so terms collide with benign\n * text. The `>= 8` filter drops `age-custom`'s empty hint (`\"\"`), which would\n * otherwise match every string ever written.\n */\nlet cachedMinorHints: ReadonlyArray<string> | null = null\nlet cachedMinorHintSourceCount = -1\nexport function getMinorAgeHintStrings(): ReadonlyArray<string> {\n const people = getRegisteredPeople()\n if (cachedMinorHints && cachedMinorHintSourceCount === people.length) return cachedMinorHints\n const out = new Set<string>()\n for (const e of people) {\n const minorAge = e.dimension === \"age\" && !ADULT_AGE_IDS.has(e.id)\n const minorType = e.dimension === \"type\" && MINOR_IMPLYING_TYPE_IDS.has(e.id)\n if (!minorAge && !minorType) continue\n if (e.promptHint) out.add(e.promptHint.toLowerCase())\n }\n cachedMinorHintSourceCount = people.length\n cachedMinorHints = [...out].filter((s) => s.length >= 8).sort((a, b) => b.length - a.length)\n return cachedMinorHints\n}\n\nfunction escapeReSource(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n\n/** One needle's regex source: the phrase's tokens — split on whitespace AND\n * hyphens — escaped and rejoined by `[\\s-]+`, so it matches however the text\n * that carries it happened to be spaced or hyphenated. */\nfunction needleTokenSource(needle: string): string {\n return needle\n .trim()\n .split(/[\\s-]+/)\n .filter((t) => t.length > 0)\n .map(escapeReSource)\n .join(\"[\\\\s-]+\")\n}\n\n/**\n * The word-bounded alternation SOURCE for a needle list — the one place both\n * layers of the floor build their matcher, so they can never disagree about\n * what \"the same phrase\" means.\n *\n * Two properties, both load-bearing:\n * - **Separator tolerance.** A catalog hint is authored with single spaces\n * (\"very full bust\"), but the free text that carries it is written by a\n * human or an LLM and arrives as \"very-full bust\" or \"very full bust\".\n * A literal alternation misses those, and a miss is a flagged phrase\n * reaching the provider on a minor's prompt. Each needle's tokens are\n * joined by `[\\s-]+`, which requires AT LEAST one separator — so\n * \"very fullbust\" (no separator at all) is still not a match, and the\n * phrase can't silently widen into a substring rule.\n * - **Word boundaries.** `(?<![\\w-])` / `(?![\\w-])` keep a needle from\n * gluing onto an adjacent word's characters (\"mesh tops\" must survive a\n * \"mesh top\" needle).\n *\n * Ordering is the CALLER's: pass needles longest-first so the alternation\n * consumes the longest match at a given position instead of leaving debris.\n * Returns `null` when there is nothing to match (an empty list would otherwise\n * compile to `(?:)`, which matches everywhere). Flags are the caller's too —\n * `\"i\"` for a `.test()` instance, `\"gi\"` for one used with `String.replace`.\n */\nexport function buildNeedleAlternationSource(needles: ReadonlyArray<string>): string | null {\n const alts = needles.map(needleTokenSource).filter((s) => s.length > 0)\n if (alts.length === 0) return null\n return `(?<![\\\\w-])(?:${alts.join(\"|\")})(?![\\\\w-])`\n}\n\n/** Needle alternation over `getMinorAgeHintStrings()`, word-bounded on both\n * sides so a hint can only match a whole phrase. Deliberately NOT global:\n * this instance is only ever `.test()`ed, and a `/g` regex would carry\n * `lastIndex` across calls. Cached by needle count (packs are registered\n * before the first prompt is assembled). */\nlet cachedMinorNeedleRe: RegExp | null = null\nlet cachedMinorNeedleCount = -1\nfunction minorNeedleRegex(): RegExp | null {\n const needles = getMinorAgeHintStrings()\n if (cachedMinorNeedleRe && cachedMinorNeedleCount === needles.length) return cachedMinorNeedleRe\n cachedMinorNeedleCount = needles.length\n const src = buildNeedleAlternationSource(needles)\n cachedMinorNeedleRe = src === null ? null : new RegExp(src, \"i\")\n return cachedMinorNeedleRe\n}\n\n/**\n * NUMBER-FIRST age shapes: the ones `buildAgeFragment` (person.ts) emits for a\n * CUSTOM age (\"N years old\", \"N year old\", \"N-year-old\") and the catalog's own\n * \"2-3 years old\" range (the FIRST number decides), plus the colloquial tails a\n * human or an LLM writes instead — \"12yo\", \"12 yo\", \"12 y.o.\", \"12 y/o\",\n * \"12 yr old\", \"12-yr-old\", \"12yrs old\", \"12 years of age\". The cut is `< 20`,\n * the same boundary `isMinorAge` uses for `customAge` and the same one\n * `buildAgeFragment` switches to \"in their teens\" at.\n *\n * Both boundaries are load-bearing. The LEADING one stops a match inside a\n * larger token; the TRAILING one is what makes \"a 5 year older sibling\" a\n * non-hit (\"old\" may not glue onto \"older\") and what stops \"yo\" from firing\n * inside \"12 young\" or \"12 yoga\". Used via `matchAll`, which clones the regex\n * rather than advancing this instance's `lastIndex`.\n */\nconst NUMERIC_AGE_RE =\n /(?<![\\w-])(\\d{1,3})(?:\\s*-\\s*\\d{1,3})?\\s*-?\\s*(?:years?\\s*-?\\s*old|yrs?\\s*-?\\s*old|y(?:\\.\\s*o\\.?|\\/o|o)|years?\\s+of\\s+age)(?![\\w-])/gi\n\n/**\n * AGE-FIRST shapes, where the number trails the word instead of leading it:\n * \"age 12\", \"aged 12\", \"at the age of 12\". The leading boundary is what keeps\n * \"image 12\" / \"page 12\" out (the `age` there is glued to a preceding word\n * character), and the trailing one keeps \"aged 12th\" out.\n */\nconst PREFIXED_AGE_RE = /(?<![\\w-])aged?\\s+(?:of\\s+)?(\\d{1,3})(?![\\w-])/gi\n\n/** Every rule that reads a NUMBER out of the text, each capturing the age in\n * group 1. Iterated together below so a new shape is one array entry. */\nconst AGE_NUMBER_RULES: ReadonlyArray<RegExp> = [NUMERIC_AGE_RE, PREFIXED_AGE_RE]\n\n/** The one NON-numeric shape `buildAgeFragment` emits below 20 (`${n} years\n * old, in their teens`). Kept as its own rule rather than as a catalog term.\n * Separator-tolerant on the same terms as the needle alternation, so\n * \"in their teens\" and \"in-their-teens\" are the same phrase. */\nconst IN_THEIR_TEENS_RE = /(?<![\\w-])in[\\s-]+their[\\s-]+teens(?![\\w-])/i\n\n/**\n * True when free text describes a MINOR subject. Three rules, in order:\n * 1. any minor-age / minor-implying-type prompt hint, word-bounded;\n * 2. a numeric age below 20 in any shape `buildAgeFragment` emits;\n * 3. the literal \"in their teens\".\n *\n * Deliberately NOT a bare-word check: \"child\", \"teen\", \"kid\" alone must never\n * fire, or an adult prompt that merely MENTIONS a child (\"a mother holding her\n * child\") would be floored — the spec's \"adults are byte-identical\" is a hard\n * requirement, so every rule here is a full phrase or a bounded number.\n *\n * Pairs with `isMinorAge`, never replaces it: the structured picker value is\n * the primary signal; this catches the same subject when only the assembled\n * text survives.\n */\nexport function containsMinorAgeHint(text: string | null | undefined): boolean {\n if (typeof text !== \"string\" || text.trim().length === 0) return false\n const re = minorNeedleRegex()\n if (re && re.test(text)) return true\n for (const rule of AGE_NUMBER_RULES) {\n for (const m of text.matchAll(rule)) {\n const n = Number(m[1])\n if (Number.isFinite(n) && n < 20) return true\n }\n }\n return IN_THEIR_TEENS_RE.test(text)\n}\n\n/** The analyzer/import value keys the floor strips flagged ids out of:\n * `person` plus EVERY catalog the flag sweep reads. DERIVED, never\n * hand-listed — the hand-written version omitted `photo-genre` while the\n * sweep included it, so a minor kept `glamour-portrait`. The analyzer JSON is\n * keyed by picker type id (`describe-to-picker.ts`), which is the same string\n * as the catalog id, so this list IS the set of keys to visit. */\nexport const FLOORED_PICKER_KEYS = [\"person\", ...ADULT_SWEPT_CATALOG_IDS] as const\n\nfunction stripIds(obj: Record<string, unknown>, drop: ReadonlySet<string>): Record<string, unknown> {\n const out: Record<string, unknown> = {}\n for (const [k, v] of Object.entries(obj)) {\n if (typeof v === \"string\") {\n if (!drop.has(v)) out[k] = v\n } else if (Array.isArray(v)) {\n const kept = v.filter((x) => !(typeof x === \"string\" && drop.has(x)))\n if (kept.length > 0) out[k] = kept\n } else {\n out[k] = v\n }\n }\n return out\n}\n\n/** Analyzer / import post-filter: when the person value describes a minor,\n * remove every flagged id from the person, styling, pose and mood values.\n * Identity (same reference) for an adult. */\nexport function applyMinorAgeFloorToPickerValues<T extends Record<string, unknown>>(values: T): T {\n const person = values.person\n if (!person || typeof person !== \"object\" || !isMinorAge(person as { age?: string; customAge?: number; type?: string })) return values\n const drop = getAdultOnlyIds()\n const out: Record<string, unknown> = { ...values }\n for (const key of FLOORED_PICKER_KEYS) {\n const v = out[key]\n if (v && typeof v === \"object\" && !Array.isArray(v)) out[key] = stripIds(v as Record<string, unknown>, drop)\n }\n return out as T\n}\n","import type { HintNodeLike, HintEdgeLike, HintGraphContext } from \"@nodaro/shared/types\"\nexport type { HintNodeLike, HintEdgeLike, HintGraphContext }\n/**\n * Single source of truth for parameter-node prompt-hint text.\n *\n * Every parameter node (framing, lens, camera-format, lighting, color-look,\n * atmosphere, style, setting, person, mood, pose, styling, temporal, tone,\n * text-prompt, camera-motion) dispatches through `getParameterPromptHint` to\n * produce the descriptive clause it contributes to a consumer's prompt.\n *\n * The frontend DAG executor and backend workflow orchestrator both call this,\n * so the text injected via the `cinematography` handle is identical to the\n * text injected when the node is wired directly into a Text Prompt / LLM Chat\n * / Combine Text input.\n *\n * Camera-motion is graph-aware: when `ctx` is provided the function walks the\n * node's `startState`/`endState` incoming edges and composes a fully formed\n * sentence via `composeCameraMotionHintFromConnections`. Without `ctx` only\n * the bare motion description is returned.\n */\n\nimport { buildFramingHints } from \"./framing.js\"\nimport { buildLightingHints } from \"./lighting.js\"\nimport { getLensPromptHint, getLensTerm } from \"./lens.js\"\nimport { getCameraFormatPromptHint, getCameraFormatTerm } from \"./camera-format.js\"\nimport { getColorLookPromptHint, getColorLookTerm } from \"./color-look.js\"\nimport { buildAtmosphereHints } from \"./atmosphere.js\"\nimport { buildActionFxHints } from \"./action-fx.js\"\nimport { getStylePromptHint, getStyleTerm } from \"./style.js\"\nimport { getSettingPromptHint, getSettingTerm } from \"./setting.js\"\nimport { getLoopSubjectPromptHint, getLoopSubjectTerm } from \"./loop-subject.js\"\nimport { buildPersonHints } from \"./person.js\"\nimport { buildMoodHints } from \"./mood.js\"\nimport { buildPoseHints } from \"./pose.js\"\nimport { buildStylingHints } from \"./styling.js\"\nimport { buildTemporalHints } from \"./temporal.js\"\nimport { composeCameraMotionHintFromConnections } from \"./camera-motions.js\"\nimport { joinHintFragments } from \"./hint-join.js\"\nimport { composeTransitionHintFromConnections, readTransitionOptionValues, type TransitionDuration, type TransitionIntensity, type TransitionPosition, type TransitionTiming } from \"./transitions.js\"\nimport { composeCharacterFxHintFromConnections, type CharacterFxDuration, type CharacterFxIntensity, type CharacterFxPosition, type CharacterFxTiming } from \"./character-fx.js\"\nimport { composeCharacterMotionHintFromConnections, type CharacterMotionPace, type CharacterMotionPosition, type CharacterMotionTiming } from \"./character-motion.js\"\nimport { containsMinorAgeHint, isMinorAge } from \"./age-floor.js\"\nimport { buildMaterialHints } from \"./materials.js\"\nimport { curatedAnimalPromptHint, curatedAnimalTerm, curatedVehicleText, curatedWeaponText, curatedFurnitureText } from \"./shared-catalog-overlay.js\"\nimport { getPhotoGenrePromptHint, getPhotoGenreTerm } from \"./photo-genre.js\"\nimport { getBackdropPromptHint, getBackdropTerm } from \"./backdrop.js\"\nimport { buildHeldPropHints } from \"./held-prop.js\"\nimport { buildPhotographerHints } from \"./photographer.js\"\nimport { buildAestheticHints } from \"./aesthetic.js\"\nimport { getEraPromptHint, getEraTerm } from \"./era.js\"\nimport { buildExposureHints } from \"./exposure-settings.js\"\nimport { getRenderQualityPromptHint, getRenderQualityTerm } from \"./render-quality.js\"\nimport { getCompositionEffectPromptHint, getCompositionEffectTerm } from \"./composition-effects.js\"\nimport { buildPostProcessHints } from \"./post-process-effects.js\"\nimport { buildMusicGenreHints } from \"./music-genre.js\"\nimport { buildMusicMoodHints } from \"./music-mood.js\"\nimport { buildInstrumentationHints } from \"./instrumentation.js\"\nimport { buildVoiceCharacterHints } from \"./voice-character.js\"\nimport { buildVoiceDeliveryHints } from \"./voice-delivery.js\"\nimport { getPickerCatalog } from \"./picker-catalogs.js\"\nimport { resolveTerm, type PickerHintMode } from \"./term.js\"\n\n\nfunction asStr(v: unknown): string {\n return typeof v === \"string\" ? v : \"\"\n}\n\n/** Extract the display name from a character / face / object / location ref node. */\nfunction extractCharacterRefName(node: HintNodeLike): string | undefined {\n const d = (node.data ?? {}) as Record<string, unknown>\n const candidates = [d.characterName, d.faceName, d.objectName, d.locationName]\n for (const v of candidates) {\n if (typeof v === \"string\" && v.trim().length > 0) return v.trim()\n }\n return undefined\n}\n\n/** Character Motion's name read: the shared character / face / object / location\n * read, then a creature's `creatureName`. Local to Character Motion so the\n * Character FX prompt, which shares `extractCharacterRefName`, stays unchanged. */\nfunction extractCharacterMotionRefName(node: HintNodeLike): string | undefined {\n const name = extractCharacterRefName(node)\n if (name) return name\n const creatureName = asStr(((node.data ?? {}) as Record<string, unknown>).creatureName).trim()\n return creatureName.length > 0 ? creatureName : undefined\n}\n\n/** Free-text fields a character / face / object / location ref node describes its subject in.\n * A creature ref uses the same `description` / `canonicalDescription` names. */\nconst REF_DESCRIPTION_FIELDS = [\"description\", \"seedPrompt\", \"canonicalDescription\"] as const\n\n/** True when a character / face / object / location ref node describes a minor:\n * its structured `person` age (the primary signal) or an age phrase in its\n * free-text description. Feeds the Character Motion floor (adult-only moves\n * dropped) — errs toward flooring, never toward letting an adult-only move through. */\nfunction extractCharacterRefMinor(node: HintNodeLike): boolean {\n const d = (node.data ?? {}) as Record<string, unknown>\n const person = d.person\n if (person && typeof person === \"object\" && !Array.isArray(person) && isMinorAge(person as Parameters<typeof isMinorAge>[0])) {\n return true\n }\n return REF_DESCRIPTION_FIELDS.some((field) => containsMinorAgeHint(asStr(d[field])))\n}\n\n/** The preview, diagnostics and execution use identical graph bindings. */\nexport function getCharacterMotionBindings(node: HintNodeLike, ctx?: HintGraphContext) {\n const targetNames: string[] = []\n const partnerNames: string[] = []\n const targetIds = new Set<string>()\n const partnerIds = new Set<string>()\n let subjectMinor = false\n for (const edge of ctx?.edges ?? []) {\n if (edge.target !== node.id || (edge.targetHandle !== \"target\" && edge.targetHandle !== \"partner\")) continue\n const src = ctx?.nodes.find(n => n.id === edge.source)\n if (!src) continue\n if (edge.targetHandle === \"target\") targetIds.add(src.id)\n else partnerIds.add(src.id)\n if (extractCharacterRefMinor(src)) subjectMinor = true\n const name = extractCharacterMotionRefName(src)\n if (!name) continue\n const names = edge.targetHandle === \"target\" ? targetNames : partnerNames\n if (!names.includes(name)) names.push(name)\n }\n return { targetNames, partnerNames, subjectMinor, selfPairing: [...targetIds].some(id => partnerIds.has(id)) }\n}\n\n/** Compose `[preText, mainHint, postText]` into a comma-joined string,\n * honoring the user's free-text fragments around the structured hint.\n * Helpers like `getStylePromptHint` that already include preText/postText\n * composition (build*Hints in mood/person/etc.) bypass this — they\n * return the fully-composed string directly. */\nfunction withCustomText(data: Record<string, unknown>, mainHint: string): string {\n const fragments: string[] = []\n const pre = typeof data.preText === \"string\" ? data.preText.trim() : \"\"\n if (pre) fragments.push(pre)\n if (mainHint) fragments.push(mainHint)\n const post = typeof data.postText === \"string\" ? data.postText.trim() : \"\"\n if (post) fragments.push(post)\n return joinHintFragments(fragments)\n}\n\n/**\n * The node-level hint mode a picker declares via `data.hintMode`.\n *\n * Only the two documented values count; anything else (a stale value, a typo,\n * a non-string) is treated as UNDECLARED and falls back — to the inherited\n * mode when the node is resolved as an upstream input, and to `\"full\"`\n * otherwise. Compact is opt-in, so an unrecognized value can never silently\n * shorten a prompt.\n */\nfunction readHintMode(data: Record<string, unknown>): PickerHintMode | undefined {\n const raw = data.hintMode\n return raw === \"compact\" || raw === \"full\" ? raw : undefined\n}\n\n/** Pick the full-hint or the compact-term getter for the active mode. */\nfunction byMode<T>(mode: PickerHintMode, full: T, compact: T): T {\n return mode === \"compact\" ? compact : full\n}\n\n/** How much a shot moves (the Motion node's three steps), as the clause it\n * adds to a video prompt; the compact form is the bare term. */\nconst MOTION_INTENSITY_HINTS: Readonly<Record<string, { readonly full: string; readonly compact: string }>> = {\n subtle: { full: \"subtle, gentle motion with slow, minimal movement\", compact: \"subtle motion\" },\n moderate: { full: \"moderate, natural motion at an even pace\", compact: \"moderate motion\" },\n dynamic: { full: \"dynamic, energetic motion with fast, pronounced movement\", compact: \"dynamic motion\" },\n}\n\n/**\n * Dispatch by parameter-node type to its prompt-hint string. For camera-motion,\n * pass `ctx` to include the composed start/end clauses; otherwise only the\n * bare motion description is returned.\n *\n * VERBOSITY — a picker node may set `data.hintMode` to `\"compact\"` to inject\n * its short professional `term` (\"whip pan left\", \"hard cut\") instead of the\n * long `promptHint`. Absent, or any unrecognized value, means `\"full\"`, whose\n * output is byte-identical to what this function returned before hint modes\n * existed. ONLY the base catalog fragment swaps: `preText`/`postText`, the\n * transition / camera-motion / character-fx timing and start-state/end-state\n * clauses, multi-pick joining and multi-dimension composition are emitted the\n * same way in both modes.\n */\nexport function getParameterPromptHint(\n node: HintNodeLike | undefined,\n ctx?: HintGraphContext,\n): string {\n return resolveParameterHint(node, ctx)\n}\n\n/**\n * The dispatch body. `inherited` carries the mode DOWN into the nodes wired to\n * a composer's `startState` / `endState` handles, so a compact transition\n * composes compact start/end clauses rather than mixing a term with two\n * paragraphs. A node that declares its own `hintMode` still wins over what it\n * inherits.\n */\nfunction resolveParameterHint(\n node: HintNodeLike | undefined,\n ctx?: HintGraphContext,\n inherited?: PickerHintMode,\n): string {\n if (!node?.type) return \"\"\n const data = (node.data ?? {}) as Record<string, unknown>\n const mode: PickerHintMode = readHintMode(data) ?? inherited ?? \"full\"\n\n if (node.type === \"camera-motion\") {\n const motionId = asStr(data.cameraMotion) || undefined\n if (!ctx) return withCustomText(data, composeCameraMotionHintFromConnections(motionId, [], [], mode))\n const startHints: string[] = []\n const endHints: string[] = []\n for (const edge of ctx.edges) {\n if (edge.target !== node.id) continue\n const src = ctx.nodes.find((n) => n.id === edge.source)\n if (!src) continue\n // Pass no ctx for nested resolution: startState/endState inputs are\n // themselves parameter nodes (framing/tone/etc.) that don't need graph\n // context, and avoiding recursion keeps the walk cycle-safe. The mode\n // rides down so the composed clause stays at one level of detail.\n const hint = resolveParameterHint(src, undefined, mode)\n if (!hint) continue\n if (edge.targetHandle === \"startState\") startHints.push(hint)\n else if (edge.targetHandle === \"endState\") endHints.push(hint)\n }\n return withCustomText(data, composeCameraMotionHintFromConnections(motionId, startHints, endHints, mode))\n }\n\n if (node.type === \"transition\") {\n const raw = data.transition\n const transitionId: string | string[] | undefined =\n Array.isArray(raw)\n ? raw.filter((s): s is string => typeof s === \"string\" && s.length > 0)\n : (asStr(raw) || undefined)\n const timing: TransitionTiming = {\n position: asStr(data.position) as TransitionPosition | undefined,\n duration: asStr(data.duration) as TransitionDuration | undefined,\n intensity: asStr(data.intensity) as TransitionIntensity | undefined,\n }\n // A picked row's own options (a wipe's `wipeDirection`), off the same node data.\n const optionValues = readTransitionOptionValues(data)\n const hintOptions = optionValues ? { optionValues } : undefined\n if (!ctx) {\n return withCustomText(data, composeTransitionHintFromConnections(transitionId, [], [], timing, mode, hintOptions))\n }\n const startHints: string[] = []\n const endHints: string[] = []\n for (const edge of ctx.edges) {\n if (edge.target !== node.id) continue\n const src = ctx.nodes.find((n) => n.id === edge.source)\n if (!src) continue\n const hint = resolveParameterHint(src, undefined, mode) // no ctx — cycle-safe\n if (!hint) continue\n if (edge.targetHandle === \"startState\") startHints.push(hint)\n else if (edge.targetHandle === \"endState\") endHints.push(hint)\n }\n return withCustomText(data, composeTransitionHintFromConnections(transitionId, startHints, endHints, timing, mode, hintOptions))\n }\n\n if (node.type === \"character-fx\") {\n const raw = data.characterFx\n const effectId: string | string[] | undefined =\n Array.isArray(raw)\n ? raw.filter((s): s is string => typeof s === \"string\" && s.length > 0)\n : (asStr(raw) || undefined)\n const timing: CharacterFxTiming = {\n position: asStr(data.position) as CharacterFxPosition | undefined,\n duration: asStr(data.duration) as CharacterFxDuration | undefined,\n intensity: asStr(data.intensity) as CharacterFxIntensity | undefined,\n }\n if (!ctx) {\n return withCustomText(data, composeCharacterFxHintFromConnections(effectId, [], timing, mode))\n }\n const targetNames: string[] = []\n for (const edge of ctx.edges) {\n if (edge.target !== node.id) continue\n if (edge.targetHandle !== \"target\") continue\n const src = ctx.nodes.find((n) => n.id === edge.source)\n if (!src) continue\n const name = extractCharacterRefName(src)\n if (name) targetNames.push(name)\n }\n return withCustomText(data, composeCharacterFxHintFromConnections(effectId, targetNames, timing, mode))\n }\n\n if (node.type === \"character-motion\") {\n const raw = data.characterMotion\n const motionId: string | string[] | undefined =\n Array.isArray(raw)\n ? raw.filter((s): s is string => typeof s === \"string\" && s.length > 0)\n : (asStr(raw) || undefined)\n const timing: CharacterMotionTiming = {\n position: asStr(data.position) as CharacterMotionPosition | undefined,\n pace: asStr(data.pace) as CharacterMotionPace | undefined,\n }\n if (!ctx) {\n return withCustomText(data, composeCharacterMotionHintFromConnections(motionId, [], [], timing, mode))\n }\n const { targetNames, partnerNames, subjectMinor } = getCharacterMotionBindings(node, ctx)\n return withCustomText(\n data,\n composeCharacterMotionHintFromConnections(motionId, targetNames, partnerNames, timing, mode, { subjectMinor }),\n )\n }\n\n const base = resolveBaseHint(node.type, data, mode)\n if (base) return base\n // Pack-extend fallback: a single-dim pack entry the per-catalog getter (which\n // reads the frozen base array) can't resolve. Resolve it against the\n // registered (pack-composed) catalog's options. Composition already resolved\n // `PickerOption.term`; `resolveTerm` is idempotent over a resolved option and\n // is called anyway so a pack option that reached this array by some other\n // route still injects SOMETHING in compact mode rather than `undefined`.\n const cat = getPickerCatalog(node.type)\n if (cat?.kind === \"single\" && cat.valueField) {\n const id = typeof data[cat.valueField] === \"string\" ? (data[cat.valueField] as string) : \"\"\n const opt = cat.options?.find((o) => o.id === id)\n if (opt) return byMode(mode, opt.promptHint, resolveTerm(opt))\n }\n return base\n}\n\n/**\n * Base (upstream) hint dispatch by node type — the per-catalog getters read the\n * frozen base arrays. Pack-added single-dim ids are resolved by the caller\n * against the registered (pack-composed) catalog.\n *\n * `mode` selects the base fragment only: the compact `get<Name>Term` getter /\n * `build<Name>Terms` builder instead of the verbose one. The `withCustomText`\n * wrapper, the builders' own pre/post composition, and the free-text node\n * types (tone / style-guide / text-prompt — user prose, not catalog copy) are\n * identical in both modes.\n */\nfunction resolveBaseHint(\n type: string,\n data: Record<string, unknown>,\n mode: PickerHintMode = \"full\",\n): string {\n switch (type) {\n case \"framing\":\n return withCustomText(data, buildFramingHints(data, false, mode).join(\", \"))\n case \"lighting\":\n return withCustomText(data, buildLightingHints(data, mode).join(\", \"))\n case \"lens\":\n return withCustomText(data, byMode(mode, getLensPromptHint, getLensTerm)(asStr(data.lens)))\n case \"camera-format\":\n return withCustomText(data, byMode(mode, getCameraFormatPromptHint, getCameraFormatTerm)(asStr(data.cameraFormat)))\n case \"color-look\":\n return withCustomText(data, byMode(mode, getColorLookPromptHint, getColorLookTerm)(asStr(data.colorLook)))\n\n // build*Hints in music-* / voice-* / mood / person / etc. compose\n // preText/postText internally — bypass the wrapper to avoid double-\n // composition.\n case \"music-genre\":\n return buildMusicGenreHints((data ?? {}) as Parameters<typeof buildMusicGenreHints>[0], mode)\n case \"music-mood\":\n return buildMusicMoodHints((data ?? {}) as Parameters<typeof buildMusicMoodHints>[0], mode)\n case \"instrumentation\":\n return buildInstrumentationHints((data ?? {}) as Parameters<typeof buildInstrumentationHints>[0], mode)\n case \"voice-character\":\n return buildVoiceCharacterHints((data ?? {}) as Parameters<typeof buildVoiceCharacterHints>[0], mode)\n case \"voice-delivery\":\n return buildVoiceDeliveryHints((data ?? {}) as Parameters<typeof buildVoiceDeliveryHints>[0], mode)\n case \"person\":\n return buildPersonHints(data, mode).join(\", \")\n case \"mood\":\n return buildMoodHints(data, mode).join(\", \")\n case \"pose\":\n return buildPoseHints(data, mode).join(\", \")\n case \"styling\":\n return buildStylingHints(data, mode).join(\", \")\n\n case \"atmosphere\":\n return withCustomText(data, buildAtmosphereHints(data.atmosphere, mode).join(\", \"))\n case \"action-fx\":\n return withCustomText(data, buildActionFxHints(data.actionFx, mode).join(\", \"))\n case \"style\":\n return withCustomText(data, byMode(mode, getStylePromptHint, getStyleTerm)(asStr(data.style)))\n case \"setting\":\n return withCustomText(data, byMode(mode, getSettingPromptHint, getSettingTerm)(asStr(data.setting)))\n case \"loop-subject\":\n return withCustomText(data, byMode(mode, getLoopSubjectPromptHint, getLoopSubjectTerm)(asStr(data.loopSubject)))\n case \"material\":\n return withCustomText(data, buildMaterialHints(data.material, mode))\n // The four object-entity catalogs are owned by @nodaro/shared and overlaid\n // in shared-catalog-overlay.ts — the ONE module every prompt-text read of\n // them goes through (the subject fold uses it too). Each returns \"\" on a\n // miss, so the entry lookup is the module's job, not this switch's.\n case \"animal\":\n return withCustomText(data, byMode(mode, curatedAnimalPromptHint, curatedAnimalTerm)(asStr(data.animal)))\n case \"vehicle\": {\n const t = curatedVehicleText(asStr(data.vehicle))\n return withCustomText(data, byMode(mode, t.hint, t.term))\n }\n case \"weapon\": {\n const t = curatedWeaponText(asStr(data.weapon))\n return withCustomText(data, byMode(mode, t.hint, t.term))\n }\n case \"furniture\": {\n const t = curatedFurnitureText(asStr(data.furniture))\n return withCustomText(data, byMode(mode, t.hint, t.term))\n }\n case \"photo-genre\":\n return withCustomText(data, byMode(mode, getPhotoGenrePromptHint, getPhotoGenreTerm)(asStr(data.photoGenre)))\n case \"backdrop\":\n return withCustomText(data, byMode(mode, getBackdropPromptHint, getBackdropTerm)(asStr(data.backdrop)))\n case \"held-prop\":\n return withCustomText(data, buildHeldPropHints(data.heldProp, mode).join(\", \"))\n case \"photographer\":\n return withCustomText(data, buildPhotographerHints(data.photographer, mode))\n case \"aesthetic\":\n return withCustomText(data, buildAestheticHints(data.aesthetic, mode))\n case \"era\":\n return withCustomText(data, byMode(mode, getEraPromptHint, getEraTerm)(asStr(data.era)))\n case \"temporal\":\n return withCustomText(data, buildTemporalHints(data, mode).join(\", \"))\n case \"exposure-settings\":\n return withCustomText(data, buildExposureHints(data, mode).join(\", \"))\n case \"render-quality\":\n return withCustomText(data, byMode(mode, getRenderQualityPromptHint, getRenderQualityTerm)(asStr(data.renderQuality)))\n case \"composition-effects\":\n return withCustomText(data, byMode(mode, getCompositionEffectPromptHint, getCompositionEffectTerm)(asStr(data.compositionEffect)))\n case \"post-process-effects\":\n return withCustomText(data, buildPostProcessHints(data.postProcess, mode).join(\", \"))\n // Motion intensity: a Generation Settings node that a video node's\n // Settings input takes as a prompt fragment (video only).\n case \"motion\": {\n const hint = MOTION_INTENSITY_HINTS[asStr(data.motion)]\n return hint ? byMode(mode, hint.full, hint.compact) : \"\"\n }\n\n // Free text authored by the user, not catalog copy — there is no shorter\n // professional form to swap in, so these are identical in both modes.\n case \"tone\":\n return asStr(data.tone).trim()\n case \"style-guide\":\n // The node's whole purpose is injecting its style text into consumer\n // prompts; without this case, {Style Guide} refs stayed as literal\n // brace text and direct wires injected nothing (only fieldMappings\n // worked, via getParameterValue).\n return asStr(data.text).trim()\n case \"text-prompt\":\n return asStr(data.text).trim()\n default:\n return \"\"\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/age-floor.ts","../src/parameter-prompt-hint.ts"],"names":[],"mappings":";;;;;;;AAoCO,IAAM,0BAA0B,CAAC,SAAA,EAAW,MAAA,EAAQ,MAAA,EAAQ,eAAe,kBAAkB;AAGpG,IAAM,0BAAA,GAAkD,IAAI,GAAA,CAAI,uBAAuB,CAAA;AAMvF,SAAS,UAAU,OAAA,EAAqD;AACtE,EAAA,IAAI,QAAQ,IAAA,KAAS,QAAA,EAAU,OAAO,OAAA,CAAQ,WAAW,EAAC;AAC1D,EAAA,OAAA,CAAQ,OAAA,CAAQ,cAAc,EAAC,EAAG,QAAQ,CAAC,CAAA,KAAM,EAAE,OAAO,CAAA;AAC5D;AAMO,SAAS,mBAAA,GAAqD;AACnE,EAAA,MAAM,cAAA,GAAiB,2BAAA,EAA4B,CAChD,MAAA,CAAO,CAAC,CAAA,KAAM,0BAAA,CAA2B,GAAA,CAAI,CAAA,CAAE,SAAS,CAAC,CAAA,CACzD,QAAQ,SAAS,CAAA;AACpB,EAAA,MAAM,MAAqC,CAAC,GAAG,mBAAA,EAAoB,EAAG,GAAG,cAAc,CAAA;AACvF,EAAA,OAAO,IAAI,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,cAAc,IAAI,CAAA;AAC/C;AAGO,SAAS,eAAA,GAAuC;AACrD,EAAA,OAAO,IAAI,IAAI,mBAAA,EAAoB,CAAE,IAAI,CAAC,CAAA,KAAM,CAAA,CA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AA;AAAA,IACnI,KAAK,sBAAA;AACH,MAAA,OAAO,cAAA,CAAe,MAAM,qBAAA,CAAsB,IAAA,CAAK,aAAa,IAAI,CAAA,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA;AAAA;AAAA,IAGtF,KAAK,QAAA,EAAU;AACb,MAAA,MAAM,IAAA,GAAO,sBAAA,CAAuB,KAAA,CAAM,IAAA,CAAK,MAAM,CAAC,CAAA;AACtD,MAAA,OAAO,OAAO,MAAA,CAAO,IAAA,EAAM,KAAK,IAAA,EAAM,IAAA,CAAK,OAAO,CAAA,GAAI,EAAA;AAAA,IACxD;AAAA;AAAA;AAAA,IAIA,KAAK,MAAA;AACH,MAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,CAAA,CAAE,IAAA,EAAK;AAAA,IAC/B,KAAK,aAAA;AAKH,MAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,CAAA,CAAE,IAAA,EAAK;AAAA,IAC/B,KAAK,aAAA;AACH,MAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,CAAA,CAAE,IAAA,EAAK;AAAA,IAC/B;AACE,MAAA,OAAO,EAAA;AAAA;AAEb","file":"chunk-QDUTMOF4.js","sourcesContent":["/**\n * The minor-age floor — Layer 1 of spec 2026-09-01-app-reports-triage-design.md\n * §3.3 (W1-a). Content-free: this module decides WHICH catalog entries a minor\n * subject may not carry; the clause a deployment appends lives in its\n * registered PromptPolicy (backend/src/lib/prompt-policies/), never here.\n *\n * `ADULT_ONLY_FLAG`, `ADULT_AGE_IDS`, `MINOR_IMPLYING_TYPE_IDS` and\n * `isMinorAge` live in the import-free leaf `age-signal.ts` and are\n * re-exported here unchanged — this module's own catalog-funnel imports\n * (`person-packs.js`, `picker-catalogs.js`) are exactly what `person.ts` /\n * `styling.ts` must NOT reach through, on pain of reopening the\n * person → age-floor → picker-catalogs load-time cycle (see `age-signal.ts`'s\n * header). `person.ts` / `styling.ts` import `isMinorAge` from\n * `age-signal.ts` directly instead of from here.\n */\n\nimport { getRegisteredPeople } from \"./person-packs.js\"\nimport { getRegisteredPickerCatalogs, type PickerCatalog, type PickerOption } from \"./picker-catalogs.js\"\nimport { isMinorAge, ADULT_AGE_IDS, MINOR_IMPLYING_TYPE_IDS } from \"./age-signal.js\"\n\nexport { ADULT_ONLY_FLAG, ADULT_AGE_IDS, MINOR_IMPLYING_TYPE_IDS, isMinorAge } from \"./age-signal.js\"\n\n/** Shape shared by every catalog entry the floor reads. */\nexport interface AdultOnlyEntry {\n readonly id: string\n readonly promptHint: string\n readonly term?: string\n readonly adultOnly?: true\n}\n\n/** The picker catalogs (by `catalogId`) this floor sweeps beside person.\n * Exported because it is the SINGLE source of truth for two things that used\n * to be maintained by hand and drifted: which catalogs `getAdultOnlyEntries`\n * sweeps for the flag, and which analyzer keys `FLOORED_PICKER_KEYS` strips\n * flagged ids out of (a `photo-genre` swept for the flag but absent from the\n * strip list let `glamour-portrait` survive on a minor). */\nexport const ADULT_SWEPT_CATALOG_IDS = [\"styling\", \"mood\", \"pose\", \"photo-genre\", \"character-motion\"] as const\n\n/** Membership form of the list above (the sweep does one lookup per catalog). */\nconst ADULT_SWEPT_CATALOG_ID_SET: ReadonlySet<string> = new Set(ADULT_SWEPT_CATALOG_IDS)\n\n/** Flatten a catalog's options regardless of shape: single-dim catalogs carry\n * `options` directly, multi-dim ones carry `dimensions[].options` (mirrors\n * `applyDeny` in catalog-packs.ts, the other consumer that has to handle\n * both shapes). */\nfunction optionsOf(catalog: PickerCatalog): ReadonlyArray<PickerOption> {\n if (catalog.kind === \"single\") return catalog.options ?? []\n return (catalog.dimensions ?? []).flatMap((d) => d.options)\n}\n\n/** Every entry, across the swept catalogs, that carries the flag. Reads every\n * catalog through the pack-composed funnel — `getRegisteredPeople()` for\n * person, `getRegisteredPickerCatalogs()` for styling/mood/pose/photo-genre —\n * so a pack-added or pack-replaced entry is included. */\nexport function getAdultOnlyEntries(): ReadonlyArray<AdultOnlyEntry> {\n const catalogEntries = getRegisteredPickerCatalogs()\n .filter((c) => ADULT_SWEPT_CATALOG_ID_SET.has(c.catalogId))\n .flatMap(optionsOf)\n const all: ReadonlyArray<AdultOnlyEntry> = [...getRegisteredPeople(), ...catalogEntries]\n return all.filter((e) => e.adultOnly === true)\n}\n\n/** The set of flagged ids (fast membership for the collectors). */\nexport function getAdultOnlyIds(): ReadonlySet<string> {\n return new Set(getAdultOnlyEntries().map((e) => e.id))\n}\n\n/**\n * The pre-rework `promptHint` of every `adultOnly` entry the spec\n * (2026-09-01-app-reports-triage-design §3.3) listed for rewording — including\n * `eye-state-half-lidded` and `feature-collarbone-visible`, which the W1-b\n * harness initially left byte-identical (0/10 and 0/22 render rate under\n * either wording) and a 2026-09-03 replay then found renderable wordings for\n * — plus the hard-coded midriff+navel fold clause. These strings are permanently part of the strip\n * set: a consumer that has not bumped `@nodaro/prompts` still emits them, and\n * the client-assembled `seedPrompt` path is exactly how the 2026-07-30\n * minor-age prompts reached a provider. Retiring can only ever cause an EXTRA\n * strip, and only for a subject `isMinorAge` has already judged a minor — so\n * the list only grows, never shrinks.\n *\n * `promptHint` ONLY, for the same reason `getAdultOnlyHintStrings` gives:\n * `term` is short display vocabulary and the composed-catalog projection\n * back-fills a derived `term` for every option, so terms collide with benign\n * everyday text. Assembled prompts and client seedPrompts are built from\n * hints, never from terms. The three W1-b entries that are NOT flagged —\n * `texture-dewy`, `texture-baby-soft`, `eye-state-staring-camera` (spec\n * §3.3's \"deliberately not flagged\" list) — are absent: their old wording\n * never belonged to the floor.\n *\n * 15 flagged hints + the fold literal = 16.\n */\nexport const RETIRED_ADULT_ONLY_HINT_STRINGS: ReadonlyArray<string> = [\n // bust-very-full\n \"very full bust\",\n // silhouette-hourglass\n \"hourglass silhouette\",\n // waist-defined\n \"defined waist\",\n // lip-state-glossy\n \"with high-shine glossy wet-look lips\",\n // lip-state-parted\n \"with lips slightly parted, taking a soft breath\",\n // lip-state-bitten\n \"playfully biting the lower lip\",\n // eye-state-half-lidded\n \"with heavy half-lidded sleepy eyes\",\n // texture-glistening\n \"with glistening skin, sweat or oil catching the light\",\n // texture-shower-fresh-wet\n \"with just-out-of-the-shower wet skin, water beading on the surface and rolling in slow droplets down the curves of the body\",\n // feature-bare-shoulders\n \"with bare shoulders exposed, the line of the collarbone and shoulder muscles uncovered\",\n // feature-collarbone-visible\n \"with a prominent collarbone clearly defined and catching the light\",\n // feature-midriff-visible\n \"wearing a cropped style with the midriff visible\",\n // state-fitted — the 2026-07-30 incident clause\n \"the clothing fitted and form-conscious, hugging the contours of the body\",\n // state-wet\n \"the clothing soaked and wet, the fabric clinging to the body and dripping water\",\n // pose `biting-lip` (the lip-state-bitten twin)\n \"biting the lower lip with a subtle playful expression\",\n // the hard-coded midriff+navel fold in emitIndependentFragments — not any\n // entry's hint, so retiring it ADDS a needle for a clause that really is\n // emitted verbatim.\n \"wearing a cropped style, midriff and navel visible\",\n]\n\n/** Every full prompt-hint string a flagged entry can inject, lower-cased,\n * longest first — the backend policy strips text that contains any of them\n * (Layer 2), which is how flagged wording arriving inside free text (a\n * client-assembled seedPrompt) is caught. Seeded with\n * `RETIRED_ADULT_ONLY_HINT_STRINGS` so a catalog rewording can never narrow\n * the strip set for a consumer still shipping the pre-rephrase wording.\n *\n * `promptHint` ONLY, deliberately — `term` is analyzer/UI vocabulary\n * (compact-mode display), and `picker-catalogs.ts`'s composed-catalog\n * projection back-fills a `term` for EVERY option via `deriveTerm(label)`\n * when no explicit term was authored (e.g. \"lounging\", \"cropped top\",\n * \"school uniform\", \"lying down\"). Those short, generic derived terms are\n * exactly the kind of everyday word that collides with unrelated, benign\n * text and over-strips it. Assembled prompts and client seedPrompts are\n * built from HINTS, never from terms, so hints are the only strings that\n * can actually arrive verbatim in free text — terms don't need to be (and\n * must not be) swept here. */\nexport function getAdultOnlyHintStrings(): ReadonlyArray<string> {\n const out = new Set<string>(RETIRED_ADULT_ONLY_HINT_STRINGS)\n for (const e of getAdultOnlyEntries()) {\n if (e.promptHint) out.add(e.promptHint.toLowerCase())\n }\n return [...out].filter((s) => s.length >= 8).sort((a, b) => b.length - a.length)\n}\n\n/**\n * Every full prompt-hint string that DESCRIBES A MINOR — the mirror of\n * `getAdultOnlyHintStrings`, and the needle list for the TEXT signal below.\n *\n * Why a text signal exists at all: `isMinorAge` reads the structured picker\n * value, and the P0 arrival path does not have one. A thin client can create a\n * character row carrying only `{nodeId, name, projectId}` and send the picker\n * selection as an already-assembled `seedPrompt`, so `row.person === null`\n * while the prompt itself says \"a young child around 5 years old\". That client\n * assembles the text FROM THESE HINTS, which is exactly why the catalog is the\n * drift-proof needle list: a new minor age entry is swept the day it is added,\n * with no second list to remember.\n *\n * Selection is DERIVED, never hand-listed: an `age` entry is a minor unless its\n * id is in the `ADULT_AGE_IDS` allow-list (so a new age id is inside the floor\n * by default — same ratchet as `isMinorAge`), plus every `type` entry named by\n * `MINOR_IMPLYING_TYPE_IDS`. Read through the pack-composed funnel\n * (`getRegisteredPeople()`), so a deployment pack's entries are swept too.\n *\n * `promptHint` ONLY — never `term` and never `label`, for the same reason\n * `getAdultOnlyHintStrings` gives: `term` is short display vocabulary\n * (\"in their teens\" as a compact chip) and the composed-catalog projection\n * back-fills a derived `term` for every option, so terms collide with benign\n * text. The `>= 8` filter drops `age-custom`'s empty hint (`\"\"`), which would\n * otherwise match every string ever written.\n */\nlet cachedMinorHints: ReadonlyArray<string> | null = null\nlet cachedMinorHintSourceCount = -1\nexport function getMinorAgeHintStrings(): ReadonlyArray<string> {\n const people = getRegisteredPeople()\n if (cachedMinorHints && cachedMinorHintSourceCount === people.length) return cachedMinorHints\n const out = new Set<string>()\n for (const e of people) {\n const minorAge = e.dimension === \"age\" && !ADULT_AGE_IDS.has(e.id)\n const minorType = e.dimension === \"type\" && MINOR_IMPLYING_TYPE_IDS.has(e.id)\n if (!minorAge && !minorType) continue\n if (e.promptHint) out.add(e.promptHint.toLowerCase())\n }\n cachedMinorHintSourceCount = people.length\n cachedMinorHints = [...out].filter((s) => s.length >= 8).sort((a, b) => b.length - a.length)\n return cachedMinorHints\n}\n\nfunction escapeReSource(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n\n/** One needle's regex source: the phrase's tokens — split on whitespace AND\n * hyphens — escaped and rejoined by `[\\s-]+`, so it matches however the text\n * that carries it happened to be spaced or hyphenated. */\nfunction needleTokenSource(needle: string): string {\n return needle\n .trim()\n .split(/[\\s-]+/)\n .filter((t) => t.length > 0)\n .map(escapeReSource)\n .join(\"[\\\\s-]+\")\n}\n\n/**\n * The word-bounded alternation SOURCE for a needle list — the one place both\n * layers of the floor build their matcher, so they can never disagree about\n * what \"the same phrase\" means.\n *\n * Two properties, both load-bearing:\n * - **Separator tolerance.** A catalog hint is authored with single spaces\n * (\"very full bust\"), but the free text that carries it is written by a\n * human or an LLM and arrives as \"very-full bust\" or \"very full bust\".\n * A literal alternation misses those, and a miss is a flagged phrase\n * reaching the provider on a minor's prompt. Each needle's tokens are\n * joined by `[\\s-]+`, which requires AT LEAST one separator — so\n * \"very fullbust\" (no separator at all) is still not a match, and the\n * phrase can't silently widen into a substring rule.\n * - **Word boundaries.** `(?<![\\w-])` / `(?![\\w-])` keep a needle from\n * gluing onto an adjacent word's characters (\"mesh tops\" must survive a\n * \"mesh top\" needle).\n *\n * Ordering is the CALLER's: pass needles longest-first so the alternation\n * consumes the longest match at a given position instead of leaving debris.\n * Returns `null` when there is nothing to match (an empty list would otherwise\n * compile to `(?:)`, which matches everywhere). Flags are the caller's too —\n * `\"i\"` for a `.test()` instance, `\"gi\"` for one used with `String.replace`.\n */\nexport function buildNeedleAlternationSource(needles: ReadonlyArray<string>): string | null {\n const alts = needles.map(needleTokenSource).filter((s) => s.length > 0)\n if (alts.length === 0) return null\n return `(?<![\\\\w-])(?:${alts.join(\"|\")})(?![\\\\w-])`\n}\n\n/** Needle alternation over `getMinorAgeHintStrings()`, word-bounded on both\n * sides so a hint can only match a whole phrase. Deliberately NOT global:\n * this instance is only ever `.test()`ed, and a `/g` regex would carry\n * `lastIndex` across calls. Cached by needle count (packs are registered\n * before the first prompt is assembled). */\nlet cachedMinorNeedleRe: RegExp | null = null\nlet cachedMinorNeedleCount = -1\nfunction minorNeedleRegex(): RegExp | null {\n const needles = getMinorAgeHintStrings()\n if (cachedMinorNeedleRe && cachedMinorNeedleCount === needles.length) return cachedMinorNeedleRe\n cachedMinorNeedleCount = needles.length\n const src = buildNeedleAlternationSource(needles)\n cachedMinorNeedleRe = src === null ? null : new RegExp(src, \"i\")\n return cachedMinorNeedleRe\n}\n\n/**\n * NUMBER-FIRST age shapes: the ones `buildAgeFragment` (person.ts) emits for a\n * CUSTOM age (\"N years old\", \"N year old\", \"N-year-old\") and the catalog's own\n * \"2-3 years old\" range (the FIRST number decides), plus the colloquial tails a\n * human or an LLM writes instead — \"12yo\", \"12 yo\", \"12 y.o.\", \"12 y/o\",\n * \"12 yr old\", \"12-yr-old\", \"12yrs old\", \"12 years of age\". The cut is `< 20`,\n * the same boundary `isMinorAge` uses for `customAge` and the same one\n * `buildAgeFragment` switches to \"in their teens\" at.\n *\n * Both boundaries are load-bearing. The LEADING one stops a match inside a\n * larger token; the TRAILING one is what makes \"a 5 year older sibling\" a\n * non-hit (\"old\" may not glue onto \"older\") and what stops \"yo\" from firing\n * inside \"12 young\" or \"12 yoga\". Used via `matchAll`, which clones the regex\n * rather than advancing this instance's `lastIndex`.\n */\nconst NUMERIC_AGE_RE =\n /(?<![\\w-])(\\d{1,3})(?:\\s*-\\s*\\d{1,3})?\\s*-?\\s*(?:years?\\s*-?\\s*old|yrs?\\s*-?\\s*old|y(?:\\.\\s*o\\.?|\\/o|o)|years?\\s+of\\s+age)(?![\\w-])/gi\n\n/**\n * AGE-FIRST shapes, where the number trails the word instead of leading it:\n * \"age 12\", \"aged 12\", \"at the age of 12\". The leading boundary is what keeps\n * \"image 12\" / \"page 12\" out (the `age` there is glued to a preceding word\n * character), and the trailing one keeps \"aged 12th\" out.\n */\nconst PREFIXED_AGE_RE = /(?<![\\w-])aged?\\s+(?:of\\s+)?(\\d{1,3})(?![\\w-])/gi\n\n/** Every rule that reads a NUMBER out of the text, each capturing the age in\n * group 1. Iterated together below so a new shape is one array entry. */\nconst AGE_NUMBER_RULES: ReadonlyArray<RegExp> = [NUMERIC_AGE_RE, PREFIXED_AGE_RE]\n\n/** The one NON-numeric shape `buildAgeFragment` emits below 20 (`${n} years\n * old, in their teens`). Kept as its own rule rather than as a catalog term.\n * Separator-tolerant on the same terms as the needle alternation, so\n * \"in their teens\" and \"in-their-teens\" are the same phrase. */\nconst IN_THEIR_TEENS_RE = /(?<![\\w-])in[\\s-]+their[\\s-]+teens(?![\\w-])/i\n\n/**\n * True when free text describes a MINOR subject. Three rules, in order:\n * 1. any minor-age / minor-implying-type prompt hint, word-bounded;\n * 2. a numeric age below 20 in any shape `buildAgeFragment` emits;\n * 3. the literal \"in their teens\".\n *\n * Deliberately NOT a bare-word check: \"child\", \"teen\", \"kid\" alone must never\n * fire, or an adult prompt that merely MENTIONS a child (\"a mother holding her\n * child\") would be floored — the spec's \"adults are byte-identical\" is a hard\n * requirement, so every rule here is a full phrase or a bounded number.\n *\n * Pairs with `isMinorAge`, never replaces it: the structured picker value is\n * the primary signal; this catches the same subject when only the assembled\n * text survives.\n */\nexport function containsMinorAgeHint(text: string | null | undefined): boolean {\n if (typeof text !== \"string\" || text.trim().length === 0) return false\n const re = minorNeedleRegex()\n if (re && re.test(text)) return true\n for (const rule of AGE_NUMBER_RULES) {\n for (const m of text.matchAll(rule)) {\n const n = Number(m[1])\n if (Number.isFinite(n) && n < 20) return true\n }\n }\n return IN_THEIR_TEENS_RE.test(text)\n}\n\n/** The analyzer/import value keys the floor strips flagged ids out of:\n * `person` plus EVERY catalog the flag sweep reads. DERIVED, never\n * hand-listed — the hand-written version omitted `photo-genre` while the\n * sweep included it, so a minor kept `glamour-portrait`. The analyzer JSON is\n * keyed by picker type id (`describe-to-picker.ts`), which is the same string\n * as the catalog id, so this list IS the set of keys to visit. */\nexport const FLOORED_PICKER_KEYS = [\"person\", ...ADULT_SWEPT_CATALOG_IDS] as const\n\nfunction stripIds(obj: Record<string, unknown>, drop: ReadonlySet<string>): Record<string, unknown> {\n const out: Record<string, unknown> = {}\n for (const [k, v] of Object.entries(obj)) {\n if (typeof v === \"string\") {\n if (!drop.has(v)) out[k] = v\n } else if (Array.isArray(v)) {\n const kept = v.filter((x) => !(typeof x === \"string\" && drop.has(x)))\n if (kept.length > 0) out[k] = kept\n } else {\n out[k] = v\n }\n }\n return out\n}\n\n/** Analyzer / import post-filter: when the person value describes a minor,\n * remove every flagged id from the person, styling, pose and mood values.\n * Identity (same reference) for an adult. */\nexport function applyMinorAgeFloorToPickerValues<T extends Record<string, unknown>>(values: T): T {\n const person = values.person\n if (!person || typeof person !== \"object\" || !isMinorAge(person as { age?: string; customAge?: number; type?: string })) return values\n const drop = getAdultOnlyIds()\n const out: Record<string, unknown> = { ...values }\n for (const key of FLOORED_PICKER_KEYS) {\n const v = out[key]\n if (v && typeof v === \"object\" && !Array.isArray(v)) out[key] = stripIds(v as Record<string, unknown>, drop)\n }\n return out as T\n}\n","import type { HintNodeLike, HintEdgeLike, HintGraphContext } from \"@nodaro/shared/types\"\nexport type { HintNodeLike, HintEdgeLike, HintGraphContext }\n/**\n * Single source of truth for parameter-node prompt-hint text.\n *\n * Every parameter node (framing, lens, camera-format, lighting, color-look,\n * atmosphere, style, setting, person, mood, pose, styling, temporal, tone,\n * text-prompt, camera-motion) dispatches through `getParameterPromptHint` to\n * produce the descriptive clause it contributes to a consumer's prompt.\n *\n * The frontend DAG executor and backend workflow orchestrator both call this,\n * so the text injected via the `cinematography` handle is identical to the\n * text injected when the node is wired directly into a Text Prompt / LLM Chat\n * / Combine Text input.\n *\n * Camera-motion is graph-aware: when `ctx` is provided the function walks the\n * node's `startState`/`endState` incoming edges and composes a fully formed\n * sentence via `composeCameraMotionHintFromConnections`. Without `ctx` only\n * the bare motion description is returned.\n */\n\nimport { buildFramingHints } from \"./framing.js\"\nimport { buildLightingHints } from \"./lighting.js\"\nimport { getLensPromptHint, getLensTerm } from \"./lens.js\"\nimport { getCameraFormatPromptHint, getCameraFormatTerm } from \"./camera-format.js\"\nimport { getColorLookPromptHint, getColorLookTerm } from \"./color-look.js\"\nimport { buildAtmosphereHints } from \"./atmosphere.js\"\nimport { buildActionFxHints } from \"./action-fx.js\"\nimport { getStylePromptHint, getStyleTerm } from \"./style.js\"\nimport { getSettingPromptHint, getSettingTerm } from \"./setting.js\"\nimport { getLoopSubjectPromptHint, getLoopSubjectTerm } from \"./loop-subject.js\"\nimport { buildPersonHints } from \"./person.js\"\nimport { buildMoodHints } from \"./mood.js\"\nimport { buildPoseHints } from \"./pose.js\"\nimport { buildStylingHints } from \"./styling.js\"\nimport { buildTemporalHints } from \"./temporal.js\"\nimport { composeCameraMotionHintFromConnections } from \"./camera-motions.js\"\nimport { joinHintFragments } from \"./hint-join.js\"\nimport { composeTransitionHintFromConnections, readTransitionOptionValues, type TransitionDuration, type TransitionIntensity, type TransitionPosition, type TransitionTiming } from \"./transitions.js\"\nimport { composeCharacterFxHintFromConnections, type CharacterFxDuration, type CharacterFxIntensity, type CharacterFxPosition, type CharacterFxTiming } from \"./character-fx.js\"\nimport { composeCharacterMotionHintFromConnections, type CharacterMotionPace, type CharacterMotionPosition, type CharacterMotionTiming } from \"./character-motion.js\"\nimport { containsMinorAgeHint, isMinorAge } from \"./age-floor.js\"\nimport { buildMaterialHints } from \"./materials.js\"\nimport { curatedAnimalPromptHint, curatedAnimalTerm, curatedVehicleText, curatedWeaponText, curatedFurnitureText } from \"./shared-catalog-overlay.js\"\nimport { getPhotoGenrePromptHint, getPhotoGenreTerm } from \"./photo-genre.js\"\nimport { getBackdropPromptHint, getBackdropTerm } from \"./backdrop.js\"\nimport { buildHeldPropHints } from \"./held-prop.js\"\nimport { buildPhotographerHints } from \"./photographer.js\"\nimport { buildAestheticHints } from \"./aesthetic.js\"\nimport { getEraPromptHint, getEraTerm } from \"./era.js\"\nimport { buildExposureHints } from \"./exposure-settings.js\"\nimport { getRenderQualityPromptHint, getRenderQualityTerm } from \"./render-quality.js\"\nimport { getCompositionEffectPromptHint, getCompositionEffectTerm } from \"./composition-effects.js\"\nimport { buildPostProcessHints } from \"./post-process-effects.js\"\nimport { buildMusicGenreHints } from \"./music-genre.js\"\nimport { buildMusicMoodHints } from \"./music-mood.js\"\nimport { buildInstrumentationHints } from \"./instrumentation.js\"\nimport { buildVoiceCharacterHints } from \"./voice-character.js\"\nimport { buildVoiceDeliveryHints } from \"./voice-delivery.js\"\nimport { getPickerCatalog } from \"./picker-catalogs.js\"\nimport { resolveTerm, type PickerHintMode } from \"./term.js\"\n\n\nfunction asStr(v: unknown): string {\n return typeof v === \"string\" ? v : \"\"\n}\n\n/** Extract the display name from a character / face / object / location ref node. */\nfunction extractCharacterRefName(node: HintNodeLike): string | undefined {\n const d = (node.data ?? {}) as Record<string, unknown>\n const candidates = [d.characterName, d.faceName, d.objectName, d.locationName]\n for (const v of candidates) {\n if (typeof v === \"string\" && v.trim().length > 0) return v.trim()\n }\n return undefined\n}\n\n/** Character Motion's name read: the shared character / face / object / location\n * read, then a creature's `creatureName`. Local to Character Motion so the\n * Character FX prompt, which shares `extractCharacterRefName`, stays unchanged. */\nfunction extractCharacterMotionRefName(node: HintNodeLike): string | undefined {\n const name = extractCharacterRefName(node)\n if (name) return name\n const creatureName = asStr(((node.data ?? {}) as Record<string, unknown>).creatureName).trim()\n return creatureName.length > 0 ? creatureName : undefined\n}\n\n/** Free-text fields a character / face / object / location ref node describes its subject in.\n * A creature ref uses the same `description` / `canonicalDescription` names. */\nconst REF_DESCRIPTION_FIELDS = [\"description\", \"seedPrompt\", \"canonicalDescription\"] as const\n\n/** True when a character / face / object / location ref node describes a minor:\n * its structured `person` age (the primary signal) or an age phrase in its\n * free-text description. Feeds the Character Motion floor (adult-only moves\n * dropped) — errs toward flooring, never toward letting an adult-only move through. */\nfunction extractCharacterRefMinor(node: HintNodeLike): boolean {\n const d = (node.data ?? {}) as Record<string, unknown>\n const person = d.person\n if (person && typeof person === \"object\" && !Array.isArray(person) && isMinorAge(person as Parameters<typeof isMinorAge>[0])) {\n return true\n }\n return REF_DESCRIPTION_FIELDS.some((field) => containsMinorAgeHint(asStr(d[field])))\n}\n\n/** The preview, diagnostics and execution use identical graph bindings. */\nexport function getCharacterMotionBindings(node: HintNodeLike, ctx?: HintGraphContext) {\n const targetNames: string[] = []\n const partnerNames: string[] = []\n const targetIds = new Set<string>()\n const partnerIds = new Set<string>()\n let subjectMinor = false\n for (const edge of ctx?.edges ?? []) {\n if (edge.target !== node.id || (edge.targetHandle !== \"target\" && edge.targetHandle !== \"partner\")) continue\n const src = ctx?.nodes.find(n => n.id === edge.source)\n if (!src) continue\n if (edge.targetHandle === \"target\") targetIds.add(src.id)\n else partnerIds.add(src.id)\n if (extractCharacterRefMinor(src)) subjectMinor = true\n const name = extractCharacterMotionRefName(src)\n if (!name) continue\n const names = edge.targetHandle === \"target\" ? targetNames : partnerNames\n if (!names.includes(name)) names.push(name)\n }\n return { targetNames, partnerNames, subjectMinor, selfPairing: [...targetIds].some(id => partnerIds.has(id)) }\n}\n\n/** Compose `[preText, mainHint, postText]` into a comma-joined string,\n * honoring the user's free-text fragments around the structured hint.\n * Helpers like `getStylePromptHint` that already include preText/postText\n * composition (build*Hints in mood/person/etc.) bypass this — they\n * return the fully-composed string directly. */\nfunction withCustomText(data: Record<string, unknown>, mainHint: string): string {\n const fragments: string[] = []\n const pre = typeof data.preText === \"string\" ? data.preText.trim() : \"\"\n if (pre) fragments.push(pre)\n if (mainHint) fragments.push(mainHint)\n const post = typeof data.postText === \"string\" ? data.postText.trim() : \"\"\n if (post) fragments.push(post)\n return joinHintFragments(fragments)\n}\n\n/**\n * The node-level hint mode a picker declares via `data.hintMode`.\n *\n * Only the two documented values count; anything else (a stale value, a typo,\n * a non-string) is treated as UNDECLARED and falls back — to the inherited\n * mode when the node is resolved as an upstream input, and to `\"full\"`\n * otherwise. Compact is opt-in, so an unrecognized value can never silently\n * shorten a prompt.\n */\nfunction readHintMode(data: Record<string, unknown>): PickerHintMode | undefined {\n const raw = data.hintMode\n return raw === \"compact\" || raw === \"full\" ? raw : undefined\n}\n\n/** Pick the full-hint or the compact-term getter for the active mode. */\nfunction byMode<T>(mode: PickerHintMode, full: T, compact: T): T {\n return mode === \"compact\" ? compact : full\n}\n\n/** How much a shot moves (the Motion node's three steps), as the clause it\n * adds to a video prompt; the compact form is the bare term. */\nconst MOTION_INTENSITY_HINTS: Readonly<Record<string, { readonly full: string; readonly compact: string }>> = {\n subtle: { full: \"subtle, gentle motion with slow, minimal movement\", compact: \"subtle motion\" },\n moderate: { full: \"moderate, natural motion at an even pace\", compact: \"moderate motion\" },\n dynamic: { full: \"dynamic, energetic motion with fast, pronounced movement\", compact: \"dynamic motion\" },\n}\n\n/**\n * Dispatch by parameter-node type to its prompt-hint string. For camera-motion,\n * pass `ctx` to include the composed start/end clauses; otherwise only the\n * bare motion description is returned.\n *\n * VERBOSITY — a picker node may set `data.hintMode` to `\"compact\"` to inject\n * its short professional `term` (\"whip pan left\", \"hard cut\") instead of the\n * long `promptHint`. Absent, or any unrecognized value, means `\"full\"`, whose\n * output is byte-identical to what this function returned before hint modes\n * existed. ONLY the base catalog fragment swaps: `preText`/`postText`, the\n * transition / camera-motion / character-fx timing and start-state/end-state\n * clauses, multi-pick joining and multi-dimension composition are emitted the\n * same way in both modes.\n */\nexport function getParameterPromptHint(\n node: HintNodeLike | undefined,\n ctx?: HintGraphContext,\n): string {\n return resolveParameterHint(node, ctx)\n}\n\n/**\n * The dispatch body. `inherited` carries the mode DOWN into the nodes wired to\n * a composer's `startState` / `endState` handles, so a compact transition\n * composes compact start/end clauses rather than mixing a term with two\n * paragraphs. A node that declares its own `hintMode` still wins over what it\n * inherits.\n */\nfunction resolveParameterHint(\n node: HintNodeLike | undefined,\n ctx?: HintGraphContext,\n inherited?: PickerHintMode,\n): string {\n if (!node?.type) return \"\"\n const data = (node.data ?? {}) as Record<string, unknown>\n const mode: PickerHintMode = readHintMode(data) ?? inherited ?? \"full\"\n\n if (node.type === \"camera-motion\") {\n const motionId = asStr(data.cameraMotion) || undefined\n if (!ctx) return withCustomText(data, composeCameraMotionHintFromConnections(motionId, [], [], mode))\n const startHints: string[] = []\n const endHints: string[] = []\n for (const edge of ctx.edges) {\n if (edge.target !== node.id) continue\n const src = ctx.nodes.find((n) => n.id === edge.source)\n if (!src) continue\n // Pass no ctx for nested resolution: startState/endState inputs are\n // themselves parameter nodes (framing/tone/etc.) that don't need graph\n // context, and avoiding recursion keeps the walk cycle-safe. The mode\n // rides down so the composed clause stays at one level of detail.\n const hint = resolveParameterHint(src, undefined, mode)\n if (!hint) continue\n if (edge.targetHandle === \"startState\") startHints.push(hint)\n else if (edge.targetHandle === \"endState\") endHints.push(hint)\n }\n return withCustomText(data, composeCameraMotionHintFromConnections(motionId, startHints, endHints, mode))\n }\n\n if (node.type === \"transition\") {\n const raw = data.transition\n const transitionId: string | string[] | undefined =\n Array.isArray(raw)\n ? raw.filter((s): s is string => typeof s === \"string\" && s.length > 0)\n : (asStr(raw) || undefined)\n const timing: TransitionTiming = {\n position: asStr(data.position) as TransitionPosition | undefined,\n duration: asStr(data.duration) as TransitionDuration | undefined,\n intensity: asStr(data.intensity) as TransitionIntensity | undefined,\n }\n // A picked row's own options (a wipe's `wipeDirection`), off the same node data.\n const optionValues = readTransitionOptionValues(data)\n const hintOptions = optionValues ? { optionValues } : undefined\n if (!ctx) {\n return withCustomText(data, composeTransitionHintFromConnections(transitionId, [], [], timing, mode, hintOptions))\n }\n const startHints: string[] = []\n const endHints: string[] = []\n for (const edge of ctx.edges) {\n if (edge.target !== node.id) continue\n const src = ctx.nodes.find((n) => n.id === edge.source)\n if (!src) continue\n const hint = resolveParameterHint(src, undefined, mode) // no ctx — cycle-safe\n if (!hint) continue\n if (edge.targetHandle === \"startState\") startHints.push(hint)\n else if (edge.targetHandle === \"endState\") endHints.push(hint)\n }\n return withCustomText(data, composeTransitionHintFromConnections(transitionId, startHints, endHints, timing, mode, hintOptions))\n }\n\n if (node.type === \"character-fx\") {\n const raw = data.characterFx\n const effectId: string | string[] | undefined =\n Array.isArray(raw)\n ? raw.filter((s): s is string => typeof s === \"string\" && s.length > 0)\n : (asStr(raw) || undefined)\n const timing: CharacterFxTiming = {\n position: asStr(data.position) as CharacterFxPosition | undefined,\n duration: asStr(data.duration) as CharacterFxDuration | undefined,\n intensity: asStr(data.intensity) as CharacterFxIntensity | undefined,\n }\n if (!ctx) {\n return withCustomText(data, composeCharacterFxHintFromConnections(effectId, [], timing, mode))\n }\n const targetNames: string[] = []\n for (const edge of ctx.edges) {\n if (edge.target !== node.id) continue\n if (edge.targetHandle !== \"target\") continue\n const src = ctx.nodes.find((n) => n.id === edge.source)\n if (!src) continue\n const name = extractCharacterRefName(src)\n if (name) targetNames.push(name)\n }\n return withCustomText(data, composeCharacterFxHintFromConnections(effectId, targetNames, timing, mode))\n }\n\n if (node.type === \"character-motion\") {\n const raw = data.characterMotion\n const motionId: string | string[] | undefined =\n Array.isArray(raw)\n ? raw.filter((s): s is string => typeof s === \"string\" && s.length > 0)\n : (asStr(raw) || undefined)\n const timing: CharacterMotionTiming = {\n position: asStr(data.position) as CharacterMotionPosition | undefined,\n pace: asStr(data.pace) as CharacterMotionPace | undefined,\n }\n if (!ctx) {\n return withCustomText(data, composeCharacterMotionHintFromConnections(motionId, [], [], timing, mode))\n }\n const { targetNames, partnerNames, subjectMinor } = getCharacterMotionBindings(node, ctx)\n return withCustomText(\n data,\n composeCharacterMotionHintFromConnections(motionId, targetNames, partnerNames, timing, mode, { subjectMinor }),\n )\n }\n\n const base = resolveBaseHint(node.type, data, mode)\n if (base) return base\n // Pack-extend fallback: a single-dim pack entry the per-catalog getter (which\n // reads the frozen base array) can't resolve. Resolve it against the\n // registered (pack-composed) catalog's options. Composition already resolved\n // `PickerOption.term`; `resolveTerm` is idempotent over a resolved option and\n // is called anyway so a pack option that reached this array by some other\n // route still injects SOMETHING in compact mode rather than `undefined`.\n const cat = getPickerCatalog(node.type)\n if (cat?.kind === \"single\" && cat.valueField) {\n const id = typeof data[cat.valueField] === \"string\" ? (data[cat.valueField] as string) : \"\"\n const opt = cat.options?.find((o) => o.id === id)\n if (opt) return byMode(mode, opt.promptHint, resolveTerm(opt))\n }\n return base\n}\n\n/**\n * Base (upstream) hint dispatch by node type — the per-catalog getters read the\n * frozen base arrays. Pack-added single-dim ids are resolved by the caller\n * against the registered (pack-composed) catalog.\n *\n * `mode` selects the base fragment only: the compact `get<Name>Term` getter /\n * `build<Name>Terms` builder instead of the verbose one. The `withCustomText`\n * wrapper, the builders' own pre/post composition, and the free-text node\n * types (tone / style-guide / text-prompt — user prose, not catalog copy) are\n * identical in both modes.\n */\nfunction resolveBaseHint(\n type: string,\n data: Record<string, unknown>,\n mode: PickerHintMode = \"full\",\n): string {\n switch (type) {\n case \"framing\":\n return withCustomText(data, buildFramingHints(data, false, mode).join(\", \"))\n case \"lighting\":\n return withCustomText(data, buildLightingHints(data, mode).join(\", \"))\n case \"lens\":\n return withCustomText(data, byMode(mode, getLensPromptHint, getLensTerm)(asStr(data.lens)))\n case \"camera-format\":\n return withCustomText(data, byMode(mode, getCameraFormatPromptHint, getCameraFormatTerm)(asStr(data.cameraFormat)))\n case \"color-look\":\n return withCustomText(data, byMode(mode, getColorLookPromptHint, getColorLookTerm)(asStr(data.colorLook)))\n\n // build*Hints in music-* / voice-* / mood / person / etc. compose\n // preText/postText internally — bypass the wrapper to avoid double-\n // composition.\n case \"music-genre\":\n return buildMusicGenreHints((data ?? {}) as Parameters<typeof buildMusicGenreHints>[0], mode)\n case \"music-mood\":\n return buildMusicMoodHints((data ?? {}) as Parameters<typeof buildMusicMoodHints>[0], mode)\n case \"instrumentation\":\n return buildInstrumentationHints((data ?? {}) as Parameters<typeof buildInstrumentationHints>[0], mode)\n case \"voice-character\":\n return buildVoiceCharacterHints((data ?? {}) as Parameters<typeof buildVoiceCharacterHints>[0], mode)\n case \"voice-delivery\":\n return buildVoiceDeliveryHints((data ?? {}) as Parameters<typeof buildVoiceDeliveryHints>[0], mode)\n case \"person\":\n return buildPersonHints(data, mode).join(\", \")\n case \"mood\":\n return buildMoodHints(data, mode).join(\", \")\n case \"pose\":\n return buildPoseHints(data, mode).join(\", \")\n case \"styling\":\n return buildStylingHints(data, mode).join(\", \")\n\n case \"atmosphere\":\n return withCustomText(data, buildAtmosphereHints(data.atmosphere, mode).join(\", \"))\n case \"action-fx\":\n return withCustomText(data, buildActionFxHints(data.actionFx, mode).join(\", \"))\n case \"style\":\n return withCustomText(data, byMode(mode, getStylePromptHint, getStyleTerm)(asStr(data.style)))\n case \"setting\":\n return withCustomText(data, byMode(mode, getSettingPromptHint, getSettingTerm)(asStr(data.setting)))\n case \"loop-subject\":\n return withCustomText(data, byMode(mode, getLoopSubjectPromptHint, getLoopSubjectTerm)(asStr(data.loopSubject)))\n case \"material\":\n return withCustomText(data, buildMaterialHints(data.material, mode))\n // The four object-entity catalogs are owned by @nodaro/shared and overlaid\n // in shared-catalog-overlay.ts — the ONE module every prompt-text read of\n // them goes through (the subject fold uses it too). Each returns \"\" on a\n // miss, so the entry lookup is the module's job, not this switch's.\n case \"animal\":\n return withCustomText(data, byMode(mode, curatedAnimalPromptHint, curatedAnimalTerm)(asStr(data.animal)))\n case \"vehicle\": {\n const t = curatedVehicleText(asStr(data.vehicle))\n return withCustomText(data, byMode(mode, t.hint, t.term))\n }\n case \"weapon\": {\n const t = curatedWeaponText(asStr(data.weapon))\n return withCustomText(data, byMode(mode, t.hint, t.term))\n }\n case \"furniture\": {\n const t = curatedFurnitureText(asStr(data.furniture))\n return withCustomText(data, byMode(mode, t.hint, t.term))\n }\n case \"photo-genre\":\n return withCustomText(data, byMode(mode, getPhotoGenrePromptHint, getPhotoGenreTerm)(asStr(data.photoGenre)))\n case \"backdrop\":\n return withCustomText(data, byMode(mode, getBackdropPromptHint, getBackdropTerm)(asStr(data.backdrop)))\n case \"held-prop\":\n return withCustomText(data, buildHeldPropHints(data.heldProp, mode).join(\", \"))\n case \"photographer\":\n return withCustomText(data, buildPhotographerHints(data.photographer, mode))\n case \"aesthetic\":\n return withCustomText(data, buildAestheticHints(data.aesthetic, mode))\n case \"era\":\n return withCustomText(data, byMode(mode, getEraPromptHint, getEraTerm)(asStr(data.era)))\n case \"temporal\":\n return withCustomText(data, buildTemporalHints(data, mode).join(\", \"))\n case \"exposure-settings\":\n return withCustomText(data, buildExposureHints(data, mode).join(\", \"))\n case \"render-quality\":\n return withCustomText(data, byMode(mode, getRenderQualityPromptHint, getRenderQualityTerm)(asStr(data.renderQuality)))\n case \"composition-effects\":\n return withCustomText(data, byMode(mode, getCompositionEffectPromptHint, getCompositionEffectTerm)(asStr(data.compositionEffect)))\n case \"post-process-effects\":\n return withCustomText(data, buildPostProcessHints(data.postProcess, mode).join(\", \"))\n // Motion intensity: a Generation Settings node that a video node's\n // Settings input takes as a prompt fragment (video only).\n case \"motion\": {\n const hint = MOTION_INTENSITY_HINTS[asStr(data.motion)]\n return hint ? byMode(mode, hint.full, hint.compact) : \"\"\n }\n\n // Free text authored by the user, not catalog copy — there is no shorter\n // professional form to swap in, so these are identical in both modes.\n case \"tone\":\n return asStr(data.tone).trim()\n case \"style-guide\":\n // The node's whole purpose is injecting its style text into consumer\n // prompts; without this case, {Style Guide} refs stayed as literal\n // brace text and direct wires injected nothing (only fieldMappings\n // worked, via getParameterValue).\n return asStr(data.text).trim()\n case \"text-prompt\":\n return asStr(data.text).trim()\n default:\n return \"\"\n }\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ownEntry, getPromptFields, NODE_PROMPT_CANDIDATE_FIELDS, promptAffixCoreField, nodeSupportsPromptAffixes } from './chunk-N6VMPG5S.js';
|
|
2
|
+
import { IMAGE_TOKEN_PATTERN } from './chunk-GILUVQQJ.js';
|
|
1
3
|
import { realismEmptyHands, NEUTRAL_PERSON, realismViewpoint, REFERENCE_RULES, SCENE_FRAME_RULE, CINEMATIC_LOOK_TAIL, FILM_STILL_PREFIX, REALISM_PASS_INSTRUCTION, REALISM_FINISH, REALISM_SKIN } from './chunk-T64D26P4.js';
|
|
2
|
-
import { T2I_TO_I2I_VARIANT } from '@nodaro/shared/models';
|
|
4
|
+
import { MODELS_WITH_REFERENCE_IMAGE_SUPPORT, imageReferenceLimit, T2I_TO_I2I_VARIANT } from '@nodaro/shared/models';
|
|
3
5
|
|
|
4
6
|
// src/brand-tokens.ts
|
|
5
7
|
var BRAND_PRESET_IDS = [
|
|
@@ -135,7 +137,9 @@ function stylizedSubjectFor(nodeType) {
|
|
|
135
137
|
name: p.name,
|
|
136
138
|
description: p.description,
|
|
137
139
|
group: "Stylized Subject",
|
|
138
|
-
data: { provider: editProviderFor(nodeType), ...p.data }
|
|
140
|
+
data: { provider: editProviderFor(nodeType), ...p.data },
|
|
141
|
+
// Restyles the person in the connected photo ("the reference image").
|
|
142
|
+
minReferences: 1
|
|
139
143
|
}));
|
|
140
144
|
}
|
|
141
145
|
var IMAGE_EDITS = [
|
|
@@ -259,7 +263,9 @@ function editsFor(nodeType) {
|
|
|
259
263
|
name: p.name,
|
|
260
264
|
description: p.description,
|
|
261
265
|
group: "Edits",
|
|
262
|
-
data: { provider: editProviderFor(nodeType), ...p.data }
|
|
266
|
+
data: { provider: editProviderFor(nodeType), ...p.data },
|
|
267
|
+
// Every edit operates on the connected photo.
|
|
268
|
+
minReferences: 1
|
|
263
269
|
}));
|
|
264
270
|
}
|
|
265
271
|
|
|
@@ -268,12 +274,17 @@ var sentences = (...parts) => parts.join(" ");
|
|
|
268
274
|
var REALISM_MODEL = { provider: "gpt-image-2", resolution: "2K" };
|
|
269
275
|
var SKIN_STUDY_MODEL = { provider: "seedream-5-pro", quality: "high" };
|
|
270
276
|
var GENERATE_IMAGE_PRESETS = [
|
|
277
|
+
// `minReferences` marks a preset that works from connected photos its prompt
|
|
278
|
+
// describes in words ("the attached photo"); `{image:N}` tokens count on their
|
|
279
|
+
// own, so a tokenized preset declares nothing. The groups stay all-or-nothing
|
|
280
|
+
// (factory-preset-references.test.ts), so a new preset copies the line along.
|
|
271
281
|
// ── Reference Sheet ──────────────────────────────────────────────────────
|
|
272
282
|
{
|
|
273
283
|
id: "generate-image/character-board",
|
|
274
284
|
name: "Character Board",
|
|
275
285
|
description: "Connect a sharp, well-lit photo \u2192 dense character sheet; reuse it as a reference for consistent shots.",
|
|
276
286
|
group: "Reference Sheet",
|
|
287
|
+
minReferences: 1,
|
|
277
288
|
data: {
|
|
278
289
|
provider: "gpt-image-2",
|
|
279
290
|
aspectRatio: "16:9",
|
|
@@ -288,6 +299,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
288
299
|
name: "Pose Board",
|
|
289
300
|
description: "Connect a sharp photo \u2192 animation-ready pose & expression sheet; reuse it as a reference for consistent action.",
|
|
290
301
|
group: "Reference Sheet",
|
|
302
|
+
minReferences: 1,
|
|
291
303
|
data: {
|
|
292
304
|
provider: "gpt-image-2",
|
|
293
305
|
aspectRatio: "16:9",
|
|
@@ -302,6 +314,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
302
314
|
name: "Location Board",
|
|
303
315
|
description: "Connect a photo \u2192 dense location sheet; reuse it as a reference for consistent scenes.",
|
|
304
316
|
group: "Reference Sheet",
|
|
317
|
+
minReferences: 1,
|
|
305
318
|
data: {
|
|
306
319
|
provider: "gpt-image-2",
|
|
307
320
|
aspectRatio: "16:9",
|
|
@@ -316,6 +329,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
316
329
|
name: "Product Board",
|
|
317
330
|
description: "Connect a photo \u2192 dense product sheet; reuse it as a reference for consistent shots.",
|
|
318
331
|
group: "Reference Sheet",
|
|
332
|
+
minReferences: 1,
|
|
319
333
|
data: {
|
|
320
334
|
provider: "gpt-image-2",
|
|
321
335
|
aspectRatio: "16:9",
|
|
@@ -330,6 +344,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
330
344
|
name: "Outfit Board",
|
|
331
345
|
description: "Connect a photo \u2192 dense wardrobe sheet; reuse it as a reference for consistent looks.",
|
|
332
346
|
group: "Reference Sheet",
|
|
347
|
+
minReferences: 1,
|
|
333
348
|
data: {
|
|
334
349
|
provider: "gpt-image-2",
|
|
335
350
|
aspectRatio: "16:9",
|
|
@@ -344,6 +359,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
344
359
|
name: "Scene Board",
|
|
345
360
|
description: "Connect a photo \u2192 set-dressing & props study; reuse it as a reference for consistent sets.",
|
|
346
361
|
group: "Reference Sheet",
|
|
362
|
+
minReferences: 1,
|
|
347
363
|
data: {
|
|
348
364
|
provider: "gpt-image-2",
|
|
349
365
|
aspectRatio: "16:9",
|
|
@@ -358,6 +374,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
358
374
|
name: "Creature Board",
|
|
359
375
|
description: "Connect a sharp photo \u2192 dense creature sheet; reuse it as a reference for consistent shots.",
|
|
360
376
|
group: "Reference Sheet",
|
|
377
|
+
minReferences: 1,
|
|
361
378
|
data: {
|
|
362
379
|
provider: "gpt-image-2",
|
|
363
380
|
aspectRatio: "16:9",
|
|
@@ -372,6 +389,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
372
389
|
name: "Vehicle Board",
|
|
373
390
|
description: "Connect a photo \u2192 dense vehicle sheet; reuse it as a reference for consistent shots.",
|
|
374
391
|
group: "Reference Sheet",
|
|
392
|
+
minReferences: 1,
|
|
375
393
|
data: {
|
|
376
394
|
provider: "gpt-image-2",
|
|
377
395
|
aspectRatio: "16:9",
|
|
@@ -386,6 +404,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
386
404
|
name: "Food Board",
|
|
387
405
|
description: "Connect a photo \u2192 dense dish sheet; reuse it as a reference for consistent food shots.",
|
|
388
406
|
group: "Reference Sheet",
|
|
407
|
+
minReferences: 1,
|
|
389
408
|
data: {
|
|
390
409
|
provider: "gpt-image-2",
|
|
391
410
|
aspectRatio: "16:9",
|
|
@@ -400,6 +419,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
400
419
|
name: "Mascot Board",
|
|
401
420
|
description: "Connect a mascot image \u2192 brand-character sheet with brand applications; reuse it for a consistent mascot.",
|
|
402
421
|
group: "Reference Sheet",
|
|
422
|
+
minReferences: 1,
|
|
403
423
|
data: {
|
|
404
424
|
provider: "gpt-image-2",
|
|
405
425
|
aspectRatio: "16:9",
|
|
@@ -414,6 +434,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
414
434
|
name: "Pet Board",
|
|
415
435
|
description: "Connect a sharp photo \u2192 dense pet sheet; reuse it as a reference for consistent shots.",
|
|
416
436
|
group: "Reference Sheet",
|
|
437
|
+
minReferences: 1,
|
|
417
438
|
data: {
|
|
418
439
|
provider: "gpt-image-2",
|
|
419
440
|
aspectRatio: "16:9",
|
|
@@ -428,6 +449,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
428
449
|
name: "Skin Detail Sheet",
|
|
429
450
|
description: "Connect a sharp face photo \u2192 a six-panel skin reference.",
|
|
430
451
|
group: "Reference Sheet",
|
|
452
|
+
minReferences: 1,
|
|
431
453
|
data: {
|
|
432
454
|
...SKIN_STUDY_MODEL,
|
|
433
455
|
aspectRatio: "3:2",
|
|
@@ -450,6 +472,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
450
472
|
name: "Character Reference Grid",
|
|
451
473
|
description: "Connect a photo \u2192 clean 4-angle identity grid (no decorations) \u2014 the strongest consistency anchor.",
|
|
452
474
|
group: "Cast & Consistency",
|
|
475
|
+
minReferences: 1,
|
|
453
476
|
data: {
|
|
454
477
|
provider: "gpt-image-2",
|
|
455
478
|
aspectRatio: "3:4",
|
|
@@ -464,6 +487,8 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
464
487
|
name: "Cast Mega Grid",
|
|
465
488
|
description: "Connect 2\u20134 character refs \u2192 one labeled cast sheet; then reference cast members by name in scenes.",
|
|
466
489
|
group: "Cast & Consistency",
|
|
490
|
+
// A cast sheet is two characters or more ("Connect 2–4 character refs").
|
|
491
|
+
minReferences: 2,
|
|
467
492
|
data: {
|
|
468
493
|
provider: "gpt-image-2",
|
|
469
494
|
aspectRatio: "3:4",
|
|
@@ -477,6 +502,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
477
502
|
name: "Cast Scene (by name)",
|
|
478
503
|
description: "Connect a cast grid \u2192 stage a scene naming the characters; never re-describe their looks.",
|
|
479
504
|
group: "Cast & Consistency",
|
|
505
|
+
minReferences: 1,
|
|
480
506
|
data: {
|
|
481
507
|
provider: "gpt-image-2",
|
|
482
508
|
aspectRatio: "16:9",
|
|
@@ -491,6 +517,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
491
517
|
name: "Label Elements",
|
|
492
518
|
description: "Step 1 \xB7 connect a photo \u2192 the same image with a numbered label on each changeable element.",
|
|
493
519
|
group: "Edit by Name",
|
|
520
|
+
minReferences: 1,
|
|
494
521
|
data: {
|
|
495
522
|
provider: "gpt-image-2",
|
|
496
523
|
quality: "high",
|
|
@@ -503,6 +530,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
503
530
|
name: "Apply Named Edit",
|
|
504
531
|
description: 'Step 2 \xB7 connect the labeled sheet \u2192 type your change in the prompt (e.g. change "drink 1" to blue); the labels are removed from the result.',
|
|
505
532
|
group: "Edit by Name",
|
|
533
|
+
minReferences: 1,
|
|
506
534
|
data: {
|
|
507
535
|
provider: "gpt-image-2",
|
|
508
536
|
quality: "high",
|
|
@@ -1711,6 +1739,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
1711
1739
|
name: "Five Ages (Timeless Soul)",
|
|
1712
1740
|
description: "One person at 5 ages, studio line-up. Needs a reference photo.",
|
|
1713
1741
|
group: "Portrait Transformations",
|
|
1742
|
+
minReferences: 1,
|
|
1714
1743
|
data: {
|
|
1715
1744
|
provider: "gpt-image-2",
|
|
1716
1745
|
aspectRatio: "3:4",
|
|
@@ -1723,6 +1752,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
1723
1752
|
name: "Three-Age Triptych",
|
|
1724
1753
|
description: "Same person at 3 ages (~10 / 40 / 75). Needs a reference photo.",
|
|
1725
1754
|
group: "Portrait Transformations",
|
|
1755
|
+
minReferences: 1,
|
|
1726
1756
|
data: {
|
|
1727
1757
|
provider: "gpt-image-2",
|
|
1728
1758
|
aspectRatio: "3:4",
|
|
@@ -1735,6 +1765,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
1735
1765
|
name: "Five Ages \u2014 B&W",
|
|
1736
1766
|
description: "Monochrome age line-up. Needs a reference photo.",
|
|
1737
1767
|
group: "Portrait Transformations",
|
|
1768
|
+
minReferences: 1,
|
|
1738
1769
|
data: {
|
|
1739
1770
|
provider: "gpt-image-2",
|
|
1740
1771
|
aspectRatio: "3:4",
|
|
@@ -1747,6 +1778,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
1747
1778
|
name: "Decade Timeline",
|
|
1748
1779
|
description: "Same person across the '80s\u20132020s. Needs a reference photo.",
|
|
1749
1780
|
group: "Portrait Transformations",
|
|
1781
|
+
minReferences: 1,
|
|
1750
1782
|
data: {
|
|
1751
1783
|
provider: "gpt-image-2",
|
|
1752
1784
|
aspectRatio: "3:4",
|
|
@@ -1759,6 +1791,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
1759
1791
|
name: "Four Seasons",
|
|
1760
1792
|
description: "Same person in spring / summer / autumn / winter. Needs a reference photo.",
|
|
1761
1793
|
group: "Portrait Transformations",
|
|
1794
|
+
minReferences: 1,
|
|
1762
1795
|
data: {
|
|
1763
1796
|
provider: "gpt-image-2",
|
|
1764
1797
|
aspectRatio: "3:4",
|
|
@@ -1771,6 +1804,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
1771
1804
|
name: "Times of Day",
|
|
1772
1805
|
description: "Same person at dawn / midday / golden hour / night. Needs a reference photo.",
|
|
1773
1806
|
group: "Portrait Transformations",
|
|
1807
|
+
minReferences: 1,
|
|
1774
1808
|
data: {
|
|
1775
1809
|
provider: "gpt-image-2",
|
|
1776
1810
|
aspectRatio: "3:4",
|
|
@@ -1783,6 +1817,7 @@ var GENERATE_IMAGE_PRESETS = [
|
|
|
1783
1817
|
name: "Sports Jersey Portrait",
|
|
1784
1818
|
description: "You in an oversized team jersey, studio editorial. Needs a reference photo.",
|
|
1785
1819
|
group: "Portrait Transformations",
|
|
1820
|
+
minReferences: 1,
|
|
1786
1821
|
data: {
|
|
1787
1822
|
provider: "nano-banana-2-1",
|
|
1788
1823
|
aspectRatio: "4:5",
|
|
@@ -5114,6 +5149,64 @@ function groupFactoryPresets(presets) {
|
|
|
5114
5149
|
}
|
|
5115
5150
|
return buckets;
|
|
5116
5151
|
}
|
|
5152
|
+
var MAX_PRESET_REFERENCES = Math.max(
|
|
5153
|
+
1,
|
|
5154
|
+
...[...MODELS_WITH_REFERENCE_IMAGE_SUPPORT].map((provider) => imageReferenceLimit(provider))
|
|
5155
|
+
);
|
|
5156
|
+
function promptFieldsOf(nodeType) {
|
|
5157
|
+
const spec = getPromptFields(nodeType);
|
|
5158
|
+
const candidates = ownEntry(NODE_PROMPT_CANDIDATE_FIELDS, nodeType) ?? [];
|
|
5159
|
+
if (!spec && candidates.length === 0) return [];
|
|
5160
|
+
const fields = new Set(candidates);
|
|
5161
|
+
if (spec) {
|
|
5162
|
+
fields.add(spec.prompt);
|
|
5163
|
+
if (spec.negative) fields.add(spec.negative);
|
|
5164
|
+
}
|
|
5165
|
+
const core = promptAffixCoreField(nodeType);
|
|
5166
|
+
if (core) fields.add(core);
|
|
5167
|
+
if (nodeSupportsPromptAffixes(nodeType)) {
|
|
5168
|
+
fields.add("promptPrefix");
|
|
5169
|
+
fields.add("promptSuffix");
|
|
5170
|
+
}
|
|
5171
|
+
return [...fields];
|
|
5172
|
+
}
|
|
5173
|
+
function highestImageToken(text) {
|
|
5174
|
+
let highest = 0;
|
|
5175
|
+
for (const match of text.matchAll(IMAGE_TOKEN_PATTERN)) {
|
|
5176
|
+
const n = Number.parseInt(match[1] ?? "", 10);
|
|
5177
|
+
if (Number.isInteger(n) && n > highest) highest = n;
|
|
5178
|
+
}
|
|
5179
|
+
return highest;
|
|
5180
|
+
}
|
|
5181
|
+
function presetMinReferences(nodeType, data, declared) {
|
|
5182
|
+
let count = typeof declared === "number" && Number.isInteger(declared) && declared > 0 ? declared : 0;
|
|
5183
|
+
for (const field of promptFieldsOf(nodeType)) {
|
|
5184
|
+
const value = data[field];
|
|
5185
|
+
if (typeof value === "string") count = Math.max(count, highestImageToken(value));
|
|
5186
|
+
}
|
|
5187
|
+
return Math.min(count, MAX_PRESET_REFERENCES);
|
|
5188
|
+
}
|
|
5189
|
+
|
|
5190
|
+
// src/factory-presets/preview-files.generated.ts
|
|
5191
|
+
var FACTORY_PRESET_PREVIEW_FILES = {};
|
|
5192
|
+
|
|
5193
|
+
// src/factory-presets/previews.ts
|
|
5194
|
+
var PRESET_PREVIEW_PATH = "/preset-previews/";
|
|
5195
|
+
function originOf(baseUrl) {
|
|
5196
|
+
try {
|
|
5197
|
+
const url = new URL(baseUrl);
|
|
5198
|
+
if (url.protocol !== "https:" && url.protocol !== "http:") return void 0;
|
|
5199
|
+
return url.origin + url.pathname.replace(/\/+$/, "");
|
|
5200
|
+
} catch {
|
|
5201
|
+
return void 0;
|
|
5202
|
+
}
|
|
5203
|
+
}
|
|
5204
|
+
function factoryPresetPreviewUrl(presetId, baseUrl, files = FACTORY_PRESET_PREVIEW_FILES) {
|
|
5205
|
+
const file = Object.prototype.hasOwnProperty.call(files, presetId) ? files[presetId] : void 0;
|
|
5206
|
+
if (!file) return null;
|
|
5207
|
+
const origin = originOf(baseUrl);
|
|
5208
|
+
return origin ? `${origin}${PRESET_PREVIEW_PATH}${file}` : null;
|
|
5209
|
+
}
|
|
5117
5210
|
|
|
5118
5211
|
// src/factory-presets/index.ts
|
|
5119
5212
|
function forModifyImage(p) {
|
|
@@ -5145,7 +5238,7 @@ var FACTORY_PRESETS = {
|
|
|
5145
5238
|
"lottie-overlay": LOTTIE_OVERLAY_PRESETS
|
|
5146
5239
|
};
|
|
5147
5240
|
function getFactoryPresets(nodeType) {
|
|
5148
|
-
return FACTORY_PRESETS
|
|
5241
|
+
return ownEntry(FACTORY_PRESETS, nodeType) ?? [];
|
|
5149
5242
|
}
|
|
5150
5243
|
|
|
5151
5244
|
// src/caption-treatments.ts
|
|
@@ -5523,6 +5616,6 @@ function getFactorySnippets(target, media) {
|
|
|
5523
5616
|
);
|
|
5524
5617
|
}
|
|
5525
5618
|
|
|
5526
|
-
export { BODY_CAPTIONS_PRESET_ID, BRAND_PRESETS, BRAND_PRESET_IDS, BRAND_PRESET_META, CAPTION_LEVERS_BY_LANGUAGE, CAPTION_SEGMENT_LEVER_KEYS, FACTORY_PRESETS, FACTORY_SNIPPETS, HOOK_PLATE_PRESET_ID, OBJECT_ANGLE_PRESETS, OBJECT_ANGLE_PROMPTS, OBJECT_ASSET_PRESETS, OBJECT_ASSET_PROMPTS, OBJECT_MATERIAL_PRESETS, OBJECT_MATERIAL_PROMPTS, OBJECT_VARIATION_PRESETS, OBJECT_VARIATION_PROMPTS, SNIPPET_MEDIA_VALUES, STYLE_PRESETS, getFactoryPresets, getFactorySnippets, getStylePreset, groupFactoryPresets, hookPlateCaptionSegments, resolveBrandInput };
|
|
5527
|
-
//# sourceMappingURL=chunk-
|
|
5528
|
-
//# sourceMappingURL=chunk-
|
|
5619
|
+
export { BODY_CAPTIONS_PRESET_ID, BRAND_PRESETS, BRAND_PRESET_IDS, BRAND_PRESET_META, CAPTION_LEVERS_BY_LANGUAGE, CAPTION_SEGMENT_LEVER_KEYS, FACTORY_PRESETS, FACTORY_PRESET_PREVIEW_FILES, FACTORY_SNIPPETS, HOOK_PLATE_PRESET_ID, MAX_PRESET_REFERENCES, OBJECT_ANGLE_PRESETS, OBJECT_ANGLE_PROMPTS, OBJECT_ASSET_PRESETS, OBJECT_ASSET_PROMPTS, OBJECT_MATERIAL_PRESETS, OBJECT_MATERIAL_PROMPTS, OBJECT_VARIATION_PRESETS, OBJECT_VARIATION_PROMPTS, PRESET_PREVIEW_PATH, SNIPPET_MEDIA_VALUES, STYLE_PRESETS, factoryPresetPreviewUrl, getFactoryPresets, getFactorySnippets, getStylePreset, groupFactoryPresets, hookPlateCaptionSegments, presetMinReferences, resolveBrandInput };
|
|
5620
|
+
//# sourceMappingURL=chunk-RB2F5JQF.js.map
|
|
5621
|
+
//# sourceMappingURL=chunk-RB2F5JQF.js.map
|