@nodaro/prompts 1.38.0 → 1.40.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 (130) hide show
  1. package/dist/chunk-2EW5B7ZV.cjs +86 -0
  2. package/dist/chunk-2EW5B7ZV.cjs.map +1 -0
  3. package/dist/chunk-2P26SZX5.cjs +414 -0
  4. package/dist/chunk-2P26SZX5.cjs.map +1 -0
  5. package/dist/{chunk-7XKHDXCL.cjs → chunk-3U7X6JZN.cjs} +13 -12
  6. package/dist/chunk-3U7X6JZN.cjs.map +1 -0
  7. package/dist/chunk-4GKTOVFM.cjs +8 -0
  8. package/dist/chunk-4GKTOVFM.cjs.map +1 -0
  9. package/dist/{chunk-HRBBNODV.js → chunk-6GVFJLDL.js} +4 -3
  10. package/dist/chunk-6GVFJLDL.js.map +1 -0
  11. package/dist/{chunk-LVSH7K7R.cjs → chunk-C3NHNECH.cjs} +165 -88
  12. package/dist/chunk-C3NHNECH.cjs.map +1 -0
  13. package/dist/{chunk-CEPVQQVO.js → chunk-C46256GZ.js} +43 -5
  14. package/dist/chunk-C46256GZ.js.map +1 -0
  15. package/dist/{chunk-JKCR6WRZ.cjs → chunk-DQFQJECU.cjs} +43 -5
  16. package/dist/chunk-DQFQJECU.cjs.map +1 -0
  17. package/dist/{chunk-QDEWBBUR.js → chunk-DUXX6CBX.js} +12 -143
  18. package/dist/chunk-DUXX6CBX.js.map +1 -0
  19. package/dist/chunk-EAYEZXWT.js +388 -0
  20. package/dist/chunk-EAYEZXWT.js.map +1 -0
  21. package/dist/chunk-GILUVQQJ.js +6 -0
  22. package/dist/chunk-GILUVQQJ.js.map +1 -0
  23. package/dist/{chunk-KIYNOOPJ.js → chunk-GTDKDD7Y.js} +12 -6
  24. package/dist/chunk-GTDKDD7Y.js.map +1 -0
  25. package/dist/{chunk-QBEZMR2F.js → chunk-HQTHDTHN.js} +137 -62
  26. package/dist/chunk-HQTHDTHN.js.map +1 -0
  27. package/dist/{chunk-TLVX5PXD.cjs → chunk-IUCNJAHW.cjs} +13 -7
  28. package/dist/chunk-IUCNJAHW.cjs.map +1 -0
  29. package/dist/{chunk-ZFIXQRBZ.cjs → chunk-LXPKTI2K.cjs} +12 -83
  30. package/dist/chunk-LXPKTI2K.cjs.map +1 -0
  31. package/dist/{chunk-CVPB2N3Z.cjs → chunk-LZ53F5BN.cjs} +103 -5
  32. package/dist/chunk-LZ53F5BN.cjs.map +1 -0
  33. package/dist/{chunk-4FDNVNJE.js → chunk-N6VMPG5S.js} +12 -79
  34. package/dist/chunk-N6VMPG5S.js.map +1 -0
  35. package/dist/{chunk-LK2CZK5U.cjs → chunk-PWWM7Q3T.cjs} +7 -7
  36. package/dist/{chunk-LK2CZK5U.cjs.map → chunk-PWWM7Q3T.cjs.map} +1 -1
  37. package/dist/{chunk-N7TOWXDJ.js → chunk-QDUTMOF4.js} +3 -3
  38. package/dist/{chunk-N7TOWXDJ.js.map → chunk-QDUTMOF4.js.map} +1 -1
  39. package/dist/{chunk-NO6XHX4R.js → chunk-RB2F5JQF.js} +100 -7
  40. package/dist/chunk-RB2F5JQF.js.map +1 -0
  41. package/dist/{chunk-MENBHEAY.cjs → chunk-WRM52ZBN.cjs} +19 -161
  42. package/dist/chunk-WRM52ZBN.cjs.map +1 -0
  43. package/dist/chunk-YS6HOWMW.js +80 -0
  44. package/dist/chunk-YS6HOWMW.js.map +1 -0
  45. package/dist/entries/assembly.cjs +34 -25
  46. package/dist/entries/assembly.d.cts +121 -37
  47. package/dist/entries/assembly.d.ts +121 -37
  48. package/dist/entries/assembly.js +5 -4
  49. package/dist/entries/doctrine.cjs +46 -46
  50. package/dist/entries/doctrine.d.cts +3 -3
  51. package/dist/entries/doctrine.d.ts +3 -3
  52. package/dist/entries/doctrine.js +1 -1
  53. package/dist/entries/picker-catalogs.cjs +42 -42
  54. package/dist/entries/picker-catalogs.js +3 -3
  55. package/dist/entries/presets.cjs +49 -26
  56. package/dist/entries/presets.d.cts +53 -1
  57. package/dist/entries/presets.d.ts +53 -1
  58. package/dist/entries/presets.js +4 -1
  59. package/dist/entries/prompt-builder.cjs +135 -98
  60. package/dist/entries/prompt-builder.d.cts +22 -11
  61. package/dist/entries/prompt-builder.d.ts +22 -11
  62. package/dist/entries/prompt-builder.js +4 -3
  63. package/dist/entries/prompt-fields.cjs +41 -40
  64. package/dist/entries/prompt-fields.d.cts +2 -1
  65. package/dist/entries/prompt-fields.d.ts +2 -1
  66. package/dist/entries/prompt-fields.js +2 -1
  67. package/dist/index.cjs +339 -273
  68. package/dist/index.d.cts +4 -4
  69. package/dist/index.d.ts +4 -4
  70. package/dist/index.js +11 -9
  71. package/dist/{subject-registry-BUswuEVD.d.cts → subject-registry-CQi_CZfJ.d.cts} +78 -9
  72. package/dist/{subject-registry-D7V8PEG-.d.ts → subject-registry-DFiGx49v.d.ts} +78 -9
  73. package/package.json +2 -2
  74. package/src/__tests__/assemble-image-input-style-references.test.ts +173 -0
  75. package/src/__tests__/catalog-id-guard.test.ts +30 -0
  76. package/src/__tests__/factory-preset-previews.test.ts +123 -0
  77. package/src/__tests__/factory-preset-references.test.ts +222 -0
  78. package/src/__tests__/factory-presets-prototype-keys.test.ts +43 -0
  79. package/src/__tests__/frame-reference-slots.test.ts +43 -0
  80. package/src/__tests__/gemini-omni-inputs.test.ts +12 -10
  81. package/src/__tests__/provider-prompt-doctrine.test.ts +14 -0
  82. package/src/__tests__/user-direction-refs.test.ts +180 -0
  83. package/src/__tests__/veo-i2v-inputs.test.ts +16 -11
  84. package/src/assemble-image-input.ts +114 -13
  85. package/src/catalog-id-guard.ts +18 -2
  86. package/src/color-names.ts +192 -0
  87. package/src/direction-registry.ts +66 -5
  88. package/src/entries/assembly.ts +1 -0
  89. package/src/entries/prompt-builder.ts +2 -0
  90. package/src/factory-presets/generate-image.ts +29 -0
  91. package/src/factory-presets/index.ts +6 -1
  92. package/src/factory-presets/preview-files.generated.ts +4 -0
  93. package/src/factory-presets/previews.ts +40 -0
  94. package/src/factory-presets/references.ts +81 -0
  95. package/src/factory-presets/shared-image.ts +4 -0
  96. package/src/factory-presets/types.ts +8 -0
  97. package/src/frame-reference-slots.ts +92 -0
  98. package/src/gemini-omni-inputs.ts +23 -22
  99. package/src/image-reference-doctrine.ts +3 -3
  100. package/src/image-token-pattern.ts +13 -0
  101. package/src/node-prompt-fields.ts +5 -3
  102. package/src/own-entry.ts +11 -0
  103. package/src/prompt-builder.ts +4 -5
  104. package/src/prompt-style-section.ts +3 -3
  105. package/src/prompt-wizard-categories.ts +2 -0
  106. package/src/provider-prompt-doctrine.ts +45 -3
  107. package/src/ref-binding.ts +28 -3
  108. package/src/resolve-prompt.ts +2 -1
  109. package/src/seedance-2-inputs.ts +15 -40
  110. package/src/user-direction-refs.ts +110 -0
  111. package/src/veo-i2v-inputs.ts +24 -17
  112. package/src/video-reference-resolver.ts +1 -1
  113. package/dist/chunk-4FDNVNJE.js.map +0 -1
  114. package/dist/chunk-7XKHDXCL.cjs.map +0 -1
  115. package/dist/chunk-CEPVQQVO.js.map +0 -1
  116. package/dist/chunk-CVPB2N3Z.cjs.map +0 -1
  117. package/dist/chunk-HRBBNODV.js.map +0 -1
  118. package/dist/chunk-JKCR6WRZ.cjs.map +0 -1
  119. package/dist/chunk-KIYNOOPJ.js.map +0 -1
  120. package/dist/chunk-LVSH7K7R.cjs.map +0 -1
  121. package/dist/chunk-MENBHEAY.cjs.map +0 -1
  122. package/dist/chunk-NO6XHX4R.js.map +0 -1
  123. package/dist/chunk-QBEZMR2F.js.map +0 -1
  124. package/dist/chunk-QDEWBBUR.js.map +0 -1
  125. package/dist/chunk-TLVX5PXD.cjs.map +0 -1
  126. package/dist/chunk-UJKFHPZ7.js +0 -37
  127. package/dist/chunk-UJKFHPZ7.js.map +0 -1
  128. package/dist/chunk-W5SCZIOB.cjs +0 -43
  129. package/dist/chunk-W5SCZIOB.cjs.map +0 -1
  130. package/dist/chunk-ZFIXQRBZ.cjs.map +0 -1
