@nodaro/shared 2.21.1 → 2.23.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 +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -1
- package/dist/index.d.ts +63 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/model-constants.ts +23 -0
- package/src/types.ts +43 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type {
|
|
|
3
3
|
GenericEdge,
|
|
4
4
|
CharacterDef,
|
|
5
5
|
ConnectedReference,
|
|
6
|
+
DescribedReference,
|
|
6
7
|
IdentityFidelity,
|
|
7
8
|
IdentityMeta,
|
|
8
9
|
ReferenceSource,
|
|
@@ -112,6 +113,7 @@ export {
|
|
|
112
113
|
checkRefVideoDurations,
|
|
113
114
|
VIDEO_PROVIDERS_REQUIRING_IMAGE,
|
|
114
115
|
videoProviderRequiresImage,
|
|
116
|
+
videoProviderFoldsLoneEndFrame,
|
|
115
117
|
VIDEO_MODE_ALIASES,
|
|
116
118
|
VIDEO_GEN_COLLAPSED_T2V_IDS,
|
|
117
119
|
resolveVideoProviderForMode,
|
package/src/model-constants.ts
CHANGED
|
@@ -2105,6 +2105,29 @@ export function videoProviderRequiresImage(provider: string | undefined): boolea
|
|
|
2105
2105
|
return !!provider && VIDEO_PROVIDERS_REQUIRING_IMAGE.has(provider)
|
|
2106
2106
|
}
|
|
2107
2107
|
|
|
2108
|
+
/**
|
|
2109
|
+
* True when the provider's image-to-video path FOLDS a lone closing frame into
|
|
2110
|
+
* its reference images — i.e. an end frame with no start frame is a reference
|
|
2111
|
+
* the model actually receives, not a half-formed frame pair.
|
|
2112
|
+
*
|
|
2113
|
+
* The Seedance 2.x, MiniMax Hailuo 3 and Wan 3 families all assemble their KIE
|
|
2114
|
+
* input through the shared `resolveSeedance2Inputs` (`@nodaro/prompts`), whose
|
|
2115
|
+
* reference mode takes a lone last frame as the sole reference image plus a
|
|
2116
|
+
* closing-frame prompt hint. NOTHING else does: VEO ships `[imageUrl,
|
|
2117
|
+
* endFrameUrl]` verbatim (a lone end frame would reach KIE as `[null, url]`),
|
|
2118
|
+
* the Gemini Omni branch drops the frame when there is no start frame, and the
|
|
2119
|
+
* generic KIE path sends `end_frame` with no image param at all. So the
|
|
2120
|
+
* exemption is keyed to the FOLD, not to "carries image references" — the
|
|
2121
|
+
* catalog has no capability for it, and these three family predicates are the
|
|
2122
|
+
* same membership the provider layer itself branches on (the backend's
|
|
2123
|
+
* `kie/video.ts::applySeedance2Params` / `applyMinimaxH3Params` / `runWan3`).
|
|
2124
|
+
* A ref-capable provider that grows the fold gets the exemption by joining a
|
|
2125
|
+
* family here; one that does not keeps the honest `image_required` 400.
|
|
2126
|
+
*/
|
|
2127
|
+
export function videoProviderFoldsLoneEndFrame(provider: string): boolean {
|
|
2128
|
+
return isSeedance2Provider(provider) || isMinimaxH3Provider(provider) || isWan3Provider(provider)
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2108
2131
|
/**
|
|
2109
2132
|
* Video models where enabling audio/sound incurs an additional cost.
|
|
2110
2133
|
* The audio addon is expressed as a separate composite identifier suffix.
|
package/src/types.ts
CHANGED
|
@@ -214,6 +214,49 @@ export interface ConnectedReference {
|
|
|
214
214
|
* The single new structured-shape field for external (API/MCP/SDK) parity.
|
|
215
215
|
*/
|
|
216
216
|
readonly identityLock?: { enabled: boolean; text?: string }
|
|
217
|
+
/**
|
|
218
|
+
* PER-USE identity description for this reference — what the caller wants the
|
|
219
|
+
* model told about this subject THIS TIME, overriding whatever the entity's
|
|
220
|
+
* library record says. Wherever a reference's identity description already
|
|
221
|
+
* renders (the legacy identity bullet's `— <desc>` part, a `{image:N:label}`
|
|
222
|
+
* directive's descriptor) it WINS over `characterCanonicalDescription` /
|
|
223
|
+
* `locationCanonicalDescription` / `description`; where the HYBRID format
|
|
224
|
+
* renders no description at all, it adds one trailing `<binding> — <override>.`
|
|
225
|
+
* line instead.
|
|
226
|
+
*
|
|
227
|
+
* The two formats are deliberately ASYMMETRIC where a reference renders no
|
|
228
|
+
* directive at all — a plain upload (`manual` / `wired-image`, non-extra) that
|
|
229
|
+
* is neither `@`-mentioned nor `{image:N}`-covered: the LEGACY format stays
|
|
230
|
+
* silent, and the override is not surfaced there (a bullet would force a
|
|
231
|
+
* fidelity verb onto an opaque image); the HYBRID format — the production
|
|
232
|
+
* default — adds the trailing line above for it.
|
|
233
|
+
*
|
|
234
|
+
* DISTINCT from `description`, which stays the reference's own label slot (the
|
|
235
|
+
* free text an extra-ref row / an upstream node carries) — a caller that edits
|
|
236
|
+
* the wording for ONE use writes it here, so the label is untouched and
|
|
237
|
+
* dropping the override falls back to the library wording. Absent →
|
|
238
|
+
* byte-identical to a caller that never sent it.
|
|
239
|
+
*/
|
|
240
|
+
readonly descriptionOverride?: string
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* A reference the caller can NAME and DESCRIBE but has no media for — a cast
|
|
245
|
+
* role no entity has been bound to yet, an analysis slot, a character the author
|
|
246
|
+
* has only written down. It carries no `url`, so it attaches no reference image
|
|
247
|
+
* and claims no `@image_N` seat; it reaches the model purely as prose
|
|
248
|
+
* (`<Name> — <description>.`), rendered in ONE place per lane by
|
|
249
|
+
* `@nodaro/prompts`' `renderDescribedReferenceLines`.
|
|
250
|
+
*
|
|
251
|
+
* Correlation with the prompt body is BY NAME: the caller leaves the name in the
|
|
252
|
+
* prose (never an indexed `@slug:N` mention — that grammar is url-gated) and the
|
|
253
|
+
* described line tells the model who that name is.
|
|
254
|
+
*/
|
|
255
|
+
export interface DescribedReference {
|
|
256
|
+
/** Display name exactly as it appears in the prompt prose (e.g. "Natalie"). */
|
|
257
|
+
readonly name: string
|
|
258
|
+
/** What the model should picture when it reads that name. */
|
|
259
|
+
readonly description: string
|
|
217
260
|
}
|
|
218
261
|
|
|
219
262
|
/** Default label per source — used by `@` autocomplete and inventory fallback. */
|