@beff/aula-cli 0.8.0 → 0.8.2

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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/src/aula-render.core.wasm +0 -0
  3. package/dist/src/aula-version-2DF4P4QU.js +55 -0
  4. package/dist/src/{chunk-OCYYXBFC.js → chunk-AKBT72QJ.js} +5 -5
  5. package/dist/src/{chunk-P5ERWQRZ.js → chunk-CO6PVRRP.js} +1 -1
  6. package/dist/src/{chunk-SFLLSQQC.js → chunk-EDTZIVO7.js} +152 -45
  7. package/dist/src/{chunk-3T52RRLX.js → chunk-H3SCHOAT.js} +1 -1
  8. package/dist/src/{chunk-RJRTIPDX.js → chunk-KND7IF3K.js} +43 -19
  9. package/dist/src/{chunk-MM5CK3FH.js → chunk-OLAUZCE4.js} +1 -1
  10. package/dist/src/{chunk-RRS3SD7K.js → chunk-TYPWU6EF.js} +2 -1
  11. package/dist/src/cli.js +16 -9
  12. package/dist/src/{commands-MPUZFWXF.js → commands-BPEGSWPJ.js} +8 -8
  13. package/dist/src/problems-Q4WAM4GF.js +14 -0
  14. package/dist/src/project-MCSMU7LQ.js +12 -0
  15. package/dist/src/{run-FXI6756W.js → run-3Q4HQSAQ.js} +13 -12
  16. package/dist/src/{server-DDZZD235.js → server-3ODXWDEU.js} +6 -6
  17. package/dist/src/{site-QB34UYGW.js → site-2PE6SEQF.js} +6 -6
  18. package/dist/web/app/assets/__vite-browser-external-CUgZ0mbF.js +1 -0
  19. package/dist/web/app/assets/{aula-voice-worker-OUvhHtjq.js → aula-voice-worker-D-T3qZPJ.js} +1 -1
  20. package/dist/web/app/assets/{aula.core5-C0zBQXNI.wasm → aula.core5-C-gePbHx.wasm} +0 -0
  21. package/dist/web/app/assets/{3b96b843 → deb0a1c1}/aula-method.js +1 -1
  22. package/dist/web/app/assets/deb0a1c1/aula.js +1 -0
  23. package/dist/web/app/assets/{3b96b843 → deb0a1c1}/build-worker.js +1 -1
  24. package/dist/web/app/assets/{3b96b843 → deb0a1c1}/index.js +4 -6
  25. package/dist/web/app/assets/{index-CFRTa3wf.css → index-BL7_U8KF.css} +1 -1
  26. package/dist/web/{site/assets/protocol-BnvCw7zV.js → app/assets/protocol-Rrh_NCGw.js} +3 -3
  27. package/dist/web/app/assets/{src-CUqPzsYz.js → src-BzXPjcyo.js} +6 -6
  28. package/dist/web/app/index.html +4 -4
  29. package/dist/web/site/assets/{ea493e11 → 142f9973}/aula-method.js +1 -1
  30. package/dist/web/site/assets/142f9973/aula.js +1 -0
  31. package/dist/web/site/assets/{ea493e11 → 142f9973}/build-worker.js +1 -1
  32. package/dist/web/site/assets/{ea493e11 → 142f9973}/index.js +4 -6
  33. package/dist/web/site/assets/__vite-browser-external-BaJPhbOR.js +1 -0
  34. package/dist/web/site/assets/{aula-voice-worker-CQfH2h75.js → aula-voice-worker-DzsDUtvQ.js} +1 -1
  35. package/dist/web/site/assets/{aula.core5-C0zBQXNI.wasm → aula.core5-C-gePbHx.wasm} +0 -0
  36. package/dist/web/site/assets/{index-CFRTa3wf.css → index-BL7_U8KF.css} +1 -1
  37. package/dist/web/{app/assets/protocol-CtrtQiG8.js → site/assets/protocol-CLpTIPIb.js} +3 -3
  38. package/dist/web/site/assets/{src-CPJqNVHd.js → src-FOaCgbcX.js} +6 -6
  39. package/dist/web/site/index.html +4 -4
  40. package/package.json +2 -2
  41. package/dist/src/problems-7MYMBW7E.js +0 -14
  42. package/dist/src/project-B2XEBGUG.js +0 -12
  43. package/dist/web/app/assets/3b96b843/aula.js +0 -1
  44. package/dist/web/app/assets/__vite-browser-external-vebSPdNx.js +0 -1
  45. package/dist/web/site/assets/__vite-browser-external-ZYY1CvYw.js +0 -1
  46. package/dist/web/site/assets/ea493e11/aula.js +0 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@ The `aula` command of [aula](https://github.com/lucasavila00/aula): it runs chap
4
4
 
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
- The package has no model file. The first command that narrates or times a video (`preview`, `timeline`, `export`, `aula web`) downloads the narrator's model into `~/.cache/aula/models/aula-voice/`: the raw model of aula-voice's release [v0.2.0](https://github.com/lucasavila00/aula-voice/releases/tag/v0.2.0) (`model.f16-text-fp32.safetensors` and `config.json`, approximately 21 MB). The CLI checks the SHA-256 of each file, makes the engine's weight file (`aula-voice.avw`) from them, and checks its SHA-256 too. `aula web` narrates in the browser: it serves that file to its page from the same folder. The [model card](https://github.com/lucasavila00/aula-voice/releases/download/v0.2.0/MODEL_CARD.md) has the license of the model, its sources and its training data, and their attribution.
7
+ The package has no model file. The first command that narrates or times a video (`preview`, `timeline`, `export`, `aula web`) downloads the narrator's model into `~/.cache/aula/models/aula-voice/`: the raw model of aula-voice's release [v0.2.2](https://github.com/lucasavila00/aula-voice/releases/tag/v0.2.2) (`model.f16-text-fp32.safetensors` and `config.json`, approximately 21 MB). The CLI checks the SHA-256 of each file, makes the engine's weight file (`aula-voice.avw`) from them, and checks its SHA-256 too. `aula web` narrates in the browser: it serves that file to its page from the same folder. The [model card](https://github.com/lucasavila00/aula-voice/releases/download/v0.2.2/MODEL_CARD.md) has the license of the model, its sources and its training data, and their attribution.
8
8
 
9
9
  ## Licenses
10
10
 
Binary file
@@ -0,0 +1,55 @@
1
+ import {
2
+ requireMatchingAulaVersion
3
+ } from "./chunk-EDTZIVO7.js";
4
+ import "./chunk-S74JLCZK.js";
5
+ import "./chunk-AKBT72QJ.js";
6
+ import {
7
+ Parsers,
8
+ wrongArgument
9
+ } from "./chunk-TYPWU6EF.js";
10
+
11
+ // src/aula-version.ts
12
+ import { createRequire } from "node:module";
13
+ import path from "node:path";
14
+ import { fileURLToPath } from "node:url";
15
+ var AULA = "@beff/aula";
16
+ function aulaVersionAt(capabilities, fromFile) {
17
+ const require2 = createRequire(fromFile);
18
+ const entry = require2.resolve(AULA);
19
+ let dir = path.dirname(entry);
20
+ for (; ; ) {
21
+ const file = path.join(dir, "package.json");
22
+ if (capabilities.fs.existsSync(file)) {
23
+ const parsed = Parsers.PackageJson.safeParse(JSON.parse(capabilities.fs.readFileSync(file, "utf8")));
24
+ if (parsed.success && parsed.data.name === AULA) {
25
+ const version = parsed.data.version;
26
+ if (typeof version === "string" && version !== "") return version;
27
+ throw wrongArgument(
28
+ `${file} has no version`,
29
+ "align the versions: install the same version of @beff/aula and @beff/aula-cli"
30
+ );
31
+ }
32
+ }
33
+ const parent = path.dirname(dir);
34
+ if (parent === dir) break;
35
+ dir = parent;
36
+ }
37
+ throw wrongArgument(
38
+ `could not find ${AULA}'s package.json from ${entry}`,
39
+ "align the versions: install the same version of @beff/aula and @beff/aula-cli"
40
+ );
41
+ }
42
+ function cliAulaVersion(capabilities) {
43
+ return aulaVersionAt(capabilities, fileURLToPath(import.meta.url));
44
+ }
45
+ function projectAulaVersion(capabilities, folder) {
46
+ return aulaVersionAt(capabilities, path.join(folder, "index.ts"));
47
+ }
48
+ function assertAulaVersion(capabilities, folder) {
49
+ requireMatchingAulaVersion(cliAulaVersion(capabilities), projectAulaVersion(capabilities, folder));
50
+ }
51
+ export {
52
+ assertAulaVersion,
53
+ cliAulaVersion,
54
+ projectAulaVersion
55
+ };
@@ -283,24 +283,24 @@ var KOKORO_VOCAB = /* @__PURE__ */ new Map([
283
283
  ]);
284
284
 
285
285
  // ../aula-narration/src/aula-voice.ts
286
- var AULA_VOICE_RELEASE = "v0.2.0";
286
+ var AULA_VOICE_RELEASE = "v0.2.2";
287
287
  var RELEASE_URL = `https://github.com/lucasavila00/aula-voice/releases/download/${AULA_VOICE_RELEASE}`;
288
288
  var AULA_VOICE_FILES = {
289
289
  model: {
290
290
  path: "model.f16-text-fp32.safetensors",
291
291
  bytes: 21484448,
292
- sha256: "00dc9a0c9cc1992c8ed16e7a188113d8fec27da919c056a36ffb8b147dbf08dc"
292
+ sha256: "2a53c01a91817f4d22211f37209ebdb4c46a7baf8458d21c85555c73825f6711"
293
293
  },
294
294
  config: {
295
295
  path: "config.json",
296
- bytes: 2214,
297
- sha256: "340eefd2b52b2b3579ff9305414b614cd59437af92952d7815b1dc136e93680d"
296
+ bytes: 2215,
297
+ sha256: "6b12bb11248f3fe3acdfe9a940ace7c45892c3b69d93ea19f5c01e9c7b07a334"
298
298
  }
299
299
  };
300
300
  var AULA_VOICE_WEIGHTS = {
301
301
  path: "aula-voice.avw",
302
302
  bytes: 21474688,
303
- sha256: "a1ef7a8c151a975f002d7c4262c5677056e9fc3601a440469aacabc3eeeb1c6b"
303
+ sha256: "c895eeb4c322b337ee3f82552bf159347579fbb5fbe5349228e5c67e83dae581"
304
304
  };
305
305
  var SERVER_WEIGHTS_PATH = `/models/${AULA_VOICE_WEIGHTS.path}`;
306
306
  var aulaVoiceUrl = (file) => `${RELEASE_URL}/${file.path}`;
@@ -4,7 +4,7 @@ import {
4
4
  error,
5
5
  projectName,
6
6
  wrongArgument
7
- } from "./chunk-RRS3SD7K.js";
7
+ } from "./chunk-TYPWU6EF.js";
8
8
 
9
9
  // ../aula-project/src/node.ts
10
10
  import path from "node:path";
@@ -8,27 +8,30 @@ import {
8
8
  isError,
9
9
  linkBundle,
10
10
  wrongArgument
11
- } from "./chunk-RRS3SD7K.js";
11
+ } from "./chunk-TYPWU6EF.js";
12
+
13
+ // ../aula-project/src/aula-version.ts
14
+ function requireMatchingAulaVersion(cli, project) {
15
+ if (cli === project) return;
16
+ throw wrongArgument(
17
+ `the CLI's @beff/aula is ${cli}, but the project has @beff/aula ${project}`,
18
+ "align the versions: install the same version of @beff/aula and @beff/aula-cli"
19
+ );
20
+ }
21
+
22
+ // ../aula-project/src/check.ts
23
+ import { checkChapter, checkLexicon, checkTitle, readChapter as readChapter2 } from "@beff/aula";
24
+ import { chapterNames } from "@beff/aula/run";
25
+ import { check as rules, phonemize } from "@beff/aula/text";
12
26
 
13
27
  // ../aula-project/src/chapters.ts
14
28
  import { readChapter } from "@beff/aula";
15
- import { paragraphAt, scriptMarkdown } from "@beff/aula/text";
29
+ import { paragraphAt } from "@beff/aula/text";
16
30
  function chapterIndex(names, name) {
17
31
  const at = names.indexOf(name);
18
32
  if (at >= 0) return at;
19
33
  throw wrongArgument(`No chapter '${name}': use one of [${names.join(", ")}]`);
20
34
  }
21
- function header(project) {
22
- const body = project.storyboard.trim();
23
- return body === "" ? `# ${project.title}
24
- ` : `# ${project.title}
25
-
26
- ${body}
27
- `;
28
- }
29
- function placeText(place) {
30
- return `${place.file}:${String(place.line)}`;
31
- }
32
35
  function chapterText(project, host, index) {
33
36
  const result = readChapter(project, index, { host });
34
37
  if (!result.ok || !result.value) throw new Problems(result.diagnostics);
@@ -41,15 +44,6 @@ function paragraphCue(text, name, line) {
41
44
  const list = starts.length > 1 ? `${starts.slice(0, -1).join(", ")} and ${starts.at(-1) ?? ""}` : starts.join("");
42
45
  throw wrongArgument(`line ${String(line)} of ${name} is in no paragraph; the paragraphs start at lines ${list}`);
43
46
  }
44
- function texts(project, host) {
45
- const reads = project.chapters.map((_, i) => readChapter(project, i + 1, { host }));
46
- const problems = reads.flatMap((r) => r.ok && r.value ? [] : r.diagnostics);
47
- if (problems.length) throw new Problems(problems);
48
- return reads.flatMap((r) => r.value ? [r.value] : []);
49
- }
50
- function scriptView(project, host) {
51
- return scriptMarkdown(project.title, texts(project, host));
52
- }
53
47
  function openMoves(text) {
54
48
  return text.paragraphs.flatMap((p) => p.moves).filter((m2) => !m2.done);
55
49
  }
@@ -58,9 +52,6 @@ function openCount(chapters, indexes) {
58
52
  }
59
53
 
60
54
  // ../aula-project/src/check.ts
61
- import { checkChapter, checkLexicon, checkTitle, readChapter as readChapter2 } from "@beff/aula";
62
- import { chapterNames } from "@beff/aula/run";
63
- import { check as rules, phonemize } from "@beff/aula/text";
64
55
  var hasSpokenSound = (spoken) => Array.from(phonemize(spoken)).some((c) => new RegExp("\\p{L}", "u").test(c) && c !== "\u02C8" && c !== "\u02CC");
65
56
  function cueLocation(place) {
66
57
  if (place === void 0) return void 0;
@@ -309,21 +300,71 @@ function pictureGroups(window, stills) {
309
300
  { folder: "motion", cols: 4, rows: 4, tiles: motion }
310
301
  ];
311
302
  }
312
- function movesMarkdown(stills) {
313
- return stills.map((still) => {
314
- const at = still.place ? placeText(still.place) : "title card";
315
- const clip = still.embed === void 0 ? "" : ` (${still.embed.path}, ${still.embed.length})`;
316
- return `- ${at}, ${(still.frame / FPS3).toFixed(1)} s: ${still.note}${clip} (stills/${still.name}.png)
317
- `;
318
- }).join("");
319
- }
320
303
 
321
- // ../aula-project/src/timeline.ts
304
+ // ../aula-project/src/rows.ts
322
305
  import { readChapter as readChapter3, renderChapter } from "@beff/aula";
323
- import { chapterNames as chapterNames3 } from "@beff/aula/run";
324
- import { narrationScript, timeline as timelineOf } from "@beff/aula/text";
306
+ import { chapterNames as chapterNames3, FPS as FPS4 } from "@beff/aula/run";
307
+ import {
308
+ narrationScript,
309
+ timeline as timelineOf,
310
+ words
311
+ } from "@beff/aula/text";
312
+ var EMBED_TAIL = 15;
325
313
  var EMPTY2 = { heading: "", headingSpoken: "", metaphor: "", paragraphs: [] };
326
- async function timelineView(project, host, narrator, only) {
314
+ function frameAt(sample, rate, fps) {
315
+ const x = sample / rate * fps;
316
+ const floored = Math.floor(x);
317
+ const frac = x - floored;
318
+ if (frac < 0.5) return floored;
319
+ if (frac > 0.5) return floored + 1;
320
+ return floored % 2 === 0 ? floored : floored + 1;
321
+ }
322
+ function sampleAt(cue, word) {
323
+ if (cue.words.length > 0) return cue.words[word]?.startFrame ?? cue.endFrame;
324
+ const n = Math.max(words(cue.text).length, 1);
325
+ const t = Math.min(word, n) / n;
326
+ return cue.speechStartFrame + t * (cue.endFrame - cue.speechStartFrame);
327
+ }
328
+ function secondsAt(narration, sample) {
329
+ return frameAt(sample, narration.sampleRate, FPS4) / FPS4;
330
+ }
331
+ function scriptBeats(narration, text) {
332
+ const beats = [];
333
+ for (let n = 0; n < text.paragraphs.length; n++) {
334
+ const p = text.paragraphs[n];
335
+ const cue = narration.cues[n + 1];
336
+ if (p === void 0 || cue === void 0) break;
337
+ const firstWord = (index) => p.says.slice(0, index).reduce((sum, say) => sum + words(say.text).length, 0);
338
+ for (let k = 0; k < p.says.length; k++) {
339
+ const say = p.says[k];
340
+ if (say === void 0) continue;
341
+ const onScreen = p.moves.filter((m2) => m2.say === k).map((m2) => m2.note);
342
+ beats.push({
343
+ seconds: secondsAt(narration, sampleAt(cue, firstWord(k))),
344
+ kind: "say",
345
+ text: say.text,
346
+ onScreen
347
+ });
348
+ for (const e of p.embeds.filter((embed) => embed.say === k)) {
349
+ const start = secondsAt(narration, sampleAt(cue, firstWord(k + 1))) - (e.frames + EMBED_TAIL) / FPS4;
350
+ beats.push({ seconds: start, kind: "embed", text: e.note, onScreen: [] });
351
+ }
352
+ }
353
+ }
354
+ return beats;
355
+ }
356
+ function timedChapter(index, name, text, narration) {
357
+ return {
358
+ index,
359
+ name,
360
+ heading: text.heading,
361
+ metaphor: text.metaphor,
362
+ seconds: narration.endFrame / narration.sampleRate,
363
+ fullLines: timelineOf(narration, text),
364
+ beats: scriptBeats(narration, text)
365
+ };
366
+ }
367
+ async function loadTimed(project, host, narrator, only) {
327
368
  const names = chapterNames3(project);
328
369
  const indexes = only.length === 0 ? project.chapters.map((_, i) => i + 1) : only.map((name) => chapterIndex(names, name));
329
370
  if (indexes.includes(0)) throw wrongArgument("the title card has no timeline: give a chapter name");
@@ -334,20 +375,84 @@ async function timelineView(project, host, narrator, only) {
334
375
  return loaded.get(index) ?? readChapter3(project, index, { host }).value ?? EMPTY2;
335
376
  });
336
377
  const n = await clock(narrator, narrationScript(project, all), indexes, names);
337
- let out = header(project);
378
+ const chapters = [];
338
379
  for (const index of indexes) {
339
380
  const text = loaded.get(index) ?? chapterText(project, host, index);
340
381
  const run = renderChapter(project, index, { host, narration: narrationAt(n, index), lint: true });
341
382
  if (!run.ok || run.value === void 0) throw new Problems(run.diagnostics);
342
- out += `
343
- ## ${names[index] ?? ""}
344
- Metaphor: ${text.metaphor}
383
+ chapters.push(timedChapter(index, names[index] ?? "", text, run.value.narration));
384
+ }
385
+ return { title: project.title, storyboard: project.storyboard, chapters };
386
+ }
387
+ function formatFullChapter(chapter) {
388
+ let out = `## ${chapter.name}
389
+ Metaphor: ${chapter.metaphor}
345
390
  `;
346
- for (const line of timelineOf(run.value.narration, text)) out += `${line}
391
+ for (const line of chapter.fullLines) out += `${line}
347
392
  `;
348
- }
349
393
  return out;
350
394
  }
395
+ function movesMarkdown(chapter) {
396
+ return formatFullChapter(chapter);
397
+ }
398
+ function storyboardHeader(title, storyboard) {
399
+ const body = storyboard.trim();
400
+ return body === "" ? `# ${title}
401
+ ` : `# ${title}
402
+
403
+ ${body}
404
+ `;
405
+ }
406
+ function formatTimeline(project) {
407
+ let out = storyboardHeader(project.title, project.storyboard);
408
+ for (const chapter of project.chapters) out += `
409
+ ${formatFullChapter(chapter)}`;
410
+ return out;
411
+ }
412
+ function chapterLabel(name, heading) {
413
+ const prefix = /^(\d+)/.exec(name)?.[1];
414
+ return prefix === void 0 ? heading : `${prefix} ${heading}`;
415
+ }
416
+ function formatClock(seconds) {
417
+ const total = Math.max(0, Math.floor(seconds + 1e-9));
418
+ const m2 = Math.floor(total / 60);
419
+ const s = total % 60;
420
+ return `${String(m2)}:${String(s).padStart(2, "0")}`;
421
+ }
422
+ function formatDuration(seconds) {
423
+ if (seconds < 60) return `${seconds.toFixed(1)} s`;
424
+ const whole = Math.round(seconds);
425
+ const m2 = Math.floor(whole / 60);
426
+ const s = whole % 60;
427
+ return `${String(m2)} min ${String(s)} s`;
428
+ }
429
+ function formatScript(project) {
430
+ const total = project.chapters.reduce((sum, c) => sum + c.seconds, 0);
431
+ const lines = [`Video: ${project.title} (${formatDuration(total)})`, ""];
432
+ for (const chapter of project.chapters) {
433
+ lines.push(`${chapterLabel(chapter.name, chapter.heading)} (${chapter.seconds.toFixed(1)} s)`);
434
+ for (const beat of chapter.beats) {
435
+ const at = formatClock(beat.seconds);
436
+ if (beat.kind === "say") {
437
+ lines.push(` ${at} "${beat.text}"`);
438
+ if (beat.onScreen.length > 0) lines.push(` On screen: ${beat.onScreen.join("; ")}`);
439
+ } else {
440
+ lines.push(` ${at} embed: ${beat.text}`);
441
+ }
442
+ }
443
+ lines.push("");
444
+ }
445
+ return `${lines.join("\n").replace(/\n+$/, "")}
446
+ `;
447
+ }
448
+
449
+ // ../aula-project/src/timeline.ts
450
+ async function timelineView(project, host, narrator, only) {
451
+ return formatTimeline(await loadTimed(project, host, narrator, only));
452
+ }
453
+ async function scriptView(project, host, narrator, only) {
454
+ return formatScript(await loadTimed(project, host, narrator, only));
455
+ }
351
456
 
352
457
  // ../aula-project/src/workspace.ts
353
458
  import * as Engine from "@beff/aula";
@@ -430,11 +535,11 @@ function localProject(name, folder, section, definition, host) {
430
535
  }
431
536
 
432
537
  // ../aula-project/src/videos.ts
433
- import { FPS as FPS4 } from "@beff/aula/run";
538
+ import { FPS as FPS5 } from "@beff/aula/run";
434
539
  import { estimateNarration } from "@beff/aula/text";
435
540
 
436
541
  export {
437
- scriptView,
542
+ requireMatchingAulaVersion,
438
543
  clock,
439
544
  narrationAt,
440
545
  checkProject,
@@ -450,8 +555,10 @@ export {
450
555
  previewJobs,
451
556
  pictureStills,
452
557
  pictureGroups,
558
+ timedChapter,
453
559
  movesMarkdown,
454
560
  timelineView,
561
+ scriptView,
455
562
  workspaceHost,
456
563
  loadBuiltProjects
457
564
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  withSource
3
- } from "./chunk-P5ERWQRZ.js";
3
+ } from "./chunk-CO6PVRRP.js";
4
4
 
5
5
  // src/problems.ts
6
6
  import { loadEngine } from "@beff/aula/run";
@@ -1,3 +1,6 @@
1
+ import {
2
+ createNodeBundler
3
+ } from "./chunk-THQ5Y74K.js";
1
4
  import {
2
5
  VIDEO,
3
6
  assemble,
@@ -6,7 +9,14 @@ import {
6
9
  } from "./chunk-BLKXJGEO.js";
7
10
  import {
8
11
  printDiagnostics
9
- } from "./chunk-3T52RRLX.js";
12
+ } from "./chunk-H3SCHOAT.js";
13
+ import {
14
+ host
15
+ } from "./chunk-OLAUZCE4.js";
16
+ import {
17
+ folderOf,
18
+ nameOf
19
+ } from "./chunk-CO6PVRRP.js";
10
20
  import {
11
21
  chapterIndexes,
12
22
  checkProject,
@@ -24,24 +34,15 @@ import {
24
34
  previewTargets,
25
35
  scriptView,
26
36
  targetChapters,
37
+ timedChapter,
27
38
  timelineView,
28
39
  wordNotes
29
- } from "./chunk-SFLLSQQC.js";
30
- import {
31
- createNodeBundler
32
- } from "./chunk-THQ5Y74K.js";
40
+ } from "./chunk-EDTZIVO7.js";
33
41
  import {
34
42
  narrateScript,
35
43
  scriptAudio,
36
44
  wav
37
45
  } from "./chunk-S74JLCZK.js";
38
- import {
39
- host
40
- } from "./chunk-MM5CK3FH.js";
41
- import {
42
- folderOf,
43
- nameOf
44
- } from "./chunk-P5ERWQRZ.js";
45
46
  import {
46
47
  ObjectRuntype,
47
48
  OptionalFieldRuntype,
@@ -54,7 +55,7 @@ import {
54
55
  bundle,
55
56
  isError,
56
57
  wrongArgument
57
- } from "./chunk-RRS3SD7K.js";
58
+ } from "./chunk-TYPWU6EF.js";
58
59
 
59
60
  // src/commands.ts
60
61
  import path2 from "node:path";
@@ -972,24 +973,46 @@ function printCounts(capabilities, project, checked) {
972
973
  capabilities.log.out(`other chapters: ${String(errors)} errors, ${String(warnings)} warnings`);
973
974
  capabilities.log.out(rowLine(project, checked));
974
975
  }
976
+ async function timeChapters(capabilities, root, project, texts, only) {
977
+ const names = chapterNames(project);
978
+ const indexes = (only ?? names.map((_, i2) => i2)).filter((i2) => i2 > 0);
979
+ if (indexes.length === 0) return [];
980
+ return withHeavy(capabilities, async () => {
981
+ const n = await clock(capabilities.narrator, narrationScript(project, texts), only, names);
982
+ const h = host(capabilities, root);
983
+ const warnings = [];
984
+ for (const index of indexes) {
985
+ const drawn = renderChapter(project, index, {
986
+ host: h,
987
+ narration: narrationAt(n, index),
988
+ lint: true
989
+ });
990
+ warnings.push(...drawn.diagnostics.filter((d) => !isError(d)));
991
+ }
992
+ return warnings;
993
+ });
994
+ }
975
995
  async function check(capabilities, root, project, only, json = false) {
976
996
  const chapters = chapterIndexes(project, only);
977
997
  const checked = checkProject(project, host(capabilities, root), chapters);
998
+ const timing = checked.errors === 0 ? await timeChapters(capabilities, root, project, checked.texts, chapters) : [];
999
+ const findings = [...checked.findings, ...timing];
1000
+ const warnings = checked.warnings + timing.length;
978
1001
  const notes = wordNotes(narrationScript(project, checked.texts), chapters);
979
1002
  if (json) {
980
- const { findings, others, errors, warnings, open } = checked;
1003
+ const { others, errors, open } = checked;
981
1004
  const result = { name: nameOf(project), errors, warnings, openMoves: open, others, findings, notes };
982
1005
  capabilities.log.out(JSON.stringify(result, null, 2));
983
1006
  return errors === 0;
984
1007
  }
985
- await printDiagnostics(capabilities, root, checked.findings);
1008
+ await printDiagnostics(capabilities, root, findings);
986
1009
  for (const note of notes) capabilities.log.out(noteLine(note));
987
1010
  if (notes.length > 0) capabilities.log.out(notesLine(notes));
988
- printCounts(capabilities, project, checked);
1011
+ printCounts(capabilities, project, { ...checked, findings, warnings });
989
1012
  return checked.errors === 0;
990
1013
  }
991
- async function script(capabilities, root, project) {
992
- capabilities.log.write(scriptView(project, host(capabilities, root)));
1014
+ async function script(capabilities, root, project, only) {
1015
+ capabilities.log.write(await scriptView(project, host(capabilities, root), capabilities.narrator, only));
993
1016
  return true;
994
1017
  }
995
1018
  async function timeline(capabilities, root, project, only) {
@@ -1027,7 +1050,8 @@ async function preview(capabilities, root, project, folder, given) {
1027
1050
  const groups = inFolder(folderOf(project), pictureGroups(window, stills));
1028
1051
  const sheets = await capabilities.render.pictures({ lottie, out, groups });
1029
1052
  await capabilities.fs.mkdir(out, { recursive: true });
1030
- await capabilities.fs.writeFile(path2.join(out, "moves.md"), movesMarkdown(stills));
1053
+ const moves = job.text === null ? "title card\n" : movesMarkdown(timedChapter(job.index, job.name, job.text, drawn.narration));
1054
+ await capabilities.fs.writeFile(path2.join(out, "moves.md"), moves);
1031
1055
  job.written.push(path2.join(out, "moves.md"), ...sheets);
1032
1056
  });
1033
1057
  });
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  host,
3
3
  loadProject
4
- } from "./chunk-P5ERWQRZ.js";
4
+ } from "./chunk-CO6PVRRP.js";
5
5
 
