@nodaro/shared 3.54.0 → 3.54.1

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.
Files changed (55) hide show
  1. package/dist/{chunk-NEIWY6CC.cjs → chunk-6HUWQLF2.cjs} +6 -6
  2. package/dist/{chunk-NEIWY6CC.cjs.map → chunk-6HUWQLF2.cjs.map} +1 -1
  3. package/dist/{chunk-ND3IE3IB.cjs → chunk-G7IUQKRU.cjs} +17 -17
  4. package/dist/{chunk-ND3IE3IB.cjs.map → chunk-G7IUQKRU.cjs.map} +1 -1
  5. package/dist/{chunk-IB5B3EBD.js → chunk-JCNTNAZP.js} +13 -7
  6. package/dist/chunk-JCNTNAZP.js.map +1 -0
  7. package/dist/{chunk-6F6GGX2W.cjs → chunk-M7LU4NTI.cjs} +3 -2
  8. package/dist/chunk-M7LU4NTI.cjs.map +1 -0
  9. package/dist/{chunk-6UR5UE5G.js → chunk-MCIBQ5BF.js} +3 -3
  10. package/dist/{chunk-6UR5UE5G.js.map → chunk-MCIBQ5BF.js.map} +1 -1
  11. package/dist/{chunk-C4R7BTBQ.js → chunk-TADEEG5E.js} +3 -2
  12. package/dist/chunk-TADEEG5E.js.map +1 -0
  13. package/dist/{chunk-ADWIAQQS.js → chunk-UWMXMLMV.js} +3 -3
  14. package/dist/{chunk-ADWIAQQS.js.map → chunk-UWMXMLMV.js.map} +1 -1
  15. package/dist/{chunk-3GMTGX3D.cjs → chunk-WVACGZYV.cjs} +4 -4
  16. package/dist/{chunk-3GMTGX3D.cjs.map → chunk-WVACGZYV.cjs.map} +1 -1
  17. package/dist/{chunk-ANMCMSGR.cjs → chunk-YTXP4VHD.cjs} +13 -7
  18. package/dist/chunk-YTXP4VHD.cjs.map +1 -0
  19. package/dist/{chunk-NMX6HQC3.js → chunk-ZAK276QF.js} +3 -3
  20. package/dist/{chunk-NMX6HQC3.js.map → chunk-ZAK276QF.js.map} +1 -1
  21. package/dist/entries/apps.cjs +38 -38
  22. package/dist/entries/apps.js +3 -3
  23. package/dist/entries/i18n.cjs +11 -11
  24. package/dist/entries/i18n.d.cts +5 -4
  25. package/dist/entries/i18n.d.ts +5 -4
  26. package/dist/entries/i18n.js +1 -1
  27. package/dist/entries/nodes.cjs +199 -199
  28. package/dist/entries/nodes.js +3 -3
  29. package/dist/entries/video.cjs +24 -24
  30. package/dist/entries/video.d.cts +11 -10
  31. package/dist/entries/video.d.ts +11 -10
  32. package/dist/entries/video.js +1 -1
  33. package/dist/index.cjs +269 -269
  34. package/dist/index.js +5 -5
  35. package/package.json +1 -1
  36. package/src/__tests__/entry-matches-query.test.ts +34 -0
  37. package/src/__tests__/video-link-needs.test.ts +23 -4
  38. package/src/__tests__/video-link.test.ts +1 -1
  39. package/src/i18n/index.ts +6 -4
  40. package/src/i18n/style.ar.ts +1 -1
  41. package/src/i18n/style.de.ts +1 -1
  42. package/src/i18n/style.es.ts +1 -1
  43. package/src/i18n/style.fr.ts +1 -1
  44. package/src/i18n/style.he.ts +1 -1
  45. package/src/i18n/style.hi.ts +1 -1
  46. package/src/i18n/style.ja.ts +1 -1
  47. package/src/i18n/style.ko.ts +1 -1
  48. package/src/i18n/style.pt-BR.ts +1 -1
  49. package/src/i18n/style.ru.ts +1 -1
  50. package/src/i18n/style.zh-CN.ts +1 -1
  51. package/src/video-link.ts +35 -15
  52. package/dist/chunk-6F6GGX2W.cjs.map +0 -1
  53. package/dist/chunk-ANMCMSGR.cjs.map +0 -1
  54. package/dist/chunk-C4R7BTBQ.js.map +0 -1
  55. package/dist/chunk-IB5B3EBD.js.map +0 -1
