@nodaro/shared 3.14.0 → 3.18.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 (153) hide show
  1. package/dist/index.cjs +1679 -81
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +1822 -49
  4. package/dist/index.d.ts +1822 -49
  5. package/dist/index.js +1491 -82
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/__tests__/apply-edl-credit-id.test.ts +25 -0
  9. package/src/__tests__/camera-switch-contract.test.ts +98 -0
  10. package/src/__tests__/competitors.test.ts +49 -0
  11. package/src/__tests__/content-recipe-ideas.test.ts +96 -0
  12. package/src/__tests__/edl-multicam.test.ts +192 -0
  13. package/src/__tests__/exposed-field-keys.test.ts +78 -0
  14. package/src/__tests__/instagram-scrape.test.ts +62 -0
  15. package/src/__tests__/llm-models.test.ts +5 -2
  16. package/src/__tests__/music-provider.test.ts +17 -0
  17. package/src/__tests__/node-runtime-keys.test.ts +11 -0
  18. package/src/__tests__/parameter-node-value.test.ts +2 -1
  19. package/src/__tests__/per-unit-video-pricing.test.ts +97 -0
  20. package/src/__tests__/producer-types.test.ts +35 -0
  21. package/src/__tests__/saved-posts.test.ts +37 -0
  22. package/src/__tests__/script-settings.test.ts +61 -0
  23. package/src/__tests__/settings-input.test.ts +252 -0
  24. package/src/__tests__/social-search.test.ts +243 -0
  25. package/src/__tests__/studio-sequence-owner.test.ts +356 -0
  26. package/src/__tests__/studio-take-voice.test.ts +200 -0
  27. package/src/__tests__/studio-transient.test.ts +71 -0
  28. package/src/__tests__/sub-gates.test.ts +21 -0
  29. package/src/__tests__/telegram-account-trigger.test.ts +120 -0
  30. package/src/__tests__/text-to-audio-pricing.test.ts +71 -0
  31. package/src/__tests__/tts-capabilities.test.ts +237 -0
  32. package/src/__tests__/video-analysis-pricing.test.ts +27 -13
  33. package/src/__tests__/video-link.test.ts +2 -2
  34. package/src/__tests__/video-utils.test.ts +89 -83
  35. package/src/__tests__/workflow-export-strip.test.ts +37 -0
  36. package/src/camera-switch-contract.ts +166 -0
  37. package/src/catalog-projection.ts +7 -0
  38. package/src/competitors.ts +430 -0
  39. package/src/content-recipe-ideas.ts +69 -0
  40. package/src/credit-estimators/index.ts +21 -0
  41. package/src/credit-estimators/ltx-extend.ts +33 -0
  42. package/src/credit-estimators/ltx-retake.ts +30 -0
  43. package/src/credit-estimators/text-to-audio.ts +58 -0
  44. package/src/credit-estimators/video-sfx.ts +41 -0
  45. package/src/credit-estimators/video-utils.ts +38 -24
  46. package/src/credit-identifiers.ts +22 -0
  47. package/src/edl-multicam.ts +220 -0
  48. package/src/exposed-field-keys.ts +49 -0
  49. package/src/fan-out-rows.ts +7 -2
  50. package/src/i18n/action-fx.ko.ts +18 -18
  51. package/src/i18n/action-fx.pt-BR.ts +66 -66
  52. package/src/i18n/aesthetic.ko.ts +49 -49
  53. package/src/i18n/aesthetic.pt-BR.ts +14 -14
  54. package/src/i18n/animals.ko.ts +126 -126
  55. package/src/i18n/animals.pt-BR.ts +33 -33
  56. package/src/i18n/atmosphere.ko.ts +37 -37
  57. package/src/i18n/atmosphere.pt-BR.ts +29 -29
  58. package/src/i18n/backdrop.ko.ts +40 -40
  59. package/src/i18n/backdrop.pt-BR.ts +38 -38
  60. package/src/i18n/camera-format.ko.ts +31 -31
  61. package/src/i18n/camera-format.pt-BR.ts +12 -12
  62. package/src/i18n/camera-motions.ko.ts +66 -66
  63. package/src/i18n/camera-motions.pt-BR.ts +51 -51
  64. package/src/i18n/character-fx.ko.ts +19 -19
  65. package/src/i18n/character-fx.pt-BR.ts +64 -52
  66. package/src/i18n/character-motion.ko.ts +164 -164
  67. package/src/i18n/character-motion.pt-BR.ts +867 -858
  68. package/src/i18n/color-look.ko.ts +41 -41
  69. package/src/i18n/color-look.pt-BR.ts +23 -23
  70. package/src/i18n/composition-effects.ko.ts +18 -18
  71. package/src/i18n/composition-effects.pt-BR.ts +17 -17
  72. package/src/i18n/era.ko.ts +28 -28
  73. package/src/i18n/era.pt-BR.ts +20 -20
  74. package/src/i18n/exposure-settings.ko.ts +20 -20
  75. package/src/i18n/exposure-settings.pt-BR.ts +3 -3
  76. package/src/i18n/framing.ko.ts +66 -66
  77. package/src/i18n/framing.pt-BR.ts +50 -50
  78. package/src/i18n/furniture.ko.ts +78 -78
  79. package/src/i18n/furniture.pt-BR.ts +46 -46
  80. package/src/i18n/held-prop.ko.ts +60 -60
  81. package/src/i18n/held-prop.pt-BR.ts +30 -30
  82. package/src/i18n/instrumentation.ko.ts +62 -62
  83. package/src/i18n/instrumentation.pt-BR.ts +64 -64
  84. package/src/i18n/lens.ko.ts +16 -16
  85. package/src/i18n/lens.pt-BR.ts +5 -5
  86. package/src/i18n/lighting.ko.ts +68 -68
  87. package/src/i18n/lighting.pt-BR.ts +43 -43
  88. package/src/i18n/loop-subject.ko.ts +1 -1
  89. package/src/i18n/loop-subject.pt-BR.ts +31 -31
  90. package/src/i18n/materials.ko.ts +66 -66
  91. package/src/i18n/materials.pt-BR.ts +22 -22
  92. package/src/i18n/mood.ko.ts +50 -50
  93. package/src/i18n/mood.pt-BR.ts +12 -12
  94. package/src/i18n/music-genre.ko.ts +28 -28
  95. package/src/i18n/music-genre.pt-BR.ts +50 -50
  96. package/src/i18n/music-mood.ko.ts +27 -27
  97. package/src/i18n/music-mood.pt-BR.ts +20 -20
  98. package/src/i18n/person.ko.ts +396 -396
  99. package/src/i18n/person.pt-BR.ts +237 -237
  100. package/src/i18n/photo-genre.ko.ts +46 -46
  101. package/src/i18n/photo-genre.pt-BR.ts +32 -32
  102. package/src/i18n/photographer.ko.ts +63 -63
  103. package/src/i18n/photographer.pt-BR.ts +15 -15
  104. package/src/i18n/pose.ko.ts +81 -81
  105. package/src/i18n/pose.pt-BR.ts +65 -65
  106. package/src/i18n/post-process-effects.ko.ts +18 -18
  107. package/src/i18n/post-process-effects.pt-BR.ts +18 -18
  108. package/src/i18n/render-quality.ko.ts +24 -24
  109. package/src/i18n/render-quality.pt-BR.ts +12 -12
  110. package/src/i18n/setting.ko.ts +64 -64
  111. package/src/i18n/setting.pt-BR.ts +41 -41
  112. package/src/i18n/style.ko.ts +49 -49
  113. package/src/i18n/style.pt-BR.ts +19 -19
  114. package/src/i18n/styling.ko.ts +265 -265
  115. package/src/i18n/styling.pt-BR.ts +141 -141
  116. package/src/i18n/temporal.ko.ts +18 -18
  117. package/src/i18n/temporal.pt-BR.ts +12 -12
  118. package/src/i18n/transitions.ko.ts +14 -14
  119. package/src/i18n/transitions.pt-BR.ts +83 -71
  120. package/src/i18n/vehicles.ko.ts +107 -107
  121. package/src/i18n/vehicles.pt-BR.ts +55 -55
  122. package/src/i18n/voice-character.ko.ts +19 -19
  123. package/src/i18n/voice-character.pt-BR.ts +19 -19
  124. package/src/i18n/voice-delivery.ko.ts +22 -22
  125. package/src/i18n/voice-delivery.pt-BR.ts +22 -22
  126. package/src/i18n/weapons.ko.ts +85 -85
  127. package/src/i18n/weapons.pt-BR.ts +46 -46
  128. package/src/index.ts +236 -1
  129. package/src/instagram-scrape.ts +91 -16
  130. package/src/llm-models.ts +11 -0
  131. package/src/model-catalog.ts +151 -16
  132. package/src/model-constants.ts +54 -16
  133. package/src/node-mappable-fields.ts +21 -5
  134. package/src/node-runtime-keys.ts +45 -0
  135. package/src/oauth-scopes.ts +28 -0
  136. package/src/parameter-node-value.ts +13 -5
  137. package/src/pipeline-defaults.ts +14 -0
  138. package/src/pipeline-state-types.ts +14 -0
  139. package/src/presentation-utils.ts +5 -1
  140. package/src/producer-types.ts +85 -0
  141. package/src/recast-segment-packs.ts +13 -0
  142. package/src/resolve-field-mappings.ts +15 -5
  143. package/src/saved-posts.ts +106 -0
  144. package/src/script-settings.ts +70 -0
  145. package/src/settings-input.ts +366 -0
  146. package/src/social-search.ts +467 -0
  147. package/src/studio-transient.ts +479 -7
  148. package/src/telegram-account-send.ts +32 -0
  149. package/src/telegram-account-trigger.ts +108 -0
  150. package/src/tts-capabilities.ts +75 -0
  151. package/src/video-analysis-pricing.ts +17 -6
  152. package/src/video-link.ts +16 -4
  153. package/src/workflow-export.ts +7 -0
