@ossclip/core 0.1.12 → 0.1.13
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/package.json +1 -1
- package/src/cover.ts +21 -0
package/package.json
CHANGED
package/src/cover.ts
CHANGED
|
@@ -59,6 +59,27 @@ export function coverHeadline(text: string, maxWords = COVER_MAX_WORDS): string
|
|
|
59
59
|
return out.join(" ").replace(/[,;:—–-]+$/, "");
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* What the cover step should emit.
|
|
64
|
+
*
|
|
65
|
+
* "textless" exists because of the Urdu field run 2026-08-05: a run without
|
|
66
|
+
* `--produce` has no LLM hook text, and the old behavior skipped the cover
|
|
67
|
+
* entirely — but frame selection needs no text at all, and the
|
|
68
|
+
* sharpness-scored face frame is a clean thumbnail on its own. Only the
|
|
69
|
+
* banner needs a headline; the pick does not, so a missing headline demotes
|
|
70
|
+
* the cover to a bare frame instead of erasing it.
|
|
71
|
+
*/
|
|
72
|
+
export type CoverDecision = "banner" | "textless" | "none";
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Pure so the three-way outcome is testable without a video, ffmpeg, or a
|
|
76
|
+
* beat sheet on disk — the same I/O split as `openCommand()`.
|
|
77
|
+
*/
|
|
78
|
+
export function coverDecision(coverEnabled: boolean, headline: string): CoverDecision {
|
|
79
|
+
if (!coverEnabled) return "none";
|
|
80
|
+
return headline.trim() ? "banner" : "textless";
|
|
81
|
+
}
|
|
82
|
+
|
|
62
83
|
/** Where the face sits in the COVER frame, as fractions of it. */
|
|
63
84
|
export interface CoverFace {
|
|
64
85
|
centerXFrac: number;
|