@@ -0,0 +1,80 @@
1
+ import { computeNodePrompt, computeScriptTopic, computeLlmChatFields } from './chunk-N6VMPG5S.js';
2
+ import { resolveNodeRefs } from '@nodaro/shared/workflow';
3
+ import { SOCIAL_POST_NODE_TYPES } from '@nodaro/shared/social';
4
+
5
+ // src/audio-tags.ts
6
+ function removeBracketTags(text) {
7
+ let out = "";
8
+ let from = 0;
9
+ let open = text.indexOf("[");
10
+ while (open !== -1) {
11
+ const close = text.indexOf("]", open + 1);
12
+ if (close === -1) break;
13
+ if (close === open + 1) {
14
+ open = text.indexOf("[", open + 1);
15
+ continue;
16
+ }
17
+ out += text.slice(from, open);
18
+ from = close + 1;
19
+ open = text.indexOf("[", from);
20
+ }
21
+ return out + text.slice(from);
22
+ }
23
+ function stripAudioTags(text) {
24
+ return removeBracketTags(text).replace(/\s{2,}/g, " ").trim();
25
+ }
26
+ var WIRED_OUTPUT_NODE_TYPES = /* @__PURE__ */ new Set(["webhook-output", ...SOCIAL_POST_NODE_TYPES]);
27
+ var TEXT_REQUIRED_NODE_TYPES = /* @__PURE__ */ new Set([
28
+ "llm-chat",
29
+ "ai-writer",
30
+ "generate-script",
31
+ "text-to-speech",
32
+ "generate-music",
33
+ "text-to-audio",
34
+ // Save to Collection refuses an empty record ("nothing to save"): a feed
35
+ // with nothing new wired straight into it must skip it, not fail the run.
36
+ "collection-write",
37
+ // Generate Image: an empty prompt is a legal request in general (references
38
+ // alone), but when the text it was WIRED produced nothing this run — the skip
39
+ // rule's precondition — an empty prompt is a paid picture of nothing.
40
+ "generate-image"
41
+ ]);
42
+ var withoutAffixes = (data) => ({ ...data, promptPrefix: void 0, promptSuffix: void 0 });
43
+ var present = (s) => typeof s === "string" && s.trim().length > 0;
44
+ function computeAiWriterInput(data, { override, wired }) {
45
+ return [override, wired, data.userInput, data.prompt].find(present) ?? "";
46
+ }
47
+ function computeNodeSendText(nodeType, data, args) {
48
+ const bare = withoutAffixes(data);
49
+ switch (nodeType) {
50
+ case "llm-chat":
51
+ return computeLlmChatFields(bare, {
52
+ override: args.override,
53
+ wiredUserInput: args.wired,
54
+ wiredSystemPrompt: args.wiredSystemPrompt,
55
+ refMap: args.refMap
56
+ }).userInput;
57
+ case "ai-writer":
58
+ return computeAiWriterInput(bare, args);
59
+ case "generate-script":
60
+ return computeScriptTopic(bare, { override: args.override, wired: args.wired, refMap: args.refMap });
61
+ case "generate-music": {
62
+ const prompt = computeNodePrompt(nodeType, bare, { override: args.override, wired: args.wired, refMap: args.refMap });
63
+ return present(prompt) ? prompt : present(data.lyrics) ? data.lyrics : "";
64
+ }
65
+ case "text-to-speech":
66
+ case "text-to-audio":
67
+ case "generate-image":
68
+ return computeNodePrompt(nodeType, bare, { override: args.override, wired: args.wired, refMap: args.refMap });
69
+ case "collection-write": {
70
+ const typed = [data.title, data.text, data.link].map((v) => typeof v === "string" ? resolveNodeRefs(v, args.refMap) : v).find((v) => present(v));
71
+ return [args.override, args.wired, typed].find(present) ?? "";
72
+ }
73
+ default:
74
+ return void 0;
75
+ }
76
+ }
77
+
78
+ export { TEXT_REQUIRED_NODE_TYPES, WIRED_OUTPUT_NODE_TYPES, computeAiWriterInput, computeNodeSendText, stripAudioTags };
79
+ //# sourceMappingURL=chunk-YS6HOWMW.js.map
80
+ //# sourceMappingURL=chunk-YS6HOWMW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/audio-tags.ts","../src/node-send-text.ts"],"names":[],"mappings":"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","file":"chunk-YS6HOWMW.js","sourcesContent":["/**\n * Remove inline `[audio tags]` from speech text, for a model that does not\n * perform them (it would read them aloud). Pure, dependency-free: the\n * backend's credit counter (lib/speech-credits.ts), its payload builder and\n * the editor's estimate (frontend/src/lib/speech-estimate.ts) all read it, so\n * the two engines count exactly the same characters.\n *\n * A tag is `[`, one or more characters that are not `]`, then `]` — what\n * `/\\[[^\\]]+\\]/g` matches. That pattern is quadratic on an unclosed run of `[`\n * (every `[` rescans to the end of the text), and the credit counter runs this\n * on raw request text on the API and orchestrator event loops, so the scan is\n * written by hand: one `indexOf` per `[`, and when no `]` is left no later `[`\n * can match either, so the rest of the text is kept in one slice.\n */\nfunction removeBracketTags(text: string): string {\n let out = \"\"\n let from = 0\n let open = text.indexOf(\"[\")\n while (open !== -1) {\n const close = text.indexOf(\"]\", open + 1)\n if (close === -1) break\n if (close === open + 1) {\n // \"[]\" is not a tag (needs 1+ characters); the \"[\" stays and the scan moves on.\n open = text.indexOf(\"[\", open + 1)\n continue\n }\n out += text.slice(from, open)\n from = close + 1\n open = text.indexOf(\"[\", from)\n }\n return out + text.slice(from)\n}\n\nexport function stripAudioTags(text: string): string {\n return removeBracketTags(text).replace(/\\s{2,}/g, \" \").trim()\n}\n","import { resolveNodeRefs } from \"@nodaro/shared/workflow\"\nimport { SOCIAL_POST_NODE_TYPES } from \"@nodaro/shared/social\"\nimport { computeLlmChatFields, computeNodePrompt, computeScriptTopic } from \"./resolve-prompt.js\"\n\n/**\n * Output nodes that send exactly what is WIRED into them — a webhook's\n * parameters, a social post's caption and media. When every wire produced\n * nothing in this run (a Filter List that kept no row, a node that was itself\n * skipped), there is nothing to send: the node is skipped with\n * `skipReason: \"empty_input\"` instead of posting an empty payload (a site that\n * validates its input answers 400 and alerts its owner) or failing the run\n * (a publish route refuses a post with no text and no media). A typed caption\n * with no wire at all is the author's choice and still runs, as before. ONE\n * list, read by the orchestrator's skip rule (`empty-input-skips.ts`).\n */\nexport const WIRED_OUTPUT_NODE_TYPES: ReadonlySet<string> = new Set([\"webhook-output\", ...SOCIAL_POST_NODE_TYPES])\n\n/**\n * Node types that send TEXT to a model or a voice and fail on an empty one —\n * `userInput: Too small` (llm-chat), \"no text found\" (text-to-speech) — so a\n * run with nothing upstream can skip them instead of failing. Never an image\n * or video node (an empty prompt is a legal request there) and never a social\n * post (an empty caption is the author's choice). ONE list, read by the\n * orchestrator's skip rule (`empty-input-skips.ts`); the engine never names a\n * type on its own.\n */\nexport const TEXT_REQUIRED_NODE_TYPES: ReadonlySet<string> = new Set([\n \"llm-chat\",\n \"ai-writer\",\n \"generate-script\",\n \"text-to-speech\",\n \"generate-music\",\n \"text-to-audio\",\n // Save to Collection refuses an empty record (\"nothing to save\"): a feed\n // with nothing new wired straight into it must skip it, not fail the run.\n \"collection-write\",\n // Generate Image: an empty prompt is a legal request in general (references\n // alone), but when the text it was WIRED produced nothing this run — the skip\n // rule's precondition — an empty prompt is a paid picture of nothing.\n \"generate-image\",\n])\n\n/**\n * The node's data without its prompt pre/post text: the skip decision is about\n * the CORE text. A prefix alone (\"Write a news item about:\") is not something\n * to send — with the affixes applied, an empty core read as non-empty and an\n * idle tick paid for a model call on the prefix.\n */\nconst withoutAffixes = (data: Record<string, unknown>): Record<string, unknown> => ({ ...data, promptPrefix: undefined, promptSuffix: undefined })\n\nexport interface NodeSendTextArgs {\n /** A list fan-out item (highest precedence). */\n override?: string\n /** The text wired into the node's main text input. */\n wired?: string\n /** llm-chat only: the text wired into `system-prompt`. */\n wiredSystemPrompt?: string\n refMap: ReadonlyMap<string, string>\n}\n\nconst present = (s?: string): s is string => typeof s === \"string\" && s.trim().length > 0\n\n/**\n * ai-writer's user input — the rule its sync-HTTP body applies: a fan-out\n * item, else the wired text, else the typed `userInput`, else the legacy\n * `prompt`. (ai-writer is renamed to llm-chat on load; saved graphs that\n * never reloaded still run it.)\n */\nexport function computeAiWriterInput(\n data: Record<string, unknown>,\n { override, wired }: Pick<NodeSendTextArgs, \"override\" | \"wired\">,\n): string {\n return [override, wired, data.userInput as string | undefined, data.prompt as string | undefined].find(present) ?? \"\"\n}\n\n/**\n * The text a text-requiring node would send, by the SAME rule its executor\n * uses (`computeLlmChatFields`, `computeScriptTopic`, `computeNodePrompt`,\n * `computeAiWriterInput`) — so \"would this node run on nothing?\" is answered\n * by the function that decides what it sends, not by a second reading of it.\n * Undefined for any other node type.\n */\nexport function computeNodeSendText(\n nodeType: string,\n data: Record<string, unknown>,\n args: NodeSendTextArgs,\n): string | undefined {\n const bare = withoutAffixes(data)\n switch (nodeType) {\n case \"llm-chat\":\n return computeLlmChatFields(bare, {\n override: args.override,\n wiredUserInput: args.wired,\n wiredSystemPrompt: args.wiredSystemPrompt,\n refMap: args.refMap,\n }).userInput\n case \"ai-writer\":\n return computeAiWriterInput(bare, args)\n case \"generate-script\":\n return computeScriptTopic(bare, { override: args.override, wired: args.wired, refMap: args.refMap })\n case \"generate-music\": {\n // A music node sings typed lyrics with no prompt; only both empty is nothing to send.\n const prompt = computeNodePrompt(nodeType, bare, { override: args.override, wired: args.wired, refMap: args.refMap })\n return present(prompt) ? prompt : present(data.lyrics as string | undefined) ? (data.lyrics as string) : \"\"\n }\n case \"text-to-speech\":\n case \"text-to-audio\":\n case \"generate-image\":\n return computeNodePrompt(nodeType, bare, { override: args.override, wired: args.wired, refMap: args.refMap })\n case \"collection-write\": {\n // The record's content: the item (a fan-out row, else what reached `in`),\n // else a title, text or link typed on the node. A picture alone is a\n // record too, but it never starves the node: only a wired TEXT input that\n // produced nothing can (the skip rule's precondition).\n // A typed field counts as the engines send it, its `{Node}` references\n // resolved: `{Feed || }` over a feed with nothing new is empty, so the\n // node skips instead of failing with an empty record (#1890).\n const typed = [data.title, data.text, data.link]\n .map((v) => (typeof v === \"string\" ? resolveNodeRefs(v, args.refMap) : v))\n .find((v): v is string => present(v as string | undefined))\n return [args.override, args.wired, typed].find(present) ?? \"\"\n }\n default:\n return undefined\n }\n}\n"]}
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkLVSH7K7R_cjs = require('../chunk-LVSH7K7R.cjs');
4
- require('../chunk-MENBHEAY.cjs');
3
+ var chunkC3NHNECH_cjs = require('../chunk-C3NHNECH.cjs');
4
+ require('../chunk-WRM52ZBN.cjs');
5
+ require('../chunk-4GKTOVFM.cjs');
5
6
  require('../chunk-XUZXBY75.cjs');
