@beff/aula-cli 0.4.3 → 0.5.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/src/aula-render.core.wasm +0 -0
- package/dist/src/{chunk-7KT36JRP.js → chunk-2NMVSQG4.js} +83 -93
- package/dist/src/{chunk-46KT47TH.js → chunk-5VYKT646.js} +1 -1
- package/dist/src/chunk-A5QHTZKT.js +6 -0
- package/dist/src/{chunk-CIFP475T.js → chunk-DQ2NGXNI.js} +6 -321
- package/dist/src/chunk-EQ3DVZV5.js +15 -0
- package/dist/src/chunk-IKKANHTF.js +94 -0
- package/dist/src/chunk-JDXHKYLZ.js +369 -0
- package/dist/src/chunk-JVCECTG2.js +77 -0
- package/dist/src/{chunk-BT3Z5CJI.js → chunk-YBHISJLN.js} +70 -31
- package/dist/src/cli.js +12 -7
- package/dist/src/{commands-QCUCX2GF.js → commands-34YCDSR5.js} +8 -5
- package/dist/src/{problems-7BVC64RO.js → problems-U4QXN6RO.js} +4 -2
- package/dist/src/project-WS7P5VIH.js +12 -0
- package/dist/src/render-child.js +284 -9
- package/dist/src/{run-5WC5WRZ2.js → run-7PM6EPND.js} +45 -9
- package/dist/src/{server-GK3EWFX3.js → server-YQYW4FT4.js} +6 -5
- package/dist/src/site-SVNNSF72.js +139 -0
- package/dist/web/app/assets/__vite-browser-external-CJXyzDbj.js +1 -0
- package/dist/web/app/assets/aula-voice-worker-Ca14p_J5.js +52 -0
- package/dist/web/app/assets/{aula.core5-Bnq4-bLp.wasm → aula.core5-BsYwXoy8.wasm} +0 -0
- package/dist/web/app/assets/{ebd381c3 → b274e91c}/aula-method.js +1 -1
- package/dist/web/app/assets/b274e91c/aula.js +1 -0
- package/dist/web/app/assets/{ebd381c3 → b274e91c}/build-worker.js +2 -2
- package/dist/web/app/assets/b274e91c/index.js +52 -0
- package/dist/web/app/assets/{index-C_rGCAZR.css → index-BXxc0ZmT.css} +1 -1
- package/dist/web/app/assets/protocol-BejjzB3o.js +15 -0
- package/dist/web/app/assets/src-BA-sYAmS.js +25 -0
- package/dist/web/app/index.html +4 -4
- package/dist/web/site/assets/27f0d05e/aula-method.js +1 -0
- package/dist/web/site/assets/27f0d05e/aula.js +1 -0
- package/dist/web/site/assets/27f0d05e/build-worker.js +696 -0
- package/dist/web/site/assets/27f0d05e/index.js +52 -0
- package/dist/web/site/assets/__vite-browser-external-BtQTJ51O.js +1 -0
- package/dist/web/site/assets/__vite-browser-external-CHF7v6EZ.js +1 -0
- package/dist/web/site/assets/aula-voice-worker-CaLJBS98.js +54 -0
- package/dist/web/site/assets/aula.core-BtiPQSZi.wasm +0 -0
- package/dist/web/site/assets/aula.core5-BsYwXoy8.wasm +0 -0
- package/dist/web/site/assets/esbuild-BaXVPFT2.wasm +0 -0
- package/dist/web/site/assets/index-Dn5gqwRn.css +2 -0
- package/dist/web/site/assets/protocol-fozbK8HD.js +15 -0
- package/dist/web/site/assets/rolldown-runtime-BLXQ4ufn.js +1 -0
- package/dist/web/site/assets/src-BXUc4CQF.js +25 -0
- package/dist/web/site/index.html +39 -0
- package/package.json +2 -2
- package/dist/src/chunk-GFCJYE75.js +0 -42
- package/dist/src/project-NWT5MDQI.js +0 -11
- package/dist/web/app/assets/__vite-browser-external-BVodma7T.js +0 -1
- package/dist/web/app/assets/aula-voice-worker-D9iPLcHQ.js +0 -52
- package/dist/web/app/assets/ebd381c3/aula.js +0 -1
- package/dist/web/app/assets/ebd381c3/index.js +0 -52
- package/dist/web/app/assets/protocol-B46WpNW5.js +0 -15
- package/dist/web/app/assets/src-nkkXaLup.js +0 -25
|
@@ -5,13 +5,8 @@ import {
|
|
|
5
5
|
Problems,
|
|
6
6
|
error,
|
|
7
7
|
isError,
|
|
8
|
-
withSource,
|
|
9
8
|
wrongArgument
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
|
|
12
|
-
// src/problems.ts
|
|
13
|
-
import { loadEngine as loadEngine2 } from "@beff/aula/run";
|
|
14
|
-
import { renderDiagnostic } from "@beff/aula/text";
|
|
9
|
+
} from "./chunk-2NMVSQG4.js";
|
|
15
10
|
|
|
16
11
|
// ../aula-project/src/chapters.ts
|
|
17
12
|
import { readChapter } from "@beff/aula";
|
|
@@ -54,7 +49,7 @@ function scriptView(project, host) {
|
|
|
54
49
|
return scriptMarkdown(project.title, texts(project, host));
|
|
55
50
|
}
|
|
56
51
|
function openMoves(text) {
|
|
57
|
-
return text.paragraphs.flatMap((p) => p.moves).filter((
|
|
52
|
+
return text.paragraphs.flatMap((p) => p.moves).filter((m2) => !m2.done);
|
|
58
53
|
}
|
|
59
54
|
function openCount(chapters, indexes) {
|
|
60
55
|
return chapters.filter((_, i) => indexes.includes(i + 1)).reduce((sum, t) => sum + openMoves(t).length, 0);
|
|
@@ -123,12 +118,13 @@ function chapterIndexes(project, only) {
|
|
|
123
118
|
}
|
|
124
119
|
|
|
125
120
|
// ../aula-project/src/export.ts
|
|
121
|
+
import { FPS } from "@beff/aula/run";
|
|
126
122
|
function exportCheck(project, host) {
|
|
127
123
|
const checked = checkProject(project, host, null);
|
|
128
124
|
const open = checked.texts.flatMap(
|
|
129
125
|
(t) => openMoves(t).map(
|
|
130
|
-
(
|
|
131
|
-
location:
|
|
126
|
+
(m2) => error(`show: the move "${m2.note}" has no animation yet`, {
|
|
127
|
+
location: m2.place,
|
|
132
128
|
hint: "give the show its move, show`note``25%`((s) => { \u2026 }), or make it a hold, show`note``25%`(() => {})"
|
|
133
129
|
})
|
|
134
130
|
)
|
|
@@ -145,6 +141,23 @@ function clipPlan(narrations, fps) {
|
|
|
145
141
|
});
|
|
146
142
|
return { clips, seconds: starts.at(-1) ?? 0 };
|
|
147
143
|
}
|
|
144
|
+
function overlayPlan(narrations, embeds) {
|
|
145
|
+
let offset = 0;
|
|
146
|
+
const out = [];
|
|
147
|
+
narrations.forEach((narration, index) => {
|
|
148
|
+
for (const e of embeds[index] ?? []) {
|
|
149
|
+
out.push({
|
|
150
|
+
path: e.path,
|
|
151
|
+
image: e.image,
|
|
152
|
+
kind: e.kind,
|
|
153
|
+
at: offset + e.start / narration.sampleRate,
|
|
154
|
+
seconds: e.frames / FPS
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
offset += narration.endFrame / narration.sampleRate;
|
|
158
|
+
});
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
148
161
|
|
|
149
162
|
// ../aula-project/src/notes.ts
|
|
150
163
|
import { unclearWords } from "@beff/aula/text";
|
|
@@ -179,11 +192,15 @@ function notesLine(notes) {
|
|
|
179
192
|
}
|
|
180
193
|
|
|
181
194
|
// ../aula-project/src/preview.ts
|
|
182
|
-
import { chapterNames as chapterNames2, FPS } from "@beff/aula/run";
|
|
195
|
+
import { chapterNames as chapterNames2, FPS as FPS3 } from "@beff/aula/run";
|
|
183
196
|
|
|
184
197
|
// ../aula-project/src/stills.ts
|
|
185
|
-
import {
|
|
186
|
-
|
|
198
|
+
import { FPS as FPS2 } from "@beff/aula/run";
|
|
199
|
+
import {
|
|
200
|
+
moveFrames
|
|
201
|
+
} from "@beff/aula/text";
|
|
202
|
+
var clipLength = (frames) => `${(frames / FPS2).toFixed(1)} s`;
|
|
203
|
+
function stillsOf(narration, text, frames, embeds = []) {
|
|
187
204
|
if (text === null) {
|
|
188
205
|
return [{ name: "title", cue: 0, place: null, note: "title card", frame: Math.floor(0.6 * frames) }];
|
|
189
206
|
}
|
|
@@ -191,12 +208,24 @@ function stillsOf(narration, text, frames) {
|
|
|
191
208
|
const moves = paragraphs.flatMap(
|
|
192
209
|
(p, k) => Array.from(p.moves, (start, i) => ({ start, cue: k + 1, move: text.paragraphs[k]?.moves[i] }))
|
|
193
210
|
);
|
|
194
|
-
|
|
211
|
+
const ofMoves = moves.flatMap(({ start, cue, move }, i) => {
|
|
195
212
|
if (move === void 0) return [];
|
|
196
213
|
const next = moves[i + 1]?.start ?? frames;
|
|
197
214
|
const name = `L${String(move.place.line).padStart(4, "0")}`;
|
|
198
215
|
return [{ name, cue, place: move.place, note: move.note, frame: Math.max(start, next - 1) }];
|
|
199
216
|
});
|
|
217
|
+
const rows = text.paragraphs.flatMap((p, k) => p.embeds.map((embed) => ({ embed, cue: k + 1 })));
|
|
218
|
+
const ofEmbeds = rows.flatMap(({ embed, cue }, i) => {
|
|
219
|
+
const played = embeds[i];
|
|
220
|
+
if (played === void 0) return [];
|
|
221
|
+
const frame = Math.min(Math.round(played.start / narration.sampleRate * FPS2), Math.max(frames - 1, 0));
|
|
222
|
+
const name = `E${String(embed.place?.line ?? 0).padStart(4, "0")}`;
|
|
223
|
+
const note = `embed: ${embed.note}`;
|
|
224
|
+
const length = clipLength(played.frames);
|
|
225
|
+
const clip = { path: played.path, image: played.image, kind: played.kind, length };
|
|
226
|
+
return [{ name, cue, place: embed.place ?? null, note, frame, embed: clip }];
|
|
227
|
+
});
|
|
228
|
+
return [...ofMoves, ...ofEmbeds].toSorted((a, b) => a.frame - b.frame);
|
|
200
229
|
}
|
|
201
230
|
function paragraphWindow(narration, text, cue, frames) {
|
|
202
231
|
const paragraphs = moveFrames(narration, text);
|
|
@@ -210,10 +239,10 @@ function previewTargets(project, given) {
|
|
|
210
239
|
const names = chapterNames2(project);
|
|
211
240
|
if (given.length === 0) return names.map((name, index) => ({ index, name, line: null }));
|
|
212
241
|
return given.map((target) => {
|
|
213
|
-
const
|
|
214
|
-
const index = chapterIndex(names,
|
|
215
|
-
if (index === 0 &&
|
|
216
|
-
return { index, name: names[index] ?? target, line:
|
|
242
|
+
const m2 = /^(.*):([0-9]+)$/.exec(target);
|
|
243
|
+
const index = chapterIndex(names, m2?.[1] ?? target);
|
|
244
|
+
if (index === 0 && m2 !== null) throw wrongArgument("the title card has no lines: give a chapter name with :<line>");
|
|
245
|
+
return { index, name: names[index] ?? target, line: m2?.[2] === void 0 ? null : Number(m2[2]) };
|
|
217
246
|
});
|
|
218
247
|
}
|
|
219
248
|
var targetChapters = (targets, given) => given.length === 0 ? null : [...new Set(targets.map((t) => t.index))];
|
|
@@ -226,27 +255,42 @@ function previewJobs(targets, chapters) {
|
|
|
226
255
|
return { ...t, base, text, cue };
|
|
227
256
|
});
|
|
228
257
|
}
|
|
229
|
-
function pictureStills(narration, job, frames) {
|
|
258
|
+
function pictureStills(narration, job, frames, embeds = []) {
|
|
230
259
|
const { text, cue } = job;
|
|
231
260
|
const window = text === null || cue === null ? [0, frames] : paragraphWindow(narration, text, cue, frames);
|
|
232
|
-
const stills = stillsOf(narration, text, frames).filter((s) => cue === null || s.cue === cue);
|
|
261
|
+
const stills = stillsOf(narration, text, frames, embeds).filter((s) => cue === null || s.cue === cue);
|
|
233
262
|
return { window, stills };
|
|
234
263
|
}
|
|
264
|
+
function tileEmbed(still) {
|
|
265
|
+
const clip = still.embed;
|
|
266
|
+
if (clip === void 0) return void 0;
|
|
267
|
+
if (clip.kind === "sound") return { picture: clip.image, lines: [] };
|
|
268
|
+
return { picture: void 0, lines: [still.note.replace(/^embed: /, ""), `${clip.path} \xB7 ${clip.length}`] };
|
|
269
|
+
}
|
|
235
270
|
function pictureGroups(window, stills) {
|
|
236
271
|
const [from, to] = window;
|
|
237
272
|
const motion = [];
|
|
238
|
-
for (let k = Math.ceil(from * 2 /
|
|
239
|
-
motion.push({ name: `t${(k / 2).toFixed(1).padStart(5, "0")}s`, frame: Math.floor(k *
|
|
273
|
+
for (let k = Math.ceil(from * 2 / FPS3); Math.floor(k * FPS3 / 2) < to; k++) {
|
|
274
|
+
motion.push({ name: `t${(k / 2).toFixed(1).padStart(5, "0")}s`, frame: Math.floor(k * FPS3 / 2) });
|
|
240
275
|
}
|
|
241
276
|
return [
|
|
242
|
-
{
|
|
277
|
+
{
|
|
278
|
+
folder: "stills",
|
|
279
|
+
cols: 3,
|
|
280
|
+
rows: 3,
|
|
281
|
+
tiles: stills.map((s) => {
|
|
282
|
+
const embed = tileEmbed(s);
|
|
283
|
+
return embed === void 0 ? { name: s.name, frame: s.frame } : { name: s.name, frame: s.frame, embed };
|
|
284
|
+
})
|
|
285
|
+
},
|
|
243
286
|
{ folder: "motion", cols: 4, rows: 4, tiles: motion }
|
|
244
287
|
];
|
|
245
288
|
}
|
|
246
289
|
function movesMarkdown(stills) {
|
|
247
290
|
return stills.map((still) => {
|
|
248
291
|
const at = still.place ? placeText(still.place) : "title card";
|
|
249
|
-
|
|
292
|
+
const clip = still.embed === void 0 ? "" : ` (${still.embed.path}, ${still.embed.length})`;
|
|
293
|
+
return `- ${at}, ${(still.frame / FPS3).toFixed(1)} s: ${still.note}${clip} (stills/${still.name}.png)
|
|
250
294
|
`;
|
|
251
295
|
}).join("");
|
|
252
296
|
}
|
|
@@ -276,6 +320,7 @@ Metaphor: ${text.metaphor}
|
|
|
276
320
|
}
|
|
277
321
|
|
|
278
322
|
// ../aula-project/src/videos.ts
|
|
323
|
+
import { FPS as FPS4 } from "@beff/aula/run";
|
|
279
324
|
import { estimateNarration } from "@beff/aula/text";
|
|
280
325
|
|
|
281
326
|
// ../aula-project/src/workspace.ts
|
|
@@ -285,12 +330,6 @@ import {
|
|
|
285
330
|
narrationScript as narrationScript2
|
|
286
331
|
} from "@beff/aula/text";
|
|
287
332
|
|
|
288
|
-
// src/problems.ts
|
|
289
|
-
async function printDiagnostics(capabilities, root, diagnostics, print = (text) => capabilities.log.out(text)) {
|
|
290
|
-
await loadEngine2();
|
|
291
|
-
for (const d of diagnostics) print(renderDiagnostic(await withSource(capabilities, root, d)));
|
|
292
|
-
}
|
|
293
|
-
|
|
294
333
|
export {
|
|
295
334
|
scriptView,
|
|
296
335
|
clock,
|
|
@@ -299,6 +338,7 @@ export {
|
|
|
299
338
|
chapterIndexes,
|
|
300
339
|
exportCheck,
|
|
301
340
|
clipPlan,
|
|
341
|
+
overlayPlan,
|
|
302
342
|
wordNotes,
|
|
303
343
|
noteLine,
|
|
304
344
|
notesLine,
|
|
@@ -308,6 +348,5 @@ export {
|
|
|
308
348
|
pictureStills,
|
|
309
349
|
pictureGroups,
|
|
310
350
|
movesMarkdown,
|
|
311
|
-
timelineView
|
|
312
|
-
printDiagnostics
|
|
351
|
+
timelineView
|
|
313
352
|
};
|
package/dist/src/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
20
20
|
import { spawn } from "node:child_process";
|
|
21
|
-
import { existsSync, watch } from "node:fs";
|
|
21
|
+
import { existsSync, readFileSync, statSync, watch } from "node:fs";
|
|
22
22
|
import * as fs from "node:fs/promises";
|
|
23
23
|
import os from "node:os";
|
|
24
24
|
import { createInterface } from "node:readline";
|
|
@@ -261,7 +261,7 @@ process.stdout.on("error", (e) => {
|
|
|
261
261
|
var base = Capabilities.create({
|
|
262
262
|
clock: { now: () => performance.now(), timeout: (seconds) => AbortSignal.timeout(Math.ceil(seconds * 1e3)) },
|
|
263
263
|
env: { variables: process.env, temp: os.tmpdir(), parallelism: os.availableParallelism() },
|
|
264
|
-
fs: { ...fs, existsSync },
|
|
264
|
+
fs: { ...fs, existsSync, statSync, readFileSync },
|
|
265
265
|
log: {
|
|
266
266
|
out: (line) => process.stdout.write(`${line}
|
|
267
267
|
`),
|
|
@@ -271,9 +271,9 @@ var base = Capabilities.create({
|
|
|
271
271
|
},
|
|
272
272
|
spawn
|
|
273
273
|
});
|
|
274
|
-
var { diagnosticsOf, printDiagnostics } = await import("./problems-
|
|
275
|
-
var { host, loadProject } = await import("./project-
|
|
276
|
-
var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, webOptions } = await import("./run-
|
|
274
|
+
var { diagnosticsOf, printDiagnostics } = await import("./problems-U4QXN6RO.js");
|
|
275
|
+
var { host, loadProject } = await import("./project-WS7P5VIH.js");
|
|
276
|
+
var { USAGE, folderArgs, isHelp, optionsOf, parse, run: run2, siteOptions, webOptions } = await import("./run-7PM6EPND.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-
|
|
299
|
+
const { serve } = await import("./server-YQYW4FT4.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({
|
|
@@ -311,8 +311,13 @@ async function main(argv) {
|
|
|
311
311
|
await serve(Capabilities.extend(capabilities, web), { ...webOptions(cwd, args), stop: stop.signal });
|
|
312
312
|
return 0;
|
|
313
313
|
}
|
|
314
|
+
if (command === "site") {
|
|
315
|
+
const { site } = await import("./site-SVNNSF72.js");
|
|
316
|
+
const weights = Capabilities.create({ weights: aulaVoiceWeights(base, fetch, models) });
|
|
317
|
+
return await site(Capabilities.extend(capabilities, weights), siteOptions(cwd, args)) ? 0 : 1;
|
|
318
|
+
}
|
|
314
319
|
if (command === "tokens") {
|
|
315
|
-
const { tokens, tokensArgs } = await import("./commands-
|
|
320
|
+
const { tokens, tokensArgs } = await import("./commands-34YCDSR5.js");
|
|
316
321
|
tokensArgs(args.positional);
|
|
317
322
|
const tokensOf = createTokens();
|
|
318
323
|
return await tokens(capabilities, tokensOf, createInterface({ input: process.stdin, crlfDelay: Infinity })) ? 0 : 1;
|
|
@@ -7,14 +7,17 @@ import {
|
|
|
7
7
|
timeline,
|
|
8
8
|
tokens,
|
|
9
9
|
tokensArgs
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-JDXHKYLZ.js";
|
|
11
|
+
import "./chunk-DQ2NGXNI.js";
|
|
12
|
+
import "./chunk-IKKANHTF.js";
|
|
12
13
|
import "./chunk-2XGNOG2U.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-EQ3DVZV5.js";
|
|
15
|
+
import "./chunk-YBHISJLN.js";
|
|
14
16
|
import "./chunk-S74JLCZK.js";
|
|
15
17
|
import "./chunk-6LC3WXJ7.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-5VYKT646.js";
|
|
19
|
+
import "./chunk-JVCECTG2.js";
|
|
20
|
+
import "./chunk-2NMVSQG4.js";
|
|
18
21
|
export {
|
|
19
22
|
bundle,
|
|
20
23
|
check,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
printDiagnostics
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EQ3DVZV5.js";
|
|
4
|
+
import "./chunk-YBHISJLN.js";
|
|
4
5
|
import "./chunk-S74JLCZK.js";
|
|
5
6
|
import "./chunk-6LC3WXJ7.js";
|
|
7
|
+
import "./chunk-JVCECTG2.js";
|
|
6
8
|
import {
|
|
7
9
|
diagnosticsOf
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2NMVSQG4.js";
|
|
9
11
|
export {
|
|
10
12
|
diagnosticsOf,
|
|
11
13
|
printDiagnostics
|
package/dist/src/render-child.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VIDEO
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IKKANHTF.js";
|
|
4
4
|
import "./chunk-2XGNOG2U.js";
|
|
5
5
|
|
|
6
6
|
// src/render-child.ts
|
|
@@ -3581,11 +3581,277 @@ function sheet(arg0, arg1, arg2) {
|
|
|
3581
3581
|
}
|
|
3582
3582
|
});
|
|
3583
3583
|
}
|
|
3584
|
-
var
|
|
3585
|
-
function
|
|
3584
|
+
var renderEmbedStill;
|
|
3585
|
+
function embedStill(arg0, arg1, arg2) {
|
|
3586
|
+
getOrCreateAsyncState(_jcoComponentStateLookupContext, 0).throwIfTrapped();
|
|
3587
|
+
let { task, threadID } = createNewCurrentImplicitThread(_jcoTaskCreateContext, {
|
|
3588
|
+
componentIdx: 0,
|
|
3589
|
+
isAsync: false,
|
|
3590
|
+
isManualAsync: false,
|
|
3591
|
+
preserveFutureResult: false,
|
|
3592
|
+
entryFnName: "renderEmbedStill",
|
|
3593
|
+
getCallbackFn: () => null,
|
|
3594
|
+
callbackFnName: null,
|
|
3595
|
+
errHandling: "throw-result-err",
|
|
3596
|
+
callingWasmExport: true
|
|
3597
|
+
});
|
|
3598
|
+
task.setCalleeIsAsync(false);
|
|
3599
|
+
task.setFuncTypeIsAsync(false);
|
|
3600
|
+
task.setReturnResultTypeIdx(8);
|
|
3601
|
+
task.enterSync();
|
|
3602
|
+
CURRENT_TASK_MAY_BLOCK.value = +!!task.mayBlock();
|
|
3603
|
+
task.setReturnMemoryIdx(0);
|
|
3604
|
+
task.setReturnMemory(memory0);
|
|
3605
|
+
return _withGlobalCurrentThreadMeta(CURRENT_TASK_META, {
|
|
3606
|
+
taskID: task.id(),
|
|
3607
|
+
threadID,
|
|
3608
|
+
componentIdx: task.componentIdx(),
|
|
3609
|
+
fn: () => {
|
|
3610
|
+
try {
|
|
3611
|
+
var val0 = arg0;
|
|
3612
|
+
var len0 = Array.isArray(val0) ? val0.length : val0.byteLength;
|
|
3613
|
+
var ptr0 = ((...args) => {
|
|
3614
|
+
let state = getOrCreateAsyncState(_jcoComponentStateLookupContext, 0);
|
|
3615
|
+
let previousMayLeave = state.mayLeave;
|
|
3616
|
+
let meta = _getGlobalCurrentThreadMeta(CURRENT_TASK_META, 0);
|
|
3617
|
+
let thread = meta && getCurrentThread(_jcoThreadLookupContext, meta.componentIdx, meta.threadID, meta.taskID)?.thread;
|
|
3618
|
+
let previousStorage = thread?.storage;
|
|
3619
|
+
thread && (thread.storage = [0, 0]);
|
|
3620
|
+
state.mayLeave = false;
|
|
3621
|
+
let restore = () => {
|
|
3622
|
+
state.mayLeave = previousMayLeave;
|
|
3623
|
+
thread && (thread.storage = previousStorage);
|
|
3624
|
+
};
|
|
3625
|
+
let result;
|
|
3626
|
+
try {
|
|
3627
|
+
result = realloc0(...args);
|
|
3628
|
+
} catch (err) {
|
|
3629
|
+
restore();
|
|
3630
|
+
throw err;
|
|
3631
|
+
}
|
|
3632
|
+
if (result && typeof result.then == "function") return Promise.resolve(result).finally(restore);
|
|
3633
|
+
restore();
|
|
3634
|
+
return result;
|
|
3635
|
+
})(0, 0, 1, len0 * 1);
|
|
3636
|
+
ptr0 >>>= 0;
|
|
3637
|
+
if (ptr0 % 1 != 0) throw new WebAssemblyRuntimeError("realloc return: result not aligned");
|
|
3638
|
+
if (ptr0 > memory0.buffer.byteLength || len0 > Math.floor((memory0.buffer.byteLength - ptr0) / 1)) throw new WebAssemblyRuntimeError("realloc return: beyond end of memory");
|
|
3639
|
+
let valData0;
|
|
3640
|
+
let valLenBytes0 = len0 * 1;
|
|
3641
|
+
if (Array.isArray(val0)) {
|
|
3642
|
+
let offset = 0;
|
|
3643
|
+
let dv0 = new DataView(memory0.buffer);
|
|
3644
|
+
for (let v of val0) {
|
|
3645
|
+
_requireValidNumericPrimitive.bind(null, "u8")(v);
|
|
3646
|
+
dv0.setUint8(ptr0 + offset, v, true);
|
|
3647
|
+
offset += 1;
|
|
3648
|
+
}
|
|
3649
|
+
} else {
|
|
3650
|
+
valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
|
|
3651
|
+
new Uint8Array(memory0.buffer, ptr0, valLenBytes0).set(valData0);
|
|
3652
|
+
}
|
|
3653
|
+
var variant2 = arg1;
|
|
3654
|
+
let variant2_0;
|
|
3655
|
+
let variant2_1;
|
|
3656
|
+
let variant2_2;
|
|
3657
|
+
if (variant2 == null) {
|
|
3658
|
+
variant2_0 = 0;
|
|
3659
|
+
variant2_1 = 0;
|
|
3660
|
+
variant2_2 = 0;
|
|
3661
|
+
} else {
|
|
3662
|
+
var val1 = variant2;
|
|
3663
|
+
var len1 = Array.isArray(val1) ? val1.length : val1.byteLength;
|
|
3664
|
+
var ptr1 = ((...args) => {
|
|
3665
|
+
let state = getOrCreateAsyncState(_jcoComponentStateLookupContext, 0);
|
|
3666
|
+
let previousMayLeave = state.mayLeave;
|
|
3667
|
+
let meta = _getGlobalCurrentThreadMeta(CURRENT_TASK_META, 0);
|
|
3668
|
+
let thread = meta && getCurrentThread(_jcoThreadLookupContext, meta.componentIdx, meta.threadID, meta.taskID)?.thread;
|
|
3669
|
+
let previousStorage = thread?.storage;
|
|
3670
|
+
thread && (thread.storage = [0, 0]);
|
|
3671
|
+
state.mayLeave = false;
|
|
3672
|
+
let restore = () => {
|
|
3673
|
+
state.mayLeave = previousMayLeave;
|
|
3674
|
+
thread && (thread.storage = previousStorage);
|
|
3675
|
+
};
|
|
3676
|
+
let result;
|
|
3677
|
+
try {
|
|
3678
|
+
result = realloc0(...args);
|
|
3679
|
+
} catch (err) {
|
|
3680
|
+
restore();
|
|
3681
|
+
throw err;
|
|
3682
|
+
}
|
|
3683
|
+
if (result && typeof result.then == "function") return Promise.resolve(result).finally(restore);
|
|
3684
|
+
restore();
|
|
3685
|
+
return result;
|
|
3686
|
+
})(0, 0, 1, len1 * 1);
|
|
3687
|
+
ptr1 >>>= 0;
|
|
3688
|
+
if (ptr1 % 1 != 0) throw new WebAssemblyRuntimeError("realloc return: result not aligned");
|
|
3689
|
+
if (ptr1 > memory0.buffer.byteLength || len1 > Math.floor((memory0.buffer.byteLength - ptr1) / 1)) throw new WebAssemblyRuntimeError("realloc return: beyond end of memory");
|
|
3690
|
+
let valData1;
|
|
3691
|
+
let valLenBytes1 = len1 * 1;
|
|
3692
|
+
if (Array.isArray(val1)) {
|
|
3693
|
+
let offset = 0;
|
|
3694
|
+
let dv1 = new DataView(memory0.buffer);
|
|
3695
|
+
for (let v of val1) {
|
|
3696
|
+
_requireValidNumericPrimitive.bind(null, "u8")(v);
|
|
3697
|
+
dv1.setUint8(ptr1 + offset, v, true);
|
|
3698
|
+
offset += 1;
|
|
3699
|
+
}
|
|
3700
|
+
} else {
|
|
3701
|
+
valData1 = new Uint8Array(val1.buffer || val1, val1.byteOffset, valLenBytes1);
|
|
3702
|
+
new Uint8Array(memory0.buffer, ptr1, valLenBytes1).set(valData1);
|
|
3703
|
+
}
|
|
3704
|
+
variant2_0 = 1;
|
|
3705
|
+
variant2_1 = ptr1;
|
|
3706
|
+
variant2_2 = len1;
|
|
3707
|
+
}
|
|
3708
|
+
var vec4 = arg2;
|
|
3709
|
+
var len4 = vec4.length;
|
|
3710
|
+
var result4 = ((...args) => {
|
|
3711
|
+
let state = getOrCreateAsyncState(_jcoComponentStateLookupContext, 0);
|
|
3712
|
+
let previousMayLeave = state.mayLeave;
|
|
3713
|
+
let meta = _getGlobalCurrentThreadMeta(CURRENT_TASK_META, 0);
|
|
3714
|
+
let thread = meta && getCurrentThread(_jcoThreadLookupContext, meta.componentIdx, meta.threadID, meta.taskID)?.thread;
|
|
3715
|
+
let previousStorage = thread?.storage;
|
|
3716
|
+
thread && (thread.storage = [0, 0]);
|
|
3717
|
+
state.mayLeave = false;
|
|
3718
|
+
let restore = () => {
|
|
3719
|
+
state.mayLeave = previousMayLeave;
|
|
3720
|
+
thread && (thread.storage = previousStorage);
|
|
3721
|
+
};
|
|
3722
|
+
let result;
|
|
3723
|
+
try {
|
|
3724
|
+
result = realloc0(...args);
|
|
3725
|
+
} catch (err) {
|
|
3726
|
+
restore();
|
|
3727
|
+
throw err;
|
|
3728
|
+
}
|
|
3729
|
+
if (result && typeof result.then == "function") return Promise.resolve(result).finally(restore);
|
|
3730
|
+
restore();
|
|
3731
|
+
return result;
|
|
3732
|
+
})(0, 0, 4, len4 * 8);
|
|
3733
|
+
result4 >>>= 0;
|
|
3734
|
+
if (result4 % 4 != 0) throw new WebAssemblyRuntimeError("realloc return: result not aligned");
|
|
3735
|
+
if (result4 > memory0.buffer.byteLength || len4 > Math.floor((memory0.buffer.byteLength - result4) / 8)) throw new WebAssemblyRuntimeError("realloc return: beyond end of memory");
|
|
3736
|
+
if (result4 < 0 || len4 < 0 || len4 > 33554431 || result4 > memory0.buffer.byteLength || len4 > Math.floor((memory0.buffer.byteLength - result4) / 8)) throw new WebAssemblyRuntimeError("wasm trap: out of bounds memory access");
|
|
3737
|
+
for (let i = 0; i < vec4.length; i++) {
|
|
3738
|
+
let e = vec4[i];
|
|
3739
|
+
let base = result4 + i * 8;
|
|
3740
|
+
var encodeRes = _utf8AllocateAndEncode(TEXT_ENCODER_UTF8, e, ((...args) => {
|
|
3741
|
+
let state = getOrCreateAsyncState(_jcoComponentStateLookupContext, 0);
|
|
3742
|
+
let previousMayLeave = state.mayLeave;
|
|
3743
|
+
let meta = _getGlobalCurrentThreadMeta(CURRENT_TASK_META, 0);
|
|
3744
|
+
let thread = meta && getCurrentThread(_jcoThreadLookupContext, meta.componentIdx, meta.threadID, meta.taskID)?.thread;
|
|
3745
|
+
let previousStorage = thread?.storage;
|
|
3746
|
+
thread && (thread.storage = [0, 0]);
|
|
3747
|
+
state.mayLeave = false;
|
|
3748
|
+
let restore = () => {
|
|
3749
|
+
state.mayLeave = previousMayLeave;
|
|
3750
|
+
thread && (thread.storage = previousStorage);
|
|
3751
|
+
};
|
|
3752
|
+
let result;
|
|
3753
|
+
try {
|
|
3754
|
+
result = realloc0(...args);
|
|
3755
|
+
} catch (err) {
|
|
3756
|
+
restore();
|
|
3757
|
+
throw err;
|
|
3758
|
+
}
|
|
3759
|
+
if (result && typeof result.then == "function") return Promise.resolve(result).finally(restore);
|
|
3760
|
+
restore();
|
|
3761
|
+
return result;
|
|
3762
|
+
}), memory0);
|
|
3763
|
+
var ptr3 = encodeRes.ptr;
|
|
3764
|
+
var len3 = encodeRes.len;
|
|
3765
|
+
dataView(_jcoDataViewCacheContext, memory0).setUint32(base + 4, len3, true);
|
|
3766
|
+
dataView(_jcoDataViewCacheContext, memory0).setUint32(base + 0, ptr3, true);
|
|
3767
|
+
}
|
|
3768
|
+
_debugLog('[iface="aula:render/render", function="embed-still"][Instruction::CallWasm] enter', {
|
|
3769
|
+
funcName: "embed-still",
|
|
3770
|
+
paramCount: 7,
|
|
3771
|
+
async: false,
|
|
3772
|
+
postReturn: true
|
|
3773
|
+
});
|
|
3774
|
+
let ret;
|
|
3775
|
+
try {
|
|
3776
|
+
ret = _withGlobalCurrentThreadMeta(CURRENT_TASK_META, {
|
|
3777
|
+
taskID: task.id(),
|
|
3778
|
+
threadID,
|
|
3779
|
+
componentIdx: task.componentIdx(),
|
|
3780
|
+
fn: () => renderEmbedStill(ptr0, len0, variant2_0, variant2_1, variant2_2, result4, len4)
|
|
3781
|
+
});
|
|
3782
|
+
} catch (err) {
|
|
3783
|
+
_debugLog("[Instruction::CallWasm] error during sync call", {
|
|
3784
|
+
taskID: task.id(),
|
|
3785
|
+
err
|
|
3786
|
+
});
|
|
3787
|
+
getOrCreateAsyncState(_jcoComponentStateLookupContext, 0).markTrapped(err);
|
|
3788
|
+
task.setErrored(err);
|
|
3789
|
+
task.reject(err);
|
|
3790
|
+
task.exit();
|
|
3791
|
+
throw err;
|
|
3792
|
+
}
|
|
3793
|
+
task.endFirstSlice();
|
|
3794
|
+
let variant7;
|
|
3795
|
+
switch (dataView(_jcoDataViewCacheContext, memory0).getUint8((ret >>> 0) + 0, true)) {
|
|
3796
|
+
case 0:
|
|
3797
|
+
var ptr5 = dataView(_jcoDataViewCacheContext, memory0).getUint32((ret >>> 0) + 4, true) >>> 0;
|
|
3798
|
+
var len5 = dataView(_jcoDataViewCacheContext, memory0).getUint32((ret >>> 0) + 8, true);
|
|
3799
|
+
if (ptr5 < 0 || len5 < 0 || len5 > 268435455 || ptr5 > memory0.buffer.byteLength || len5 > Math.floor((memory0.buffer.byteLength - ptr5) / 1)) throw new WebAssemblyRuntimeError("wasm trap: out of bounds memory access");
|
|
3800
|
+
if (ptr5 % 1 != 0) throw TypeError(`list pointer [${ptr5}] is not aligned to 1`);
|
|
3801
|
+
variant7 = {
|
|
3802
|
+
tag: "ok",
|
|
3803
|
+
val: new Uint8Array(memory0.buffer.slice(ptr5, ptr5 + len5 * 1))
|
|
3804
|
+
};
|
|
3805
|
+
break;
|
|
3806
|
+
case 1:
|
|
3807
|
+
var ptr6 = dataView(_jcoDataViewCacheContext, memory0).getUint32((ret >>> 0) + 4, true) >>> 0;
|
|
3808
|
+
var len6 = dataView(_jcoDataViewCacheContext, memory0).getUint32((ret >>> 0) + 8, true) >>> 0;
|
|
3809
|
+
if (ptr6 > memory0.buffer.byteLength || len6 > Math.floor((memory0.buffer.byteLength - ptr6) / 1)) throw new WebAssemblyRuntimeError("string pointer/length out of bounds of memory");
|
|
3810
|
+
variant7 = {
|
|
3811
|
+
tag: "err",
|
|
3812
|
+
val: _decodeUtf8(WebAssemblyRuntimeError, TEXT_DECODER_UTF8, new Uint8Array(memory0.buffer, ptr6, len6))
|
|
3813
|
+
};
|
|
3814
|
+
break;
|
|
3815
|
+
default:
|
|
3816
|
+
throw TypeError("invalid variant discriminant for expected");
|
|
3817
|
+
}
|
|
3818
|
+
_debugLog('[iface="aula:render/render", function="embed-still"][Instruction::Return]', {
|
|
3819
|
+
funcName: "embed-still",
|
|
3820
|
+
paramCount: 1,
|
|
3821
|
+
async: false,
|
|
3822
|
+
postReturn: true
|
|
3823
|
+
});
|
|
3824
|
+
let retCopy = variant7;
|
|
3825
|
+
task.resolve([retCopy]);
|
|
3826
|
+
let cstate = getOrCreateAsyncState(_jcoComponentStateLookupContext, 0);
|
|
3827
|
+
cstate.mayLeave = false;
|
|
3828
|
+
try {
|
|
3829
|
+
postReturn2(ret);
|
|
3830
|
+
} catch (err) {
|
|
3831
|
+
err = _postReturnTrap(_jcoComponentPostReturnTrapContext, 0, err);
|
|
3832
|
+
task.reject(err);
|
|
3833
|
+
throw err;
|
|
3834
|
+
}
|
|
3835
|
+
cstate.mayLeave = true;
|
|
3836
|
+
task.exit();
|
|
3837
|
+
if (typeof retCopy == "object" && retCopy.tag === "err") throw new ComponentError(retCopy.val);
|
|
3838
|
+
return retCopy.val;
|
|
3839
|
+
} catch (err) {
|
|
3840
|
+
if (!task.isResolvedState()) {
|
|
3841
|
+
task.setErrored(err);
|
|
3842
|
+
task.reject(err);
|
|
3843
|
+
}
|
|
3844
|
+
task.isExited() || task.exit({ skipExclusiveLockCheck: true });
|
|
3845
|
+
throw err;
|
|
3846
|
+
}
|
|
3847
|
+
}
|
|
3848
|
+
});
|
|
3849
|
+
}
|
|
3850
|
+
function trampoline0(handle) {
|
|
3586
3851
|
let handleEntry = rscTableRemove(_jcoResourceRemoveContext, handleTable0, handle);
|
|
3587
3852
|
handleEntry.own && exports0[0](handleEntry.rep);
|
|
3588
3853
|
}
|
|
3854
|
+
var trampoline1 = (rep) => rscTableCreateOwn(HANDLE_INDEX_SPACES, handleTable0, rep);
|
|
3589
3855
|
await (() => {
|
|
3590
3856
|
let gen = (function* _initGenerator() {
|
|
3591
3857
|
let module0 = fetchCompile(_jcoFetchCompileContext, new URL("./aula-render.core.wasm", import.meta.url));
|
|
@@ -3604,8 +3870,8 @@ await (() => {
|
|
|
3604
3870
|
INSTANCE_FLAGS.set(0, instanceFlags0);
|
|
3605
3871
|
({ exports: exports0 } = yield instantiateCore(WebAssembly, yield module1));
|
|
3606
3872
|
({ exports: exports1 } = yield instantiateCore(WebAssembly, yield module0, { "[export]aula:render/render": {
|
|
3607
|
-
"[resource-drop]player": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 0, _guardMayLeave(_jcoComponentMayLeaveContext, 0,
|
|
3608
|
-
"[resource-new]player": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 0, _guardMayLeave(_jcoComponentMayLeaveContext, 0,
|
|
3873
|
+
"[resource-drop]player": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 0, _guardMayLeave(_jcoComponentMayLeaveContext, 0, trampoline0), true), { _jcoMaySuspend: false }),
|
|
3874
|
+
"[resource-new]player": Object.assign(_guardTrap(_jcoComponentRecordTrapContext, 0, _guardMayLeave(_jcoComponentMayLeaveContext, 0, trampoline1), true), { _jcoMaySuspend: false })
|
|
3609
3875
|
} }));
|
|
3610
3876
|
({ exports: exports2 } = yield instantiateCore(WebAssembly, yield module2, {
|
|
3611
3877
|
actual: { 0: Object.assign(exports1["aula:render/render#[dtor]player"], { _jcoMaySuspend: false }) },
|
|
@@ -3629,11 +3895,11 @@ await (() => {
|
|
|
3629
3895
|
} catch {
|
|
3630
3896
|
exports1["cabi_post_aula:render/render#[method]player.png"];
|
|
3631
3897
|
}
|
|
3632
|
-
postReturn2 = exports1["cabi_post_aula:render/render#
|
|
3898
|
+
postReturn2 = exports1["cabi_post_aula:render/render#embed-still"];
|
|
3633
3899
|
try {
|
|
3634
|
-
WebAssembly.promising(exports1["cabi_post_aula:render/render#
|
|
3900
|
+
WebAssembly.promising(exports1["cabi_post_aula:render/render#embed-still"]);
|
|
3635
3901
|
} catch {
|
|
3636
|
-
exports1["cabi_post_aula:render/render#
|
|
3902
|
+
exports1["cabi_post_aula:render/render#embed-still"];
|
|
3637
3903
|
}
|
|
3638
3904
|
renderStaticPlayerParse = exports1["aula:render/render#[static]player.parse"];
|
|
3639
3905
|
renderMethodPlayerFps = exports1["aula:render/render#[method]player.fps"];
|
|
@@ -3641,6 +3907,7 @@ await (() => {
|
|
|
3641
3907
|
renderMethodPlayerPng = exports1["aula:render/render#[method]player.png"];
|
|
3642
3908
|
renderMethodPlayerRgba = exports1["aula:render/render#[method]player.rgba"];
|
|
3643
3909
|
renderSheet = exports1["aula:render/render#sheet"];
|
|
3910
|
+
renderEmbedStill = exports1["aula:render/render#embed-still"];
|
|
3644
3911
|
})();
|
|
3645
3912
|
let promise, resolve, reject;
|
|
3646
3913
|
function normalizeInstantiationError(e) {
|
|
@@ -3670,6 +3937,7 @@ await (() => {
|
|
|
3670
3937
|
})();
|
|
3671
3938
|
var render = {
|
|
3672
3939
|
Player,
|
|
3940
|
+
embedStill,
|
|
3673
3941
|
sheet
|
|
3674
3942
|
};
|
|
3675
3943
|
var _util = {
|
|
@@ -3688,7 +3956,14 @@ async function pictures(job) {
|
|
|
3688
3956
|
const sheets = [];
|
|
3689
3957
|
for (const group of job.groups) {
|
|
3690
3958
|
const folder = path.join(job.out, group.folder);
|
|
3691
|
-
const tiles =
|
|
3959
|
+
const tiles = await Promise.all(
|
|
3960
|
+
group.tiles.map(async (t) => {
|
|
3961
|
+
const held = player.png(t.frame);
|
|
3962
|
+
if (t.embed === void 0) return { name: t.name, png: held };
|
|
3963
|
+
const picture = t.embed.picture === void 0 ? void 0 : await readFile(t.embed.picture);
|
|
3964
|
+
return { name: t.name, png: render.embedStill(held, picture, t.embed.lines) };
|
|
3965
|
+
})
|
|
3966
|
+
);
|
|
3692
3967
|
await mkdir(folder, { recursive: true });
|
|
3693
3968
|
for (const tile of tiles) await writeFile(path.join(folder, `${tile.name}.png`), tile.png);
|
|
3694
3969
|
const per = group.cols * group.rows;
|