@beff/aula-cli 0.13.0 → 0.13.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.
Files changed (61) hide show
  1. package/README.md +2 -2
  2. package/dist/src/aula-render.core.wasm +0 -0
  3. package/dist/src/{aula-voice-tts-H2OQFQ5J.js → aula-voice-tts-FEFKNA2I.js} +1 -1
  4. package/dist/src/aula.js +2 -2
  5. package/dist/src/{chunk-UBVMGS2E.js → chunk-2BEUK7M7.js} +1 -1
  6. package/dist/src/{chunk-G44UMBPW.js → chunk-2VD3JPLV.js} +3 -5
  7. package/dist/src/chunk-4N5SDSCV.js +63 -0
  8. package/dist/src/{chunk-THZNJBUF.js → chunk-F37DXY3P.js} +95 -100
  9. package/dist/src/{chunk-S6IM5XXK.js → chunk-FGTN34N7.js} +3 -3
  10. package/dist/src/{chunk-D5N3QDDF.js → chunk-GQSFMINU.js} +3 -33
  11. package/dist/src/{chunk-XIVHJMET.js → chunk-N3YZ7K5L.js} +3 -3
  12. package/dist/src/{chunk-F5RPEFZR.js → chunk-T7S65ZHW.js} +4306 -1645
  13. package/dist/src/{chunk-4FWDTPLR.js → chunk-V3GJ4XSW.js} +118 -66
  14. package/dist/src/{chunk-WV2UYZND.js → chunk-VJAXVLXZ.js} +1 -1
  15. package/dist/src/{chunk-UQOXT6QN.js → chunk-Z7VLJSDG.js} +132 -35
  16. package/dist/src/cli.js +27 -74
  17. package/dist/src/{commands-PLST75CP.js → commands-ZTGXXVOO.js} +10 -9
  18. package/dist/src/generated/aula.core5.wasm +0 -0
  19. package/dist/src/generated/aula.js +4076 -1341
  20. package/dist/src/generated/interfaces/aula-engine-engine.d.ts +39 -0
  21. package/dist/src/problems-BDPV4IRL.js +17 -0
  22. package/dist/src/project-XHL7FN7B.js +16 -0
  23. package/dist/src/{run-NE5HOAXA.js → run-LZVKYMKT.js} +14 -11
  24. package/dist/src/{server-KXIU66BB.js → server-H7XOUJNL.js} +8 -8
  25. package/dist/src/{site-HUWODSZ3.js → site-7MLO35NA.js} +6 -6
  26. package/dist/src/{workspace-load-DOHFEZFR.js → workspace-load-OQXB2ZOC.js} +6 -6
  27. package/dist/web/app/assets/{62289de9 → 15e78332}/aula-method.js +1 -1
  28. package/dist/web/app/assets/{62289de9 → 15e78332}/aula.js +1 -1
  29. package/dist/web/app/assets/{62289de9 → 15e78332}/build-worker.js +2 -2
  30. package/dist/web/app/assets/15e78332/index.js +51 -0
  31. package/dist/web/app/assets/__vite-browser-external-CCI-9X_7.js +1 -0
  32. package/dist/web/app/assets/aula-voice-worker-bYZ7BKji.js +1 -0
  33. package/dist/web/app/assets/{aula.core5-CQ2oHbtB.wasm → aula.core5-CtBp7wFf.wasm} +0 -0
  34. package/dist/web/app/assets/protocol-j759xoXL.js +15 -0
  35. package/dist/web/app/assets/src-BjcN7H3T.js +6 -0
  36. package/dist/web/{site/assets/tex-mathjax-DrZV_cwB.js → app/assets/tex-mathjax-Bbh2jsAv.js} +1 -1
  37. package/dist/web/app/index.html +4 -4
  38. package/dist/web/site/assets/{82618540 → 671a8ee2}/aula-method.js +1 -1
  39. package/dist/web/site/assets/{82618540 → 671a8ee2}/aula.js +1 -1
  40. package/dist/web/site/assets/{82618540 → 671a8ee2}/build-worker.js +2 -2
  41. package/dist/web/site/assets/671a8ee2/index.js +51 -0
  42. package/dist/web/site/assets/__vite-browser-external-CrZYh5ba.js +1 -0
  43. package/dist/web/site/assets/aula-voice-worker-Doyh20uI.js +1 -0
  44. package/dist/web/site/assets/{aula.core5-CQ2oHbtB.wasm → aula.core5-CtBp7wFf.wasm} +0 -0
  45. package/dist/web/site/assets/protocol-ByKVs3Yn.js +15 -0
  46. package/dist/web/site/assets/src-BwnY0kQu.js +6 -0
  47. package/dist/web/{app/assets/tex-mathjax-eWNptbJg.js → site/assets/tex-mathjax-DKtiwFu-.js} +1 -1
  48. package/dist/web/site/index.html +4 -4
  49. package/package.json +1 -1
  50. package/dist/src/problems-EI4DOEZ4.js +0 -17
  51. package/dist/src/project-7EROVEUE.js +0 -16
  52. package/dist/web/app/assets/62289de9/index.js +0 -51
  53. package/dist/web/app/assets/__vite-browser-external-BHESVS8k.js +0 -1
  54. package/dist/web/app/assets/aula-voice-worker-CJpoa9h-.js +0 -1
  55. package/dist/web/app/assets/protocol-kcdbhuRm.js +0 -15
  56. package/dist/web/app/assets/src-DWqZcp-P.js +0 -6
  57. package/dist/web/site/assets/82618540/index.js +0 -51
  58. package/dist/web/site/assets/__vite-browser-external-DQubyTsZ.js +0 -1
  59. package/dist/web/site/assets/aula-voice-worker-BRrzyFz3.js +0 -1
  60. package/dist/web/site/assets/protocol-XMWr-E-D.js +0 -15
  61. package/dist/web/site/assets/src-DfPcHwz-.js +0 -6