6
7
  require('../chunk-UXDKZVNN.cjs');
7
8
  require('../chunk-2NJTFCKQ.cjs');
8
- require('../chunk-LK2CZK5U.cjs');
9
- require('../chunk-W5SCZIOB.cjs');
9
+ require('../chunk-PWWM7Q3T.cjs');
10
+ require('../chunk-2P26SZX5.cjs');
10
11
  require('../chunk-MQEXFCNU.cjs');
11
12
  require('../chunk-3UEA3UHQ.cjs');
12
13
  require('../chunk-K6NT635Z.cjs');
@@ -18,87 +19,95 @@ require('../chunk-Q7SFCCGT.cjs');
18
19
 
19
20
  Object.defineProperty(exports, "REF_BINDING", {
20
21
  enumerable: true,
21
- get: function () { return chunkLVSH7K7R_cjs.REF_BINDING; }
22
+ get: function () { return chunkC3NHNECH_cjs.REF_BINDING; }
22
23
  });
23
24
  Object.defineProperty(exports, "SEEDANCE_VIDEO_EDIT_PREFIX", {
24
25
  enumerable: true,
25
- get: function () { return chunkLVSH7K7R_cjs.SEEDANCE_VIDEO_EDIT_PREFIX; }
26
+ get: function () { return chunkC3NHNECH_cjs.SEEDANCE_VIDEO_EDIT_PREFIX; }
26
27
  });