@@ -85,6 +85,7 @@ function resolveDescription(catalog, id, englishDescription, locale) {
85
85
  function entryMatchesQuery(catalog, id, englishLabel, englishDescription, locale, query) {
86
86
  const q = query.trim().toLowerCase();
87
87
  if (!q) return true;
88
+ if (id.toLowerCase().includes(q)) return true;
88
89
  if (englishLabel.toLowerCase().includes(q)) return true;
89
90
  if (englishDescription.toLowerCase().includes(q)) return true;
90
91
  if (locale === "en") return false;
@@ -119,5 +120,5 @@ async function loadLocaleCatalog(catalog, locale) {
119
120
  }
120
121
 
121
122
  export { LANGUAGES, NON_EN_LOCALE_IDS, ensureLocaleCatalogLoaded, entryMatchesQuery, getLocaleDirection, registerCatalogSidecars, registerSidecarLoaders, resetCatalogSidecars, resolveDescription, resolveLabel };
122
- //# sourceMappingURL=chunk-C4R7BTBQ.js.map
123
- //# sourceMappingURL=chunk-C4R7BTBQ.js.map
123
+ //# sourceMappingURL=chunk-TADEEG5E.js.map
124
+ //# sourceMappingURL=chunk-TADEEG5E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/i18n/types.ts","../src/i18n/index.ts"],"names":[],"mappings":";AA6DA,IAAM,cAAA,GAAiB;AAAA,EACrB,EAAE,EAAA,EAAI,IAAA,EAAS,WAAA,EAAa,SAAA,EAAwB,YAAY,SAAA,EAAmB,SAAA,EAAW,IAAA,EAAO,GAAA,EAAK,KAAA,EAAM;AAAA,EAChH,EAAE,EAAA,EAAI,IAAA,EAAS,WAAA,EAAa,SAAA,EAAwB,YAAY,YAAA,EAAmB,SAAA,EAAW,IAAA,EAAO,GAAA,EAAK,KAAA,EAAM;AAAA,EAChH,EAAE,EAAA,EAAI,IAAA,EAAS,WAAA,EAAa,QAAA,EAAwB,YAAY,aAAA,EAAmB,SAAA,EAAW,IAAA,EAAO,GAAA,EAAK,KAAA,EAAM;AAAA,EAChH,EAAE,EAAA,EAAI,IAAA,EAAS,WAAA,EAAa,QAAA,EAAwB,YAAY,SAAA,EAAmB,SAAA,EAAW,IAAA,EAAO,GAAA,EAAK,KAAA,EAAM;AAAA,EAChH,EAAE,EAAA,EAAI,OAAA,EAAS,WAAA,EAAa,qBAAA,EAAwB,YAAY,cAAA,EAAmB,SAAA,EAAW,IAAA,EAAO,GAAA,EAAK,KAAA,EAAM;AAAA,EAChH,EAAE,EAAA,EAAI,IAAA,EAAS,WAAA,EAAa,SAAA,EAAwB,YAAY,4CAAA,EAAmB,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for parameter-node pickers.\n *\n * Architecture:\n * - English is the canonical source — every catalog entry has its `label` and\n * `description` in English in the catalog file itself.\n * - Non-English translations live in sidecar files under\n * `packages/shared/src/i18n/<catalog>.<locale>.ts`.\n * - Each sidecar exports a `Record<id, LocalizedEntry>` keyed by entry id.\n * - Lazy-loaded per locale via dynamic import so users only download languages\n * they actually use.\n *\n * Translation rules (see picker-i18n design doc):\n * - `id` and `promptHint` are NEVER translated.\n * - `label` is translated when it's a common noun/adjective (e.g. \"Smoky Eye\"\n * → \"Ojo Ahumado\"). Proper names, brand names, model numbers, technical\n * units, and Latin/Italian/Japanese cinematography jargon stay in their\n * canonical form (e.g. Tim Walker, Sony A7III, chiaroscuro, anamorphic,\n * Y2K, ukiyo-e).\n * - `description` is translated freely, with proper nouns preserved inside.\n *\n * Search rule: pickers filter on the union of current-locale + English text,\n * so a French user typing \"soie\" finds \"Silk\" AND a French user typing \"silk\"\n * still finds it.\n */\n\n/** Canonical language code (BCP-47 or simplified two-letter). */\nexport type LocaleId =\n | \"en\"\n | \"es\"\n | \"fr\"\n | \"de\"\n | \"pt-BR\"\n | \"ru\"\n | \"hi\"\n | \"ja\"\n | \"ko\"\n | \"zh-CN\"\n | \"he\"\n | \"ar\"\n\n/** Reading direction. RTL languages need `dir=\"rtl\"` on the picker container. */\nexport type LocaleDirection = \"ltr\" | \"rtl\"\n\nexport interface LanguageDefinition {\n readonly id: LocaleId\n /** English name shown in language pickers when current locale is English. */\n readonly englishName: string\n /** Native name shown to native speakers (in their own script). */\n readonly nativeName: string\n /** Two-letter or short code displayed inside the small locale chip. */\n readonly shortCode: string\n /** Reading direction. */\n readonly dir: LocaleDirection\n}\n\n/**\n * Master language registry. Order = display order in the language picker\n * dropdown. English first as canonical default, then mainstream LTR\n * languages, then RTL languages last.\n */\nconst LANGUAGE_TABLE = [\n { id: \"en\", englishName: \"English\", nativeName: \"English\", shortCode: \"EN\", dir: \"ltr\" },\n { id: \"es\", englishName: \"Spanish\", nativeName: \"Español\", shortCode: \"ES\", dir: \"ltr\" },\n { id: \"fr\", englishName: \"French\", nativeName: \"Français\", shortCode: \"FR\", dir: \"ltr\" },\n { id: \"de\", englishName: \"German\", nativeName: \"Deutsch\", shortCode: \"DE\", dir: \"ltr\" },\n { id: \"pt-BR\", englishName: \"Portuguese (Brazil)\", nativeName: \"Português\", shortCode: \"PT\", dir: \"ltr\" },\n { id: \"ru\", englishName: \"Russian\", nativeName: \"Русский\", shortCode: \"RU\", dir: \"ltr\" },\n { id: \"hi\", englishName: \"Hindi\", nativeName: \"हिन्दी\", shortCode: \"HI\", dir: \"ltr\" },\n { id: \"ja\", englishName: \"Japanese\", nativeName: \"日本語\", shortCode: \"JA\", dir: \"ltr\" },\n { id: \"ko\", englishName: \"Korean\", nativeName: \"한국어\", shortCode: \"KO\", dir: \"ltr\" },\n { id: \"zh-CN\", englishName: \"Chinese (Simplified)\", nativeName: \"简体中文\", shortCode: \"ZH\", dir: \"ltr\" },\n { id: \"he\", englishName: \"Hebrew\", nativeName: \"עברית\", shortCode: \"HE\", dir: \"rtl\" },\n { id: \"ar\", englishName: \"Arabic\", nativeName: \"العربية\", shortCode: \"AR\", dir: \"rtl\" },\n] as const satisfies ReadonlyArray<LanguageDefinition>\n\nexport const LANGUAGES: ReadonlyArray<LanguageDefinition> = LANGUAGE_TABLE\n\n// Compile-time: the registry's ids are exactly the LocaleId union. `satisfies`\n// above rejects an id that is not a LocaleId; this rejects a LocaleId with no\n// LANGUAGES entry (the error names the missing ids). Types only: nothing is\n// emitted or exported.\ntype LocaleIdsWithoutALanguage = Exclude<LocaleId, (typeof LANGUAGE_TABLE)[number][\"id\"]>\ntype MustBeNever<T extends never> = T\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype EveryLocaleIdHasALanguage = MustBeNever<LocaleIdsWithoutALanguage>\n\nexport const LOCALE_IDS: ReadonlyArray<LocaleId> = LANGUAGES.map((l) => l.id)\nexport const NON_EN_LOCALE_IDS: ReadonlyArray<Exclude<LocaleId, \"en\">> = LANGUAGES\n .filter((l) => l.id !== \"en\")\n .map((l) => l.id) as ReadonlyArray<Exclude<LocaleId, \"en\">>\n\nconst languageById = new Map<LocaleId, LanguageDefinition>(LANGUAGES.map((l) => [l.id, l]))\n\nexport function getLanguage(id: string | undefined | null): LanguageDefinition | undefined {\n if (!id) return undefined\n return languageById.get(id as LocaleId)\n}\n\nexport function getLocaleDirection(id: string | undefined | null): LocaleDirection {\n return getLanguage(id)?.dir ?? \"ltr\"\n}\n\nexport function isRTL(id: string | undefined | null): boolean {\n return getLocaleDirection(id) === \"rtl\"\n}\n\n/**\n * A single localized entry. Either or both fields may be missing — the\n * resolver falls back to the canonical English `label` / `description` from\n * the catalog when a field is absent.\n */\nexport interface LocalizedEntry {\n readonly label?: string\n readonly description?: string\n}\n\n/** Map shape exported by every sidecar file (`<catalog>.<locale>.ts`). */\nexport type LocaleCatalogMap = Readonly<Record<string, LocalizedEntry>>\n\n/**\n * The catalogs that have i18n sidecar files. Each name corresponds to a\n * shared catalog file (e.g. \"mood\" → `packages/shared/src/mood.ts`).\n */\nexport const I18N_CATALOGS = [\n \"action-fx\",\n \"aesthetic\",\n \"animals\",\n \"atmosphere\",\n \"backdrop\",\n \"camera-format\",\n \"camera-motions\",\n \"character-fx\",\n \"character-motion\",\n \"color-look\",\n \"composition-effects\",\n \"era\",\n \"exposure-settings\",\n \"framing\",\n \"furniture\",\n \"held-prop\",\n \"instrumentation\",\n \"lens\",\n \"lighting\",\n \"loop-subject\",\n \"materials\",\n \"mood\",\n \"music-genre\",\n \"music-mood\",\n \"person\",\n \"photo-genre\",\n \"photographer\",\n \"pose\",\n \"post-process-effects\",\n \"render-quality\",\n \"seasons\",\n \"setting\",\n \"style\",\n \"styling\",\n \"temporal\",\n \"transitions\",\n \"vehicles\",\n \"voice-character\",\n \"voice-delivery\",\n \"weapons\",\n] as const\n\nexport type I18nCatalogId = (typeof I18N_CATALOGS)[number]\n","/**\n * i18n resolver + lazy loader for parameter-node picker labels/descriptions.\n *\n * Usage from a picker component:\n *\n * ```ts\n * const locale = useUserLocale() // current user-selected locale\n * await ensureLocaleCatalogLoaded(\"styling\", locale) // call once per (catalog, locale), cached\n * const localized = getLocalizedEntry(\"styling\", entry.id, locale)\n * const label = localized?.label ?? entry.label // fallback to canonical English\n * const description = localized?.description ?? entry.description\n * ```\n *\n * For search filtering, use `entryMatchesQuery(entry, locale, query)` which\n * filters across the entry's id, the canonical English text AND the localized text.\n */\n\nimport type { I18nCatalogId, LocaleCatalogMap, LocaleId, LocalizedEntry } from \"./types.js\"\n\nexport * from \"./types.js\"\n\n/**\n * In-memory cache of loaded locale catalogs. Key = `<catalog>:<locale>`.\n * `undefined` = never loaded; `null` = loaded but missing/empty.\n */\nconst cache = new Map<string, LocaleCatalogMap | null>()\nconst inflight = new Map<string, Promise<LocaleCatalogMap | null>>()\n\nfunction cacheKey(catalog: I18nCatalogId, locale: LocaleId): string {\n return `${catalog}:${locale}`\n}\n\n/**\n * Pack-sidecar overlay: localized strings contributed by registered catalog\n * packs (e.g. an extension pack's `sidecars.he`), keyed `<catalog>:<locale>`.\n * Consulted by `getLocalizedEntry` when the file sidecar lacks an id. Empty on\n * mainline. Populated by `@nodaro/prompts` at pack registration — the content\n * (the translated strings) lives in the pack (the deployment overlay), never\n * in this Apache package.\n */\nconst packSidecars = new Map<string, LocaleCatalogMap>()\n\nexport function registerCatalogSidecars(\n catalog: string,\n sidecars: Partial<Record<LocaleId, LocaleCatalogMap>> | undefined,\n): void {\n if (!sidecars) return\n for (const locale of Object.keys(sidecars) as LocaleId[]) {\n const map = sidecars[locale]\n if (!map) continue\n const key = `${catalog}:${locale}`\n packSidecars.set(key, { ...(packSidecars.get(key) ?? {}), ...map })\n }\n}\n\nexport function resetCatalogSidecars(): void {\n packSidecars.clear()\n}\n\n/**\n * Lazy-load a sidecar catalog. Returns `null` if the locale is `en` (no\n * sidecar — English lives in the canonical catalog file) or if no sidecar\n * file exists for that (catalog, locale) pair.\n *\n * Implementation note: the dynamic import string is constructed so that\n * Vite can statically analyze the glob and code-split each locale into its\n * own chunk. The `/* @vite-ignore *\\/` comment is required because the\n * locale variable defeats Vite's default static analysis; we accept the\n * runtime resolution and rely on the glob-discovery at module init.\n */\nexport async function ensureLocaleCatalogLoaded(\n catalog: I18nCatalogId,\n locale: LocaleId,\n): Promise<LocaleCatalogMap | null> {\n if (locale === \"en\") return null\n const key = cacheKey(catalog, locale)\n const cached = cache.get(key)\n if (cached !== undefined) return cached\n const existing = inflight.get(key)\n if (existing) return existing\n const promise = loadLocaleCatalog(catalog, locale).then(\n (map) => {\n cache.set(key, map)\n inflight.delete(key)\n return map\n },\n (err) => {\n inflight.delete(key)\n // Cache the failure as null so we don't retry forever\n cache.set(key, null)\n // Don't throw — missing sidecars are expected during gradual rollout;\n // the picker just falls back to English.\n console.warn(`[i18n] failed to load ${key}:`, err)\n return null\n },\n )\n inflight.set(key, promise)\n return promise\n}\n\n/**\n * Resolved value lookup. Reads from the in-memory cache; returns `undefined`\n * if the locale's catalog hasn't been loaded yet (caller should await\n * `ensureLocaleCatalogLoaded` first).\n */\nexport function getLocalizedEntry(\n catalog: I18nCatalogId,\n id: string,\n locale: LocaleId,\n): LocalizedEntry | undefined {\n if (locale === \"en\") return undefined\n const key = cacheKey(catalog, locale)\n const fromFile = cache.get(key)?.[id]\n if (fromFile) return fromFile\n // Fall back to a pack-registered sidecar overlay (G10). File sidecars win;\n // pack sidecars cover ids the deployment overlay added. Empty on mainline.\n return packSidecars.get(key)?.[id]\n}\n\n/**\n * Synchronous resolver that returns the best label available right now.\n * Falls back to `englishLabel` when no translation exists (or the locale\n * sidecar isn't loaded yet).\n */\nexport function resolveLabel(\n catalog: I18nCatalogId,\n id: string,\n englishLabel: string,\n locale: LocaleId,\n): string {\n if (locale === \"en\") return englishLabel\n return getLocalizedEntry(catalog, id, locale)?.label ?? englishLabel\n}\n\n/**\n * Synchronous resolver that returns the best description available now.\n * Falls back to `englishDescription` when no translation exists.\n */\nexport function resolveDescription(\n catalog: I18nCatalogId,\n id: string,\n englishDescription: string,\n locale: LocaleId,\n): string {\n if (locale === \"en\") return englishDescription\n return getLocalizedEntry(catalog, id, locale)?.description ?? englishDescription\n}\n\n/**\n * Search predicate: returns true if `query` matches the entry's id, the\n * canonical English label/description, or the localized label/description for\n * the current locale. An id is a stable name no display text has to repeat, so\n * an entry stays findable by it after its display name changes.\n *\n * Empty query always matches.\n */\nexport function entryMatchesQuery(\n catalog: I18nCatalogId,\n id: string,\n englishLabel: string,\n englishDescription: string,\n locale: LocaleId,\n query: string,\n): boolean {\n const q = query.trim().toLowerCase()\n if (!q) return true\n if (id.toLowerCase().includes(q)) return true\n if (englishLabel.toLowerCase().includes(q)) return true\n if (englishDescription.toLowerCase().includes(q)) return true\n if (locale === \"en\") return false\n const localized = getLocalizedEntry(catalog, id, locale)\n if (!localized) return false\n if (localized.label && localized.label.toLowerCase().includes(q)) return true\n if (localized.description && localized.description.toLowerCase().includes(q)) return true\n return false\n}\n\n/**\n * Sidecar loader registry. Populated by the consuming app via\n * `registerSidecarLoaders` at startup.\n *\n * Why externalised: this package is bundled by tsup for npm publish, and\n * `tsup` does NOT expand Vite's `import.meta.glob`. Calling it from inside\n * the bundled module yields an empty loader map at runtime → all pickers\n * silently fall back to English regardless of the user's locale.\n *\n * The frontend (which is processed by Vite) owns the glob — see\n * `frontend/src/lib/i18n-bootstrap.ts`. Backend / Node tests don't need\n * picker translations and simply skip registration.\n *\n * Keys are file paths relative to `packages/shared/src/i18n/`, e.g.\n * `\"./person.ja.ts\"`.\n */\ntype SidecarModule = { default?: LocaleCatalogMap } & Record<string, unknown>\nexport type SidecarLoader = () => Promise<unknown>\n\nlet sidecarLoaders: Record<string, SidecarLoader> = {}\n\n/**\n * Register the map of locale-sidecar loaders. Call once at app startup\n * before any picker mounts.\n *\n * In Vite-processed code:\n * ```ts\n * import { registerSidecarLoaders } from \"@nodaro/shared\"\n * registerSidecarLoaders(\n * import.meta.glob(\"../../packages/shared/src/i18n/*.*.ts\"),\n * )\n * ```\n */\nexport function registerSidecarLoaders(loaders: Record<string, SidecarLoader>): void {\n sidecarLoaders = loaders\n}\n\nasync function loadLocaleCatalog(\n catalog: I18nCatalogId,\n locale: LocaleId,\n): Promise<LocaleCatalogMap | null> {\n if (locale === \"en\") return null\n // Match by suffix so the registry survives different glob roots —\n // frontend's bootstrap globs from a different relative path than\n // this file lives at, so keys look like \".../i18n/person.ja.ts\".\n const suffix = `${catalog}.${locale}.ts`\n const matchKey = Object.keys(sidecarLoaders).find((k) =>\n k.endsWith(`/${suffix}`) || k === `./${suffix}`,\n )\n const loader = matchKey ? sidecarLoaders[matchKey] : undefined\n if (!loader) return null\n try {\n const mod = (await loader()) as SidecarModule\n if (mod.default && typeof mod.default === \"object\") return mod.default\n // Fallback: convention-named export (e.g. STYLING_FR)\n const conventional = `${catalog.toUpperCase().replace(/-/g, \"_\")}_${locale.toUpperCase().replace(/-/g, \"_\")}`\n const named = mod[conventional]\n if (named && typeof named === \"object\") return named as LocaleCatalogMap\n return null\n } catch {\n return null\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { INPUT_FIELD_MAP, canonicalExposedFieldKey } from './chunk-NMX6HQC3.js';
1
+ import { INPUT_FIELD_MAP, canonicalExposedFieldKey } from './chunk-ZAK276QF.js';
2
2
 
3
3
  // src/picker-restrictions.ts
4
4
  var valuesOf = (v) => (Array.isArray(v) ? v : [v]).filter((x) => x !== void 0 && x !== null && x !== "").map(String);
@@ -139,5 +139,5 @@ function templateCategoryStoredValues(category) {
139
139
  }
140
140
 
141
141
  export { DEFAULT_TEMPLATE_CATEGORY, HANDLE_PORT_SEPARATOR, INPUT_FIELD_MAP2 as INPUT_FIELD_MAP, LEGACY_TEMPLATE_CATEGORIES, OAUTH_SCOPES, OUTPUT_FIELD_MAP, RECAST_SEGMENT_PACKS, TEMPLATE_CATEGORIES, applyHandleInputOverride, findRestrictedPickerValue, isHandleInputWired, isTemplateCategory, mergeExposedSettings, normalizeTemplateCategory, parseHandleId, resolveTemplateCategory, templateCategoryStoredValues };
142
- //# sourceMappingURL=chunk-ADWIAQQS.js.map
143
- //# sourceMappingURL=chunk-ADWIAQQS.js.map
142
+ //# sourceMappingURL=chunk-UWMXMLMV.js.map
143
+ //# sourceMappingURL=chunk-UWMXMLMV.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/picker-restrictions.ts","../src/component-types.ts","../src/oauth-scopes.ts","../src/recast-segment-packs.ts","../src/template-categories.ts"],"names":["INPUT_FIELD_MAP"],"mappings":";;;AAYA,IAAM,QAAA,GAAW,CAAC,CAAA,KAAA,CACf,KAAA,CAAM,QAAQ,CAAC,CAAA,GAAI,CAAA,GAAI,CAAC,CAAC,CAAA,EAAG,OAAO,CAAC,CAAA,KAAM,MAAM,MAAA,IAAa,CAAA,KAAM,QAAQ,CAAA,KAAM,EAAE,CAAA,CAAE,GAAA,CAAI,MAAM,CAAA;AAS3F,SAAS,0BAA0B,KAAA,EAIxB;AAChB,EAAA,IAAI,CAAC,KAAA,CAAM,QAAA,IAAY,CAAC,KAAA,CAAM,aAAa,OAAO,IAAA;AAClD,EAAA,KAAA,MAAW,IAAA,IAAQ,MAAM,KAAA,EAAO;AAC9B,IAAA,MAAM,IAAA,GAAO,KAAA,CAAM,QAAA,CAAS,IAAA,CAAK,EAAE,CAAA;AACnC,IAAA,MAAM,SAAA,GAAY,KAAA,CAAM,WAAA,CAAY,IAAA,CAAK,EAAE,CAAA;AAC3C,IAAA,IAAI,CAAC,IAAA,IAAQ,CAAC,SAAA,EAAW;AACzB,IAAA,MAAM,QAA4C,EAAC;AACnD,IAAA,MAAM,MAAM,IAAA,CAAK,IAAA,GAAO,gBAAgB,IAAA,CAAK,IAAI,GAAG,GAAA,GAAM,MAAA;AAC1D,IAAA,IAAI,GAAA,IAAO,IAAA,CAAK,mBAAA,IAAuB,IAAA,CAAK,mBAAA,CAAoB,MAAA,GAAS,CAAA,EAAG,KAAA,CAAM,IAAA,CAAK,CAAC,GAAA,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ACA,kBAAA;AAAA;AAAA,EAEA;AACF;AAKO,IAAM,yBAAA,GAA8C;AAQpD,IAAM,0BAAA,GAAyE;AAAA,EACpF,kBAAA,EAAoB,iBAAA;AAAA,EACpB,kBAAA,EAAoB,WAAA;AAAA,EACpB,aAAA,EAAe,kBAAA;AAAA,EACf,iBAAA,EAAmB,mBAAA;AAAA,EACnB,cAAA,EAAgB,kBAAA;AAAA,EAChB,iBAAA,EAAmB,aAAA;AAAA,EACnB,YAAA,EAAc,aAAA;AAAA,EACd,KAAA,EAAO;AACT;AAEA,IAAM,OAAA,GAAU,IAAI,GAAA,CAAY,mBAAmB,CAAA;AAE5C,SAAS,mBAAmB,KAAA,EAA2C;AAC5E,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,OAAA,CAAQ,IAAI,KAAK,CAAA;AACvD;AAGO,SAAS,wBAAwB,KAAA,EAAgE;AACtG,EAAA,IAAI,KAAA,IAAS,MAAM,OAAO,MAAA;AAC1B,EAAA,IAAI,kBAAA,CAAmB,KAAK,CAAA,EAAG,OAAO,KAAA;AACtC,EAAA,OAAO,2BAA2B,KAAK,CAAA;AACzC;AAGO,SAAS,0BAA0B,KAAA,EAAoD;AAC5F,EAAA,OAAO,uBAAA,CAAwB,KAAK,CAAA,IAAK,yBAAA;AAC3C;AAOO,SAAS,6BAA6B,QAAA,EAAsC;AACjF,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,IAAA,CAAK,0BAA0B,CAAA,CAAE,MAAA,CAAO,CAAC,KAAA,KAAU,0BAAA,CAA2B,KAAK,CAAA,KAAM,QAAQ,CAAA;AACvH,EAAA,OAAO,CAAC,QAAA,EAAU,GAAG,MAAM,CAAA;AAC7B","file":"chunk-ADWIAQQS.js","sourcesContent":["import { canonicalExposedFieldKey } from \"./exposed-field-keys.js\"\nimport { INPUT_FIELD_MAP } from \"./presentation-utils.js\"\n\n/** What an app's picker card may restrict (stored in `presentationSettings.cardMeta[nodeId]`). */\nexport interface PickerCardRestrictions {\n readonly pickerAllowedValues?: readonly string[]\n readonly pickerAllowedValuesByField?: Readonly<Record<string, readonly string[]>>\n}\n\n// Every submitted value is checked, whatever its type — a number or object where a\n// catalog id belongs must be refused, not skipped. An unset / cleared pick (\"\" , null)\n// is no selection and passes (the node falls back to its default).\nconst valuesOf = (v: unknown): string[] =>\n (Array.isArray(v) ? v : [v]).filter((x) => x !== undefined && x !== null && x !== \"\").map(String)\n\n/**\n * The first submitted picker value an app's card restrictions forbid, as the\n * runner's 400 text; null when all pass. Runs on every app run — `run_app`,\n * the SDK and a hand-built body included — so a restriction is never UI-only.\n * A submitted key is read through `canonicalExposedFieldKey`, so a legacy\n * spelling cannot slip past a restriction written against the current field.\n */\nexport function findRestrictedPickerValue(input: {\n readonly cardMeta: Readonly<Record<string, PickerCardRestrictions | undefined>> | undefined\n readonly nodes: ReadonlyArray<{ readonly id: string; readonly type?: string }>\n readonly inputValues: Readonly<Record<string, Readonly<Record<string, unknown>>>> | undefined\n}): string | null {\n if (!input.cardMeta || !input.inputValues) return null\n for (const node of input.nodes) {\n const meta = input.cardMeta[node.id]\n const submitted = input.inputValues[node.id]\n if (!meta || !submitted) continue\n const rules: Array<[string, readonly string[]]> = []\n const rep = node.type ? INPUT_FIELD_MAP[node.type]?.key : undefined\n if (rep && meta.pickerAllowedValues && meta.pickerAllowedValues.length > 0) rules.push([rep, meta.pickerAllowedValues])\n for (const [field, allowed] of Object.entries(meta.pickerAllowedValuesByField ?? {})) {\n if (allowed.length > 0) rules.push([field, allowed])\n }\n for (const [field, allowed] of rules) {\n for (const [key, raw] of Object.entries(submitted)) {\n if (canonicalExposedFieldKey(node.type, key) !== field) continue\n for (const value of valuesOf(raw)) {\n if (!allowed.includes(value)) return `Invalid value for ${field}: ${value}. Allowed: ${allowed.join(\", \")}`\n }\n }\n }\n }\n return null\n}\n","import { INPUT_FIELD_MAP as PRESENTATION_INPUT_MAP } from \"./presentation-utils.js\"\n\nexport interface ComponentHandle {\n id: string\n name: string\n type: \"image\" | \"video\" | \"audio\" | \"text\"\n required: boolean\n mediaPreview?: boolean\n fieldKey: string\n}\n\nexport interface ExposedSetting {\n nodeId: string\n field: string\n label: string\n type: \"select\" | \"text\" | \"number\" | \"toggle\" | \"aspect-ratio\"\n allowedValues?: unknown[]\n /** Full option list with labels for select fields (preferred over allowedValues). */\n options?: Array<{ value: string; label: string }>\n defaultValue: unknown\n /**\n * Set when the setting is one of the node's quick settings (the editor's bottom-bar levers): the node type,\n * so the consuming workflow can render the same control, and the node's own lever values its choices depend\n * on (its model, Draft, …), so the control offers what that model takes. Never prompts or results.\n */\n quick?: {\n nodeType: string\n context?: Record<string, string | number | boolean>\n }\n}\n\nexport interface ComponentMetadata {\n inputs: ComponentHandle[]\n outputs: ComponentHandle[]\n exposedSettings: ExposedSetting[]\n}\n\n/** Maps input node types to their data field key for inputOverrides (derived from presentation-utils) */\nexport const INPUT_FIELD_MAP: Record<string, string> = Object.fromEntries(\n Object.entries(PRESENTATION_INPUT_MAP).map(([k, v]) => [k, v.key]),\n)\n\n/** Separator used in component handle ids that target a specific port on a sub-workflow-input / sub-workflow-output node. */\nexport const HANDLE_PORT_SEPARATOR = \"::\"\n\n/**\n * Split a component handle id of the form `nodeId` or `nodeId::portId`.\n * Returns the literal nodeId when no separator is present.\n */\nexport function parseHandleId(handleId: string): { nodeId: string; portId?: string } {\n const sep = handleId.indexOf(HANDLE_PORT_SEPARATOR)\n if (sep < 0) return { nodeId: handleId }\n const portId = handleId.slice(sep + HANDLE_PORT_SEPARATOR.length)\n return { nodeId: handleId.slice(0, sep), portId: portId || undefined }\n}\n\n/**\n * Apply a value for a component input handle to the inputOverrides map.\n *\n * - Plain handles (id = nodeId) write to `inputOverrides[nodeId][fieldKey]`,\n * which the orchestrator shallow-merges into `node.data` at execution.\n * - Compound handles (id = nodeId::portId) write into\n * `inputOverrides[nodeId].__injectedPortValues[portId]`, the slot that\n * sub-workflow-input nodes read at runtime via output-extractor.\n *\n * Mutates the map in place so multi-port accumulation merges correctly when\n * iterating handles in a loop.\n */\nexport function applyHandleInputOverride(\n inputOverrides: Record<string, Record<string, unknown>>,\n handle: { id: string; fieldKey: string },\n value: unknown,\n): void {\n const { nodeId, portId } = parseHandleId(handle.id)\n if (portId) {\n const existing = (inputOverrides[nodeId]?.__injectedPortValues as Record<string, unknown> | undefined) ?? {}\n inputOverrides[nodeId] = {\n ...inputOverrides[nodeId],\n __injectedPortValues: { ...existing, [portId]: value },\n }\n } else {\n inputOverrides[nodeId] = { ...inputOverrides[nodeId], [handle.fieldKey]: value }\n }\n}\n\n/**\n * Has a value already been recorded for this handle in the inputOverrides map?\n * Used to skip fallback wiring when an upstream connection already supplied\n * the input.\n */\nexport function isHandleInputWired(\n inputOverrides: Record<string, Record<string, unknown>>,\n handle: { id: string; fieldKey: string },\n): boolean {\n const { nodeId, portId } = parseHandleId(handle.id)\n if (portId) {\n const injected = inputOverrides[nodeId]?.__injectedPortValues as Record<string, unknown> | undefined\n return injected?.[portId] !== undefined\n }\n return inputOverrides[nodeId]?.[handle.fieldKey] !== undefined\n}\n\n/** Maps output media types to NodeOutput field keys */\nexport const OUTPUT_FIELD_MAP: Record<string, string> = {\n image: \"imageUrl\",\n video: \"videoUrl\",\n audio: \"audioUrl\",\n text: \"text\",\n}\n\n/**\n * Merge exposed settings into inputOverrides format.\n * exposedSettings is keyed by \"nodeId:field\" -> value on the component node data.\n *\n * Connected inputs (already present in inputOverrides) always take priority\n * over exposed settings for the same node+field combination. This ensures\n * that mandatory upstream wires are never silently overwritten by stale\n * default / user-configured exposed-setting values.\n */\nexport function mergeExposedSettings(\n inputOverrides: Record<string, Record<string, unknown>>,\n exposedSettings: Record<string, unknown>,\n metadata: ComponentMetadata,\n): Record<string, Record<string, unknown>> {\n const merged = { ...inputOverrides }\n for (const setting of metadata.exposedSettings) {\n const key = `${setting.nodeId}:${setting.field}`\n const value = exposedSettings[key]\n if (value !== undefined) {\n // Skip if a connected input already provided this field\n if (merged[setting.nodeId]?.[setting.field] !== undefined) continue\n merged[setting.nodeId] = { ...merged[setting.nodeId], [setting.field]: value }\n }\n }\n return merged\n}\n","/**\n * The OAuth scopes a Nodaro token can carry — part of the public API contract\n * (published in the authorization server's `scopes_supported`, requested by\n * developer apps, typed in `@nodaro/sdk`). The server validates against this\n * list and the SDK types against it, so the two cannot drift.\n *\n * A scope in this list is published and handed to any Dynamic Client\n * Registration client that asks for everything, so add one in the same change\n * that makes something check it (see backend/src/lib/scopes.ts).\n */\nexport const OAUTH_SCOPES = [\n \"workflows:read\",\n \"workflows:write\",\n \"workflows:execute\",\n \"jobs:read\",\n \"assets:read\",\n \"assets:write\",\n \"credits:read\",\n \"apps:read\",\n \"pipelines:read\",\n \"pipelines:execute\",\n \"pipelines:approve\",\n \"presets:read\",\n \"workspaces:read\",\n \"workspaces:write\",\n] as const\n\nexport type OAuthScope = (typeof OAUTH_SCOPES)[number]\n","/**\n * How a recast render packs scenes into parts — the values `segmentSec` takes\n * on `POST /v1/recast`, `/v1/recast/estimate` and `/v1/recast/:id/start`. A\n * name, not seconds, despite the field's name:\n *\n * - `\"scenes-max\"` (Long): whole scenes grouped into as few parts as fit, the\n * fewest seams.\n * - `\"scenes\"` (Short): whole scenes in shorter parts.\n * - `\"max\"`: the longest parts the model allows, not grouped by scene.\n */\nexport const RECAST_SEGMENT_PACKS = [\"max\", \"scenes-max\", \"scenes\"] as const\n\nexport type RecastSegmentPack = (typeof RECAST_SEGMENT_PACKS)[number]\n","/**\n * The use cases a marketplace template is filed under — exactly one each.\n * Shared by the publish/browse routes (the `category` enum), the Templates\n * page (tiles, URL filter, labels) and the publish dialog, so the list can\n * only change in one place. Labels live with the frontend's i18n\n * (`lib/template-categories.ts`), keyed by these values.\n */\nexport const TEMPLATE_CATEGORIES = [\n \"product-imagery\",\n \"static-ads\",\n \"user-generated-content\",\n \"video-ads\",\n \"brand-assets\",\n \"automations\",\n \"campaign-concepts\",\n \"social-creatives\",\n // Workflows an AI agent built through the MCP server, kept whole so every step can be opened and changed.\n \"mcp\",\n] as const\n\nexport type TemplateCategory = (typeof TEMPLATE_CATEGORIES)[number]\n\n/** Where a template with no usable category is filed: the plain \"it is a workflow\" bucket. */\nexport const DEFAULT_TEMPLATE_CATEGORY: TemplateCategory = \"automations\"\n\n/**\n * The categories templates were filed under before September 2026, each\n * read as its new home. Migration 423 rewrites the rows with the same map;\n * this keeps an old link (`?category=video-production`), a cached card and a\n * row the migration has not reached yet resolving in the meantime.\n */\nexport const LEGACY_TEMPLATE_CATEGORIES: Readonly<Record<string, TemplateCategory>> = {\n \"image-generation\": \"product-imagery\",\n \"video-production\": \"video-ads\",\n \"audio-music\": \"social-creatives\",\n \"content-writing\": \"campaign-concepts\",\n \"social-media\": \"social-creatives\",\n \"data-processing\": \"automations\",\n \"multi-step\": \"automations\",\n other: \"automations\",\n}\n\nconst CURRENT = new Set<string>(TEMPLATE_CATEGORIES)\n\nexport function isTemplateCategory(value: unknown): value is TemplateCategory {\n return typeof value === \"string\" && CURRENT.has(value)\n}\n\n/** A current category as is, a legacy one as its new home, anything else as undefined. */\nexport function resolveTemplateCategory(value: string | null | undefined): TemplateCategory | undefined {\n if (value == null) return undefined\n if (isTemplateCategory(value)) return value\n return LEGACY_TEMPLATE_CATEGORIES[value]\n}\n\n/** The category a stored row reads as: resolved, else the default bucket. */\nexport function normalizeTemplateCategory(value: string | null | undefined): TemplateCategory {\n return resolveTemplateCategory(value) ?? DEFAULT_TEMPLATE_CATEGORY\n}\n\n/**\n * Every stored value that reads as `category` — the value itself and the\n * legacy ones that map to it — so a database filter matches rows the\n * migration has not rewritten yet.\n */\nexport function templateCategoryStoredValues(category: TemplateCategory): string[] {\n const legacy = Object.keys(LEGACY_TEMPLATE_CATEGORIES).filter((value) => LEGACY_TEMPLATE_CATEGORIES[value] === category)\n return [category, ...legacy]\n}\n"]}
1
+ {"version":3,"sources":["../src/picker-restrictions.ts","../src/component-types.ts","../src/oauth-scopes.ts","../src/recast-segment-packs.ts","../src/template-categories.ts"],"names":["INPU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AA;AAAA,EACd,KAAA,EAAO;AACT;AAEA,IAAM,OAAA,GAAU,IAAI,GAAA,CAAY,mBAAmB,CAAA;AAE5C,SAAS,mBAAmB,KAAA,EAA2C;AAC5E,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,OAAA,CAAQ,IAAI,KAAK,CAAA;AACvD;AAGO,SAAS,wBAAwB,KAAA,EAAgE;AACtG,EAAA,IAAI,KAAA,IAAS,MAAM,OAAO,MAAA;AAC1B,EAAA,IAAI,kBAAA,CAAmB,KAAK,CAAA,EAAG,OAAO,KAAA;AACtC,EAAA,OAAO,2BAA2B,KAAK,CAAA;AACzC;AAGO,SAAS,0BAA0B,KAAA,EAAoD;AAC5F,EAAA,OAAO,uBAAA,CAAwB,KAAK,CAAA,IAAK,yBAAA;AAC3C;AAOO,SAAS,6BAA6B,QAAA,EAAsC;AACjF,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,IAAA,CAAK,0BAA0B,CAAA,CAAE,MAAA,CAAO,CAAC,KAAA,KAAU,0BAAA,CAA2B,KAAK,CAAA,KAAM,QAAQ,CAAA;AACvH,EAAA,OAAO,CAAC,QAAA,EAAU,GAAG,MAAM,CAAA;AAC7B","file":"chunk-UWMXMLMV.js","sourcesContent":["import { canonicalExposedFieldKey } from \"./exposed-field-keys.js\"\nimport { INPUT_FIELD_MAP } from \"./presentation-utils.js\"\n\n/** What an app's picker card may restrict (stored in `presentationSettings.cardMeta[nodeId]`). */\nexport interface PickerCardRestrictions {\n readonly pickerAllowedValues?: readonly string[]\n readonly pickerAllowedValuesByField?: Readonly<Record<string, readonly string[]>>\n}\n\n// Every submitted value is checked, whatever its type — a number or object where a\n// catalog id belongs must be refused, not skipped. An unset / cleared pick (\"\" , null)\n// is no selection and passes (the node falls back to its default).\nconst valuesOf = (v: unknown): string[] =>\n (Array.isArray(v) ? v : [v]).filter((x) => x !== undefined && x !== null && x !== \"\").map(String)\n\n/**\n * The first submitted picker value an app's card restrictions forbid, as the\n * runner's 400 text; null when all pass. Runs on every app run — `run_app`,\n * the SDK and a hand-built body included — so a restriction is never UI-only.\n * A submitted key is read through `canonicalExposedFieldKey`, so a legacy\n * spelling cannot slip past a restriction written against the current field.\n */\nexport function findRestrictedPickerValue(input: {\n readonly cardMeta: Readonly<Record<string, PickerCardRestrictions | undefined>> | undefined\n readonly nodes: ReadonlyArray<{ readonly id: string; readonly type?: string }>\n readonly inputValues: Readonly<Record<string, Readonly<Record<string, unknown>>>> | undefined\n}): string | null {\n if (!input.cardMeta || !input.inputValues) return null\n for (const node of input.nodes) {\n const meta = input.cardMeta[node.id]\n const submitted = input.inputValues[node.id]\n if (!meta || !submitted) continue\n const rules: Array<[string, readonly string[]]> = []\n const rep = node.type ? INPUT_FIELD_MAP[node.type]?.key : undefined\n if (rep && meta.pickerAllowedValues && meta.pickerAllowedValues.length > 0) rules.push([rep, meta.pickerAllowedValues])\n for (const [field, allowed] of Object.entries(meta.pickerAllowedValuesByField ?? {})) {\n if (allowed.length > 0) rules.push([field, allowed])\n }\n for (const [field, allowed] of rules) {\n for (const [key, raw] of Object.entries(submitted)) {\n if (canonicalExposedFieldKey(node.type, key) !== field) continue\n for (const value of valuesOf(raw)) {\n if (!allowed.includes(value)) return `Invalid value for ${field}: ${value}. Allowed: ${allowed.join(\", \")}`\n }\n }\n }\n }\n return null\n}\n","import { INPUT_FIELD_MAP as PRESENTATION_INPUT_MAP } from \"./presentation-utils.js\"\n\nexport interface ComponentHandle {\n id: string\n name: string\n type: \"image\" | \"video\" | \"audio\" | \"text\"\n required: boolean\n mediaPreview?: boolean\n fieldKey: string\n}\n\nexport interface ExposedSetting {\n nodeId: string\n field: string\n label: string\n type: \"select\" | \"text\" | \"number\" | \"toggle\" | \"aspect-ratio\"\n allowedValues?: unknown[]\n /** Full option list with labels for select fields (preferred over allowedValues). */\n options?: Array<{ value: string; label: string }>\n defaultValue: unknown\n /**\n * Set when the setting is one of the node's quick settings (the editor's bottom-bar levers): the node type,\n * so the consuming workflow can render the same control, and the node's own lever values its choices depend\n * on (its model, Draft, …), so the control offers what that model takes. Never prompts or results.\n */\n quick?: {\n nodeType: string\n context?: Record<string, string | number | boolean>\n }\n}\n\nexport interface ComponentMetadata {\n inputs: ComponentHandle[]\n outputs: ComponentHandle[]\n exposedSettings: ExposedSetting[]\n}\n\n/** Maps input node types to their data field key for inputOverrides (derived from presentation-utils) */\nexport const INPUT_FIELD_MAP: Record<string, string> = Object.fromEntries(\n Object.entries(PRESENTATION_INPUT_MAP).map(([k, v]) => [k, v.key]),\n)\n\n/** Separator used in component handle ids that target a specific port on a sub-workflow-input / sub-workflow-output node. */\nexport const HANDLE_PORT_SEPARATOR = \"::\"\n\n/**\n * Split a component handle id of the form `nodeId` or `nodeId::portId`.\n * Returns the literal nodeId when no separator is present.\n */\nexport function parseHandleId(handleId: string): { nodeId: string; portId?: string } {\n const sep = handleId.indexOf(HANDLE_PORT_SEPARATOR)\n if (sep < 0) return { nodeId: handleId }\n const portId = handleId.slice(sep + HANDLE_PORT_SEPARATOR.length)\n return { nodeId: handleId.slice(0, sep), portId: portId || undefined }\n}\n\n/**\n * Apply a value for a component input handle to the inputOverrides map.\n *\n * - Plain handles (id = nodeId) write to `inputOverrides[nodeId][fieldKey]`,\n * which the orchestrator shallow-merges into `node.data` at execution.\n * - Compound handles (id = nodeId::portId) write into\n * `inputOverrides[nodeId].__injectedPortValues[portId]`, the slot that\n * sub-workflow-input nodes read at runtime via output-extractor.\n *\n * Mutates the map in place so multi-port accumulation merges correctly when\n * iterating handles in a loop.\n */\nexport function applyHandleInputOverride(\n inputOverrides: Record<string, Record<string, unknown>>,\n handle: { id: string; fieldKey: string },\n value: unknown,\n): void {\n const { nodeId, portId } = parseHandleId(handle.id)\n if (portId) {\n const existing = (inputOverrides[nodeId]?.__injectedPortValues as Record<string, unknown> | undefined) ?? {}\n inputOverrides[nodeId] = {\n ...inputOverrides[nodeId],\n __injectedPortValues: { ...existing, [portId]: value },\n }\n } else {\n inputOverrides[nodeId] = { ...inputOverrides[nodeId], [handle.fieldKey]: value }\n }\n}\n\n/**\n * Has a value already been recorded for this handle in the inputOverrides map?\n * Used to skip fallback wiring when an upstream connection already supplied\n * the input.\n */\nexport function isHandleInputWired(\n inputOverrides: Record<string, Record<string, unknown>>,\n handle: { id: string; fieldKey: string },\n): boolean {\n const { nodeId, portId } = parseHandleId(handle.id)\n if (portId) {\n const injected = inputOverrides[nodeId]?.__injectedPortValues as Record<string, unknown> | undefined\n return injected?.[portId] !== undefined\n }\n return inputOverrides[nodeId]?.[handle.fieldKey] !== undefined\n}\n\n/** Maps output media types to NodeOutput field keys */\nexport const OUTPUT_FIELD_MAP: Record<string, string> = {\n image: \"imageUrl\",\n video: \"videoUrl\",\n audio: \"audioUrl\",\n text: \"text\",\n}\n\n/**\n * Merge exposed settings into inputOverrides format.\n * exposedSettings is keyed by \"nodeId:field\" -> value on the component node data.\n *\n * Connected inputs (already present in inputOverrides) always take priority\n * over exposed settings for the same node+field combination. This ensures\n * that mandatory upstream wires are never silently overwritten by stale\n * default / user-configured exposed-setting values.\n */\nexport function mergeExposedSettings(\n inputOverrides: Record<string, Record<string, unknown>>,\n exposedSettings: Record<string, unknown>,\n metadata: ComponentMetadata,\n): Record<string, Record<string, unknown>> {\n const merged = { ...inputOverrides }\n for (const setting of metadata.exposedSettings) {\n const key = `${setting.nodeId}:${setting.field}`\n const value = exposedSettings[key]\n if (value !== undefined) {\n // Skip if a connected input already provided this field\n if (merged[setting.nodeId]?.[setting.field] !== undefined) continue\n merged[setting.nodeId] = { ...merged[setting.nodeId], [setting.field]: value }\n }\n }\n return merged\n}\n","/**\n * The OAuth scopes a Nodaro token can carry — part of the public API contract\n * (published in the authorization server's `scopes_supported`, requested by\n * developer apps, typed in `@nodaro/sdk`). The server validates against this\n * list and the SDK types against it, so the two cannot drift.\n *\n * A scope in this list is published and handed to any Dynamic Client\n * Registration client that asks for everything, so add one in the same change\n * that makes something check it (see backend/src/lib/scopes.ts).\n */\nexport const OAUTH_SCOPES = [\n \"workflows:read\",\n \"workflows:write\",\n \"workflows:execute\",\n \"jobs:read\",\n \"assets:read\",\n \"assets:write\",\n \"credits:read\",\n \"apps:read\",\n \"pipelines:read\",\n \"pipelines:execute\",\n \"pipelines:approve\",\n \"presets:read\",\n \"workspaces:read\",\n \"workspaces:write\",\n] as const\n\nexport type OAuthScope = (typeof OAUTH_SCOPES)[number]\n","/**\n * How a recast render packs scenes into parts — the values `segmentSec` takes\n * on `POST /v1/recast`, `/v1/recast/estimate` and `/v1/recast/:id/start`. A\n * name, not seconds, despite the field's name:\n *\n * - `\"scenes-max\"` (Long): whole scenes grouped into as few parts as fit, the\n * fewest seams.\n * - `\"scenes\"` (Short): whole scenes in shorter parts.\n * - `\"max\"`: the longest parts the model allows, not grouped by scene.\n */\nexport const RECAST_SEGMENT_PACKS = [\"max\", \"scenes-max\", \"scenes\"] as const\n\nexport type RecastSegmentPack = (typeof RECAST_SEGMENT_PACKS)[number]\n","/**\n * The use cases a marketplace template is filed under — exactly one each.\n * Shared by the publish/browse routes (the `category` enum), the Templates\n * page (tiles, URL filter, labels) and the publish dialog, so the list can\n * only change in one place. Labels live with the frontend's i18n\n * (`lib/template-categories.ts`), keyed by these values.\n */\nexport const TEMPLATE_CATEGORIES = [\n \"product-imagery\",\n \"static-ads\",\n \"user-generated-content\",\n \"video-ads\",\n \"brand-assets\",\n \"automations\",\n \"campaign-concepts\",\n \"social-creatives\",\n // Workflows an AI agent built through the MCP server, kept whole so every step can be opened and changed.\n \"mcp\",\n] as const\n\nexport type TemplateCategory = (typeof TEMPLATE_CATEGORIES)[number]\n\n/** Where a template with no usable category is filed: the plain \"it is a workflow\" bucket. */\nexport const DEFAULT_TEMPLATE_CATEGORY: TemplateCategory = \"automations\"\n\n/**\n * The categories templates were filed under before September 2026, each\n * read as its new home. Migration 423 rewrites the rows with the same map;\n * this keeps an old link (`?category=video-production`), a cached card and a\n * row the migration has not reached yet resolving in the meantime.\n */\nexport const LEGACY_TEMPLATE_CATEGORIES: Readonly<Record<string, TemplateCategory>> = {\n \"image-generation\": \"product-imagery\",\n \"video-production\": \"video-ads\",\n \"audio-music\": \"social-creatives\",\n \"content-writing\": \"campaign-concepts\",\n \"social-media\": \"social-creatives\",\n \"data-processing\": \"automations\",\n \"multi-step\": \"automations\",\n other: \"automations\",\n}\n\nconst CURRENT = new Set<string>(TEMPLATE_CATEGORIES)\n\nexport function isTemplateCategory(value: unknown): value is TemplateCategory {\n return typeof value === \"string\" && CURRENT.has(value)\n}\n\n/** A current category as is, a legacy one as its new home, anything else as undefined. */\nexport function resolveTemplateCategory(value: string | null | undefined): TemplateCategory | undefined {\n if (value == null) return undefined\n if (isTemplateCategory(value)) return value\n return LEGACY_TEMPLATE_CATEGORIES[value]\n}\n\n/** The category a stored row reads as: resolved, else the default bucket. */\nexport function normalizeTemplateCategory(value: string | null | undefined): TemplateCategory {\n return resolveTemplateCategory(value) ?? DEFAULT_TEMPLATE_CATEGORY\n}\n\n/**\n * Every stored value that reads as `category` — the value itself and the\n * legacy ones that map to it — so a database filter matches rows the\n * migration has not rewritten yet.\n */\nexport function templateCategoryStoredValues(category: TemplateCategory): string[] {\n const legacy = Object.keys(LEGACY_TEMPLATE_CATEGORIES).filter((value) => LEGACY_TEMPLATE_CATEGORIES[value] === category)\n return [category, ...legacy]\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkC6IQCKJT_cjs = require('./chunk-C6IQCKJT.cjs');
4
- var chunkANMCMSGR_cjs = require('./chunk-ANMCMSGR.cjs');
4
+ var chunkYTXP4VHD_cjs = require('./chunk-YTXP4VHD.cjs');
5
5
  var chunkPONP5J5E_cjs = require('./chunk-PONP5J5E.cjs');
6
6
  var chunkIPCWYKX5_cjs = require('./chunk-IPCWYKX5.cjs');
7
7
 
@@ -714,7 +714,7 @@ var MEDIA_INPUT_FIELD_TYPES = /* @__PURE__ */ new Set([
714
714
  ]);
715
715
  function mergeNodeInputOverrides(nodeType, data, overrides) {
716
716
  const incoming = canonicalizeOverrideKeys(nodeType, overrides);
717
- const base = nodeType === "youtube-video" ? chunkANMCMSGR_cjs.dropStaleVideoLinkFields(data, incoming) : data;
717
+ const base = nodeType === "youtube-video" ? chunkYTXP4VHD_cjs.dropStaleVideoLinkFields(data, incoming) : data;
718
718
  const merged = { ...base, ...incoming };
719
719
  for (const [key, value] of Object.entries(incoming)) {
720
720
  if (value === null) delete merged[key];
@@ -807,5 +807,5 @@ exports.renderTranscriptOutputOf = renderTranscriptOutputOf;
807
807
  exports.rendersLatestBatch = rendersLatestBatch;
808
808
  exports.rendersTranscriptJson = rendersTranscriptJson;
809
809
  exports.validateNoNestedGroups = validateNoNestedGroups;
810
- //# sourceMappingURL=chunk-3GMTGX3D.cjs.map
811
- //# sourceMappingURL=chunk-3GMTGX3D.cjs.map
810
+ //# sourceMappingURL=chunk-WVACGZYV.cjs.map
811
+ //# sourceMappingURL=chunk-WVACGZYV.cjs.map