package/README.md CHANGED
@@ -5,11 +5,11 @@ The `aula` command of [aula](https://github.com/lucasavila00/aula): it runs chap
5
5
  It needs Node 24. Narration (aula-voice) needs only Node. `aula export` needs ffmpeg. Refer to [CLI](https://github.com/lucasavila00/aula/blob/main/docs/agents/cli.md) for the commands and [Getting started](https://github.com/lucasavila00/aula/blob/main/docs/agents/getting-started.md) for the setup.
6
6
 
7
7
  The package has no model file.
8
- The first command that narrates or times a video downloads the narrator's model of aula-voice's release [v0.2.4](https://github.com/lucasavila00/aula-voice/releases/tag/v0.2.4) (about 21 MB).
8
+ The first command that narrates or times a video downloads the narrator's model of aula-voice's release [v0.2.5](https://github.com/lucasavila00/aula-voice/releases/tag/v0.2.5) (about 21 MB).
9
9
  Those commands are `check`, `script`, `timeline`, `preview`, `export` and `aula web`.
10
10
  The CLI checks the SHA-256 of each file, makes the engine's weight file from them, and checks its SHA-256 too.
11
11
  `aula web` narrates in the browser and serves that file to its page.
12
- The [model card](https://github.com/lucasavila00/aula-voice/releases/download/v0.2.4/MODEL_CARD.md) has the license of the model, its sources and its training data, and their attribution.
12
+ The [model card](https://github.com/lucasavila00/aula-voice/releases/download/v0.2.5/MODEL_CARD.md) has the license of the model, its sources and its training data, and their attribution.
13
13
 
14
14
  ## Licenses
15
15
 
Binary file
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadEngine,
3
3
  tts
4
- } from "./chunk-F5RPEFZR.js";
4
+ } from "./chunk-T7S65ZHW.js";
5
5
  import "./chunk-VX7UVLQW.js";
6
6
  import "./chunk-CZ7CSFO4.js";
7
7
 
package/dist/src/aula.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  manim_exports
3
- } from "./chunk-D5N3QDDF.js";
3
+ } from "./chunk-GQSFMINU.js";
4
4
  import {
5
5
  defineChapter,
6
6
  defineProject,
@@ -10,7 +10,7 @@ import {
10
10
  pronounce,
11
11
  say,
12
12
  show
13
- } from "./chunk-F5RPEFZR.js";
13
+ } from "./chunk-T7S65ZHW.js";
14
14
  import "./chunk-VX7UVLQW.js";
15
15
  import "./chunk-CZ7CSFO4.js";
16
16
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  host,
3
3
  loadProject
4
- } from "./chunk-G44UMBPW.js";
4
+ } from "./chunk-2VD3JPLV.js";
5
5
 