27
28
  Object.defineProperty(exports, "appendField", {
28
29
  enumerable: true,
29
- get: function () { return chunkLVSH7K7R_cjs.appendField; }
30
+ get: function () { return chunkC3NHNECH_cjs.appendField; }
30
31
  });
31
32
  Object.defineProperty(exports, "appendMusicMeta", {
32
33
  enumerable: true,
33
- get: function () { return chunkLVSH7K7R_cjs.appendMusicMeta; }
34
+ get: function () { return chunkC3NHNECH_cjs.appendMusicMeta; }
34
35
  });
35
36
  Object.defineProperty(exports, "assembleImageInput", {
36
37
  enumerable: true,
37
- get: function () { return chunkLVSH7K7R_cjs.assembleImageInput; }
38
+ get: function () { return chunkC3NHNECH_cjs.assembleImageInput; }
38
39
  });
39
40
  Object.defineProperty(exports, "assembleSunoInput", {
40
41
  enumerable: true,
41
- get: function () { return chunkLVSH7K7R_cjs.assembleSunoInput; }
42
+ get: function () { return chunkC3NHNECH_cjs.assembleSunoInput; }
42
43
  });
43
44
  Object.defineProperty(exports, "buildSeedanceVideoEditPrompt", {
44
45
  enumerable: true,
45
- get: function () { return chunkLVSH7K7R_cjs.buildSeedanceVideoEditPrompt; }
46
+ get: function () { return chunkC3NHNECH_cjs.buildSeedanceVideoEditPrompt; }
46
47
  });
