@nodaro/shared 3.23.0 → 3.24.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
@@ -11674,6 +11674,18 @@ function clampChars(text, max) {
11674
11674
  const points2 = Array.from(text);
11675
11675
  return points2.length <= max ? text : points2.slice(0, max).join("");
11676
11676
  }
11677
+ function fitCollectionField(key, value) {
11678
+ switch (key) {
11679
+ case "title":
11680
+ return clampChars(value, COLLECTION_RECORD_TITLE_MAX);
11681
+ case "text":
11682
+ return clampChars(value, COLLECTION_RECORD_TEXT_MAX);
11683
+ case "dedupeKey":
11684
+ return clampChars(value, COLLECTION_DEDUPE_KEY_MAX);
11685
+ case "link":
11686
+ return value.length <= COLLECTION_RECORD_URL_MAX ? value : void 0;
11687
+ }
11688
+ }
11677
11689
  function normalizeDedupeKey(raw) {
11678
11690
  if (typeof raw === "number" && Number.isFinite(raw)) raw = String(raw);
11679
11691
  if (typeof raw !== "string") return null;
@@ -23059,7 +23071,22 @@ var LEGACY_SOURCE_HANDLE_ALIASES = {
23059
23071
  "telegram-channel-feed": { out: "text" },
23060
23072
  // Telegram Trigger: the docs once named six outputs; the component renders
23061
23073
  // one, `out`, and media rides it by kind on both engines.
23062
- "telegram-trigger": { text: "out", imageUrl: "out", videoUrl: "out", audioUrl: "out" }
23074
+ "telegram-trigger": { text: "out", imageUrl: "out", videoUrl: "out", audioUrl: "out" },
23075
+ // #1877 — the definitions now declare the pips these components render. The
23076
+ // id they used to declare (what MCP clients and the docs were told) moves
23077
+ // onto the pip that draws, so an edge written with it still connects.
23078
+ "add-captions": { video: "video-out" },
23079
+ "adjust-volume": { audio: "audio-out" },
23080
+ "audio-fx": { audio: "audio-out" },
23081
+ "combine-audio": { audio: "audio-out" },
23082
+ "loop-video": { video: "video-out" },
23083
+ "merge-video-audio": { video: "video-out" },
23084
+ "mix-audio": { audio: "audio-out" },
23085
+ "resize-video": { video: "video-out" },
23086
+ "trim-video": { video: "video-out" },
23087
+ "save-to-storage": { asset: "out" }
23088
+ // (audio-separation's old `audio` is NOT aliased: it could mean any of the
23089
+ // seven stems, and a stem is never guessed.)
23063
23090
  };
23064
23091
  var LEGACY_TARGET_HANDLE_ALIASES = {
23065
23092
  // Batch 1
@@ -23181,28 +23208,7 @@ function classifyLegacyTargetHandle(targetType, handle, sourceType, sentHandle =
23181
23208
  }
23182
23209
  return handle;
23183
23210
  }
23184
- var RENDERED_OUTPUT_HANDLES = {
23185
- // The ffmpeg family shipped `video-out` / `audio-out` pips through a
23186
- // different migration (single `in` retained) and was left out of the alias
23187
- // pass on purpose.
23188
- "add-captions": ["video-out"],
23189
- "adjust-volume": ["audio-out", "video-out"],
23190
- "audio-fx": ["audio-out"],
23191
- "combine-audio": ["audio-out"],
23192
- "loop-video": ["video-out"],
23193
- "merge-video-audio": ["video-out"],
23194
- "mix-audio": ["audio-out"],
23195
- "resize-video": ["video-out"],
23196
- "trim-video": ["video-out"],
23197
- // Output nodes: a pass-through `out` pip the definition does not declare.
23198
- "save-to-storage": ["out"],
23199
- "sub-workflow-output": ["out"],
23200
- "webhook-output": ["out"],
23201
- // Stem separator: one declared `audio` output, a pip per stem rendered.
23202
- "audio-separation": ["bass", "drums", "guitar", "instrumental", "other", "piano", "vocals"],
23203
- // Dual-mode revoice: the video pip is rendered but undeclared.
23204
- "voice-changer": ["audio", "video"]
23205
- };
23211
+ var RENDERED_OUTPUT_HANDLES = {};
23206
23212
  function renderedSourceHandle(nodeType, handle, declaredOutputs) {
23207
23213
  if (!nodeType || !handle) return null;
23208
23214
  const rendered = RENDERED_OUTPUT_HANDLES[nodeType];
@@ -24428,6 +24434,7 @@ exports.findUgcLockedFields = findUgcLockedFields;
24428
24434
  exports.findWordlessTranscriptFeeds = findWordlessTranscriptFeeds;
24429
24435
  exports.firstSightExtraRole = firstSightExtraRole;
24430
24436
  exports.fitAspectRatioToModel = fitAspectRatioToModel;
24437
+ exports.fitCollectionField = fitCollectionField;
24431
24438
  exports.flattenItems = flattenItems;
24432
24439
  exports.formatVideoOverlayError = formatVideoOverlayError;
24433
24440
  exports.getAnimal = getAnimal;