@beff/aula-cli 0.2.0 → 0.3.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.
Files changed (24) hide show
  1. package/dist/src/{chunk-D2BDOCX7.js → chunk-5MXHQCWH.js} +24 -7
  2. package/dist/src/{chunk-PSI7MMGP.js → chunk-7IQUN2SB.js} +40 -4
  3. package/dist/src/{chunk-BMP6H3SZ.js → chunk-H54BN5R7.js} +6 -9
  4. package/dist/src/{chunk-SW5BNPAM.js → chunk-HDAMZF5B.js} +16 -20
  5. package/dist/src/cli.js +8 -8
  6. package/dist/src/{commands-CEBO6WWE.js → commands-DUMGD7TE.js} +4 -4
  7. package/dist/src/{problems-FFAR72WZ.js → problems-DYLEPGE6.js} +3 -3
  8. package/dist/src/{run-DU2H6FZI.js → run-72KOJGZE.js} +14 -9
  9. package/dist/src/{server-7AN6XCTF.js → server-BWWN7KZA.js} +4 -3
  10. package/dist/web/app/assets/__vite-browser-external-BTSih4Wj.js +1 -0
  11. package/dist/web/app/assets/{aula-voice-worker-DNzLI-en.js → aula-voice-worker-DfzMG86o.js} +10 -10
  12. package/dist/web/app/assets/{aula.core5-BmrvjVro.wasm → aula.core5-CdA2Cc_n.wasm} +0 -0
  13. package/dist/web/app/assets/d1a3d405/aula-method.js +1 -0
  14. package/dist/web/app/assets/d1a3d405/aula.js +1 -0
  15. package/dist/web/app/assets/{build-worker.js → d1a3d405/build-worker.js} +2 -2
  16. package/dist/web/app/assets/{index-D6yaOVRx.js → d1a3d405/index.js} +2 -2
  17. package/dist/web/app/assets/protocol-B85V84gE.js +15 -0
  18. package/dist/web/app/assets/{src-B22P60S6.js → src-BV6xlpP7.js} +6 -6
  19. package/dist/web/app/index.html +3 -3
  20. package/package.json +2 -2
  21. package/dist/web/app/assets/__vite-browser-external-B6HdzU1j.js +0 -1
  22. package/dist/web/app/assets/aula-method.js +0 -1
  23. package/dist/web/app/assets/aula.js +0 -1
  24. package/dist/web/app/assets/protocol-CDkth-6D.js +0 -15
@@ -11,6 +11,8 @@ import {
11
11
  exportCheck,
12
12
  movesMarkdown,
13
13
  narrationAt,
14
+ noteLine,
15
+ notesLine,
14
16
  pictureGroups,
15
17
  pictureStills,
16
18
  previewJobs,
@@ -18,13 +20,14 @@ import {
18
20
  printDiagnostics,
19
21
  scriptView,
20
22
  targetChapters,
21
- timelineView
22
- } from "./chunk-PSI7MMGP.js";
23
+ timelineView,
24
+ wordNotes
25
+ } from "./chunk-7IQUN2SB.js";
23
26
  import {
24
27
  narrateScript,
25
28
  scriptAudio,
26
29
  wav
27
- } from "./chunk-BMP6H3SZ.js";
30
+ } from "./chunk-H54BN5R7.js";
28
31
  import {
29
32
  host
30
33
  } from "./chunk-46KT47TH.js";