6
6
  // src/load-user.ts
7
7
  import { existsSync } from "node:fs";
@@ -4,7 +4,7 @@ import {
4
4
  error,
5
5
  projectName,
6
6
  wrongArgument
7
- } from "./chunk-WV2UYZND.js";
7
+ } from "./chunk-VJAXVLXZ.js";
8
8
  import {
9
9
  definedAt,
10
10
  importUserModule,
@@ -12,8 +12,9 @@ import {
12
12
  isProjectDefinition,
13
13
  loadEngine,
14
14
  loadTex,
15
+ slugOf,
15
16
  v8Frames
16
- } from "./chunk-F5RPEFZR.js";
17
+ } from "./chunk-T7S65ZHW.js";
17
18
 
18
19
  // ../aula-project/src/node.ts
19
20
  import { existsSync } from "node:fs";
@@ -49,9 +50,6 @@ function host(capabilities, root, glue = []) {
49
50
  function propertyOf(e, key) {
50
51
  return typeof e === "object" && e !== null ? Reflect.get(e, key) : void 0;
51
52
  }
52
- function slugOf(text) {
53
- return text.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
54
- }
55
53
  function listedChapters(capabilities, folder, projectFile) {
56
54
  const source = capabilities.fs.readFileSync(projectFile, "utf8");
57
55
  const imports = /* @__PURE__ */ new Map();
@@ -0,0 +1,63 @@
1
+ // ../../node_modules/.pnpm/@beff+diy@0.0.36/node_modules/@beff/diy/dist/esm/capabilities.js
2
+ function create(serviceMap) {
3
+ return serviceMap;
4
+ }
5
+ function extend(capabilities, extra) {
6
+ return Object.assign({}, capabilities, extra);
7
+ }
8
+ function override(capabilities, replacement) {
9
+ return { ...capabilities, ...replacement };
10
+ }
11
+ function merge(...capabilitiesList) {
12
+ return Object.assign({}, ...capabilitiesList);
13
+ }
14
+ var Capabilities = {
15
+ /**
16
+ * Build the app's concrete services.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const capabilities = Capabilities.create<AppCapability>({
21
+ * clock: { now: () => new Date() },
22
+ * fs,
23
+ * });
24
+ * ```
25
+ */
26
+ create,
27
+ /**
28
+ * Add scoped services around an existing bag.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const jobCapabilities = Capabilities.extend(
33
+ * capabilities,
34
+ * Capabilities.create<ProgressCapability>({ progress }),
35
+ * );
36
+ * ```
37
+ */
38
+ extend,
39
+ /**
40
+ * Combine capability bags built by separate modules.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const appCapabilities = Capabilities.merge(nodeCapabilities, databaseCapabilities);
45
+ * ```
46
+ */
47
+ merge,
48
+ /**
49
+ * Replace services without changing the capability type.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const quietCapabilities = Capabilities.override(capabilities, {
54
+ * logger: { info: () => undefined },
55
+ * });
56
+ * ```
57
+ */
58
+ override
59
+ };
60
+
61
+ export {
62
+ Capabilities
63
+ };
@@ -4,11 +4,11 @@ import {
4
4
  moveFrames,
5
5
  narrationScript,
6
6
  paragraphAt,
7
- phonemize,
7
+ scriptBeats,
8
8
  timeline,
9
9
  unclearWords,
10
- words
11
- } from "./chunk-4FWDTPLR.js";
10
+ unclearWordsFrom
11
+ } from "./chunk-V3GJ4XSW.js";
12
12
  import {
13
13
  LIST_MODULE,
14
14
  Problems,
@@ -16,10 +16,10 @@ import {
16
16
  isError,
17
17
  linkBundle,
18
18
  wrongArgument
19
- } from "./chunk-WV2UYZND.js";
19
+ } from "./chunk-VJAXVLXZ.js";
20
20
  import {
21
21
  manim_exports
22
- } from "./chunk-D5N3QDDF.js";
22
+ } from "./chunk-GQSFMINU.js";
23
23
  import {
24
24
  FPS,
25
25
  TITLE,
@@ -34,10 +34,10 @@ import {
34
34
  loadEngine,
35
35
  readChapter,
36
36
  renderChapter
37
- } from "./chunk-F5RPEFZR.js";
37
+ } from "./chunk-T7S65ZHW.js";
38
38
 