47
48
  Object.defineProperty(exports, "buildSurroundFillPrompt", {
48
49
  enumerable: true,
49
- get: function () { return chunkLVSH7K7R_cjs.buildSurroundFillPrompt; }
50
+ get: function () { return chunkC3NHNECH_cjs.buildSurroundFillPrompt; }
50
51
  });
51
52
  Object.defineProperty(exports, "composeSoundHintFromConnections", {
52
53
  enumerable: true,
53
- get: function () { return chunkLVSH7K7R_cjs.composeSoundHintFromConnections; }
54
+ get: function () { return chunkC3NHNECH_cjs.composeSoundHintFromConnections; }
54
55
  });
55
56
  Object.defineProperty(exports, "composeVideoPromptText", {
56
57
  enumerable: true,
57
- get: function () { return chunkLVSH7K7R_cjs.composeVideoPromptText; }
58
+ get: function () { return chunkC3NHNECH_cjs.composeVideoPromptText; }
58
59
  });
59
60
  Object.defineProperty(exports, "getEffectiveSunoCustomMode", {
60
61
  enumerable: true,
61
- get: function () { return chunkLVSH7K7R_cjs.getEffectiveSunoCustomMode; }
62
+ get: function () { return chunkC3NHNECH_cjs.getEffectiveSunoCustomMode; }
62
63
  });
63
64
  Object.defineProperty(exports, "identityRefsSentence", {
64
65
  enumerable: true,
65
- get: function () { return chunkLVSH7K7R_cjs.identityRefsSentence; }
66
+ get: function () { return chunkC3NHNECH_cjs.identityRefsSentence; }
67
+ });
68
+ Object.defineProperty(exports, "imageBindingFor", {
69
+ enumerable: true,
70
+ get: function () { return chunkC3NHNECH_cjs.imageBindingFor; }
71
+ });
72
+ Object.defineProperty(exports, "placeFramesAfterReferences", {
73
+ enumerable: true,
74
+ get: function () { return chunkC3NHNECH_cjs.placeFramesAfterReferences; }
66
75
  });
67
76
  Object.defineProperty(exports, "planFrameDelivery", {
68
77
  enumerable: true,
69
- get: function () { return chunkLVSH7K7R_cjs.planFrameDelivery; }
78
+ get: function () { return chunkC3NHNECH_cjs.planFrameDelivery; }
70
79
  });
71
80
  Object.defineProperty(exports, "promptBindsFirstFrame", {
72
81
  enumerable: true,
73
- get: function () { return chunkLVSH7K7R_cjs.promptBindsFirstFrame; }
82
+ get: function () { return chunkC3NHNECH_cjs.promptBindsFirstFrame; }
74
83
  });
75
84
  Object.defineProperty(exports, "resolveGeminiOmniI2vInputs", {
76
85
  enumerable: true,
77
- get: function () { return chunkLVSH7K7R_cjs.resolveGeminiOmniI2vInputs; }
86
+ get: function () { return chunkC3NHNECH_cjs.resolveGeminiOmniI2vInputs; }
78
87
  });
79
88
  Object.defineProperty(exports, "resolveRefIdTokens", {
80
89
  enumerable: true,
81
- get: function () { return chunkLVSH7K7R_cjs.resolveRefIdTokens; }
90
+ get: function () { return chunkC3NHNECH_cjs.resolveRefIdTokens; }
82
91
  });
83
92
  Object.defineProperty(exports, "resolveReferenceTokens", {
84
93
  enumerable: true,
85
- get: function () { return chunkLVSH7K7R_cjs.resolveReferenceTokens; }
94
+ get: function () { return chunkC3NHNECH_cjs.resolveReferenceTokens; }
86
95
  });
87
96
  Object.defineProperty(exports, "resolveSeedance2Inputs", {
88
97
  enumerable: true,
89
- get: function () { return chunkLVSH7K7R_cjs.resolveSeedance2Inputs; }
98
+ get: function () { return chunkC3NHNECH_cjs.resolveSeedance2Inputs; }
90
99
  });
91
100
  Object.defineProperty(exports, "resolveVeoI2vInputs", {
92
101
  enumerable: true,
93
- get: function () { return chunkLVSH7K7R_cjs.resolveVeoI2vInputs; }
102
+ get: function () { return chunkC3NHNECH_cjs.resolveVeoI2vInputs; }
94
103
  });
95
104
  Object.defineProperty(exports, "resolveVideoReferenceCore", {
96
105
  enumerable: true,
97
- get: function () { return chunkLVSH7K7R_cjs.resolveVideoReferenceCore; }
106
+ get: function () { return chunkC3NHNECH_cjs.resolveVideoReferenceCore; }
98
107
  });
99
108
  Object.defineProperty(exports, "truncateForField", {
100
109
  enumerable: true,
101
- get: function () { return chunkLVSH7K7R_cjs.truncateForField; }
110
+ get: function () { return chunkC3NHNECH_cjs.truncateForField; }
102
111
  });
103
112
  //# sourceMappingURL=assembly.cjs.map
104
113
  //# sourceMappingURL=assembly.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { UsageMode, SurroundDirection } from '@nodaro/shared/entities';
2
2
  import { ConnectedReference, DescribedReference, HintNodeLike, HintGraphContext, IdentityMeta, CharacterDef } from '@nodaro/shared/types';
3
- import { k as DirectionFields, N as SubjectFields, J as StructuredPromptFields, c as BuildImagePromptResult, m as DirectionHintMode, Q as SubjectHintMode } from '../subject-registry-BUswuEVD.cjs';
3
+ import { k as DirectionFields, L as StyleReferenceInput, Q as SubjectFields, K as StructuredPromptFields, c as BuildImagePromptResult, m as DirectionHintMode, U as SubjectHintMode } from '../subject-registry-CQi_CZfJ.cjs';
4
4
  import { FrameDelivery } from '@nodaro/shared/video';
5
5
  import '../term-C01_g6s1.cjs';
6
6
  import '../transitions-BLFfAJUH.cjs';
@@ -34,7 +34,7 @@ import '../transitions-BLFfAJUH.cjs';
34
34
  * says the two things a multimodal model needs to hear — match exactly, and
35
35
  * these are not frames. One spelling; both resolvers ride it.
36
36
  */