6
6
  // src/project.ts
7
7
  function exists(capabilities, file) {
@@ -981,12 +981,13 @@ var direct_hoist_1 = new AnyRuntype(void 0);
981
981
  var direct_hoist_2 = new TypeofRuntype(void 0, "string");
982
982
  var direct_hoist_3 = new ArrayRuntype(void 0, direct_hoist_2);
983
983
  var direct_hoist_4 = new ObjectRuntype({
984
- "description": "The part of a package.json that aula reads: how a package names its module and its\nworkspace packages."
984
+ "description": "The part of a package.json that aula reads: how a package names its module and its\nworkspace packages, and its version when the CLI compares it to the project's."
985
985
  }, {
986
986
  "exports": new OptionalFieldRuntype(direct_hoist_1),
987
987
  "main": new OptionalFieldRuntype(direct_hoist_2),
988
988
  "module": new OptionalFieldRuntype(direct_hoist_2),
989
989
  "name": new OptionalFieldRuntype(direct_hoist_2),
990
+ "version": new OptionalFieldRuntype(direct_hoist_2),
990
991
  "workspaces": new OptionalFieldRuntype(direct_hoist_3)
991
992
  }, []);
992
993
  Object.assign(namedRuntypes, {
package/dist/src/cli.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  studentWeightFile,
15
15
  timeAulaVoice,
16
16
  tokenBatches
17
- } from "./chunk-OCYYXBFC.js";
17
+ } from "./chunk-AKBT72QJ.js";
18
18
 
19
19
  // src/cli.ts
20
20
  import { spawn } from "node:child_process";
@@ -280,9 +280,9 @@ var base = Capabilities.create({
280
280
  },
281
281
  spawn
282
282
  });
