@nodaro/prompts 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -10570,6 +10570,10 @@ var clean = (u) => {
10570
10570
  return t && t.length > 0 ? t : void 0;
10571
10571
  };
10572
10572
  var cleanList = (xs) => (xs ?? []).map(clean).filter((x) => x !== void 0);
10573
+ function promptBindsFirstFrame(prompt) {
10574
+ if (!prompt) return false;
10575
+ return /@image_\d+\s+as\s+the\s+(first|opening)\s*(\(first\))?\s*frame/i.test(prompt);
10576
+ }
10573
10577
  function resolveSeedance2Inputs(args) {
10574
10578
  const firstFrameUrl = clean(args.firstFrameUrl);
10575
10579
  const lastFrameUrl = clean(args.lastFrameUrl);
@@ -10600,7 +10604,8 @@ function resolveSeedance2Inputs(args) {
10600
10604
  lastOrdinal = referenceImageUrls.length;
10601
10605
  }
10602
10606
  let promptSuffix = "";
10603
- if (firstOrdinal > 0 && lastOrdinal > 0) {
10607
+ const suppressFrameSentence = promptBindsFirstFrame(args.prompt);
10608
+ if (suppressFrameSentence && firstOrdinal > 0 && lastOrdinal === 0) ; else if (firstOrdinal > 0 && lastOrdinal > 0) {
10604
10609
  promptSuffix = `Use ${REF_BINDING.ordinal(firstOrdinal)} as the opening (first) frame and ${REF_BINDING.ordinal(lastOrdinal)} as the closing (last) frame of the video.`;
10605
10610
  } else if (firstOrdinal > 0) {
10606
10611
  promptSuffix = REF_BINDING.frame(firstOrdinal, "opening");
@@ -31750,6 +31755,7 @@ exports.listPickerCatalogs = listPickerCatalogs;
31750
31755
  exports.migratePersonValue = migratePersonValue;
31751
31756
  exports.pickerFanoutTargets = pickerFanoutTargets;
31752
31757
  exports.projectPickerCatalog = projectPickerCatalog;
31758
+ exports.promptBindsFirstFrame = promptBindsFirstFrame;
31753
31759
  exports.renderStructuredFields = renderStructuredFields;
31754
31760
  exports.resolveBrandInput = resolveBrandInput;
31755
31761
  exports.resolveCharacterMentions = resolveCharacterMentions;