37
- declare function identityRefsSentence(firstOrdinal: number, lastOrdinal: number): string;
37
+ declare function identityRefsSentence(firstOrdinal: number, lastOrdinal: number, ordinal?: (n: number) => string): string;
38
38
  declare const REF_BINDING: {
39
39
  readonly image: (label: string, n: number) => string;
40
40
  readonly video: (label: string, n: number) => string;
@@ -43,6 +43,18 @@ declare const REF_BINDING: {
43
43
  readonly ordinal: (n: number) => string;
44
44
  readonly frame: (n: number, role: "opening" | "closing") => string;
45
45
  };
46
+ /** A binding sentence's ordinal + frame directive in one provider syntax. */
47
+ interface ImageBinding {
48
+ ordinal: (n: number) => string;
49
+ frame: (n: number, role: "opening" | "closing") => string;
50
+ }
51
+ /**
52
+ * The image binding in a provider's OWN reference syntax
53
+ * (`videoProviderReferenceSyntax` in @nodaro/shared). `@image_N` IS
54
+ * {@link REF_BINDING} — the platform swap point, byte for byte; the other two
55
+ * spell the same sentence in the form the provider documents.
56
+ */
57
+ declare function imageBindingFor(syntax: "@image_N" | "@image(n)" | "[Image N]"): ImageBinding;
46
58
  /**
47
59
  * The instruction that makes Seedance EDIT a wired clip rather than use it as a
48
60
  * style reference — the Video to Video node's Seedance lane prepends it to the
@@ -553,6 +565,23 @@ interface AssembleImageInput {
553
565
  * is a no-op for it and the result is byte-identical to today).
554
566
  */
555
567
  direction?: DirectionFields;
568
+ /**
569
+ * Rendered clauses for the caller's OWN saved resources named in `direction`
570
+ * (`colorLook: "palette:<id>"`, `style: "moodboard:<id>"`), keyed by the
571
+ * direction value. Resolving them is a database read, so the platform does it
572
+ * BEFORE this pure assembly and hands the clauses in; each one folds in its
573
+ * row's slot exactly like a catalog clause (the `[style]` film line), sheds
574
+ * like one, and a reference missing from the map folds nothing.
575
+ */
576
+ directionRefs?: ReadonlyMap<string, string>;
577
+ /**
578
+ * Style reference images (a moodboard's images). They only FILL the
579
+ * reference seats the caller's own references leave free — after them, never
580
+ * displacing, renumbering or evicting one — up to the model's reference
581
+ * limit; the rest are not sent. `styleReferencesSent` on the result says how
582
+ * many went. Each carries a short style line (`styleReferenceDescription`).
583
+ */
584
+ styleReferences?: readonly StyleReferenceInput[];
556
585
  /**
557
586
  * Flat subject ids (Person / Styling / props) → folded into the prompt AHEAD
558
587
  * of the direction clauses: the subject is the noun phrase the cinematography
@@ -622,7 +651,9 @@ interface AssembleImageInput {
622
651
  * Order: (1) compose the prompt text (no-op when no subject/direction/structured),
623
652
  * (2) `buildImagePrompt(...)` — exactly the call the three sites make today,
624
653
  * (3) shed hint clauses and re-assemble while the provider cap overflows,
625
- * (4) optional post-assembly empty-prompt throw (gated by `throwOnEmpty`).
654
+ * (4) with `styleReferences`, fill the free reference seats with them
655
+ * (`fillStyleReferences`; absent = this step does not run at all),
656
+ * (5) optional post-assembly empty-prompt throw (gated by `throwOnEmpty`).
626
657
  *
627
658
  * TRUNCATION ORDERING (step 3): `buildImagePrompt`'s cap clamp cuts the TAIL,
628
659
  * which is ORDER-BLIND — on a low-cap provider (seedream = 3000) a maximal
@@ -638,7 +669,16 @@ interface AssembleImageInput {
638
669
  * UNDER-CAP PARITY: the first pass folds every hint, so a prompt that fits is
639
670
  * byte-identical to before — the retry only ever runs on an over-cap assembly.
640
671
  */
641
- declare function assembleImageInput(input: AssembleImageInput): BuildImagePromptResult;
672
+ declare function assembleImageInput(input: AssembleImageInput): AssembleImageResult;
673
+ /** `assembleImageInput`'s result: the builder's, plus the style-reference count. */
674
+ interface AssembleImageResult extends BuildImagePromptResult {
675
+ /**
676
+ * How many of `styleReferences` were sent (they follow the caller's own
677
+ * references at the end of `referenceImageUrls`). Present only when
678
+ * `styleReferences` were given, so every other result is unchanged.
679
+ */
680
+ styleReferencesSent?: number;
681
+ }
642
682
 
643
683
  /**
644
684
  * `composeVideoPromptText` — the video twin of `assemble-image-input.ts`'s
@@ -818,6 +858,59 @@ declare function composeVideoPromptText(userPrompt: string | undefined, directio
818
858
  readonly subjectHintMode?: SubjectHintMode;
819
859
  } & VideoPromptCapOptions): string | undefined;
820
860
 
861
+ /**
862
+ * WHERE A START / END FRAME GOES WHEN IT SHARES A MODEL'S REFERENCE LIST — the
863
+ * one platform convention (2026-10-18), for every video model whose frames and
864
+ * reference images travel in a single image array (`videoProviderAppendsFrames`
865
+ * in @nodaro/shared):
866
+ *
867
+ * - the caller's own reference images come FIRST, in their order, so the
868
+ * caller's image token N (`{image:N}`, `{ref:<id>}`, a typed ordinal)
869
+ * always means their Nth reference;
870
+ * - the frames are appended AFTER them (start, then end) and named in the
871
+ * prompt as the opening / closing frame, in the provider's own syntax;
872
+ * - at the image cap the frames are KEPT — they are explicit intent — and
873
+ * trailing caller references are dropped and reported.
874
+ *
875
+ * `bindIdentities` adds the identity sentence the flat-image-list models carry
876
+ * (Gemini Omni, VEO, Grok, HappyHorse: nothing in their payload says which
877
+ * entries are identities, so the prompt says it). The Seedance-family resolver
878
+ * calls this without it — byte for byte what it always emitted.
879
+ */
880
+ interface FrameReferenceSlotsArgs {
881
+ /** Consulted only to skip a duplicate opening-frame sentence. */
882
+ prompt?: string;
883
+ firstFrameUrl?: string;
884
+ lastFrameUrl?: string;
885
+ /** The caller's own reference images, in priority order. */
886
+ refImageUrls?: readonly (string | undefined)[];
887
+ /** The provider's image cap — frames and references together. */
888
+ imageCap: number;
889
+ /** The provider's reference syntax (`videoProviderReferenceSyntax`). */
890
+ syntax?: "@image_N" | "@image(n)" | "[Image N]";
891
+ bindIdentities?: boolean;
892
+ }
893
+ interface FrameReferenceSlotsResult {
894
+ /** `[...keptRefs, start?, end?]` — never longer than `imageCap` (bar the frames themselves). */
895
+ imageUrls: string[];
896
+ promptSuffix: string;
897
+ /** Trailing caller references dropped to keep the frames. */
898
+ droppedRefImages: number;
899
+ /** 1-based seats of the frames in `imageUrls`; 0 when absent. */
900
+ firstFrameOrdinal: number;
901
+ lastFrameOrdinal: number;
902
+ }
903
+ declare function placeFramesAfterReferences(args: FrameReferenceSlotsArgs): FrameReferenceSlotsResult;
904
+ /** True when the prompt ALREADY binds an image as the first/opening frame —
905
+ * e.g. the gvp overlap transport's colon-position directive ("use @image_1
906
+ * as the first frame, it is the last keyframe of @video_1"). Field finding
907
+ * (2026-07-20): the first-frame directive only works adjacent to the extend
908
+ * colon; a duplicate sentence at the END of the prompt (this resolver's
909
+ * default position) dilutes it back into coin-flip behavior — so when the
910
+ * prompt carries its own binding, the suffix is suppressed (the frame image
911
+ * itself still rides the reference list). */
912
+ declare function promptBindsFirstFrame(prompt: string | undefined): boolean;
913
+
821
914
  type Seedance2Mode = "first-frame" | "first-last-frame" | "reference";
822
915
  interface Seedance2InputsArgs {
823
916
  /** The generation prompt — used ONLY to detect an existing first-frame
@@ -849,23 +942,7 @@ interface Seedance2InputsResult {
849
942
  promptSuffix: string;
850
943
  droppedRefImages: number;
851
944
  }
852
- /**
853
- * Single source of truth for how Seedance 2's three mutually-exclusive KIE input
854
- * modes are selected from connected inputs. Strict first/last-frame mode is used
855
- * only when nothing but frames is connected; any reference (image, video, OR
856
- * audio) switches to multimodal Reference mode, where the frames are appended to
857
- * reference_image_urls (after the user's own images, so their @Image ordinals do
858
- * not shift) and named in a doctrine-compliant prompt suffix.
859
- */
860
- /** True when the prompt ALREADY binds an image as the first/opening frame —
861
- * e.g. the gvp overlap transport's colon-position directive ("use @image_1
862
- * as the first frame, it is the last keyframe of @video_1"). Field finding
863
- * (2026-07-20): the first-frame directive only works adjacent to the extend
864
- * colon; a duplicate sentence at the END of the prompt (this resolver's
865
- * default position) dilutes it back into coin-flip behavior — so when the
866
- * prompt carries its own binding, the suffix is suppressed (the frame image
867
- * itself still rides the reference list). */
868
- declare function promptBindsFirstFrame(prompt: string | undefined): boolean;
945
+
869
946
  declare function resolveSeedance2Inputs(args: Seedance2InputsArgs): Seedance2InputsResult;
870
947
 
871
948
  /**
@@ -873,23 +950,27 @@ declare function resolveSeedance2Inputs(args: Seedance2InputsArgs): Seedance2Inp
873
950
  * `resolveSeedance2Inputs` for a model whose multimodal channel is ONE flat
874
951
  * `image_urls` list.
875
952
  *
953
+ * THE PLATFORM CONVENTION (2026-10-18, `placeFramesAfterReferences`): the
954
+ * caller's identity references come first, so their image token N is their Nth
955
+ * reference, and the start frame is appended after them. Until then the frame
956
+ * led the list, so a caller's `@image_1` landed on the frame.
957
+ *
876
958
  * WHY BINDING IS LOAD-BEARING: Gemini Omni receives the start frame and the
877
959
  * identity references in the same array, with nothing in the payload marking
878
960
  * which is which. A multimodal model treats unbound images as loose context —
879
961
  * field finding (recast keyframes run, 2026-08-14): the identity references
880
962
  * rode every call and the cast still drifted part to part, because the prompt
881
963
  * never said the images WERE identities to keep. So the resolver names the
882
- * roles in a prompt suffix, through the same `REF_BINDING` swap-point every
883
- * other video binding uses: image 1 is the opening frame; the rest are
884
- * identity references, explicitly not frames.
964
+ * roles in a prompt suffix: the references are identity references, explicitly
965
+ * not frames, and the last image is the opening frame.
885
966
  *
886
967
  * BUDGETED, NEVER REJECTED, for the list this resolver assembles: KIE's quota
887
968
  * is `images + 2×videos ≤ 7`, and `runGeminiOmni` hard-rejects overflow. That
888
969
  * reject is right for a caller-assembled list (the user's own images should
889
970
  * not silently thin out) and wrong for THIS merge, where the overflow is our
890
971
  * own construction — so trailing references are dropped to fit, the start
891
- * frame always kept, mirroring `resolveSeedance2Inputs`' drop-trailing
892
- * convention, and the drop count is reported for the caller to log.
972
+ * frame always kept (the convention's tie-break), and the drop count is
973
+ * reported for the caller to log.
893
974
  *
894
975
  * BYTE-IDENTICAL when there is nothing to bind: no references ⇒ no suffix and
895
976
  * a single-image list — exactly what every plain gemini-omni i2v call has
@@ -898,7 +979,7 @@ declare function resolveSeedance2Inputs(args: Seedance2InputsArgs): Seedance2Inp
898
979
  interface GeminiOmniI2vInputsArgs {
899
980
  /** The composed prompt, used only to detect an existing first-frame binding. */
900
981
  prompt?: string;
901
- /** The start frame — always kept, always first in the list. */
982
+ /** The start frame — always kept, appended after the references. */
902
983
  firstFrameUrl: string;
903
984
  /** Identity references, in priority order (trailing ones drop first). */
904
985
  refImageUrls?: Array<string | undefined>;
@@ -911,7 +992,7 @@ interface GeminiOmniI2vInputsArgs {
911
992
  provider?: string;
912
993
  }
913
994
  interface GeminiOmniI2vInputsResult {
914
- /** `[firstFrameUrl, ...keptRefs]` — the `image_urls` payload, quota-fitted. */
995
+ /** `[...keptRefs, firstFrameUrl]` — the `image_urls` payload, quota-fitted. */
915
996
  imageUrls: string[];
916
997
  /** The role-binding sentences; empty when no reference survived the budget. */
917
998
  promptSuffix: string;
@@ -927,13 +1008,15 @@ declare function resolveGeminiOmniI2vInputs(args: GeminiOmniI2vInputsArgs): Gemi
927
1008
  * [first(, last)] frames; REFERENCE_2_VIDEO reads every entry as a
928
1009
  * reference ingredient. Frames and identities cannot ride separate
929
1010
  * channels, so an anchored call that must carry identity references moves
930
- * to REFERENCE_2_VIDEO with the anchor in seat 1, bound in prose as the
931
- * opening frame (requested, not pixel-guaranteed — the accepted trade,
932
- * same as seedance-2's reference mode).
1011
+ * to REFERENCE_2_VIDEO with the frames bound in prose (requested, not
1012
+ * pixel-guaranteed — the accepted trade, same as seedance-2's reference mode).
933
1013
  *
934
- * REFERENCES WIN THE SEATS (the 2026-08-14 standing rule: refs are a must,
935
- * frames additional): the end anchor is dropped in reference mode rather
936
- * than spending one of three seats on a closing guess. The caller logs it.
1014
+ * THE PLATFORM CONVENTION (2026-10-18, `placeFramesAfterReferences`): the
1015
+ * caller's references take the first seats, so their image token N is their
1016
+ * Nth reference; the start frame — and the end frame, VEO takes one — follow
1017
+ * them, bound as the opening / closing frame. At the 3-ingredient cap the
1018
+ * frames are kept (explicit intent) and trailing references drop, reported.
1019
+ * (Until then the anchor took seat 1 and an end frame was surrendered.)
937
1020
  *
938
1021
  * BYTE-IDENTICAL with no references: plain frame mode, frames kept, no
939
1022
  * generationType, no suffix — exactly what every veo i2v call has always
@@ -947,14 +1030,15 @@ interface VeoI2vInputsArgs {
947
1030
  refImageUrls?: Array<string | undefined>;
948
1031
  }
949
1032
  interface VeoI2vInputsResult {
950
- /** The `imageUrls` payload: frames in plain mode, [anchor, ...refs] in
1033
+ /** The `imageUrls` payload: frames in plain mode, [...refs, start, end?] in
951
1034
  * reference mode — never more than VEO's 3-ingredient cap. */
952
1035
  imageUrls: string[];
953
1036
  /** Present (REFERENCE_2_VIDEO) exactly when references ride. */
954
1037
  generationType?: "REFERENCE_2_VIDEO";
955
1038
  promptSuffix: string;
956
1039
  droppedRefImages: number;
957
- /** True when an end anchor was surrendered to reference mode. */
1040
+ /** Always false since the frames-after-references convention: an end frame
1041
+ * is kept in reference mode. Kept for callers that log it. */
958
1042
  droppedEndFrame: boolean;
959
1043
  }
960
1044
  declare function resolveVeoI2vInputs(args: VeoI2vInputsArgs): VeoI2vInputsResult;
@@ -1020,4 +1104,4 @@ interface FrameDeliveryPlan {
1020
1104
  */
1021
1105
  declare function planFrameDelivery(args: FrameDeliveryPlanArgs): FrameDeliveryPlan;
1022
1106
 
1023
- export { type AssembleImageInput, type AssembleSunoInput, type AssembleSunoResult, type CharacterMeta, DirectionFields, type FrameDeliveryPlan, type FrameDeliveryPlanArgs, type GeminiOmniI2vInputsArgs, type GeminiOmniI2vInputsResult, REF_BINDING, type RefIdTokenContext, type ReferenceCounts, type ResolveVideoReferenceCoreArgs, SEEDANCE_VIDEO_EDIT_PREFIX, type Seedance2InputsArgs, type Seedance2InputsResult, type Seedance2Mode, type SoundComposition, type SoundCompositionFields, type SoundConsumerType, SubjectFields, type VeoI2vInputsArgs, type VeoI2vInputsResult, type VideoExtraRef, type VideoPromptCapOptions, appendField, appendMusicMeta, assembleImageInput, assembleSunoInput, buildSeedanceVideoEditPrompt, buildSurroundFillPrompt, composeSoundHintFromConnections, composeVideoPromptText, getEffectiveSunoCustomMode, identityRefsSentence, planFrameDelivery, promptBindsFirstFrame, resolveGeminiOmniI2vInputs, resolveRefIdTokens, resolveReferenceTokens, resolveSeedance2Inputs, resolveVeoI2vInputs, resolveVideoReferenceCore, truncateForField };
1107
+ export { type AssembleImageInput, type AssembleImageResult, type AssembleSunoInput, type AssembleSunoResult, type CharacterMeta, DirectionFields, type FrameDeliveryPlan, type FrameDeliveryPlanArgs, type FrameReferenceSlotsArgs, type FrameReferenceSlotsResult, type GeminiOmniI2vInputsArgs, type GeminiOmniI2vInputsResult, type ImageBinding, REF_BINDING, type RefIdTokenContext, type ReferenceCounts, type ResolveVideoReferenceCoreArgs, SEEDANCE_VIDEO_EDIT_PREFIX, type Seedance2InputsArgs, type Seedance2InputsResult, type Seedance2Mode, type SoundComposition, type SoundCompositionFields, type SoundConsumerType, SubjectFields, type VeoI2vInputsArgs, type VeoI2vInputsResult, type VideoExtraRef, type VideoPromptCapOptions, appendField, appendMusicMeta, assembleImageInput, assembleSunoInput, buildSeedanceVideoEditPrompt, buildSurroundFillPrompt, composeSoundHintFromConnections, composeVideoPromptText, getEffectiveSunoCustomMode, identityRefsSentence, imageBindingFor, placeFramesAfterReferences, planFrameDelivery, promptBindsFirstFrame, resolveGeminiOmniI2vInputs, resolveRefIdTokens, resolveReferenceTokens, resolveSeedance2Inputs, resolveVeoI2vInputs, resolveVideoReferenceCore, truncateForField };