283
- var { diagnosticsOf, printDiagnostics } = await import("./problems-7MYMBW7E.js");
284
- var { host, loadProject } = await import("./project-B2XEBGUG.js");
285
- var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, siteOptions, webOptions } = await import("./run-FXI6756W.js");
283
+ var { diagnosticsOf, printDiagnostics } = await import("./problems-Q4WAM4GF.js");
284
+ var { host, loadProject } = await import("./project-MCSMU7LQ.js");
285
+ var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, siteOptions, webOptions } = await import("./run-3Q4HQSAQ.js");
286
286
  var locks = createLocks(base, path3.join(os.homedir(), ".cache/aula/heavy.lock"));
287
287
  var render = createRender(base, process.execPath);
288
288
  var models = path3.join(os.homedir(), ".cache/aula/models");
@@ -305,7 +305,10 @@ async function main(argv) {
305
305
  }
306
306
  const args = parse(rest, optionsOf(command));
307
307
  if (command === "web") {
308
- const { serve } = await import("./server-DDZZD235.js");
308
+ const { assertAulaVersion } = await import("./aula-version-2DF4P4QU.js");
309
+ const options2 = webOptions(cwd, args);
310
+ assertAulaVersion(capabilities, options2.root);
311
+ const { serve } = await import("./server-3ODXWDEU.js");
309
312
  const stop = new AbortController();
310
313
  for (const signal of ["SIGINT", "SIGTERM"]) process.once(signal, () => stop.abort());
311
314
  const web = Capabilities.create({
@@ -317,22 +320,26 @@ async function main(argv) {
317
320
  return watcher;
318
321
  }
319
322
  });
320
- await serve(Capabilities.extend(capabilities, web), { ...webOptions(cwd, args), stop: stop.signal });
323
+ await serve(Capabilities.extend(capabilities, web), { ...options2, stop: stop.signal });
321
324
  return 0;
322
325
  }
