@nodaro/shared 3.13.0 → 3.16.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.
Files changed (142) hide show
  1. package/dist/index.cjs +1293 -55
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +1502 -30
  4. package/dist/index.d.ts +1502 -30
  5. package/dist/index.js +1134 -56
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/__tests__/camera-switch-contract.test.ts +98 -0
  9. package/src/__tests__/competitors.test.ts +49 -0
  10. package/src/__tests__/content-recipe-ideas.test.ts +96 -0
  11. package/src/__tests__/edl-multicam.test.ts +192 -0
  12. package/src/__tests__/llm-models.test.ts +5 -2
  13. package/src/__tests__/music-provider.test.ts +17 -0
  14. package/src/__tests__/node-runtime-keys.test.ts +10 -0
  15. package/src/__tests__/parameter-node-value.test.ts +2 -1
  16. package/src/__tests__/per-unit-video-pricing.test.ts +97 -0
  17. package/src/__tests__/producer-types.test.ts +35 -0
  18. package/src/__tests__/saved-posts.test.ts +37 -0
  19. package/src/__tests__/script-settings.test.ts +61 -0
  20. package/src/__tests__/settings-input.test.ts +252 -0
  21. package/src/__tests__/social-search.test.ts +243 -0
  22. package/src/__tests__/studio-take-voice.test.ts +200 -0
  23. package/src/__tests__/studio-transient.test.ts +37 -0
  24. package/src/__tests__/sub-gates.test.ts +21 -0
  25. package/src/__tests__/telegram-account-trigger.test.ts +120 -0
  26. package/src/__tests__/video-analysis-pricing.test.ts +27 -13
  27. package/src/__tests__/video-link.test.ts +2 -2
  28. package/src/__tests__/video-utils.test.ts +89 -83
  29. package/src/__tests__/workflow-export-strip.test.ts +37 -0
  30. package/src/camera-switch-contract.ts +166 -0
  31. package/src/catalog-projection.ts +27 -0
  32. package/src/competitors.ts +430 -0
  33. package/src/content-recipe-ideas.ts +69 -0
  34. package/src/credit-estimators/index.ts +14 -0
  35. package/src/credit-estimators/ltx-extend.ts +33 -0
  36. package/src/credit-estimators/ltx-retake.ts +30 -0
  37. package/src/credit-estimators/video-sfx.ts +41 -0
  38. package/src/credit-estimators/video-utils.ts +38 -24
  39. package/src/credit-identifiers.ts +10 -0
  40. package/src/edl-multicam.ts +220 -0
  41. package/src/fan-out-rows.ts +7 -2
  42. package/src/i18n/action-fx.ko.ts +18 -18
  43. package/src/i18n/action-fx.pt-BR.ts +66 -66
  44. package/src/i18n/aesthetic.ko.ts +49 -49
  45. package/src/i18n/aesthetic.pt-BR.ts +14 -14
  46. package/src/i18n/animals.ko.ts +126 -126
  47. package/src/i18n/animals.pt-BR.ts +33 -33
  48. package/src/i18n/atmosphere.ko.ts +37 -37
  49. package/src/i18n/atmosphere.pt-BR.ts +29 -29
  50. package/src/i18n/backdrop.ko.ts +40 -40
  51. package/src/i18n/backdrop.pt-BR.ts +38 -38
  52. package/src/i18n/camera-format.ko.ts +31 -31
  53. package/src/i18n/camera-format.pt-BR.ts +12 -12
  54. package/src/i18n/camera-motions.ko.ts +66 -66
  55. package/src/i18n/camera-motions.pt-BR.ts +51 -51
  56. package/src/i18n/character-fx.ko.ts +19 -19
  57. package/src/i18n/character-fx.pt-BR.ts +64 -52
  58. package/src/i18n/character-motion.ko.ts +164 -164
  59. package/src/i18n/character-motion.pt-BR.ts +867 -858
  60. package/src/i18n/color-look.ko.ts +41 -41
  61. package/src/i18n/color-look.pt-BR.ts +23 -23
  62. package/src/i18n/composition-effects.ko.ts +18 -18
  63. package/src/i18n/composition-effects.pt-BR.ts +17 -17
  64. package/src/i18n/era.ko.ts +28 -28
  65. package/src/i18n/era.pt-BR.ts +20 -20
  66. package/src/i18n/exposure-settings.ko.ts +20 -20
  67. package/src/i18n/exposure-settings.pt-BR.ts +3 -3
  68. package/src/i18n/framing.ko.ts +66 -66
  69. package/src/i18n/framing.pt-BR.ts +50 -50
  70. package/src/i18n/furniture.ko.ts +78 -78
  71. package/src/i18n/furniture.pt-BR.ts +46 -46
  72. package/src/i18n/held-prop.ko.ts +60 -60
  73. package/src/i18n/held-prop.pt-BR.ts +30 -30
  74. package/src/i18n/instrumentation.ko.ts +62 -62
  75. package/src/i18n/instrumentation.pt-BR.ts +64 -64
  76. package/src/i18n/lens.ko.ts +16 -16
  77. package/src/i18n/lens.pt-BR.ts +5 -5
  78. package/src/i18n/lighting.ko.ts +68 -68
  79. package/src/i18n/lighting.pt-BR.ts +43 -43
  80. package/src/i18n/loop-subject.ko.ts +1 -1
  81. package/src/i18n/loop-subject.pt-BR.ts +31 -31
  82. package/src/i18n/materials.ko.ts +66 -66
  83. package/src/i18n/materials.pt-BR.ts +22 -22
  84. package/src/i18n/mood.ko.ts +50 -50
  85. package/src/i18n/mood.pt-BR.ts +12 -12
  86. package/src/i18n/music-genre.ko.ts +28 -28
  87. package/src/i18n/music-genre.pt-BR.ts +50 -50
  88. package/src/i18n/music-mood.ko.ts +27 -27
  89. package/src/i18n/music-mood.pt-BR.ts +20 -20
  90. package/src/i18n/person.ko.ts +396 -396
  91. package/src/i18n/person.pt-BR.ts +237 -237
  92. package/src/i18n/photo-genre.ko.ts +46 -46
  93. package/src/i18n/photo-genre.pt-BR.ts +32 -32
  94. package/src/i18n/photographer.ko.ts +63 -63
  95. package/src/i18n/photographer.pt-BR.ts +15 -15
  96. package/src/i18n/pose.ko.ts +81 -81
  97. package/src/i18n/pose.pt-BR.ts +65 -65
  98. package/src/i18n/post-process-effects.ko.ts +18 -18
  99. package/src/i18n/post-process-effects.pt-BR.ts +18 -18
  100. package/src/i18n/render-quality.ko.ts +24 -24
  101. package/src/i18n/render-quality.pt-BR.ts +12 -12
  102. package/src/i18n/setting.ko.ts +64 -64
  103. package/src/i18n/setting.pt-BR.ts +41 -41
  104. package/src/i18n/style.ko.ts +49 -49
  105. package/src/i18n/style.pt-BR.ts +19 -19
  106. package/src/i18n/styling.ko.ts +265 -265
  107. package/src/i18n/styling.pt-BR.ts +141 -141
  108. package/src/i18n/temporal.ko.ts +18 -18
  109. package/src/i18n/temporal.pt-BR.ts +12 -12
  110. package/src/i18n/transitions.ko.ts +14 -14
  111. package/src/i18n/transitions.pt-BR.ts +83 -71
  112. package/src/i18n/vehicles.ko.ts +107 -107
  113. package/src/i18n/vehicles.pt-BR.ts +55 -55
  114. package/src/i18n/voice-character.ko.ts +19 -19
  115. package/src/i18n/voice-character.pt-BR.ts +19 -19
  116. package/src/i18n/voice-delivery.ko.ts +22 -22
  117. package/src/i18n/voice-delivery.pt-BR.ts +22 -22
  118. package/src/i18n/weapons.ko.ts +85 -85
  119. package/src/i18n/weapons.pt-BR.ts +46 -46
  120. package/src/index.ts +202 -1
  121. package/src/llm-models.ts +11 -0
  122. package/src/model-catalog.ts +30 -14
  123. package/src/model-constants.ts +28 -0
  124. package/src/node-mappable-fields.ts +21 -5
  125. package/src/node-runtime-keys.ts +33 -0
  126. package/src/oauth-scopes.ts +28 -0
  127. package/src/parameter-node-value.ts +13 -5
  128. package/src/pipeline-defaults.ts +14 -0
  129. package/src/pipeline-state-types.ts +14 -0
  130. package/src/producer-types.ts +85 -0
  131. package/src/recast-segment-packs.ts +13 -0
  132. package/src/resolve-field-mappings.ts +15 -5
  133. package/src/saved-posts.ts +106 -0
  134. package/src/script-settings.ts +70 -0
  135. package/src/settings-input.ts +366 -0
  136. package/src/social-search.ts +467 -0
  137. package/src/studio-transient.ts +176 -5
  138. package/src/telegram-account-send.ts +32 -0
  139. package/src/telegram-account-trigger.ts +108 -0
  140. package/src/video-analysis-pricing.ts +17 -6
  141. package/src/video-link.ts +16 -4
  142. package/src/workflow-export.ts +7 -0