package/src/index.ts CHANGED
@@ -87,7 +87,12 @@ export {
87
87
  MOTION_TRANSFER_PROVIDERS,
88
88
  TTS_PROVIDERS,
89
89
  TEXT_TO_AUDIO_PROVIDERS,
90
+ DEFAULT_TEXT_TO_AUDIO_PROVIDER,
90
91
  MUSIC_PROVIDERS,
92
+ DEFAULT_MUSIC_PROVIDER,
93
+ MUSIC_PROVIDER_LABELS,
94
+ MUSIC_CREDIT_ID,
95
+ resolveMusicProvider,
91
96
  TRANSCRIBE_PROVIDERS,
92
97
  TRANSCRIBE_LANES,
93
98
  TRANSCRIBE_PROVIDER_CAPABILITIES,
@@ -269,6 +274,8 @@ export {
269
274
  seedanceVideoEditCreditId,
270
275
  pricedVideoSelection,
271
276
  buildMotionCreditModelIdentifier,
277
+ speedRampCreditId,
278
+ applyEdlCreditId,
272
279
  sunoCreditType,
273
280
  SUNO_VERSION_CREDIT_KEYS,
274
281
  SUNO_VERSION_PRICED_OPERATIONS,
@@ -310,6 +317,12 @@ export {
310
317
  type InputFieldSchema,
311
318
  } from "./presentation-utils.js"
312
319
 
320
+ export {
321
+ LEGACY_EXPOSED_FIELD_KEYS,
322
+ canonicalExposedFieldKey,
323
+ canonicalizeOverrideKeys,
324
+ } from "./exposed-field-keys.js"
325
+
313
326
  export {
314
327
  ITER_CLONE_PATTERN,
315
328
  isExpandedClone,
@@ -642,6 +655,44 @@ export {
642
655
  } from "./node-default-mappings.js"
643
656
 
644
657
  export { NODE_MAPPABLE_FIELDS, SUNO_FIELD_HANDLE_FIELDS, fieldKeyFromHandle } from "./node-mappable-fields.js"
658
+ export { OAUTH_SCOPES, type OAuthScope } from "./oauth-scopes.js"
659
+ export { RECAST_SEGMENT_PACKS, type RecastSegmentPack } from "./recast-segment-packs.js"
660
+ export {
661
+ SETTINGS_INPUT_HANDLE,
662
+ SETTINGS_SOURCE_FIELDS,
663
+ SETTINGS_INPUT_CONSUMERS,
664
+ isSettingsSourceType,
665
+ settingsInputAccepts,
666
+ settingsInputFields,
667
+ settingsSourceForField,
668
+ settingsSourceForType,
669
+ isSettingsHintEdge,
670
+ isSettingsHintSource,
671
+ SETTINGS_HINT_SOURCES,
672
+ SETTINGS_SOURCE_TYPES,
673
+ connectedSettingsSources,
674
+ settingsProviderModels,
675
+ snapToModelDuration,
676
+ applySettingsInput,
677
+ resolveWiredSettings,
678
+ withWiredSettings,
679
+ type SettingsInputProblem,
680
+ type WiredSetting,
681
+ type SettingsSourceType,
682
+ type SettingsFieldSourceType,
683
+ type SettingsHintSourceType,
684
+ type SettingsField,
685
+ } from "./settings-input.js"
686
+ export {
687
+ readScriptSettings,
688
+ SCRIPT_SCENE_COUNT_RANGE,
689
+ SCRIPT_SCENE_COUNT_DEFAULT,
690
+ SCRIPT_TARGET_DURATION_RANGE,
691
+ SCRIPT_TARGET_DURATION_DEFAULT,
692
+ SCRIPT_TONE_MAX_LENGTH,
693
+ SCRIPT_STYLE_GUIDE_MAX_LENGTH,
694
+ type ScriptSettings,
695
+ } from "./script-settings.js"
645
696
  export {
646
697
  SCHEDULE_TRIGGER_NODE_TYPE,
647
698
  WEBHOOK_TRIGGER_NODE_TYPE,
@@ -650,6 +701,25 @@ export {
650
701
  PROJECTED_TRIGGER_NODE_TYPES,
651
702
  isProjectedTriggerNodeType,
652
703
  } from "./trigger-node-types.js"
704
+ export {
705
+ TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_HANDLE,
706
+ TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS,
707
+ TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_FIELDS,
708
+ TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES,
709
+ isTelegramAccountTriggerNamedHandle,
710
+ telegramAccountTriggerOutputs,
711
+ telegramAccountListeningSignature,
712
+ type TelegramAccountTriggerPostField,
713
+ } from "./telegram-account-trigger.js"
714
+ export {
715
+ TELEGRAM_ACCOUNT_SEND_NODE_TYPE,
716
+ TELEGRAM_SEND_AS,
717
+ TELEGRAM_SEND_DESTINATIONS,
718
+ telegramSendAsOf,
719
+ telegramSendDestinationOf,
720
+ type TelegramSendAs,
721
+ type TelegramSendDestination,
722
+ } from "./telegram-account-send.js"
653
723
 
654
724
  export { buildFeedMaps, nodeFeedsAnything, type FeedNode, type FeedEdge, type FeedMaps } from "./trigger-feeds.js"
655
725
 
@@ -771,6 +841,8 @@ export {
771
841
  resolveInstagramScrapeCreditId,
772
842
  instagramScrapeSources,
773
843
  instagramScrapeCreditIdFromNode,
844
+ instagramRequestedCount,
845
+ instagramPostLink,
774
846
  splitInstagramTargets,
775
847
  clampInstagramFeaturedIndex,
776
848
  featuredInstagramOutputs,
@@ -782,6 +854,128 @@ export {
782
854
  type InstagramNodeQuoteFields,
783
855
  } from "./instagram-scrape.js"
784
856
 
857
+ export {
858
+ SOCIAL_SEARCH_NODE_TYPE,
859
+ SOCIAL_PLATFORMS,
860
+ SOCIAL_SEARCH_MODES,
861
+ SOCIAL_SEARCH_PLATFORM_MODES,
862
+ SOCIAL_SEARCH_PERIODS,
863
+ SOCIAL_SEARCH_SORTS,
864
+ SOCIAL_SEARCH_COUNTS,
865
+ SOCIAL_SEARCH_VIDEO_KINDS,
866
+ SOCIAL_SEARCH_PAGED_MODES,
867
+ socialSearchMaxCount,
868
+ socialSearchEffectiveCount,
869
+ socialSearchRegion,
870
+ socialSearchCountry,
871
+ SOCIAL_SEARCH_DEFAULT_PICK_TOP,
872
+ SOCIAL_SEARCH_MAX_QUERY_LENGTH,
873
+ SOCIAL_SEARCH_CREDITS_PER_PAGE,
874
+ SOCIAL_SEARCH_CREDIT_COSTS,
875
+ isSocialPost,
876
+ socialPostsFrom,
877
+ socialSearchPlatform,
878
+ socialSearchMode,
879
+ socialSearchCount,
880
+ socialSearchPages,
881
+ socialSearchRequestFromNode,
882
+ socialSearchPostLink,
883
+ socialSearchPostVideo,
884
+ signedLinkExpiresAt,
885
+ socialPostsLongestVideoSec,
886
+ SOCIAL_POST_VIDEO_LINK_MARGIN_MS,
887
+ socialSearchCreditId,
888
+ socialSearchCreditIdFromNode,
889
+ socialSearchPickTop,
890
+ pickSocialPosts,
891
+ isSocialSearchPickFrozen,
892
+ socialPostDigestLine,
893
+ socialPostsDigest,
894
+ type SocialPlatform,
895
+ type SocialSearchMode,
896
+ type SocialSearchPeriod,
897
+ type SocialSearchSort,
898
+ type SocialSearchCount,
899
+ type SocialSearchVideoKind,
900
+ type SocialPost,
901
+ type SocialPostAuthor,
902
+ type SocialPostMetrics,
903
+ type SocialPostMedia,
904
+ type SocialSearchParams,
905
+ type SocialSearchPostVideo,
906
+ } from "./social-search.js"
907
+
908
+ export {
909
+ SAVED_POST_SOURCES,
910
+ SAVED_POST_NOTE_MAX,
911
+ SAVED_POST_MAX_TAGS,
912
+ SAVED_POST_TAG_MAX,
913
+ SAVED_POSTS_PAGE_MAX,
914
+ SAVED_POSTS_LOOKUP_MAX,
915
+ normalizeSavedPostTags,
916
+ type SavedPostSource,
917
+ type SavedPost,
918
+ type SavePostInput,
919
+ type UpdateSavedPostInput,
920
+ type ListSavedPostsParams,
921
+ type ListSavedPostsResult,
922
+ type SavedPostsLookupResult,
923
+ } from "./saved-posts.js"
924
+
925
+ export {
926
+ COMPETITOR_ACCOUNT_KEYS,
927
+ COMPETITOR_ABOUT_PLATFORMS,
928
+ COMPETITOR_DEFAULT_ABOUT_PLATFORMS,
929
+ COMPETITOR_SCHEDULES,
930
+ COMPETITOR_SCAN_MAX_SEARCHES,
931
+ COMPETITOR_SCAN_NODE_TYPE,
932
+ COMPETITORS_MAX,
933
+ ACTION_CARD_KINDS,
934
+ BRAND_LESSON_KINDS,
935
+ COMPETITOR_SCAN_CREDIT_COSTS,
936
+ competitorScanSearches,
937
+ competitorScanCreditId,
938
+ competitorScanCredits,
939
+ isCompetitorAboutPlatform,
940
+ ADVICE_FAMILIES,
941
+ CARD_OUTCOME_STATES,
942
+ adviceFamilyOf,
943
+ isMeasurableCard,
944
+ type AdviceFamily,
945
+ type AdviceRecord,
946
+ type CardAction,
947
+ type CardActionResult,
948
+ type CardOutcome,
949
+ type CardOutcomeState,
950
+ type CardSnapshot,
951
+ type CardVerdict,
952
+ type CompetitorActionsResult,
953
+ type MarkCardInput,
954
+ type UpdateCardActionInput,
955
+ type CompetitorAccountKey,
956
+ type CompetitorAboutPlatform,
957
+ type CompetitorSchedule,
958
+ type CompetitorAccounts,
959
+ type TrackedCompetitor,
960
+ type ActionCardKind,
961
+ type ActionCardPriority,
962
+ type ActionCard,
963
+ type CompetitorPost,
964
+ type CompetitorScanCounts,
965
+ type CompetitorScanSummary,
966
+ type CompetitorScan,
967
+ type CompetitorDetail,
968
+ type CompetitorCardsResult,
969
+ type CompetitorLessonsResult,
970
+ type BrandLesson,
971
+ type BrandLessonKind,
972
+ type BrandLessons,
973
+ type BrandPlatformLessons,
974
+ type CompetitorDiscovery,
975
+ type CreateCompetitorInput,
976
+ type UpdateCompetitorInput,
977
+ } from "./competitors.js"
978
+
785
979
  export { VARIABLES_HANDLE_ID, buildConditionVariables } from "./condition-variables.js"
786
980
 
787
981
  export { extractAllGeneratedResults, extractGeneratedJsonAsList, spreadJsonArrayIfSingleton } from "./generated-results.js"
@@ -808,7 +1002,7 @@ export {
808
1002
  export type { LottieOverlayCatalogEntry } from "./lottie-overlay-catalog.js"
809
1003
 
810
1004
 
811
- export { resolveFieldMappings, resolveLocationFields } from "./resolve-field-mappings.js"
1005
+ export { resolveFieldMappings, resolveLocationFields, type FieldEdgeSource } from "./resolve-field-mappings.js"
812
1006
 
813
1007
  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
1008
  export type { RefCandidate, ReferenceModality, RefModalityEdge, RefTokenKind } from "./node-refs.js"
@@ -915,6 +1109,7 @@ export {
915
1109
  buildModelMenu,
916
1110
  normalizeModelInput,
917
1111
  normalizeVideoRequestParams,
1112
+ fitAspectRatioToModel,
918
1113
  defaultResolutionFor,
919
1114
  } from "./model-catalog.js"
920
1115
  export type {
@@ -930,8 +1125,22 @@ export type {
930
1125
  ModelMenuOption,
931
1126
  ModelInputAdjustment,
932
1127
  NormalizedModelInput,
1128
+ TtsCapabilities,
1129
+ TtsSettingLever,
933
1130
  } from "./model-catalog.js"
934
1131
 
1132
+ // Speech-model capability lookups (derive from `ModelCatalogEntry.tts` above).
1133
+ export {
1134
+ TTS_PROVIDER_ALIASES,
1135
+ TTS_FALLBACK_PROVIDER,
1136
+ canonicalTtsProvider,
1137
+ getTtsCapabilities,
1138
+ ttsSupportsAudioTags,
1139
+ ttsSupportsSsmlBreaks,
1140
+ ttsHasLever,
1141
+ ttsLanguageCodes,
1142
+ } from "./tts-capabilities.js"
1143
+
935
1144
  // Per-model safety-filter retry/fallback policy (derives from
936
1145
  // `ModelCatalogEntry.safetyFilter` above).
937
1146
  export { safetyRetryPolicy } from "./safety-retry-policy.js"
@@ -1147,6 +1356,12 @@ export {
1147
1356
  AUDIO_PRODUCER_TYPES,
1148
1357
  DYNAMIC_PRODUCER_TYPES,
1149
1358
  FAN_OUT_EACH_TYPES,
1359
+ FAN_OUT_EACH_HANDLES,
1360
+ defaultEdgeOutputMode,
1361
+ listResultsServeHandle,
1362
+ FAN_IN_TARGETS,
1363
+ isFanInNodeType,
1364
+ isFanInEdge,
1150
1365
  } from "./producer-types.js"
1151
1366
 
1152
1367
  export { SUNO_TRACK_SOURCE_TYPES } from "./suno-track-sources.js"
@@ -1163,6 +1378,7 @@ export {
1163
1378
  detectVideoLinkPlatform,
1164
1379
  videoLinkDownloadedFile,
1165
1380
  resolveVideoLinkOutput,
1381
+ videoLinkPageUrl,
1166
1382
  videoLinkNeedsDownload,
1167
1383
  } from "./video-link.js"
1168
1384
  export type { VideoLinkPlatform, VideoLinkNodeFields } from "./video-link.js"
@@ -1248,6 +1464,9 @@ export * from "./video-analysis.js"
1248
1464
  // buildVideoAuditCreditId / videoAuditCreditsForBucket / bucketSecondsFromAuditCreditId).
1249
1465
  export * from "./video-analysis-pricing.js"
1250
1466
 
1467
+ // --- Content Recipe / Content Ideas pricing (credit ids + the per-five-ideas rule) ---
1468
+ export * from "./content-recipe-ideas.js"
1469
+
1251
1470
  // --- Unified video node UI-default fills (panel snap == strip == DAG payload) ---
1252
1471
  export * from "./video-ui-defaults.js"
1253
1472
 
@@ -1298,7 +1517,22 @@ export * from "./scene3d-render-pricing.js"
1298
1517
  export {
1299
1518
  STUDIO_TRANSIENT_KEYS,
1300
1519
  STUDIO_SHOT_TRANSIENT_KEYS,
1520
+ STUDIO_SHOT_DRAFT_KEYS,
1521
+ STUDIO_TAKE_VOICE_KEYS,
1522
+ STUDIO_PREVIZ_RUN_STATE_KEYS,
1301
1523
  stripStudioTransientSettings,
1524
+ stripStudioDraftSettings,
1525
+ stripStudioDraftWorkflow,
1526
+ stripStudioTakeVoiceRecords,
1527
+ STUDIO_TAKE_SEQUENCE_KEYS,
1528
+ STUDIO_SEQUENCE_PLANNING_KEYS,
1529
+ STUDIO_SEQUENCE_UNIT_REVIEW_KEYS,
1530
+ STUDIO_SEQUENCE_POLICY_KEYS,
1531
+ STUDIO_SEQUENCE_UNIT_MANIFEST_KEYS,
1532
+ STUDIO_KEYFRAME_NODE_TRANSIENT_KEYS,
1533
+ STUDIO_KEYFRAME_TRANSIENT_KEYS,
1534
+ STUDIO_KEYFRAME_REVIEW_KEYS,
1535
+ STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS,
1302
1536
  } from "./studio-transient.js"
1303
1537
 
1304
1538
  export * from "./scene3d-v2-edit.js"
@@ -1316,6 +1550,7 @@ export type { CharacterMotionMetadata } from "./character-motion-metadata.js"
1316
1550
  export * from "./edl.js"
1317
1551
  export * from "./speaker-layouts.js"
1318
1552
  export * from "./edl-multicam.js"
1553
+ export * from "./camera-switch-contract.js"
1319
1554
  export * from "./edit-plan-contract.js"
1320
1555
 
1321
1556
  export { VIDEO_DURATION_AUTO, isAutoVideoDuration } from "./video-duration-auto.js"
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * Instagram scraper node — shared vocabulary + credit identifiers.
3
3
  *
4
- * Pulls PUBLIC Instagram posts (feed images, carousels, reels) by profile or
5
- * by hashtag and emits a normalized JSON array. Same shape of contract as the
4
+ * Pulls PUBLIC Instagram posts (feed images, carousels, reels) by profile, by
5
+ * hashtag or by post link and emits a normalized JSON array. Same shape of contract as the
6
6
  * Meta Ads node: everything the backend guard/reservation, the frontend credit
7
7
  * badge and the docs formula must agree on lives here.
8
8
  *
9
9
  * Pricing: 1 credit per REQUESTED post, rounded UP to a fixed tier of
10
- * `count × sources` (a profile / hashtag is one source, up to 5). Optional
10
+ * `count × sources` (a profile / hashtag / post link is one source, up to 5;
11
+ * a post link is always ONE post — see `instagramRequestedCount`). Optional
11
12
  * per-post AI analysis folds into the same identifier, priced by the model's
12
13
  * tier — reusing the Meta analysis per-item values so the two nodes stay in
13
14
  * lockstep.
@@ -22,7 +23,12 @@ import { classifyCreativeFormat, type MetaAdsFormat } from "./meta-ads-scrape.js
22
23
 
23
24
  export const INSTAGRAM_SCRAPE_NODE_TYPE = "instagram-scrape" as const
24
25
 
25
- export const INSTAGRAM_SCRAPE_MODES = ["profile", "hashtag"] as const
26
+ /**
27
+ * `profile` = recent posts of an account, `hashtag` = recent posts under a tag,
28
+ * `post` = exactly the posts whose links are given (one post per link — the
29
+ * "remake this post" entry point, where a full run must land on THAT post).
30
+ */
31
+ export const INSTAGRAM_SCRAPE_MODES = ["profile", "hashtag", "post"] as const
26
32
  export type InstagramScrapeMode = (typeof INSTAGRAM_SCRAPE_MODES)[number]
27
33
 
28
34
  export function isInstagramScrapeMode(value: unknown): value is InstagramScrapeMode {
@@ -103,17 +109,70 @@ export function isInstagramScrapeCount(value: unknown): value is number {
103
109
  }
104
110
 
105
111
  /**
106
- * Targets (profile usernames/URLs or hashtags) are typed one per line; the
107
- * route wants an array. Unlike page urls a target can be a bare username /
108
- * `#tag`, so split on lines / commas only (never whitespace), strip a leading
109
- * `@` or `#`, dedupe, cap at MAX_SOURCES.
112
+ * A post link: instagram.com (any subdomain, an optional username segment
113
+ * before the kind) or instagr.am, `/p/`, `/reel/`, `/reels/` or `/tv/`, with or
114
+ * without scheme, query string or trailing slash. Group 1 = the kind, group 2 =
115
+ * the shortcode. The shortcode is CASE-SENSITIVE — two codes that differ only
116
+ * in case are two different posts — so the `i` flag only relaxes the host and
117
+ * the kind; the captured code keeps its case.
118
+ *
119
+ * Instagram's own path words are never a username: `/share/p/<token>/` (the
120
+ * token of a share redirect, not a shortcode), `/stories/…`, `/explore/…` and
121
+ * the kinds themselves would otherwise turn into a wrong post that still bills.
122
+ * `/reels/audio/<id>/` is an audio page, not a reel.
123
+ */
124
+ const INSTAGRAM_POST_LINK_RE =
125
+ /^(?:https?:\/\/)?(?:[a-z0-9-]+\.)*(?:instagram\.com|instagr\.am)\/(?:(?!(?:share|stories|explore|accounts|direct|p|reels?|tv)\/)[A-Za-z0-9._]+\/)?(p|reels?|tv)\/(?!audio(?:[/?#]|$))([A-Za-z0-9_-]+)/i
126
+
127
+ function parseInstagramPostLink(value: string): { readonly link: string; readonly shortcode: string } | null {
128
+ const match = INSTAGRAM_POST_LINK_RE.exec(value.trim())
129
+ if (!match) return null
130
+ const kind = match[1].toLowerCase()
131
+ const segment = kind === "p" ? "p" : kind === "tv" ? "tv" : "reel"
132
+ return { link: `https://www.instagram.com/${segment}/${match[2]}/`, shortcode: match[2] }
133
+ }
134
+
135
+ /** The canonical link of the post a value points at, or null when it is not an Instagram post link. */
136
+ export function instagramPostLink(value: string): string | null {
137
+ return parseInstagramPostLink(value)?.link ?? null
138
+ }
139
+
140
+ /**
141
+ * Post links, canonicalised, deduped by shortcode (`/p/X` and `/reel/X` are
142
+ * one post), capped at MAX_SOURCES. An item holding several links (an API
143
+ * caller's array entry) is split like typed text.
144
+ */
145
+ function splitInstagramPostLinks(raw: readonly string[]): string[] {
146
+ const seen = new Set<string>()
147
+ const out: string[] = []
148
+ for (const item of raw.flatMap((entry) => entry.split(/[\s,]+/))) {
149
+ const parsed = parseInstagramPostLink(item)
150
+ if (!parsed || seen.has(parsed.shortcode)) continue
151
+ seen.add(parsed.shortcode)
152
+ out.push(parsed.link)
153
+ if (out.length >= INSTAGRAM_SCRAPE_MAX_SOURCES) break
154
+ }
155
+ return out
156
+ }
157
+
158
+ /**
159
+ * Targets are typed one per line; the route wants an array.
160
+ *
161
+ * - `profile` / `hashtag` (the default — the signature predates post mode):
162
+ * a target can be a bare username / `#tag`, so split on lines / commas only
163
+ * (never whitespace), strip a leading `@` or `#`, dedupe, cap at MAX_SOURCES.
164
+ * - `post`: only Instagram post links count; each is canonicalised (see
165
+ * `instagramPostLink`) and anything else is dropped, so the guard, the
166
+ * reservation and the scrape all see the same set of posts.
110
167
  */
111
- export function splitInstagramTargets(value: unknown): string[] {
168
+ export function splitInstagramTargets(value: unknown, mode: InstagramScrapeMode = "profile"): string[] {
169
+ const separator = mode === "post" ? /[\s,]+/ : /[\n,]+/
112
170
  const raw = Array.isArray(value)
113
171
  ? value.filter((v): v is string => typeof v === "string")
114
172
  : typeof value === "string"
115
- ? value.split(/[\n,]+/)
173
+ ? value.split(separator)
116
174
  : []
175
+ if (mode === "post") return splitInstagramPostLinks(raw)
117
176
  const seen = new Set<string>()
118
177
  const out: string[] = []
119
178
  for (const item of raw) {
@@ -171,15 +230,29 @@ export interface InstagramNodeQuoteFields {
171
230
  readonly analysisModel?: unknown
172
231
  }
173
232
 
233
+ /**
234
+ * Posts requested PER SOURCE: the `count` setting, except in post mode, where
235
+ * every source is one link and so one post (the count setting does not apply).
236
+ * Every price computation goes through this, so the guard, the reservation,
237
+ * the settlement and the node's badge cannot disagree on a post-mode run.
238
+ */
239
+ export function instagramRequestedCount(mode: InstagramScrapeMode, count: number): number {
240
+ return mode === "post" ? 1 : count
241
+ }
242
+
174
243
  /** Billable source count: number of targets (min 1). */
175
244
  export function instagramScrapeSources(data: InstagramNodeQuoteFields): number {
176
- return Math.max(1, Math.min(splitInstagramTargets(data.targets).length, INSTAGRAM_SCRAPE_MAX_SOURCES))
245
+ return Math.max(1, Math.min(splitInstagramTargets(data.targets, instagramScrapeMode(data.mode)).length, INSTAGRAM_SCRAPE_MAX_SOURCES))
177
246
  }
178
247
 
179
248
  /** The ONE credit identifier for a node's current settings. */
180
249
  export function instagramScrapeCreditIdFromNode(data: InstagramNodeQuoteFields): string {
181
250
  const count = typeof data.count === "number" ? data.count : INSTAGRAM_SCRAPE_DEFAULT_COUNT
182
- return buildInstagramScrapeCreditId({ count, sources: instagramScrapeSources(data), analysis: instagramAnalysisTierFrom(data) })
251
+ return buildInstagramScrapeCreditId({
252
+ count: instagramRequestedCount(instagramScrapeMode(data.mode), count),
253
+ sources: instagramScrapeSources(data),
254
+ analysis: instagramAnalysisTierFrom(data),
255
+ })
183
256
  }
184
257
 
185
258
  /**
@@ -187,16 +260,18 @@ export function instagramScrapeCreditIdFromNode(data: InstagramNodeQuoteFields):
187
260
  * runs before Zod). Lands on the SAME tier the reservation computes.
188
261
  */
189
262
  export function resolveInstagramScrapeCreditId(body: unknown): string {
190
- const raw = body as { count?: unknown; targets?: unknown; analyze?: unknown; analysisModel?: unknown } | null | undefined
263
+ const raw = body as { mode?: unknown; count?: unknown; targets?: unknown; analyze?: unknown; analysisModel?: unknown } | null | undefined
191
264
  if (!raw || typeof raw !== "object") return INSTAGRAM_SCRAPE_FALLBACK_CREDIT_ID
192
265
  const count = raw.count === undefined ? INSTAGRAM_SCRAPE_DEFAULT_COUNT : raw.count
193
266
  if (!isInstagramScrapeCount(count)) return INSTAGRAM_SCRAPE_FALLBACK_CREDIT_ID
194
- // Same splitter the handler uses for `sources` (dedupes, caps at MAX), so the
267
+ // Same mode resolution as the route's Zod default (absent → profile) and the
268
+ // same splitter the handler uses for `sources` (dedupes, caps at MAX), so the
195
269
  // pre-Zod guard and the post-Zod reservation always land on the same tier —
196
270
  // a duplicate target bills once, not per copy.
197
- const sources = splitInstagramTargets(raw.targets).length
271
+ const mode = instagramScrapeMode(raw.mode)
272
+ const sources = splitInstagramTargets(raw.targets, mode).length
198
273
  if (sources < 1) return INSTAGRAM_SCRAPE_FALLBACK_CREDIT_ID
199
- return buildInstagramScrapeCreditId({ count, sources, analysis: instagramAnalysisTierFrom(raw) })
274
+ return buildInstagramScrapeCreditId({ count: instagramRequestedCount(mode, count), sources, analysis: instagramAnalysisTierFrom(raw) })
200
275
  }
201
276
 
202
277
  // Re-export the shared creative-format vocabulary so the node imports one place.
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
  /**