323
326
  if (command === "site") {
324
- const { site } = await import("./site-QB34UYGW.js");
327
+ const { site } = await import("./site-2PE6SEQF.js");
325
328
  const weights = Capabilities.create({ weights: aulaVoiceWeights(base, fetch, models) });
326
329
  return await site(Capabilities.extend(capabilities, weights), siteOptions(cwd, args)) ? 0 : 1;
327
330
  }
328
331
  if (command === "tokens") {
329
- const { tokens, tokensArgs } = await import("./commands-MPUZFWXF.js");
332
+ const { tokens, tokensArgs } = await import("./commands-BPEGSWPJ.js");
330
333
  tokensArgs(args.positional);
331
334
  const tokensOf = createTokens();
332
335
  return await tokens(capabilities, tokensOf, createInterface({ input: process.stdin, crlfDelay: Infinity })) ? 0 : 1;
333
336
  }
334
337
  const { folder, rest: after } = folderArgs(cwd, command, args);
335
- const only = command === "preview" ? after.slice(1) : command === "check" || command === "timeline" ? after : [];
338
+ if (command === "check") {
339
+ const { assertAulaVersion } = await import("./aula-version-2DF4P4QU.js");
340
+ assertAulaVersion(capabilities, folder);
341
+ }
342
+ const only = command === "preview" ? after.slice(1) : command === "check" || command === "timeline" || command === "script" ? after : [];
336
343
  const project = await loadProject(capabilities, cwd, folder, only);
