@glissade/narrate 0.11.0 → 0.12.0-pre.1

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.d.ts CHANGED
@@ -11,6 +11,13 @@ interface NarrationSegment {
11
11
  rate?: number;
12
12
  /** silence after THIS segment (s); overrides the script default */
13
13
  gapAfter?: number;
14
+ /**
15
+ * Anchor budget (s): the longest this segment's spoken beat may run before
16
+ * `gs narration-lint` flags it (a re-narrate that overran its allotted beat).
17
+ * Committed with the script — versioned data, gated by CI. A script-level
18
+ * `budgets` entry keyed by this id is equivalent; a per-segment `maxSec` wins.
19
+ */
20
+ maxSec?: number;
14
21
  }
15
22
  /** What the music bed does across a pause window. */
16
23
  type BedMode = /** hold the current (ducked) level across the pause — no swell, the default */
@@ -60,6 +67,13 @@ interface NarrationScript {
60
67
  captionSplit?: {
61
68
  maxChars: number;
62
69
  };
70
+ /**
71
+ * Anchor budgets (s): per-id ceilings on a segment's (or pause's) beat length,
72
+ * checked by `gs narration-lint` (Tier-1, can fail CI). Committed with the
73
+ * script and persisted into the timing manifest so the lint reads them from
74
+ * the committed JSON. A segment's own `maxSec` wins over an entry here.
75
+ */
76
+ budgets?: Record<string, number>;
63
77
  /** spoken segments and explicit pause beats, in playback order */
64
78
  segments: NarrationElement[];
65
79
  }
@@ -78,6 +92,8 @@ interface TimedSegment {
78
92
  file: string;
79
93
  /** present only when the provider supplies word timestamps */
80
94
  words?: TimedWord[];
95
+ /** anchor budget (s) carried from the script's per-segment `maxSec`; lint reads it here */
96
+ maxSec?: number;
81
97
  }
82
98
  /** A resolved pause window in the committed manifest. */
83
99
  interface TimedPause {
@@ -98,6 +114,12 @@ interface NarrationTiming {
98
114
  captionSplit?: {
99
115
  maxChars: number;
100
116
  };
117
+ /**
118
+ * Anchor budgets (s) carried from the script — per id, segments + pauses.
119
+ * `gs narration-lint` reads them from the committed manifest (Tier-1). A
120
+ * segment's own `maxSec` (on the TimedSegment) wins over an entry here.
121
+ */
122
+ budgets?: Record<string, number>;
101
123
  }
102
124
  declare class NarrationError extends Error {
103
125
  constructor(message: string);
package/dist/providers.js CHANGED
@@ -642,7 +642,8 @@ async function synthesizeScript(scriptPath, opts = {}) {
642
642
  text: seg.text,
643
643
  start: cursor,
644
644
  duration,
645
- file: entry.file
645
+ file: entry.file,
646
+ ...seg.maxSec !== void 0 ? { maxSec: seg.maxSec } : {}
646
647
  };
647
648
  if (words) timed.words = words.map((w) => ({
648
649
  word: w.word,
@@ -664,7 +665,8 @@ async function synthesizeScript(scriptPath, opts = {}) {
664
665
  totalDuration: ends.length > 0 ? Math.max(...ends) : 0,
665
666
  segments,
666
667
  ...pauses.length > 0 ? { pauses } : {},
667
- ...raw.captionSplit ? { captionSplit: raw.captionSplit } : {}
668
+ ...raw.captionSplit ? { captionSplit: raw.captionSplit } : {},
669
+ ...raw.budgets && Object.keys(raw.budgets).length > 0 ? { budgets: raw.budgets } : {}
668
670
  };
669
671
  const timingPath = `${base}.narration.timing.json`;
670
672
  writeFileSync(timingPath, JSON.stringify(timing, null, 2) + "\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissade/narrate",
3
- "version": "0.11.0",
3
+ "version": "0.12.0-pre.1",
4
4
  "description": "glissade narration + captions: TTS at prepare time (gs narrate), deterministic caching, narration-anchored timeline beats, and captions as plain tracks. Render stays offline.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -22,8 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@glissade/scene": "0.11.0",
26
- "@glissade/core": "0.11.0"
25
+ "@glissade/core": "0.12.0-pre.1",
26
+ "@glissade/scene": "0.12.0-pre.1"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "kokoro-js": "^1.2.0"