package/src/index.ts CHANGED
@@ -88,6 +88,10 @@ export {
88
88
  TTS_PROVIDERS,
89
89
  TEXT_TO_AUDIO_PROVIDERS,
90
90
  MUSIC_PROVIDERS,
91
+ DEFAULT_MUSIC_PROVIDER,
92
+ MUSIC_PROVIDER_LABELS,
93
+ MUSIC_CREDIT_ID,
94
+ resolveMusicProvider,
91
95
  TRANSCRIBE_PROVIDERS,
92
96
  TRANSCRIBE_LANES,
93
97
  TRANSCRIBE_PROVIDER_CAPABILITIES,
@@ -269,6 +273,7 @@ export {
269
273
  seedanceVideoEditCreditId,
270
274
  pricedVideoSelection,
271
275
  buildMotionCreditModelIdentifier,
276
+ speedRampCreditId,
272
277
  sunoCreditType,
273
278
  SUNO_VERSION_CREDIT_KEYS,
274
279
  SUNO_VERSION_PRICED_OPERATIONS,
@@ -642,6 +647,44 @@ export {
642
647
  } from "./node-default-mappings.js"
643
648
 
644
649
  export { NODE_MAPPABLE_FIELDS, SUNO_FIELD_HANDLE_FIELDS, fieldKeyFromHandle } from "./node-mappable-fields.js"
650
+ export { OAUTH_SCOPES, type OAuthScope } from "./oauth-scopes.js"
651
+ export { RECAST_SEGMENT_PACKS, type RecastSegmentPack } from "./recast-segment-packs.js"
652
+ export {
653
+ SETTINGS_INPUT_HANDLE,
654
+ SETTINGS_SOURCE_FIELDS,
655
+ SETTINGS_INPUT_CONSUMERS,
656
+ isSettingsSourceType,
657
+ settingsInputAccepts,
658
+ settingsInputFields,
659
+ settingsSourceForField,
660
+ settingsSourceForType,
661
+ isSettingsHintEdge,
662
+ isSettingsHintSource,
663
+ SETTINGS_HINT_SOURCES,
664
+ SETTINGS_SOURCE_TYPES,
665
+ connectedSettingsSources,
666
+ settingsProviderModels,
667
+ snapToModelDuration,
668
+ applySettingsInput,
669
+ resolveWiredSettings,
670
+ withWiredSettings,
671
+ type SettingsInputProblem,
672
+ type WiredSetting,
673
+ type SettingsSourceType,
674
+ type SettingsFieldSourceType,
675
+ type SettingsHintSourceType,
676
+ type SettingsField,
677
+ } from "./settings-input.js"
678
+ export {
679
+ readScriptSettings,
680
+ SCRIPT_SCENE_COUNT_RANGE,
681
+ SCRIPT_SCENE_COUNT_DEFAULT,
682
+ SCRIPT_TARGET_DURATION_RANGE,
683
+ SCRIPT_TARGET_DURATION_DEFAULT,
684
+ SCRIPT_TONE_MAX_LENGTH,
685
+ SCRIPT_STYLE_GUIDE_MAX_LENGTH,
686
+ type ScriptSettings,
687
+ } from "./script-settings.js"
645
688
  export {
646
689
  SCHEDULE_TRIGGER_NODE_TYPE,
647
690
  WEBHOOK_TRIGGER_NODE_TYPE,
@@ -650,6 +693,25 @@ export {
650
693
  PROJECTED_TRIGGER_NODE_TYPES,
651
694
  isProjectedTriggerNodeType,
652
695
  } from "./trigger-node-types.js"
696
+ export {
697
+ TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_HANDLE,
698
+ TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS,
699
+ TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_FIELDS,
700
+ TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES,
701
+ isTelegramAccountTriggerNamedHandle,
702
+ telegramAccountTriggerOutputs,
703
+ telegramAccountListeningSignature,
704
+ type TelegramAccountTriggerPostField,
705
+ } from "./telegram-account-trigger.js"
706
+ export {
707
+ TELEGRAM_ACCOUNT_SEND_NODE_TYPE,
708
+ TELEGRAM_SEND_AS,
709
+ TELEGRAM_SEND_DESTINATIONS,
710
+ telegramSendAsOf,
711
+ telegramSendDestinationOf,
712
+ type TelegramSendAs,
713
+ type TelegramSendDestination,
714
+ } from "./telegram-account-send.js"
653
715
 
654
716
  export { buildFeedMaps, nodeFeedsAnything, type FeedNode, type FeedEdge, type FeedMaps } from "./trigger-feeds.js"
655
717
 
@@ -782,6 +844,128 @@ export {
782
844
  type InstagramNodeQuoteFields,
783
845
  } from "./instagram-scrape.js"
784
846
 
847
+ export {
848
+ SOCIAL_SEARCH_NODE_TYPE,
849
+ SOCIAL_PLATFORMS,
850
+ SOCIAL_SEARCH_MODES,
851
+ SOCIAL_SEARCH_PLATFORM_MODES,
852
+ SOCIAL_SEARCH_PERIODS,
853
+ SOCIAL_SEARCH_SORTS,
854
+ SOCIAL_SEARCH_COUNTS,
855
+ SOCIAL_SEARCH_VIDEO_KINDS,
856
+ SOCIAL_SEARCH_PAGED_MODES,
857
+ socialSearchMaxCount,
858
+ socialSearchEffectiveCount,
859
+ socialSearchRegion,
860
+ socialSearchCountry,
861
+ SOCIAL_SEARCH_DEFAULT_PICK_TOP,
862
+ SOCIAL_SEARCH_MAX_QUERY_LENGTH,
863
+ SOCIAL_SEARCH_CREDITS_PER_PAGE,
864
+ SOCIAL_SEARCH_CREDIT_COSTS,
865
+ isSocialPost,
866
+ socialPostsFrom,
867
+ socialSearchPlatform,
868
+ socialSearchMode,
869
+ socialSearchCount,
870
+ socialSearchPages,
871
+ socialSearchRequestFromNode,
872
+ socialSearchPostLink,
873
+ socialSearchPostVideo,
874
+ signedLinkExpiresAt,
875
+ socialPostsLongestVideoSec,
876
+ SOCIAL_POST_VIDEO_LINK_MARGIN_MS,
877
+ socialSearchCreditId,
878
+ socialSearchCreditIdFromNode,
879
+ socialSearchPickTop,
880
+ pickSocialPosts,
881
+ isSocialSearchPickFrozen,
882
+ socialPostDigestLine,
883
+ socialPostsDigest,
884
+ type SocialPlatform,
885
+ type SocialSearchMode,
886
+ type SocialSearchPeriod,
887
+ type SocialSearchSort,
888
+ type SocialSearchCount,
889
+ type SocialSearchVideoKind,
890
+ type SocialPost,
891
+ type SocialPostAuthor,
892
+ type SocialPostMetrics,
893
+ type SocialPostMedia,
894
+ type SocialSearchParams,
895
+ type SocialSearchPostVideo,
896
+ } from "./social-search.js"
897
+
898
+ export {
899
+ SAVED_POST_SOURCES,
900
+ SAVED_POST_NOTE_MAX,
901
+ SAVED_POST_MAX_TAGS,
902
+ SAVED_POST_TAG_MAX,
903
+ SAVED_POSTS_PAGE_MAX,
904
+ SAVED_POSTS_LOOKUP_MAX,
905
+ normalizeSavedPostTags,
906
+ type SavedPostSource,
907
+ type SavedPost,
908
+ type SavePostInput,
909
+ type UpdateSavedPostInput,
910
+ type ListSavedPostsParams,
911
+ type ListSavedPostsResult,
912
+ type SavedPostsLookupResult,
913
+ } from "./saved-posts.js"
914
+
915
+ export {
916
+ COMPETITOR_ACCOUNT_KEYS,
917
+ COMPETITOR_ABOUT_PLATFORMS,
918
+ COMPETITOR_DEFAULT_ABOUT_PLATFORMS,
919
+ COMPETITOR_SCHEDULES,
920
+ COMPETITOR_SCAN_MAX_SEARCHES,
921
+ COMPETITOR_SCAN_NODE_TYPE,
922
+ COMPETITORS_MAX,
923
+ ACTION_CARD_KINDS,
924
+ BRAND_LESSON_KINDS,
925
+ COMPETITOR_SCAN_CREDIT_COSTS,
926
+ competitorScanSearches,
927
+ competitorScanCreditId,
928
+ competitorScanCredits,
929
+ isCompetitorAboutPlatform,
930
+ ADVICE_FAMILIES,
931
+ CARD_OUTCOME_STATES,
932
+ adviceFamilyOf,
933
+ isMeasurableCard,
934
+ type AdviceFamily,
935
+ type AdviceRecord,
936
+ type CardAction,
937
+ type CardActionResult,
938
+ type CardOutcome,
939
+ type CardOutcomeState,
940
+ type CardSnapshot,
941
+ type CardVerdict,
942
+ type CompetitorActionsResult,
943
+ type MarkCardInput,
944
+ type UpdateCardActionInput,
945
+ type CompetitorAccountKey,
946
+ type CompetitorAboutPlatform,
947
+ type CompetitorSchedule,
948
+ type CompetitorAccounts,
949
+ type TrackedCompetitor,
950
+ type ActionCardKind,
951
+ type ActionCardPriority,
952
+ type ActionCard,
953
+ type CompetitorPost,
954
+ type CompetitorScanCounts,
955
+ type CompetitorScanSummary,
956
+ type CompetitorScan,
957
+ type CompetitorDetail,
958
+ type CompetitorCardsResult,
959
+ type CompetitorLessonsResult,
960
+ type BrandLesson,
961
+ type BrandLessonKind,
962
+ type BrandLessons,
963
+ type BrandPlatformLessons,
964
+ type CompetitorDiscovery,
965
+ type CreateCompetitorInput,
966
+ type UpdateCompetitorInput,
967
+ } from "./competitors.js"
968
+
785
969
  export { VARIABLES_HANDLE_ID, buildConditionVariables } from "./condition-variables.js"
786
970
 
787
971
  export { extractAllGeneratedResults, extractGeneratedJsonAsList, spreadJsonArrayIfSingleton } from "./generated-results.js"
@@ -808,7 +992,7 @@ export {
808
992
  export type { LottieOverlayCatalogEntry } from "./lottie-overlay-catalog.js"
809
993
 
810
994
 
811
- export { resolveFieldMappings, resolveLocationFields } from "./resolve-field-mappings.js"
995
+ export { resolveFieldMappings, resolveLocationFields, type FieldEdgeSource } from "./resolve-field-mappings.js"
812
996
 
813
997
  export { resolveNodeRefs, parseNodeRef, canonicalVarName, NODE_REF_PATTERN, RESERVED_TEMPLATE_VARS, extractReferencedLabels, combineSameLabelRefs, refHandleCategory, REF_HANDLE_CATEGORY, REFERENCE_HANDLE_MAP, referenceModalityForHandle, FRAME_TARGET_HANDLES, countRefModalityEdges, REF_TOKEN_NAMESPACE_PREFIXES, classifyRefToken, unresolvedRefTokens } from "./node-refs.js"
814
998
  export type { RefCandidate, ReferenceModality, RefModalityEdge, RefTokenKind } from "./node-refs.js"
@@ -915,6 +1099,7 @@ export {
915
1099
  buildModelMenu,
916
1100
  normalizeModelInput,
917
1101
  normalizeVideoRequestParams,
1102
+ fitAspectRatioToModel,
918
1103
  defaultResolutionFor,
919
1104
  } from "./model-catalog.js"
920
1105
  export type {
@@ -1147,6 +1332,12 @@ export {
1147
1332
  AUDIO_PRODUCER_TYPES,
1148
1333
  DYNAMIC_PRODUCER_TYPES,
1149
1334
  FAN_OUT_EACH_TYPES,
1335
+ FAN_OUT_EACH_HANDLES,
1336
+ defaultEdgeOutputMode,
1337
+ listResultsServeHandle,
1338
+ FAN_IN_TARGETS,
1339
+ isFanInNodeType,
1340
+ isFanInEdge,
1150
1341
  } from "./producer-types.js"
1151
1342
 
1152
1343
  export { SUNO_TRACK_SOURCE_TYPES } from "./suno-track-sources.js"
@@ -1163,6 +1354,7 @@ export {
1163
1354
  detectVideoLinkPlatform,
1164
1355
  videoLinkDownloadedFile,
1165
1356
  resolveVideoLinkOutput,
1357
+ videoLinkPageUrl,
1166
1358
  videoLinkNeedsDownload,
1167
1359
  } from "./video-link.js"
1168
1360
  export type { VideoLinkPlatform, VideoLinkNodeFields } from "./video-link.js"
@@ -1248,6 +1440,9 @@ export * from "./video-analysis.js"
1248
1440
  // buildVideoAuditCreditId / videoAuditCreditsForBucket / bucketSecondsFromAuditCreditId).
1249
1441
  export * from "./video-analysis-pricing.js"
1250
1442
 
1443
+ // --- Content Recipe / Content Ideas pricing (credit ids + the per-five-ideas rule) ---
1444
+ export * from "./content-recipe-ideas.js"
1445
+
1251
1446
  // --- Unified video node UI-default fills (panel snap == strip == DAG payload) ---
1252
1447
  export * from "./video-ui-defaults.js"
1253
1448
 
@@ -1298,7 +1493,12 @@ export * from "./scene3d-render-pricing.js"
1298
1493
  export {
1299
1494
  STUDIO_TRANSIENT_KEYS,
1300
1495
  STUDIO_SHOT_TRANSIENT_KEYS,
1496
+ STUDIO_SHOT_DRAFT_KEYS,
1497
+ STUDIO_TAKE_VOICE_KEYS,
1301
1498
  stripStudioTransientSettings,
1499
+ stripStudioDraftSettings,
1500
+ stripStudioDraftWorkflow,
1501
+ stripStudioTakeVoiceRecords,
1302
1502
  } from "./studio-transient.js"
1303
1503
 
1304
1504
  export * from "./scene3d-v2-edit.js"
@@ -1316,6 +1516,7 @@ export type { CharacterMotionMetadata } from "./character-motion-metadata.js"
1316
1516
  export * from "./edl.js"
1317
1517
  export * from "./speaker-layouts.js"
1318
1518
  export * from "./edl-multicam.js"
1519
+ export * from "./camera-switch-contract.js"
1319
1520
  export * from "./edit-plan-contract.js"
1320
1521
 
1321
1522
  export { VIDEO_DURATION_AUTO, isAutoVideoDuration } from "./video-duration-auto.js"
package/src/llm-models.ts CHANGED
@@ -734,6 +734,12 @@ export type LlmFeature =
734
734
  // In-app Workflow Copilot turns (backend agent loop; metered, reservation
735
735
  // ceiling under `STATIC_CREDIT_COSTS["workflow-copilot"]`).
736
736
  | "workflow-copilot"
737
+ // "Steal the format": Content Recipe (why a post worked, one structured
738
+ // call over its analysis) and Content Ideas (recipes + brand → ideas, a
739
+ // call per five ideas). Cloud-only; the implementation is a private plugin.
740
+ // Ideas are priced per batch of five — see content-recipe-ideas.ts.
741
+ | "content-recipe"
742
+ | "content-ideas"
737
743
 
738
744
  /** Engine-dependent LlmFeature for the motion-graphics node (design §8: every credit-id site must branch on engine). */
739
745
  export function motionGraphicsFeature(engine?: string): LlmFeature {
@@ -764,6 +770,11 @@ export const LLM_FEATURE_DEFAULTS: Record<LlmFeature, string> = {
764
770
  "image-critic": "claude-sonnet-4.6",
765
771
  "pick-best-llm": "claude-sonnet-4.6",
766
772
  "workflow-copilot": "claude-sonnet-5",
773
+ // Both economy on purpose — measured: ten ideas in Hebrew took ~1 min here
774
+ // and ~3.5 min (two calls) on claude-sonnet-4.6. The private plugin keeps
775
+ // the same two defaults for API callers that omit the model.
776
+ "content-recipe": "gemini-3.6-flash",
777
+ "content-ideas": "gemini-3.6-flash",
767
778
  }
768
779
 
769
780
  /**
@@ -74,7 +74,9 @@ export type ModelMode =
74
74
  export interface PriceVariant {
75
75
  /** Composite identifier as it appears in `STATIC_CREDIT_COSTS`. */
76
76
  identifier: string
77
- /** Credits charged at reservation. */
77
+ /** The catalog's list price in credits. `GET /v1/models` and the MCP
78
+ * `list_models` tool serve the price a run is charged on the instance,
79
+ * which may differ. */
78
80
  credits: number
79
81
  /** Short human-readable note describing this variant ("1K default", "4K", "with audio"). */
80
82
  note?: string
@@ -1249,7 +1251,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
1249
1251
  resolutions: ["720p", "1080p", "4k"],
1250
1252
  pricing: [
1251
1253
  { identifier: "veo3", credits: 1000, note: "4/6/8s with audio (flat per-generation)" },
1252
- { identifier: "veo3:4k", credits: 930, note: "4K (base 1080p → get-4k-video)" },
1254
+ { identifier: "veo3:4k", credits: 1300, note: "4K (base 1080p → get-4k-video)" },
1253
1255
  ],
1254
1256
  featured: true,
1255
1257
  },
@@ -2282,9 +2284,9 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
2282
2284
  kind: "video",
2283
2285
  modes: ["video-analysis"] as const,
2284
2286
  family: "Nodaro",
2285
- label: "Video Analysis (Fast — legacy)",
2287
+ label: "Video Analysis (Fast)",
2286
2288
  series: "Video Analysis",
2287
- description: "Legacy fast-tier analysis model (pre-2026-07). Kept so stored raw-model configs keep running and keep pricing under their own identifier; new fast-tier runs use the current fast model.",
2289
+ description: "Analyze a video into a structured shot list (scenes, camera, audio) — fast, economy tier. Billed per duration bucket.",
2288
2290
  useCases: ["video-analysis", "shot-list", "fast"],
2289
2291
  pricing: [
2290
2292
  { identifier: "video-analysis:gemini-3-flash", credits: 849, note: "10-min ceiling (no duration given)" },
@@ -2299,9 +2301,9 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
2299
2301
  kind: "video",
2300
2302
  modes: ["video-analysis"] as const,
2301
2303
  family: "Nodaro",
2302
- label: "Video Analysis (Fast)",
2304
+ label: "Video Analysis (Fast — legacy)",
2303
2305
  series: "Video Analysis",
2304
- description: "Analyze a video into a structured shot list (scenes, camera, audio) — fast, economy tier. Billed per duration bucket.",
2306
+ description: "Legacy fast-tier analysis model (backed the fast tier from 2026-07 until 2026-07-29). Kept so stored raw-model configs keep running and keep pricing under their own identifier; new fast-tier runs use the current fast model.",
2305
2307
  useCases: ["video-analysis", "shot-list", "fast"],
2306
2308
  pricing: [
2307
2309
  { identifier: "video-analysis:gemini-3.6-flash", credits: 995, note: "10-min ceiling (no duration given)" },
@@ -3084,6 +3086,23 @@ function nearestAspectRatio(token: string, allowed: readonly string[]): string |
3084
3086
  return best
3085
3087
  }
3086
3088
 
3089
+ /**
3090
+ * `ratio` as `modelId` renders it: the catalog's own spelling when the model
3091
+ * lists it (any case), else the nearest ratio it lists (log space — a portrait
3092
+ * request stays portrait). "auto" / "adaptive", an empty token, a model without
3093
+ * a ratio list and an unknown model pass through unchanged. The ONE fitting
3094
+ * rule: the video lane's normalizer applies it, and so does a node's Settings
3095
+ * input for a wired Aspect Ratio (settings-input.ts), image models included.
3096
+ */
3097
+ export function fitAspectRatioToModel(modelId: string, ratio: string): string {
3098
+ const token = ratio.trim()
3099
+ const allowed = MODEL_CATALOG[modelId]?.aspectRatios
3100
+ if (!allowed?.length || token === "" || PASSTHROUGH_ASPECT_TOKENS.has(token.toLowerCase())) return token
3101
+ const exact = allowed.find((a) => a === token) ?? allowed.find((a) => a.toLowerCase() === token.toLowerCase())
3102
+ if (exact !== undefined) return exact
3103
+ return nearestAspectRatio(token, allowed.filter((a) => !PASSTHROUGH_ASPECT_TOKENS.has(a.toLowerCase()))) ?? allowed[0]!
3104
+ }
3105
+
3087
3106
  /**
3088
3107
  * Read a catalog lever off an UNVALIDATED input as a trimmed string.
3089
3108
  *
@@ -3162,18 +3181,15 @@ export function normalizeVideoRequestParams(
3162
3181
  if (!m) return out
3163
3182
 
3164
3183
  if (m.aspectRatios?.length && aspect && !PASSTHROUGH_ASPECT_TOKENS.has(aspect.toLowerCase())) {
3165
- const allowed = m.aspectRatios
3166
- const exact = allowed.find((a) => a === aspect) ?? allowed.find((a) => a.toLowerCase() === aspect.toLowerCase())
3167
- if (exact !== undefined) {
3168
- out.aspectRatio = exact
3169
- } else {
3170
- const next = nearestAspectRatio(aspect, allowed.filter((a) => !PASSTHROUGH_ASPECT_TOKENS.has(a.toLowerCase()))) ?? allowed[0]!
3184
+ const next = fitAspectRatioToModel(modelId, aspect)
3185
+ // A case-only difference is the same ratio canonicalised, not a correction.
3186
+ if (next.toLowerCase() !== aspect.toLowerCase()) {
3171
3187
  out.adjustments.push({
3172
3188
  field: "aspectRatio", from: aspect, to: next,
3173
- reason: `${m.label} does not support aspect ratio "${aspect}" — using "${next}" instead. Supported: ${allowed.join(", ")}.`,
3189
+ reason: `${m.label} does not support aspect ratio "${aspect}" — using "${next}" instead. Supported: ${m.aspectRatios.join(", ")}.`,
3174
3190
  })
3175
- out.aspectRatio = next
3176
3191
  }
3192
+ out.aspectRatio = next
3177
3193
  }
3178
3194
 
3179
3195
  if (m.resolutions?.length && res) {
@@ -1244,6 +1244,34 @@ export const MUSIC_PROVIDERS = [
1244
1244
  ] as const
1245
1245
  export type MusicProvider = typeof MUSIC_PROVIDERS[number]
1246
1246
 
1247
+ /** The model a Generate Music node runs when its data names none it offers. */
1248
+ export const DEFAULT_MUSIC_PROVIDER: MusicProvider = "minimax"
1249
+
1250
+ /** Each music model's name as the node shows it. The catalog's "minimax" is the
1251
+ * MiniMax VIDEO model, so its label cannot stand in. */
1252
+ export const MUSIC_PROVIDER_LABELS: Readonly<Record<MusicProvider, string>> = {
1253
+ minimax: "MiniMax Music",
1254
+ }
1255
+
1256
+ /**
1257
+ * The credit id every Generate Music run reserves on — the route's guard and
1258
+ * the orchestrator's payload both use it, whatever the model. The estimates
1259
+ * and the node's price read it too: the model id would price the MiniMax VIDEO
1260
+ * model that shares the name ("minimax").
1261
+ */
1262
+ export const MUSIC_CREDIT_ID = "generate-music"
1263
+
1264
+ /**
1265
+ * The music model a Generate Music node runs: its `provider` when the node
1266
+ * offers it, else the default. Nodes saved with a model that is gone ("suno",
1267
+ * "musicgen", "lyria", "bark" — or the "suno" new nodes started on) run the
1268
+ * default instead of failing validation. Coerces rather than rejects, like
1269
+ * `normalizeModelInput`: the only model to fall back to is the one there is.
1270
+ */
1271
+ export function resolveMusicProvider(value: unknown): MusicProvider {
1272
+ return (MUSIC_PROVIDERS as readonly unknown[]).includes(value) ? (value as MusicProvider) : DEFAULT_MUSIC_PROVIDER
1273
+ }
1274
+
1247
1275
  /**
1248
1276
  * Transcription providers a caller may name — on `/v1/transcribe`, the SDK/CLI
1249
1277
  * and the canvas Transcribe node. All three lanes are served on cloud again
@@ -1,3 +1,5 @@
1
+ import { settingsInputFields } from "./settings-input.js"
2
+
1
3
  /**
2
4
  * Per-node-type list of field names eligible for fieldMappings resolution.
3
5
  * Text fields also participate in {} injection when the resolver sees a
@@ -5,7 +7,8 @@
5
7
  * mapped source's value verbatim.
6
8
  */
7
9
  export const NODE_MAPPABLE_FIELDS: Readonly<Record<string, readonly string[]>> = {
8
- "generate-image": ["prompt", "style", "negativePrompt"],
10
+ // + the fields its Settings input sets (settings-input.ts).
11
+ "generate-image": ["prompt", "style", "negativePrompt", ...settingsInputFields("generate-image")],
9
12
  "edit-image": ["prompt", "style", "negativePrompt"],
10
13
  "image-to-image": ["prompt", "style", "negativePrompt"],
11
14
  "modify-image": ["prompt", "style", "negativePrompt"],
@@ -14,10 +17,13 @@ export const NODE_MAPPABLE_FIELDS: Readonly<Record<string, readonly string[]>> =
14
17
  // Unified t2v/i2v node — replaced the two deprecated keys above (kept only
15
18
  // for back-compat with un-migrated workflow JSON). Mirrors text-to-video so
16
19
  // fieldMappings/{} injection AND missing-ref detection work on the live node.
17
- "generate-video": ["prompt", "negativePrompt"],
20
+ // + the fields its Settings input sets (settings-input.ts): a Generation
21
+ // Settings node wired there overrides the node's own aspect ratio, duration
22
+ // and model at run time, through the same resolver as a field mapping.
23
+ "generate-video": ["prompt", "negativePrompt", ...settingsInputFields("generate-video")],
18
24
  // Trimmed multi-segment stitch variant of generate-video — prompt only, no
19
- // negativePrompt field on the node.
20
- "generate-video-pro": ["prompt"],
25
+ // negativePrompt field on the node; + the fields its Settings input sets.
26
+ "generate-video-pro": ["prompt", ...settingsInputFields("generate-video-pro")],
21
27
  // Span-replace sibling of generate-video-pro — prompt only, no
22
28
  // negativePrompt field on the node.
23
29
  "edit-video-pro": ["prompt"],
@@ -48,7 +54,9 @@ export const NODE_MAPPABLE_FIELDS: Readonly<Record<string, readonly string[]>> =
48
54
  "edit-3d-scene": ["editPrompt"],
49
55
  "pro-3d-render": ["scenePrompt"],
50
56
  "motion-graphics": ["motionPrompt"],
51
- "generate-script": ["styleGuide"],
57
+ // Every field the panel offers a source for. Numbers arrive as text from a
58
+ // Scene Count / Duration node; readScriptSettings coerces them on both engines.
59
+ "generate-script": ["styleGuide", "tone", "sceneCount", "targetLength"],
52
60
  "speech-to-video": ["prompt", "negativePrompt"],
53
61
  "extend-video": ["prompt"],
54
62
  "motion-transfer": ["prompt"],
@@ -71,6 +79,14 @@ export const NODE_MAPPABLE_FIELDS: Readonly<Record<string, readonly string[]>> =
71
79
  "web-scrape": ["query", "url", "target"],
72
80
  "meta-ads-scrape": ["query", "pageUrls"],
73
81
  "instagram-scrape": ["targets"],
82
+ // Content Recipe's material arrives on its `in` wire and the post link on
83
+ // its `link` wire (a Video URL node's page link) — only the focus is a field.
84
+ "content-recipe": ["focus"],
85
+ // Content Ideas folds its recipes on the `recipes` wire (FAN_IN_TARGETS);
86
+ // the brand profile and the language are fields a Text node can feed.
87
+ "content-ideas": ["brand", "language"],
88
+ // Social Search: the keyword or account a Text node (or a List item) feeds.
89
+ "social-search": ["query"],
74
90
  }
75
91
 
76
92
  /** suno-generate secondary text fields exposed as `field-<key>` canvas handles. */
@@ -28,6 +28,10 @@ export const EXECUTION_DATA_KEYS: ReadonlySet<string> = new Set([
28
28
  // below. Without the transient half, a flip into review marks a passive tab
29
29
  // dirty and a preset captures "awaiting review".
30
30
  "jobAwaitingReview",
31
+ // The editor cannot reach the server to read this node's job. The job keeps
32
+ // running and the watch keeps polling. Pure run state, cleared by the next
33
+ // check that gets through, so it is ALSO in TRANSIENT_RUNTIME_KEYS below.
34
+ "jobConnectionLost",
31
35
  "isStreaming",
32
36
  "generatedImageUrl",
33
37
  "generatedVideoUrl",
@@ -86,12 +90,36 @@ export const EXECUTION_DATA_KEYS: ReadonlySet<string> = new Set([
86
90
  "webhookSuccess",
87
91
  "webhookStatusCode",
88
92
  "webhookResponseBody",
93
+ // Content Ideas: one creative brief per idea (the node's list output — kept
94
+ // out of __listResults, which would clone the node). And the non-fatal notes
95
+ // a Content Recipe / Content Ideas run returns ("read the first of 3 posts").
96
+ // Both are RESULTS: they persist, and a preset, a template or a run-only
97
+ // patch must never treat them as config.
98
+ "ideaBriefs",
99
+ "runWarnings",
100
+ // Content Ideas: the own brand whose results the last run leaned on — a
101
+ // RESULT naming the runner's brand, so a template or a preset never carries it.
102
+ "brandLessons",
103
+ // Social Search: every post the last search found (the picker's grid), the
104
+ // ids a person picked from them, and the run's non-fatal notes ("only part
105
+ // of the results loaded"). All RESULTS: a template, a preset or a run-only
106
+ // patch must never carry yesterday's posts or picks as configuration.
107
+ "searchResults",
108
+ "pickedIds",
109
+ "searchWarnings",
89
110
  // When the editor's "Clear results" last emptied this node (ISO time). Not a
90
111
  // result and not config: bookkeeping that tells the load-time recovery lanes
91
112
  // "this node is empty ON PURPOSE" — without it, every reload reads an empty
92
113
  // node as "ran while the editor was closed" and paints the last run back.
93
114
  // Persisted (never transient): the reload is exactly when it is read.
94
115
  "resultsClearedAt",
116
+ // The id of the trigger-started run whose results this node shows (the
117
+ // editor paints a Telegram run onto the canvas). Bookkeeping, not a result
118
+ // and not config: it stops a reload from painting the same run again over
119
+ // edits made since. Persisted for the same reason as resultsClearedAt.
120
+ "resultsRunId",
121
+ // A trigger's last run values (also in TRANSIENT_RUNTIME_KEYS: never saved).
122
+ "__triggerData",
95
123
  ])
96
124
 
97
125
  /**
@@ -115,6 +143,7 @@ export const TRANSIENT_RUNTIME_KEYS: ReadonlySet<string> = new Set([
115
143
  "currentJobId",
116
144
  "currentJobProgress",
117
145
  "jobAwaitingReview",
146
+ "jobConnectionLost",
118
147
  "isStreaming",
119
148
  "subWorkflowProgress",
120
149
  "__listTotal",
@@ -128,6 +157,10 @@ export const TRANSIENT_RUNTIME_KEYS: ReadonlySet<string> = new Set([
128
157
  // `downloadStatus` + `downloadId`; the percent is re-read from the server.
129
158
  "downloadPercent",
130
159
  "downloadPhase",
160
+ // A trigger's last run values, shown in the editor after a run (a webhook's
161
+ // body, a Telegram message and its post). Never saved: the workflow is not
162
+ // where a message's content is kept — runs are, under their retention.
163
+ "__triggerData",
131
164
  ])
132
165
 
133
166
  /**
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The OAuth scopes a Nodaro token can carry — part of the public API contract
3
+ * (published in the authorization server's `scopes_supported`, requested by
4
+ * developer apps, typed in `@nodaro/sdk`). The server validates against this
5
+ * list and the SDK types against it, so the two cannot drift.
6
+ *
7
+ * A scope in this list is published and handed to any Dynamic Client
8
+ * Registration client that asks for everything, so add one in the same change
9
+ * that makes something check it (see backend/src/lib/scopes.ts).
10
+ */
11
+ export const OAUTH_SCOPES = [
12
+ "workflows:read",
13
+ "workflows:write",
14
+ "workflows:execute",
15
+ "jobs:read",
16
+ "assets:read",
17
+ "assets:write",
18
+ "credits:read",
19
+ "apps:read",
20
+ "pipelines:read",
21
+ "pipelines:execute",
22
+ "pipelines:approve",
23
+ "presets:read",
24
+ "workspaces:read",
25
+ "workspaces:write",
26
+ ] as const
27
+
28
+ export type OAuthScope = (typeof OAUTH_SCOPES)[number]
@@ -51,6 +51,10 @@ export const PARAMETER_NODE_TYPES: ReadonlySet<string> = new Set([
51
51
  "scene-count",
52
52
  "duration",
53
53
  "aspect-ratio",
54
+ // Generation Settings "Provider": a model id read from data at run time, like
55
+ // duration / aspect-ratio (it used to be only a SKIP node, so a server run
56
+ // could not read it at all).
57
+ "provider",
54
58
  "music-genre",
55
59
  "music-mood",
56
60
  "instrumentation",
@@ -61,8 +65,8 @@ export const PARAMETER_NODE_TYPES: ReadonlySet<string> = new Set([
61
65
  /**
62
66
  * Parameter types that intentionally produce NO prompt hint from
63
67
  * `getParameterPromptHint` (in `@nodaro/prompts`). They carry pure runtime
64
- * parameters — counts, durations, aspect ratios, legacy motion intensity —
65
- * consumed by the executor directly, never appended to a downstream prompt.
68
+ * parameters — counts, durations, aspect ratios, a model id — consumed by the
69
+ * executor directly, never appended to a downstream prompt.
66
70
  *
67
71
  * Consumers that treat "parameter node" as "text producer" (the `{Label}`
68
72
  * auto-fill in `main-text-handle.ts`, ref-map builders) must exclude these:
@@ -72,15 +76,16 @@ export const PARAMETER_NODE_TYPES: ReadonlySet<string> = new Set([
72
76
  * `main-text-handle.test.ts` (members are not text-producing).
73
77
  */
74
78
  export const HINT_EXEMPT_PARAMETER_TYPES: ReadonlySet<string> = new Set([
75
- "motion",
76
79
  "scene-count",
77
80
  "duration",
78
81
  "aspect-ratio",
82
+ "provider",
79
83
  ])
80
84
 
81
85
  /**
82
- * Parameter pickers whose fragment only makes sense in MOTION — a camera move,
83
- * a transition, a timeline, a character effect or a character movement. Every
86
+ * Parameter nodes whose fragment only makes sense in MOTION — a camera move,
87
+ * a transition, a timeline, a character effect, a character movement or the
88
+ * shot's motion intensity (the Motion node). Every
84
89
  * still-image consumer (generate-image, edit-image, image-to-image,
85
90
  * modify-image, location) excludes these on BOTH executors and in the add-node
86
91
  * popup. One set instead of three hand-synced copies: `STILL_IMAGE_EXCLUDE_TYPES`
@@ -93,6 +98,7 @@ export const VIDEO_ONLY_PARAMETER_NODE_TYPES: ReadonlySet<string> = new Set([
93
98
  "transition",
94
99
  "character-fx",
95
100
  "character-motion",
101
+ "motion",
96
102
  ])
97
103
 
98
104
  /**
@@ -357,6 +363,8 @@ export function getParameterValue(
357
363
  return data.seconds != null ? String(data.seconds) : undefined
358
364
  case "aspect-ratio":
359
365
  return trim(data.ratio)
366
+ case "provider":
367
+ return trim(data.provider)
360
368
  default:
361
369
  return undefined
362
370
  }
@@ -227,6 +227,20 @@ export function clearImageCriticMetadata(
227
227
  export const VIDEO_CRITIC_FRAME_MODES = ["first_last", "first_middle_last", "five_evenly"] as const
228
228
  export type VideoCriticFrameMode = (typeof VIDEO_CRITIC_FRAME_MODES)[number]
229
229
 
230
+ /**
231
+ * Credits the pipeline's upfront estimate reserves per shot for the Video
232
+ * Critic, by frame mode — a worst case; what goes unused is refunded when the
233
+ * pipeline completes. The config panel quotes these as "up to N credits per
234
+ * shot". The server derives its reservation separately, and a test there
235
+ * fails when the two disagree (they drifted ten-fold across a credit
236
+ * re-denomination while the panel still read ~2 / ~3 / ~4).
237
+ */
238
+ export const VIDEO_CRITIC_RESERVED_CREDITS_PER_SHOT: Readonly<Record<VideoCriticFrameMode, number>> = {
239
+ first_last: 20,
240
+ first_middle_last: 30,
241
+ five_evenly: 40,
242
+ }
243
+
230
244
  /** Cap=1 retry per shot — cost-aware (every retry is a full paid video
231
245
  * generation, the priciest step in the loop). */
232
246
  export const VIDEO_CRITIC_MAX_RETRIES = 1