337
344
  return await run2(capabilities, cwd, command, project, after, args.flags) ? 0 : 1;
338
345
  }
@@ -7,17 +7,17 @@ import {
7
7
  timeline,
8
8
  tokens,
9
9
  tokensArgs
10
- } from "./chunk-RJRTIPDX.js";
10
+ } from "./chunk-KND7IF3K.js";
11
+ import "./chunk-THQ5Y74K.js";
11
12
  import "./chunk-BLKXJGEO.js";
12
13
  import "./chunk-2XGNOG2U.js";
13
- import "./chunk-3T52RRLX.js";
14
- import "./chunk-SFLLSQQC.js";
15
- import "./chunk-THQ5Y74K.js";
14
+ import "./chunk-H3SCHOAT.js";
15
+ import "./chunk-OLAUZCE4.js";
16
+ import "./chunk-CO6PVRRP.js";
17
+ import "./chunk-EDTZIVO7.js";
16
18
  import "./chunk-S74JLCZK.js";
17
- import "./chunk-OCYYXBFC.js";
18
- import "./chunk-MM5CK3FH.js";
19
- import "./chunk-P5ERWQRZ.js";
20
- import "./chunk-RRS3SD7K.js";
19
+ import "./chunk-AKBT72QJ.js";
20
+ import "./chunk-TYPWU6EF.js";
21
21
  export {
22
22
  bundle,
23
23
  check,
@@ -0,0 +1,14 @@
1
+ import {
2
+ printDiagnostics
3
+ } from "./chunk-H3SCHOAT.js";
4
+ import "./chunk-CO6PVRRP.js";
5
+ import "./chunk-EDTZIVO7.js";
6
+ import "./chunk-S74JLCZK.js";
7
+ import "./chunk-AKBT72QJ.js";
8
+ import {
9
+ diagnosticsOf
10
+ } from "./chunk-TYPWU6EF.js";
11
+ export {
12
+ diagnosticsOf,
13
+ printDiagnostics
14
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ exists,
3
+ host,
4
+ loadProject
5
+ } from "./chunk-OLAUZCE4.js";
6
+ import "./chunk-CO6PVRRP.js";
7
+ import "./chunk-TYPWU6EF.js";
8
+ export {
9
+ exists,
10
+ host,
11
+ loadProject
12
+ };