39
39
  // ../aula-narration/src/script.ts
40
- var starts = (words2) => Float64Array.from(words2, (w) => w.start);
40
+ var starts = (words) => Float64Array.from(words, (w) => w.start);
41
41
  function joinChapter(cues, speeches) {
42
42
  let rate = 0;
43
43
  for (const [i, speech] of speeches.entries()) {
@@ -130,6 +130,44 @@ function wav(samples, rate) {
130
130
  return bytes;
131
131
  }
132
132
 
133
+ // ../aula-project/src/notes.ts
134
+ function scriptUnclear(script, only) {
135
+ return script.map((cues, index) => {
136
+ if (only !== null && !only.includes(index)) return cues.map(() => []);
137
+ return cues.map((cue) => unclearWords(cue.words));
138
+ });
139
+ }
140
+ function wordNotes(script, only, unclear = null) {
141
+ const lists = unclear ?? scriptUnclear(script, only);
142
+ const notes = /* @__PURE__ */ new Map();
143
+ script.forEach((cues, index) => {
144
+ if (only !== null && !only.includes(index)) return;
145
+ cues.forEach((cue, cueIndex) => {
146
+ for (const { word, kind, reading } of lists[index]?.[cueIndex] ?? []) {
147
+ const lower = word.slice(0, 1).toLowerCase() + word.slice(1);
148
+ const key = `${kind} ${lower}`;
149
+ const note = notes.get(key);
150
+ if (note === void 0) notes.set(key, { word, kind, reading, uses: 1, place: cue.place ?? null });
151
+ else {
152
+ note.uses += 1;
153
+ if (word === lower) note.word = word;
154
+ }
155
+ }
156
+ });
157
+ });
158
+ return [...notes.values()];
159
+ }
160
+ function noteLine(note) {
161
+ const why = note.kind === "ambiguous" ? `the context decides its reading, and the lexicon says "${note.reading}"` : `no dictionary has it, and eSpeak NG says /${note.reading}/`;
162
+ const place = note.place ?? "the title";
163
+ const uses = note.uses === 1 ? `1 use, at ${place}` : `${String(note.uses)} uses, the first at ${place}`;
164
+ return `note: ${JSON.stringify(note.word)}: ${why} (${uses})`;
165
+ }
166
+ function notesLine(notes) {
167
+ const count = notes.length === 1 ? "1 note" : `${String(notes.length)} notes`;
168
+ return `${count}: a note is not an error. Give each word its reading with pronounce or in the project lexicon`;
169
+ }
170
+
133
171
  // ../aula-project/src/chapters.ts
134
172
  function rejectTitleChapter(name) {
135
173
  if (name !== TITLE) return;
@@ -167,37 +205,62 @@ function openCount(chapters, indexes) {
167
205
  }
168
206
 
169
207
  // ../aula-project/src/check.ts
170
- var hasSpokenSound = (spoken) => Array.from(phonemize(spoken)).some((c) => new RegExp("\\p{L}", "u").test(c) && c !== "\u02C8" && c !== "\u02CC");
171
208
  function cueLocation(place) {
172
209
  if (place === void 0) return void 0;
173
210
  const colon = place.lastIndexOf(":");
174
211
  const line = Number(place.slice(colon + 1));
175
212
  return colon > 0 && Number.isInteger(line) ? { file: place.slice(0, colon), line, col: 0 } : void 0;
176
213
  }
214
+ function cueNoSpoken(cue, index, names) {
215
+ const chapter = names[index] ?? `chapter ${String(index)}`;
216
+ const location = cueLocation(cue.place);
217
+ return new Problems([
218
+ error(`cannot narrate ${cue.kind} in ${chapter}: ${JSON.stringify(cue.text)} has no spoken words`, {
219
+ code: "cue-no-spoken",
220
+ ...location === void 0 ? {} : { location },
221
+ hint: `give the ${cue.kind} words that the narrator can say`
222
+ })
223
+ ]);
224
+ }
177
225
  async function clock(narrator, chapters, only = null, names = []) {
178
226
  const narrations = /* @__PURE__ */ new Map();
179
227
  for (const [index, cues] of chapters.entries()) {
180
228
  if (only !== null && !only.includes(index)) continue;
181
229
  const timings = [];
182
230
  for (const cue of cues) {
183
- const spoken = cue.words.join(" ");
184
- if (!cue.words.length || !hasSpokenSound(spoken)) {
185
- const chapter = names[index] ?? `chapter ${String(index)}`;
186
- const location = cueLocation(cue.place);
187
- throw new Problems([
188
- error(`cannot narrate ${cue.kind} in ${chapter}: ${JSON.stringify(cue.text)} has no spoken words`, {
189
- code: "cue-no-spoken",
190
- ...location === void 0 ? {} : { location },
191
- hint: `give the ${cue.kind} words that the narrator can say`
192
- })
193
- ]);
194
- }
195
- timings.push(await narrator.time(cue.words));
231
+ if (!cue.words.length) throw cueNoSpoken(cue, index, names);
232
+ const timed = await narrator.tryTime(cue.words);
233
+ if (timed._tag === "Left") throw cueNoSpoken(cue, index, names);
234
+ timings.push(timed.right);
196
235
  }
197
236
  narrations.set(index, timeChapter(cues, timings));
198
237
  }
199
238
  return narrations;
200
239
  }
240
+ function unclearFromTiming(words, timing) {
241
+ const cue = timing.cue;
242
+ if (cue === void 0) return unclearWords(words);
243
+ return unclearWordsFrom(words, cue.unknowns, cue.alonePhonemes);
244
+ }
245
+ async function clockWithUnclear(narrator, chapters, only = null, names = []) {
246
+ const narrations = /* @__PURE__ */ new Map();
247
+ const unclear = chapters.map((cues) => cues.map(() => []));
248
+ for (const [index, cues] of chapters.entries()) {
249
+ if (only !== null && !only.includes(index)) continue;
250
+ const timings = [];
251
+ const chapterUnclear = [];
252
+ for (const cue of cues) {
253
+ if (!cue.words.length) throw cueNoSpoken(cue, index, names);
254
+ const timed = await narrator.tryTime(cue.words);
255
+ if (timed._tag === "Left") throw cueNoSpoken(cue, index, names);
256
+ timings.push(timed.right);
257
+ chapterUnclear.push(unclearFromTiming(cue.words, timed.right));
258
+ }
259
+ narrations.set(index, timeChapter(cues, timings));
260
+ unclear[index] = chapterUnclear;
261
+ }
262
+ return { narrations, unclear };
263
+ }
201
264
  function narrationAt(narrations, index) {
202
265
  const narration = narrations.get(index);
203
266
  if (narration === void 0) throw new Error(`no narration of chapter ${String(index)}`);
@@ -212,8 +275,13 @@ function checkProject(project, host, only) {
212
275
  });
213
276
  const all = reads.map((r) => r.value ?? EMPTY);
214
277
  const own = /* @__PURE__ */ new Map();
278
+ const textRules = /* @__PURE__ */ new Map();
215
279
  reads.forEach((r, i) => {
216
- if (r.value !== void 0) own.set(i + 1, [...r.diagnostics, ...check(r.value)]);
280
+ if (r.value !== void 0) {
281
+ const checked = check(r.value);
282
+ textRules.set(i + 1, checked);
283
+ own.set(i + 1, [...r.diagnostics, ...checked]);
284
+ }
217
285
  });
218
286
  const targets = (only ?? chapterNames(project).map((_, i) => i)).filter((i) => !unloaded.has(i));
219
287
  const inScope = (index) => only === null || only.includes(index);
@@ -221,7 +289,7 @@ function checkProject(project, host, only) {
221
289
  for (const index of targets) {
222
290
  const run = checkChapter(project, index, { host });
223
291
  const text = all[index - 1];
224
- own.set(index, [...run.diagnostics, ...index === 0 || text === void 0 ? [] : check(text)]);
292
+ own.set(index, [...run.diagnostics, ...index === 0 || text === void 0 ? [] : textRules.get(index) ?? []]);
225
293
  }
226
294
  }
227
295
  const byChapter = [...unloaded, ...[...own].toSorted(([a], [b]) => a - b)];
@@ -289,37 +357,6 @@ function overlayPlan(narrations, embeds) {
289
357
  return out;
290
358
  }
291
359
 
292
- // ../aula-project/src/notes.ts
293
- function wordNotes(script, only) {
294
- const notes = /* @__PURE__ */ new Map();
295
- script.forEach((cues, index) => {
296
- if (only !== null && !only.includes(index)) return;
297
- for (const cue of cues) {
298
- for (const { word, kind, reading } of unclearWords(cue.words)) {
299
- const lower = word.slice(0, 1).toLowerCase() + word.slice(1);
300
- const key = `${kind} ${lower}`;
301
- const note = notes.get(key);
302
- if (note === void 0) notes.set(key, { word, kind, reading, uses: 1, place: cue.place ?? null });
303
- else {
304
- note.uses += 1;
305
- if (word === lower) note.word = word;
306
- }
307
- }
308
- }
309
- });
310
- return [...notes.values()];
311
- }
312
- function noteLine(note) {
313
- const why = note.kind === "ambiguous" ? `the context decides its reading, and the lexicon says "${note.reading}"` : `no dictionary has it, and eSpeak NG says /${note.reading}/`;
314
- const place = note.place ?? "the title";
315
- const uses = note.uses === 1 ? `1 use, at ${place}` : `${String(note.uses)} uses, the first at ${place}`;
316
- return `note: ${JSON.stringify(note.word)}: ${why} (${uses})`;
317
- }
318
- function notesLine(notes) {
319
- const count = notes.length === 1 ? "1 note" : `${String(notes.length)} notes`;
320
- return `${count}: a note is not an error. Give each word its reading with pronounce or in the project lexicon`;
321
- }
322
-
323
360
  // ../aula-project/src/stills.ts
324
361
  var clipLength = (frames) => `${(frames / FPS).toFixed(1)} s`;
325
362
  function stillsOf(narration, text, frames, embeds = []) {
@@ -409,50 +446,7 @@ function pictureGroups(window, stills) {
409
446
  }
410
447
 
411
448
  // ../aula-project/src/rows.ts
412
- var EMBED_TAIL = 15;
413
449
  var EMPTY2 = { heading: "", headingSpoken: "", metaphor: "", paragraphs: [] };
414
- function frameAt(sample, rate, fps) {
415
- const x = sample / rate * fps;
416
- const floored = Math.floor(x);
417
- const frac = x - floored;
418
- if (frac < 0.5) return floored;
419
- if (frac > 0.5) return floored + 1;
420
- return floored % 2 === 0 ? floored : floored + 1;
421
- }
422
- function sampleAt(cue, word) {
423
- if (cue.words.length > 0) return cue.words[word]?.startFrame ?? cue.endFrame;
424
- const n = Math.max(words(cue.text).length, 1);
425
- const t = Math.min(word, n) / n;
426
- return cue.speechStartFrame + t * (cue.endFrame - cue.speechStartFrame);
427
- }
428
- function secondsAt(narration, sample) {
429
- return frameAt(sample, narration.sampleRate, FPS) / FPS;
430
- }
431
- function scriptBeats(narration, text) {
432
- const beats = [];
433
- for (let n = 0; n < text.paragraphs.length; n++) {
434
- const p = text.paragraphs[n];
435
- const cue = narration.cues[n + 1];
436
- if (p === void 0 || cue === void 0) break;
437
- const firstWord = (index) => p.says.slice(0, index).reduce((sum, say) => sum + words(say.text).length, 0);
438
- for (let k = 0; k < p.says.length; k++) {
439
- const say = p.says[k];
440
- if (say === void 0) continue;
441
- const onScreen = p.moves.filter((m) => m.say === k).map((m) => m.note);
442
- beats.push({
443
- seconds: secondsAt(narration, sampleAt(cue, firstWord(k))),
444
- kind: "say",
445
- text: say.text,
446
- onScreen
447
- });
448
- for (const e of p.embeds.filter((embed) => embed.say === k)) {
449
- const start = secondsAt(narration, sampleAt(cue, firstWord(k + 1))) - (e.frames + EMBED_TAIL) / FPS;
450
- beats.push({ seconds: start, kind: "embed", text: e.note, onScreen: [] });
451
- }
452
- }
453
- }
454
- return beats;
455
- }
456
450
  function timedChapter(index, name, text, narration) {
457
451
  return {
458
452
  index,
@@ -640,16 +634,17 @@ export {
640
634
  narrateScript,
641
635
  scriptAudio,
642
636
  wav,
637
+ wordNotes,
638
+ noteLine,
639
+ notesLine,
643
640
  clock,
641
+ clockWithUnclear,
644
642
  narrationAt,
645
643
  checkProject,
646
644
  chapterIndexes,
647
645
  exportCheck,
648
646
  clipPlan,
649
647
  overlayPlan,
650
- wordNotes,
651
- noteLine,
652
- notesLine,
653
648
  previewTargets,
654
649
  targetChapters,
655
650
  previewJobs,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  renderDiagnostic
3
- } from "./chunk-4FWDTPLR.js";
3
+ } from "./chunk-V3GJ4XSW.js";
4
4
  import {
5
5
  withSource
6
- } from "./chunk-G44UMBPW.js";
6
+ } from "./chunk-2VD3JPLV.js";
7
7
  import {
8
8
  loadEngine
9
- } from "./chunk-F5RPEFZR.js";
9
+ } from "./chunk-T7S65ZHW.js";
10
10
 
11
11
  // src/problems.ts
12
12
  async function printDiagnostics(capabilities, root, diagnostics, print = (text) => capabilities.log.out(text)) {
@@ -430,7 +430,7 @@ import {
430
430
  wiggle,
431
431
  wrap,
432
432
  wrong
433
- } from "./chunk-F5RPEFZR.js";
433
+ } from "./chunk-T7S65ZHW.js";
434
434
  import {
435
435
  fault
436
436
  } from "./chunk-VX7UVLQW.js";
@@ -2501,27 +2501,6 @@ function svgPathPoints(d) {
2501
2501
  }
2502
2502
  return out;
2503
2503
  }
2504
- function lerp2(a, b, t) {
2505
- return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
2506
- }
2507
- function splitCubic(q, t) {
2508
- const z = [0, 0];
2509
- const [p0, p1, p2, p3] = [q[0] ?? z, q[1] ?? z, q[2] ?? z, q[3] ?? z];
2510
- const a = lerp2(p0, p1, t);
2511
- const b = lerp2(p1, p2, t);
2512
- const d = lerp2(p2, p3, t);
2513
- const e = lerp2(a, b, t);
2514
- const f = lerp2(b, d, t);
2515
- const g = lerp2(e, f, t);
2516
- return [
2517
- [p0, a, e, g],
2518
- [g, f, d, p3]
2519
- ];
2520
- }
2521
- function cubicPart(c, t0, t1) {
2522
- const right = splitCubic(c, t0)[1];
2523
- return t0 >= 1 ? [...right] : splitCubic(right, (t1 - t0) / (1 - t0))[0];
2524
- }
2525
2504
  function partialPoints(points, a, b) {
2526
2505
  const n = Math.floor(points.length / 4);
2527
2506
  if (n === 0 || b <= a) return [];
@@ -2529,23 +2508,14 @@ function partialPoints(points, a, b) {
2529
2508
  const out = [];
2530
2509
  for (let i = 0; i < n; i++) {
2531
2510
  if (i + 1 <= lo || i >= hi) continue;
2532
- out.push(...cubicPart(points.slice(4 * i, 4 * i + 4), Math.max(0, lo - i), Math.min(1, hi - i)));
2511
+ out.push(...engine.cubicPartial(points.slice(4 * i, 4 * i + 4), Math.max(0, lo - i), Math.min(1, hi - i)));
2533
2512
  }
2534
2513
  return out;
2535
2514
  }
2536
2515
  function insertCurves(points, n) {
2537
2516
  const count = Math.floor(points.length / 4);
2538
2517
  if (count === 0 || n <= 0) return [...points];
2539
- const target = count + n;
2540
- const pieces = Array.from({ length: count }, () => 0);
2541
- for (let k = 0; k < target; k++) {
2542
- const i = Math.floor(k * count / target);
2543
- pieces[i] = (pieces[i] ?? 0) + 1;
2544
- }
2545
- return pieces.flatMap((sf, i) => {
2546
- const curve = points.slice(4 * i, 4 * i + 4);
2547
- return Array.from({ length: sf }, (_, j) => cubicPart(curve, j / sf, (j + 1) / sf)).flat();
2548
- });
2518
+ return engine.insertCurves([...points], n);
2549
2519
  }
2550
2520
 
2551
2521
  // ../aula-core/src/graphing.ts
@@ -7,17 +7,17 @@ import {
7
7
  listedProjects,
8
8
  loadBuiltProjects,
9
9
  workspaceHost
10
- } from "./chunk-THZNJBUF.js";
10
+ } from "./chunk-F37DXY3P.js";
11
11
  import {
12
12
  NO_PROJECT_MESSAGE,
13
13
  Problems,
14
14
  bundleProjects,
15
15
  bundleWorkspace,
16
16
  wrongArgument
17
- } from "./chunk-WV2UYZND.js";
17
+ } from "./chunk-VJAXVLXZ.js";
18
18
  import {
19
19
  v8Frames
20
- } from "./chunk-F5RPEFZR.js";
20
+ } from "./chunk-T7S65ZHW.js";
21
21
 
22
22
  // src/workspace-load.ts
23
23
  import { existsSync } from "node:fs";