@@ -813,7 +816,7 @@ function zipBytes(entries) {
813
816
  // src/narrate.ts
814
817
  function narrate(capabilities, chapters) {
815
818
  return narrateScript(
816
- (text, speed) => capabilities.narrator.speak(text, speed),
819
+ (words, speed) => capabilities.narrator.speak(words, speed),
817
820
  chapters,
818
821
  (spoken, count, cue) => {
819
822
  capabilities.log.out(`[${String(spoken)}/${String(count)}] Narrating: ${cue.text.slice(0, 70)}`);
@@ -927,14 +930,28 @@ async function drawChapter(capabilities, root, project, index, narration, lottie
927
930
  var rowLine = (project, r) => `${nameOf(project)}: ${String(r.errors)} errors, ${String(r.warnings)} warnings, ${String(r.open)} open moves`;
928
931
  async function printChecked(capabilities, root, project, checked) {
929
932
  await printDiagnostics(capabilities, root, checked.findings);
933
+ printCounts(capabilities, project, checked);
934
+ }
935
+ function printCounts(capabilities, project, checked) {
930
936
  const { errors, warnings } = checked.others;
931
937
  if (errors + warnings > 0)
932
938
  capabilities.log.out(`other chapters: ${String(errors)} errors, ${String(warnings)} warnings`);
933
939
  capabilities.log.out(rowLine(project, checked));
934
940
  }
935
- async function check(capabilities, root, project, only) {
936
- const checked = checkProject(project, host(capabilities, root), chapterIndexes(project, only));
937
- await printChecked(capabilities, root, project, checked);
941
+ async function check(capabilities, root, project, only, json = false) {
942
+ const chapters = chapterIndexes(project, only);
943
+ const checked = checkProject(project, host(capabilities, root), chapters);
944
+ const notes = wordNotes(narrationScript(project, checked.texts), chapters);
945
+ if (json) {
946
+ const { findings, others, errors, warnings, open } = checked;
947
+ const result = { name: nameOf(project), errors, warnings, openMoves: open, others, findings, notes };
948
+ capabilities.log.out(JSON.stringify(result, null, 2));
949
+ return errors === 0;
950
+ }
951
+ await printDiagnostics(capabilities, root, checked.findings);
952
+ for (const note of notes) capabilities.log.out(noteLine(note));
953
+ if (notes.length > 0) capabilities.log.out(notesLine(notes));
954
+ printCounts(capabilities, project, checked);
938
955
  return checked.errors === 0;
939
956
  }
940
957
  async function script(capabilities, root, project) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  timeChapter
3
- } from "./chunk-BMP6H3SZ.js";
3
+ } from "./chunk-H54BN5R7.js";
4
4
  import {
5
5
  Problems,
6
6
  error,
@@ -61,14 +61,14 @@ function openCount(chapters, indexes) {
61
61
  }
62
62
 
63
63
  // ../aula-project/src/check.ts
64
- import { checkChapter, checkLexicon, readChapter as readChapter2 } from "@beff/aula";
64
+ import { checkChapter, checkLexicon, checkTitle, readChapter as readChapter2 } from "@beff/aula";
65
65
  import { chapterNames } from "@beff/aula/run";
66
66
  import { check as rules } from "@beff/aula/text";
67
67
  async function clock(narrator, chapters) {
68
68
  const narrations = [];
69
69
  for (const cues of chapters) {
70
70
  const timings = [];
71
- for (const cue of cues) timings.push(await narrator.time(cue.spoken, cue.speed));
71
+ for (const cue of cues) timings.push(await narrator.time(cue.words, cue.speed));
72
72
  narrations.push(timeChapter(cues, timings));
73
73
  }
74
74
  return narrations;
@@ -78,7 +78,7 @@ function narrationAt(narrations, index) {
78
78
  if (narration === void 0) throw new Error(`no narration of chapter ${String(index)}`);
79
79
  return narration;
80
80
  }
81
- var EMPTY = { heading: "", metaphor: "", paragraphs: [] };
81
+ var EMPTY = { heading: "", headingSpoken: "", metaphor: "", paragraphs: [] };
82
82
  function checkProject(project, host, only) {
83
83
  const reads = project.chapters.map((_, i) => readChapter2(project, i + 1, { host }));
84
84
  const unloaded = /* @__PURE__ */ new Map();
@@ -102,6 +102,7 @@ function checkProject(project, host, only) {
102
102
  const byChapter = [...unloaded, ...[...own].toSorted(([a], [b]) => a - b)];
103
103
  const reported = [
104
104
  ...checkLexicon(project, { host }),
105
+ ...checkTitle(project, { host }),
105
106
  ...byChapter.flatMap(([index, d]) => inScope(index) ? d : [])
106
107
  ];
107
108
  const elsewhere = byChapter.flatMap(([index, d]) => inScope(index) ? [] : d);
@@ -145,6 +146,38 @@ function clipPlan(narrations, fps) {
145
146
  return { clips, seconds: starts.at(-1) ?? 0 };
146
147
  }
147
148
 
149
+ // ../aula-project/src/notes.ts
150
+ import { unclearWords } from "@beff/aula/text";
151
+ function wordNotes(script, only) {
152
+ const notes = /* @__PURE__ */ new Map();
153
+ script.forEach((cues, index) => {
154
+ if (only !== null && !only.includes(index)) return;
155
+ for (const cue of cues) {
156
+ for (const { word, kind, reading } of unclearWords(cue.words)) {
157
+ const lower = word.slice(0, 1).toLowerCase() + word.slice(1);
158
+ const key = `${kind} ${lower}`;
159
+ const note = notes.get(key);
160
+ if (note === void 0) notes.set(key, { word, kind, reading, uses: 1, place: cue.place ?? null });
161
+ else {
162
+ note.uses += 1;
163
+ if (word === lower) note.word = word;
164
+ }
165
+ }
166
+ }
167
+ });
168
+ return [...notes.values()];
169
+ }
170
+ function noteLine(note) {
171
+ 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}/`;
172
+ const place = note.place ?? "the title";
173
+ const uses = note.uses === 1 ? `1 use, at ${place}` : `${String(note.uses)} uses, the first at ${place}`;
174
+ return `note: ${JSON.stringify(note.word)}: ${why} (${uses})`;
175
+ }
176
+ function notesLine(notes) {
177
+ const count = notes.length === 1 ? "1 note" : `${String(notes.length)} notes`;
178
+ return `${count}: a note is not an error. Give each word its reading with pronounce or in the project lexicon`;
179
+ }
180
+
148
181
  // ../aula-project/src/preview.ts
149
182
  import { chapterNames as chapterNames2, FPS } from "@beff/aula/run";
150
183
 
@@ -263,6 +296,9 @@ export {
263
296
  chapterIndexes,
264
297
  exportCheck,
265
298
  clipPlan,
299
+ wordNotes,
300
+ noteLine,
301
+ notesLine,
266
302
  previewTargets,
267
303
  targetChapters,
268
304
  previewJobs,
@@ -1,5 +1,6 @@
1
1
  // ../aula-narration/src/script.ts
2
2
  import { chapterNarration } from "@beff/aula/text";
3
+ var starts = (words) => Float64Array.from(words, (w) => w.start);
3
4
  function joinChapter(cues, speeches) {
4
5
  let rate = 0;
5
6
  for (const [i, speech] of speeches.entries()) {
@@ -10,10 +11,7 @@ function joinChapter(cues, speeches) {
10
11
  if (rate !== 0 && speech.sampleRate !== rate) throw new Error("the narrator changed its sample rate");
11
12
  rate = speech.sampleRate;
12
13
  }
13
- const spoken = speeches.map((s) => ({
14
- samples: s.samples.length,
15
- words: s.words.map((w) => ({ text: w.text, char: w.char, start: w.start }))
16
- }));
14
+ const spoken = speeches.map((s) => ({ samples: s.samples.length, starts: starts(s.words) }));
17
15
  const narration = chapterNarration(cues, spoken, rate);
18
16
  const samples = new Float32Array(narration.endFrame);
19
17
  for (const [i, speech] of speeches.entries()) samples.set(speech.samples, narration.cues[i]?.speechStartFrame ?? 0);
@@ -36,10 +34,9 @@ function withWaits(samples, waits) {
36
34
  function timeChapter(cues, timings) {
37
35
  const rate = timings[0]?.sampleRate ?? 0;
38
36
  if (timings.some((t) => t.sampleRate !== rate)) throw new Error("the narrator changed its sample rate");
39
- const spoken = timings.map((t) => ({
40
- samples: t.samples,
41
- words: t.words.map((w) => ({ text: w.text, char: w.char, start: w.start }))
42
- }));
37
+ const spoken = timings.map(
38
+ (t) => t.words ? { samples: t.samples, starts: starts(t.words) } : { samples: t.samples }
39
+ );
43
40
  return chapterNarration(cues, spoken, rate);
44
41
  }
45
42
  async function narrateScript(speak, chapters, speaking) {
@@ -51,7 +48,7 @@ async function narrateScript(speak, chapters, speaking) {
51
48
  for (const cue of cues) {
52
49
  spoken += 1;
53
50
  speaking(spoken, count, cue);
54
- speeches.push(await speak(cue.spoken, cue.speed));
51
+ speeches.push(await speak(cue.words, cue.speed));
55
52
  }
56
53
  narrated.push(joinChapter(cues, speeches));
57
54
  }
@@ -1,8 +1,4 @@
1
1
  // ../aula-narration/src/align.ts
2
- var WORD = /(?:\[[^\][\s]*\]\(\/[^/]*\/\)|\S)+/g;
3
- function tokens(text) {
4
- return [...text.matchAll(WORD)].map((match) => ({ text: match[0], char: match.index }));
5
- }
6
2
  function roundHalfEven(value) {
7
3
  const floor = Math.floor(value);
8
4
  const rest = value - floor;
@@ -11,8 +7,7 @@ function roundHalfEven(value) {
11
7
  return floor % 2 === 0 ? floor : floor + 1;
12
8
  }
13
9
  var ms = (seconds) => roundHalfEven(seconds * 1e3) / 1e3;
14
- function alignWords(text, spoken, read) {
15
- const source = tokens(text);
10
+ function alignWords(source, spoken, read) {
16
11
  if (read.length !== source.length) {
17
12
  throw new Error(`${String(source.length)} words but ${String(read.length)} readings`);
18
13
  }
@@ -61,11 +56,11 @@ function alignWords(text, spoken, read) {
61
56
  ends[w] = phone.end;
62
57
  });
63
58
  let last = 0;
64
- return source.map((token, w) => {
59
+ return source.map((text, w) => {
65
60
  const start = starts[w] ?? Number.NaN;
66
61
  const end = ends[w] ?? Number.NaN;
67
62
  const found = !Number.isNaN(start) && start >= last;
68
- const time = { text: token.text, char: token.char, start: ms(found ? start : last), end: ms(found ? end : last) };
63
+ const time = { text, start: ms(found ? start : last), end: ms(found ? end : last) };
69
64
  if (found) last = end;
70
65
  return time;
71
66
  });
@@ -155,12 +150,12 @@ async function tokenBatches(vocab, phonemize2, text) {
155
150
  }
156
151
  var STRESS = "\u02C8\u02CC";
157
152
  var isSound = (phoneme) => new RegExp("\\p{L}", "u").test(phoneme) && !STRESS.includes(phoneme);
158
- async function timesOfWords(phonemize2, text, timings) {
153
+ async function timesOfWords(phonemize2, words, timings) {
159
154
  const spoken = timings.filter((timing) => isSound(timing.phoneme));
160
155
  if (!spoken.length) throw new Error("the model gave no phoneme timings");
161
156
  const read = [];
162
- for (const word of tokens(text)) read.push(Array.from(await phonemize2(word.text)).filter(isSound));
163
- return alignWords(text, spoken, read);
157
+ for (const word of words) read.push(Array.from(await phonemize2(word)).filter(isSound));
158
+ return alignWords(words, spoken, read);
164
159
  }
165
160
 
166
161
  // ../aula-narration/src/vocab.ts
@@ -317,7 +312,8 @@ function limited(audio) {
317
312
  const scale = PEAK / loudest;
318
313
  return audio.map((sample) => sample * scale);
319
314
  }
320
- async function layout(parts, text, speed, audio) {
315
+ async function layout(parts, words, speed, audio) {
316
+ const text = words.join(" ");
321
317
  const batches = await batchesOf(parts.phonemize, text, MAX_TOKENS);
322
318
  if (!batches.length) throw new Error(`Nothing to say: ${JSON.stringify(text)} has no phonemes`);
323
319
  const pieces = [];
@@ -341,10 +337,10 @@ async function layout(parts, text, speed, audio) {
341
337
  pieces.push({ audio: spoken.audio?.subarray(head, tail) ?? null, length: tail - head, pause });
342
338
  offset += tail - head + pause;
343
339
  }
344
- return { pieces, total: offset, words: await timesOfWords(parts.phonemize, text, timings) };
340
+ return { pieces, total: offset, words: await timesOfWords(parts.phonemize, words, timings) };
345
341
  }
346
- async function speakAulaVoice(parts, text, speed) {
347
- const { pieces, total, words } = await layout(parts, text, speed, true);
342
+ async function speakAulaVoice(parts, given, speed) {
343
+ const { pieces, total, words } = await layout(parts, given, speed, true);
348
344
  const samples = new Float32Array(total);
349
345
  let offset = 0;
350
346
  for (const piece of pieces) {
@@ -353,8 +349,8 @@ async function speakAulaVoice(parts, text, speed) {
353
349
  }
354
350
  return { samples: limited(samples), sampleRate: SAMPLE_RATE, words };
355
351
  }
356
- async function timeAulaVoice(parts, text, speed) {
357
- const { total, words } = await layout(parts, text, speed, false);
352
+ async function timeAulaVoice(parts, given, speed) {
353
+ const { total, words } = await layout(parts, given, speed, false);
358
354
  return { samples: total, sampleRate: SAMPLE_RATE, words };
359
355
  }
360
356
 
@@ -510,10 +506,10 @@ function studentWeightFile(model, config) {
510
506
  }
511
507
  }
512
508
  const tensors = readSafetensors(model);
513
- const tokens2 = tensors.get("tokens.weight");
509
+ const tokens = tensors.get("tokens.weight");
514
510
  const voices = tensors.get("voices.weight");
515
- if (!tokens2 || !voices) throw new Error("model.safetensors has no tokens.weight or voices.weight");
516
- const [vocab = 0, channels = 0] = tokens2.shape;
511
+ if (!tokens || !voices) throw new Error("model.safetensors has no tokens.weight or voices.weight");
512
+ const [vocab = 0, channels = 0] = tokens.shape;
517
513
  const headBlocks = new Set(
518
514
  [...tensors.keys()].filter((n) => n.startsWith("head.blocks.")).map((n) => n.split(".")[2])
519
515
  ).size;
package/dist/src/cli.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  studentWeightFile,
15
15
  timeAulaVoice,
16
16
  tokenBatches
17
- } from "./chunk-SW5BNPAM.js";
17
+ } from "./chunk-HDAMZF5B.js";
18
18
 
19
19
  // src/cli.ts
20
20
  import { spawn } from "node:child_process";
@@ -227,8 +227,8 @@ function aulaVoice(capabilities2, options2) {
227
227
  return { model: await aulaVoiceModel(await aulaVoiceWeightFile(capabilities2, options2)), phonemize };
228
228
  })();
229
229
  return {
230
- speak: async (text, speed) => speakAulaVoice(await parts(), text, speed),
231
- time: async (text, speed) => timeAulaVoice(await parts(), text, speed)
230
+ speak: async (words, speed) => speakAulaVoice(await parts(), words, speed),
231
+ time: async (words, speed) => timeAulaVoice(await parts(), words, speed)
232
232
  };
233
233
  }
234
234
 
@@ -271,9 +271,9 @@ var base = Capabilities.create({
271
271
  },
272
272
  spawn
273
273
  });
274
- var { diagnosticsOf, printDiagnostics } = await import("./problems-FFAR72WZ.js");
274
+ var { diagnosticsOf, printDiagnostics } = await import("./problems-DYLEPGE6.js");
275
275
  var { host, loadProject } = await import("./project-NWT5MDQI.js");
276
- var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, webOptions } = await import("./run-DU2H6FZI.js");
276
+ var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, webOptions } = await import("./run-72KOJGZE.js");
277
277
  var locks = createLocks(base, path3.join(os.homedir(), ".cache/aula/heavy.lock"));
278
278
  var render = createRender(base, process.execPath);
279
279
  var models = path3.join(os.homedir(), ".cache/aula/models");
@@ -296,7 +296,7 @@ async function main(argv) {
296
296
  }
297
297
  const args = parse(rest, optionsOf(command));
298
298
  if (command === "web") {
299
- const { serve } = await import("./server-7AN6XCTF.js");
299
+ const { serve } = await import("./server-BWWN7KZA.js");
300
300
  const stop = new AbortController();
301
301
  for (const signal of ["SIGINT", "SIGTERM"]) process.once(signal, () => stop.abort());
302
302
  const web = Capabilities.create({
@@ -312,14 +312,14 @@ async function main(argv) {
312
312
  return 0;
313
313
  }
314
314
  if (command === "tokens") {
315
- const { tokens, tokensArgs } = await import("./commands-CEBO6WWE.js");
315
+ const { tokens, tokensArgs } = await import("./commands-DUMGD7TE.js");
316
316
  tokensArgs(args.positional);
317
317
  const tokensOf = createTokens();
318
318
  return await tokens(capabilities, tokensOf, createInterface({ input: process.stdin, crlfDelay: Infinity })) ? 0 : 1;
319
319
  }
320
320
  const { folder, rest: after } = folderArgs(cwd, command, args);
321
321
  const project = await loadProject(capabilities, cwd, folder);
322
- return await run2(capabilities, cwd, command, project, after) ? 0 : 1;
322
+ return await run2(capabilities, cwd, command, project, after, args.flags) ? 0 : 1;
323
323
  }
324
324
  try {
325
325
  process.exitCode = await main(process.argv.slice(2));
@@ -7,12 +7,12 @@ import {
7
7
  timeline,
8
8
  tokens,
9
9
  tokensArgs
10
- } from "./chunk-D2BDOCX7.js";
10
+ } from "./chunk-5MXHQCWH.js";
11
11
  import "./chunk-GFCJYE75.js";
12
12
  import "./chunk-2XGNOG2U.js";
13
- import "./chunk-PSI7MMGP.js";
14
- import "./chunk-BMP6H3SZ.js";
15
- import "./chunk-SW5BNPAM.js";
13
+ import "./chunk-7IQUN2SB.js";
14
+ import "./chunk-H54BN5R7.js";
15
+ import "./chunk-HDAMZF5B.js";
16
16
  import "./chunk-46KT47TH.js";
17
17
  import "./chunk-7KT36JRP.js";
18
18
  export {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  printDiagnostics
3
- } from "./chunk-PSI7MMGP.js";
4
- import "./chunk-BMP6H3SZ.js";
5
- import "./chunk-SW5BNPAM.js";
3
+ } from "./chunk-7IQUN2SB.js";
4
+ import "./chunk-H54BN5R7.js";
5
+ import "./chunk-HDAMZF5B.js";
6
6
  import {
7
7
  diagnosticsOf
8
8
  } from "./chunk-7KT36JRP.js";
@@ -5,12 +5,12 @@ import {
5
5
  preview,
6
6
  script,
7
7
  timeline
8
- } from "./chunk-D2BDOCX7.js";
8
+ } from "./chunk-5MXHQCWH.js";
9
9
  import "./chunk-GFCJYE75.js";
10
10
  import "./chunk-2XGNOG2U.js";
11
- import "./chunk-PSI7MMGP.js";
12
- import "./chunk-BMP6H3SZ.js";
13
- import "./chunk-SW5BNPAM.js";
11
+ import "./chunk-7IQUN2SB.js";
12
+ import "./chunk-H54BN5R7.js";
13
+ import "./chunk-HDAMZF5B.js";
14
14
  import "./chunk-46KT47TH.js";
15
15
  import {
16
16
  wrongArgument
@@ -26,8 +26,10 @@ defineProject({ title, theme, chapters }). <chapter> is a chapter name such as
26
26
  title card). Each chapter module holds its script, storyboard notes and
27
27
  animations; messages name its lines (file:line:col).
28
28
 
29
- aula check <folder> [<chapter> ...]
30
- every check, with no narration and no frames
29
+ aula check <folder> [<chapter> ...] [--json]
30
+ every check, with no narration and no frames, and
31
+ a note for each word whose reading is not clear;
32
+ --json prints the result as one JSON object
31
33
  aula preview <folder> <out> [<chapter>[:<line>] ...]
32
34
  PNG pictures for review: per chapter, stills,
33
35
  motion stills, contact sheets and moves.md
@@ -53,7 +55,7 @@ var VALUED = {
53
55
  "--port": "a port number"
54
56
  };
55
57
  function parse(argv, allowed) {
56
- const args = { positional: [], values: /* @__PURE__ */ new Map() };
58
+ const args = { positional: [], values: /* @__PURE__ */ new Map(), flags: /* @__PURE__ */ new Set() };
57
59
  for (let i = 0; i < argv.length; i++) {
58
60
  const arg = argv[i] ?? "";
59
61
  const what = VALUED[arg];
@@ -63,6 +65,8 @@ function parse(argv, allowed) {
63
65
  if (value === void 0) throw wrongArgument(`${arg} needs ${what}`);
64
66
  if (!/^[0-9]+$/.test(value)) throw wrongArgument(`${arg} ${value} is not a number`);
65
67
  args.values.set(arg, Number(value));
68
+ } else if (allowed.includes(arg)) {
69
+ args.flags.add(arg);
66
70
  } else if (arg.startsWith("--")) {
67
71
  throw wrongArgument(`unknown option ${arg}`, "run `aula help` for the options of each command");
68
72
  } else {
@@ -72,6 +76,7 @@ function parse(argv, allowed) {
72
76
  return args;
73
77
  }
74
78
  var OPTIONS = {
79
+ check: ["--json"],
75
80
  web: ["--port"]
76
81
  };
77
82
  var isHelp = (command) => command === void 0 || command === "help" || command === "-h" || command === "--help";
@@ -92,11 +97,11 @@ function folderArgs(cwd, command, args) {
92
97
  throw wrongArgument("wrong number of arguments", "run `aula help` for the usage");
93
98
  return { folder: path.resolve(cwd, folder), rest };
94
99
  }
95
- async function run(capabilities, cwd, command, project, rest) {
100
+ async function run(capabilities, cwd, command, project, rest, flags = /* @__PURE__ */ new Set()) {
96
101
  const [first = "", ...more] = rest;
97
102
  switch (command) {
98
103
  case "check":
99
- return check(capabilities, cwd, project, rest);
104
+ return check(capabilities, cwd, project, rest, flags.has("--json"));
100
105
  case "preview":
101
106
  return preview(capabilities, cwd, project, path.resolve(cwd, first), more);
102
107
  case "export":
@@ -1,7 +1,7 @@
1
- import "./chunk-BMP6H3SZ.js";
1
+ import "./chunk-H54BN5R7.js";
2
2
  import {
3
3
  SERVER_WEIGHTS_PATH
4
- } from "./chunk-SW5BNPAM.js";
4
+ } from "./chunk-HDAMZF5B.js";
5
5
  import {
6
6
  exists
7
7
  } from "./chunk-46KT47TH.js";
@@ -40,8 +40,9 @@ async function asset(capabilities, path) {
40
40
  }
41
41
  if (!path.startsWith("/assets/")) return null;
42
42
  const name = path.slice("/assets/".length);
43
+ const parts = name.split("/");
43
44
  const kind = KINDS.get(name.slice(name.lastIndexOf(".")));
44
- if (!plain(name) || kind === void 0) return null;
45
+ if (parts.length > 2 || !parts.every(plain) || kind === void 0) return null;
45
46
  const body = await read(`assets/${name}`);
46
47
  return body ? { body, kind } : null;
47
48
  }
@@ -0,0 +1 @@
1
+ import{t as e}from"./aula-voice-worker-DfzMG86o.js";var t=/* @__PURE__ */ e(((e,t)=>{t.exports={}}));export default t();