trace-avatar-render 0.1.7 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Browser, Page } from 'playwright';
1
+ import { Browser, Page, Locator } from 'playwright';
2
2
  import { Ai, preview, Suggestion, Candidate, TextCandidate, applyRaw } from 'trace-avatar/assist';
3
3
 
4
4
  /** RGBA pixel helpers. PURE. */
@@ -819,14 +819,13 @@ declare function createGifWriter(o: {
819
819
 
820
820
  /**
821
821
  * MP4 (H.264) through the system ffmpeg: composed RGBA frames are piped in at a steady fps.
822
- * There is no bundled ffmpeg; without one on the PATH (or FFMPEG), MP4 output fails with a clear message.
823
- */
824
- /** The ffmpeg to use, or null. `FFMPEG` overrides the PATH. */
825
- declare function findFfmpeg(env?: NodeJS.ProcessEnv): string | null;
826
- /**
827
- * The ffmpeg arguments for raw RGBA frames of width×height piped in (the renderer composes them), and an
828
- * optional audio track (a WAV as long as the video). Exported for tests.
822
+ * The ffmpeg is FFMPEG, else one on the PATH, else ffmpeg-static (an optional dependency, installed with the
823
+ * package where its platform has a build). Without any, MP4 output fails with a clear message.
829
824
  */
825
+ /** The ffmpeg to use, or null. `FFMPEG` is used as given (no fallback); else the PATH's; else ffmpeg-static's. */
826
+ declare function findFfmpeg(env?: NodeJS.ProcessEnv, o?: {
827
+ bundled?: () => string | null;
828
+ }): string | null;
830
829
  declare function mp4Args(file: string, fps: number, size: {
831
830
  width: number;
832
831
  height: number;
@@ -1037,4 +1036,426 @@ interface CheckOptions {
1037
1036
  /** Check a catalogue against trace-avatar-catalogue/1. With `fetch`, its links too. */
1038
1037
  declare function checkCatalogue(doc: unknown, o?: CheckOptions): Promise<CatalogueCheck>;
1039
1038
 
1040
- export { type Action, type Brand, CANVASES, CATALOGUE_FORMATS, CATALOGUE_KINDS, CATALOGUE_REQUIRED, CATALOGUE_SHAPES, CATALOGUE_SPEC, CORNERS, type CameraOptions, type Canvas, type CanvasSpec, type Capture, type CaptureOptions, type CapturedFrame, type CardOptions, type Catalogue, type CatalogueCheck, type CatalogueEntry, type CheckOptions, type Corner, type Cue, DEFAULT_BACKGROUND, DEFAULT_MAX_WAIT_MS, type EditOptions, type FinishOptions, type FrameStyle, GEMINI_TTS, type GifOptions, type GifResult, type GifWriter, type Image, type Layers, type Layout, type NarrationPlan, type OutFormat, type OutSpec, type Pcm, type Phase, type PlanOptions, type PlannedLine, type Rect, RenderError, type RenderOptions, type RenderOutput, type RenderResult, type RepairOutcome, type RepairSuggestion, type Script, type Segment, type Span, TRACK_RATE, type TimelineEvent, type Unresolved, type Voice, type Watermark, ZOOM_KINDS, actionsOf, badgeAt, blank, brandFile, brandOf, cached, cameraKeys, cameraPath, canvasOf, captionCues, capture, cardFrames, cardOf, catalogueId, chapterCues, checkCatalogue, createGifWriter, createLayers, crop, crossfade, cueAt, dataUri, drawRegion, durationOf, editList, encodeGif, encodeMp4, findFfmpeg, findPlayer, finish, fitWidth, formatOf, frameTimes, fromS16le, fromWav, geminiVoice, layoutOf, linesOf, mix, mp4Args, mp4Head, msOf, narrationText, openAiVoice, outputAt, overlay, pageAt, paletteOf, parseScript, pickFrames, pixel, planNarration, providerOf, render, repairGuide, repairScriptOf, resample, resize, runQa, sayVoice, sourceAt, spansOf, stallInspector, stepCues, suggestScript, toVtt, toWav, trimSilence, voiceOf, vttEnds, watermarkOf, withCards, withHolds };
1039
+ declare const DIRECTOR_VIEWPORT: {
1040
+ width: number;
1041
+ height: number;
1042
+ };
1043
+ /** How much of a skipped stretch a video keeps (ms). */
1044
+ declare const SKIP_KEEP_MS = 1600;
1045
+ interface Sprite {
1046
+ width: number;
1047
+ height: number;
1048
+ data: Uint8Array;
1049
+ ox: number;
1050
+ oy: number;
1051
+ }
1052
+ interface Rgba {
1053
+ width: number;
1054
+ height: number;
1055
+ data: Uint8Array;
1056
+ }
1057
+ interface Point {
1058
+ x: number;
1059
+ y: number;
1060
+ }
1061
+ interface Move extends Point {
1062
+ t: number;
1063
+ }
1064
+ /** The arrow as an RGBA sprite (white with a dark edge), 4× supersampled; `ox, oy` is the tip. */
1065
+ declare function arrowSprite(scale?: number): Sprite;
1066
+ /** Draw the arrow with its tip at (x, y) and, while a click is fresh, a ring that grows and fades. */
1067
+ declare function drawCursor(img: Rgba, sprite: Sprite, x: number, y: number, ring?: (Point & {
1068
+ p: number;
1069
+ }) | null): void;
1070
+ /** Where the cursor is at time t, from the moves; before the first, at the first. */
1071
+ declare function cursorAt(moves: readonly Move[], t: number): Point | null;
1072
+ interface Shot {
1073
+ t: number;
1074
+ png: Buffer;
1075
+ }
1076
+ /**
1077
+ * The frames finish() gets: each screencast frame, and one every 1/30 s while the cursor moves or a click ring shows,
1078
+ * all with the cursor drawn. A still page with a still cursor needs no more frames.
1079
+ */
1080
+ declare function withCursor(shots: readonly Shot[], moves: readonly Move[], clicks: readonly Move[], o?: {
1081
+ scale?: number;
1082
+ sprite?: Sprite;
1083
+ }): Shot[];
1084
+ /** A human path from a to b: eased, with a slight arc, ~ 60 points a second. */
1085
+ declare function pathOf(a: Point, b: Point, ms: number): Point[];
1086
+ /** How long a person takes to reach something this far away (ms). */
1087
+ declare const travelMs: (d: number) => number;
1088
+ /**
1089
+ * A narration script's lines by scene number ({ lines: [{ n, text }] }, as --script). A line for a scene the video
1090
+ * doesn't have is refused, so a script can't drift from its director script unseen.
1091
+ */
1092
+ declare function sayFrom(script: {
1093
+ lines?: Array<{
1094
+ n: number;
1095
+ text?: string;
1096
+ }>;
1097
+ } | null | undefined, count: number, id?: string): Map<number, string>;
1098
+ /** A video's own polish (renderer flags: --frame, --captions, --title-card …) and titles, over its look. */
1099
+ interface LookOf {
1100
+ title?: string;
1101
+ endTitle?: string;
1102
+ polish?: readonly string[];
1103
+ }
1104
+ /**
1105
+ * finish() options for a director video: the look (a brand file, or one already read) first, the video's flags over
1106
+ * it. A card the video asks for (--title-card / --end-card), else the brand's; the video's title wins over both, and
1107
+ * a brand's card object keeps its url, logo and colour. `appName` is the cards' small line.
1108
+ */
1109
+ declare function lookOptions(video: LookOf, brand?: string | Brand, appName?: string): FinishOptions;
1110
+ interface DirectorCard {
1111
+ t: number;
1112
+ ms: number;
1113
+ title: string;
1114
+ url?: boolean;
1115
+ step: number;
1116
+ }
1117
+ /**
1118
+ * A director's cards for finish(): each in the look of the video's end card (its logo and colour, else the title
1119
+ * card's), with its own title; the product's address only on those that ask for it.
1120
+ */
1121
+ declare function cardsOf(cards: readonly DirectorCard[], finishCards?: FinishOptions['cards'], appName?: string): {
1122
+ t: number;
1123
+ ms: number;
1124
+ step: number;
1125
+ card: {
1126
+ url?: string | undefined;
1127
+ title: string;
1128
+ sub?: string;
1129
+ color?: string;
1130
+ logo?: string;
1131
+ };
1132
+ }[];
1133
+ /** The app served under its public name: https://<host> answered by the local server (nothing leaves the machine). */
1134
+ interface Alias {
1135
+ /** The public host, e.g. acme.com. */
1136
+ host: string;
1137
+ /** The app's local API, served as https://api.<host>. */
1138
+ api?: string;
1139
+ /** App paths whose text has the local API's address replaced by the public one (a runtime config, /config.js). */
1140
+ rewrite?: string[];
1141
+ }
1142
+ /** What a session is: a storageState file, or a function of the app's address and the window's options. */
1143
+ type Session = string | ((url: string, o: Record<string, unknown>) => unknown | Promise<unknown>);
1144
+ interface Director {
1145
+ [prop: string]: unknown;
1146
+ page: Page;
1147
+ /** Playwright's expect (needs @playwright/test installed). */
1148
+ expect: (...a: unknown[]) => any;
1149
+ /** The app's address as the video shows it. */
1150
+ url: string;
1151
+ /** Where the app really runs. */
1152
+ local: string;
1153
+ open(path: string): Promise<void>;
1154
+ window(path: string, o?: Record<string, unknown>): Promise<void>;
1155
+ read(ms?: number): Promise<void>;
1156
+ hover(locator: Locator, o?: {
1157
+ ms?: number;
1158
+ rest?: number;
1159
+ timeout?: number;
1160
+ }): Promise<void>;
1161
+ click(locator: Locator, o?: {
1162
+ ms?: number;
1163
+ aim?: number;
1164
+ rest?: number;
1165
+ timeout?: number;
1166
+ }): Promise<void>;
1167
+ type(locator: Locator, text: string, o?: {
1168
+ delay?: number;
1169
+ rest?: number;
1170
+ clear?: boolean;
1171
+ ms?: number;
1172
+ timeout?: number;
1173
+ }): Promise<void>;
1174
+ press(key: string, o?: {
1175
+ rest?: number;
1176
+ }): Promise<void>;
1177
+ skip(fn: () => Promise<void>): Promise<void>;
1178
+ card(title: string, o?: {
1179
+ ms?: number;
1180
+ say?: string;
1181
+ url?: boolean;
1182
+ }): Promise<void>;
1183
+ scene(caption: string, fn: () => Promise<void>, o?: {
1184
+ hold?: number;
1185
+ say?: string;
1186
+ }): Promise<void>;
1187
+ }
1188
+ interface Scene {
1189
+ index: number;
1190
+ caption: string;
1191
+ say: string;
1192
+ from: number;
1193
+ to: number;
1194
+ card?: boolean;
1195
+ }
1196
+ interface DirectOptions {
1197
+ /** The script: a module path (its default export) or the function itself. */
1198
+ script: string | ((d: Director) => Promise<void>);
1199
+ /** Where the app runs, e.g. http://127.0.0.1:3000. */
1200
+ url: string;
1201
+ /** The first page (default /). */
1202
+ page?: string;
1203
+ /** The files to write. */
1204
+ out: Array<OutSpec & {
1205
+ format: OutFormat;
1206
+ }>;
1207
+ /** finish() options (the look: lookOptions()). */
1208
+ look?: FinishOptions;
1209
+ /** The cards' small line (the app's name). */
1210
+ appName?: string;
1211
+ /** Page size (default 1280×800). Captured at 2× unless it's the desktop size. */
1212
+ viewport?: {
1213
+ width: number;
1214
+ height: number;
1215
+ };
1216
+ scale?: number;
1217
+ /** Signed in with this session (default: not signed in). */
1218
+ session?: Session;
1219
+ /** Options for a session function, for the first window (a window of its own can pass others). */
1220
+ sessionOptions?: Record<string, unknown>;
1221
+ /** Open the first window signed out (default false). */
1222
+ signedOut?: boolean;
1223
+ alias?: Alias | string;
1224
+ /** Folders served at a path of the app's own address (props the app doesn't have): { '/__terminal': 'dir' }. */
1225
+ routes?: Record<string, string>;
1226
+ /** Narrate with this voice. */
1227
+ voice?: Voice;
1228
+ /** The spoken lines by scene (instead of each caption): a script or its path. */
1229
+ voiceScript?: string | {
1230
+ lines: Array<{
1231
+ n: number;
1232
+ text: string;
1233
+ }>;
1234
+ };
1235
+ /** Write <scenes>: each scene's caption, spoken line and length (JSON). */
1236
+ scenesFile?: string;
1237
+ headless?: boolean;
1238
+ launchArgs?: string[];
1239
+ /** Kept after the script ends (ms, default 800). */
1240
+ tailMs?: number;
1241
+ /** More on `d` for the script's own use (e.g. { app: { dir } }). */
1242
+ props?: Record<string, unknown>;
1243
+ /** An id for messages. */
1244
+ id?: string;
1245
+ log?: (m: string) => void;
1246
+ }
1247
+ interface DirectResult extends RenderResult {
1248
+ narrated: boolean;
1249
+ scenes: Scene[];
1250
+ }
1251
+ /** The alias as its addresses: the public url, the local server, and the API's both. */
1252
+ declare function aliasOf(url: string, alias?: Alias | string): {
1253
+ url: string;
1254
+ local: string | null;
1255
+ api?: string;
1256
+ localApi?: string;
1257
+ rewrite: string[];
1258
+ };
1259
+ /** Make one director video. A script that throws (a failed check) makes nothing. */
1260
+ declare function direct(o: DirectOptions): Promise<DirectResult>;
1261
+
1262
+ declare const CAMPAIGN_KINDS: readonly ["intro", "demo", "guide", "onboarding", "pitch", "whats-new", "ad", "docs-gif", "qa", "support"];
1263
+ declare const CAMPAIGN_SHAPES: readonly ["16:9", "1:1", "4:5", "9:16"];
1264
+ interface CampaignApp {
1265
+ /** Its name, on the cards. */
1266
+ name?: string;
1267
+ /** Where it serves while videos are made, e.g. http://127.0.0.1:3000. */
1268
+ url: string;
1269
+ /** Its checkout (for start, guides, storageState, session). Default: the campaign's folder. */
1270
+ dir?: string;
1271
+ /** How to start it (with --start), run in `dir`. */
1272
+ start?: string[];
1273
+ /** A path that answers once it's ready (default /). */
1274
+ ready?: string;
1275
+ /** Or: a line its start prints once it's ready. */
1276
+ readyText?: string;
1277
+ /** Its guides: { guides: [{ id, trace, pages? }] }. A video's `guide` can be a .trace.json path instead. */
1278
+ guides?: string;
1279
+ /** A signed-in session (Playwright storageState): guides play with it. */
1280
+ storageState?: string;
1281
+ /** A module whose `storageStateFor(url, options)` gives one: director windows use it (a video's `session` is the
1282
+ * first window's options; `d.window(path, options)` passes others), and guides when there is no storageState. */
1283
+ session?: string;
1284
+ /** Put the app back to a known state before each video: POST this (body: the video's `reset`), or run this. */
1285
+ reset?: {
1286
+ post: string;
1287
+ body?: Record<string, unknown>;
1288
+ } | {
1289
+ run: string[];
1290
+ };
1291
+ /** Show it under its public name (https://<host>, answered locally). */
1292
+ alias?: string | Alias;
1293
+ /** Folders served at a path of the app's own address, for director videos: { "/__props": "props" }. */
1294
+ routes?: Record<string, string>;
1295
+ }
1296
+ interface CampaignLook {
1297
+ /** A brand file (--brand): frame, background, cards, watermark … */
1298
+ brand: string;
1299
+ /** What its last card says, for the catalogue. Default: the brand's end card (title and url), else its watermark. */
1300
+ endsWith?: string;
1301
+ }
1302
+ interface CampaignVideo {
1303
+ id: string;
1304
+ kind: (typeof CAMPAIGN_KINDS)[number];
1305
+ /** A guide id (from app.guides) or a .trace.json path … */
1306
+ guide?: string;
1307
+ /** … or a director script (.mjs). */
1308
+ director?: string;
1309
+ /** Guides: overlay (Show me) or perform (Do it for me: clicks and types for real). */
1310
+ mode?: 'overlay' | 'perform';
1311
+ /** Perform: values to type, by field name or label. */
1312
+ values?: Record<string, string>;
1313
+ /** The page it starts on (default: the guide's first page, else /). */
1314
+ page?: string;
1315
+ title?: string;
1316
+ endTitle?: string;
1317
+ /** The looks it's made in (default the first in `looks`). */
1318
+ looks?: string[];
1319
+ /** Its shapes; none for a docs-gif. */
1320
+ shapes?: string[];
1321
+ /** Narrated: a script per look ({ lines: [{ n, text }] }). */
1322
+ voice?: Record<string, string>;
1323
+ /** More renderer flags (--title-card, --camera, --captions-at top …). */
1324
+ polish?: string[];
1325
+ /** What it shows, plainly. */
1326
+ alt: string;
1327
+ /** The body of the app's reset for this video. */
1328
+ reset?: Record<string, unknown>;
1329
+ /** The session function's options for this video. */
1330
+ session?: Record<string, unknown>;
1331
+ /** Start signed out. */
1332
+ signedIn?: boolean;
1333
+ /** A docs-gif's width (default 800). */
1334
+ width?: number;
1335
+ /** Director: a real window (some captures can't run headless). */
1336
+ headed?: boolean;
1337
+ launchArgs?: string[];
1338
+ tailMs?: number;
1339
+ }
1340
+ interface Campaign {
1341
+ product: string;
1342
+ site: string;
1343
+ language?: string;
1344
+ /** The voice for narrated videos (voiceOf: gateway, openai:…, say:…, a .js); --voice wins. */
1345
+ narrator?: string;
1346
+ /** Where files go (default out/<product> beside the file). */
1347
+ out?: string;
1348
+ app: CampaignApp;
1349
+ looks: Record<string, CampaignLook>;
1350
+ videos: CampaignVideo[];
1351
+ [more: string]: unknown;
1352
+ }
1353
+ /** A campaign as loaded: its paths absolute, its file and folder known. */
1354
+ interface LoadedCampaign extends Campaign {
1355
+ file: string;
1356
+ base: string;
1357
+ out: string;
1358
+ }
1359
+ /** One render: a video in one look, desktop or phone. */
1360
+ interface CampaignRender {
1361
+ id: string;
1362
+ video: CampaignVideo;
1363
+ look: string;
1364
+ phone: boolean;
1365
+ shapes: string[];
1366
+ format: OutFormat;
1367
+ polish: string[];
1368
+ }
1369
+ /** Read a campaign file, its paths made absolute. Problems are found by checkCampaign. */
1370
+ declare function loadCampaign(file?: string): LoadedCampaign;
1371
+ /** Every problem in a campaign, at once. `files: false` skips what needs the app's checkout (guides, sessions). */
1372
+ declare function checkCampaign(c: LoadedCampaign, o?: {
1373
+ files?: boolean;
1374
+ }): string[];
1375
+ /** A campaign, loaded and checked: every problem named at once. */
1376
+ declare function readCampaign(file?: string, o?: {
1377
+ files?: boolean;
1378
+ }): LoadedCampaign;
1379
+ /**
1380
+ * The renders a campaign makes: per video and look, one for the desktop shapes (one capture, a file each) and one for
1381
+ * 9:16 (a phone-sized capture). Their ids are <video>--<look>[--phone].
1382
+ */
1383
+ declare function rendersOf(c: Campaign): CampaignRender[];
1384
+ /** A shape's file tag: '16:9' → '16x9'. */
1385
+ declare const shapeTag: (shape: string) => string;
1386
+ /** What a render writes: [{ key, name, canvas? }]; key is what made.json calls it ('mp4@1:1', 'gif'). */
1387
+ declare function filesOf(r: CampaignRender): Array<{
1388
+ key: string;
1389
+ name: string;
1390
+ format: OutFormat;
1391
+ canvas?: string;
1392
+ }>;
1393
+ /** What a look's videos end with: its own words, else the brand's end card, else its watermark. */
1394
+ declare function endsWithOf(look: CampaignLook, endTitle?: string): string | null;
1395
+ interface Progress {
1396
+ ids: string[];
1397
+ started: string;
1398
+ done: Record<string, string>;
1399
+ failed: Record<string, string>;
1400
+ current: {
1401
+ id: string;
1402
+ n: number;
1403
+ of: number;
1404
+ since: string;
1405
+ } | null;
1406
+ finished: string | null;
1407
+ resumed?: string;
1408
+ }
1409
+ /**
1410
+ * A run's progress, kept beside its files (<out>/progress.json) so it can be read while it runs, and a run stopped
1411
+ * part way carries on. A run of the same renders that did not finish keeps its done ones, unless `fresh`.
1412
+ */
1413
+ declare function progressOf(out: string, ids: string[], o?: {
1414
+ fresh?: boolean;
1415
+ }): {
1416
+ file: string;
1417
+ resumed: boolean;
1418
+ isDone: (id: string) => boolean;
1419
+ start(id: string, n: number, of: number): void;
1420
+ done(id: string): void;
1421
+ fail(id: string, why: string): void;
1422
+ finish(): void;
1423
+ readonly state: Progress;
1424
+ };
1425
+ /** A make run's progress in words: what's done, what failed, what it's on now. */
1426
+ declare function statusOf(c: Pick<LoadedCampaign, 'product' | 'out'>, now?: number): string;
1427
+ interface Made {
1428
+ files: Record<string, string>;
1429
+ width?: number;
1430
+ height?: number;
1431
+ seconds?: number;
1432
+ narrated: boolean;
1433
+ video: string;
1434
+ look: string;
1435
+ at: string;
1436
+ }
1437
+ interface MakeOptions {
1438
+ /** Video ids, or render ids (intro--product--phone), to make; default all. */
1439
+ only?: string[];
1440
+ /** Start the app (app.start) if it isn't serving. */
1441
+ start?: boolean;
1442
+ /** Start over instead of carrying on a stopped run. */
1443
+ fresh?: boolean;
1444
+ /** The voice (over the campaign's narrator and TRACE_AVATAR_VOICE). '' makes narrated videos without a voice. */
1445
+ voice?: string | Voice;
1446
+ log?: (m: string) => void;
1447
+ }
1448
+ /** The app serving: already, or started (app.start) and waited for. Returns how to stop what was started. */
1449
+ declare function ensureApp(app: CampaignApp, start: boolean, log?: (m: string) => void): Promise<() => void>;
1450
+ /** Make a campaign's videos (all, or the ids given): files and <out>/made.json. */
1451
+ declare function makeCampaign(c: LoadedCampaign, o?: MakeOptions): Promise<{
1452
+ made: Record<string, Made>;
1453
+ failed: string[];
1454
+ }>;
1455
+ /**
1456
+ * What a render's video says, in order: each scene's caption (narrated: the spoken line) and its cards' lines, from its
1457
+ * <id>.scenes.json (director videos). null when it has none.
1458
+ */
1459
+ declare function saysOf(c: Pick<LoadedCampaign, 'out'>, renderId: string): string[] | null;
1460
+
1461
+ export { type Action, type Alias, type Brand, CAMPAIGN_KINDS, CAMPAIGN_SHAPES, CANVASES, CATALOGUE_FORMATS, CATALOGUE_KINDS, CATALOGUE_REQUIRED, CATALOGUE_SHAPES, CATALOGUE_SPEC, CORNERS, type CameraOptions, type Campaign, type CampaignApp, type CampaignLook, type CampaignRender, type CampaignVideo, type Canvas, type CanvasSpec, type Capture, type CaptureOptions, type CapturedFrame, type CardOptions, type Catalogue, type CatalogueCheck, type CatalogueEntry, type CheckOptions, type Corner, type Cue, DEFAULT_BACKGROUND, DEFAULT_MAX_WAIT_MS, DIRECTOR_VIEWPORT, type DirectOptions, type DirectResult, type Director, type DirectorCard, type EditOptions, type FinishOptions, type FrameStyle, GEMINI_TTS, type GifOptions, type GifResult, type GifWriter, type Image, type Layers, type Layout, type LoadedCampaign, type LookOf, type Made, type MakeOptions, type Move, type NarrationPlan, type OutFormat, type OutSpec, type Pcm, type Phase, type PlanOptions, type PlannedLine, type Point, type Progress, type Rect, RenderError, type RenderOptions, type RenderOutput, type RenderResult, type RepairOutcome, type RepairSuggestion, SKIP_KEEP_MS, type Scene, type Script, type Segment, type Session, type Shot, type Span, type Sprite, TRACK_RATE, type TimelineEvent, type Unresolved, type Voice, type Watermark, ZOOM_KINDS, actionsOf, aliasOf, arrowSprite, badgeAt, blank, brandFile, brandOf, cached, cameraKeys, cameraPath, canvasOf, captionCues, capture, cardFrames, cardOf, cardsOf, catalogueId, chapterCues, checkCampaign, checkCatalogue, createGifWriter, createLayers, crop, crossfade, cueAt, cursorAt, dataUri, direct, drawCursor, drawRegion, durationOf, editList, encodeGif, encodeMp4, endsWithOf, ensureApp, filesOf, findFfmpeg, findPlayer, finish, fitWidth, formatOf, frameTimes, fromS16le, fromWav, geminiVoice, layoutOf, linesOf, loadCampaign, lookOptions, makeCampaign, mix, mp4Args, mp4Head, msOf, narrationText, openAiVoice, outputAt, overlay, pageAt, paletteOf, parseScript, pathOf, pickFrames, pixel, planNarration, progressOf, providerOf, readCampaign, render, rendersOf, repairGuide, repairScriptOf, resample, resize, runQa, sayFrom, sayVoice, saysOf, shapeTag, sourceAt, spansOf, stallInspector, statusOf, stepCues, suggestScript, toVtt, toWav, travelMs, trimSilence, voiceOf, vttEnds, watermarkOf, withCards, withCursor, withHolds };
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import {
2
+ CAMPAIGN_KINDS,
3
+ CAMPAIGN_SHAPES,
2
4
  CANVASES,
3
5
  CATALOGUE_FORMATS,
4
6
  CATALOGUE_KINDS,
@@ -8,11 +10,15 @@ import {
8
10
  CORNERS,
9
11
  DEFAULT_BACKGROUND,
10
12
  DEFAULT_MAX_WAIT_MS,
13
+ DIRECTOR_VIEWPORT,
11
14
  GEMINI_TTS,
12
15
  RenderError,
16
+ SKIP_KEEP_MS,
13
17
  TRACK_RATE,
14
18
  ZOOM_KINDS,
15
19
  actionsOf,
20
+ aliasOf,
21
+ arrowSprite,
16
22
  badgeAt,
17
23
  blank,
18
24
  brandFile,
@@ -25,20 +31,28 @@ import {
25
31
  capture,
26
32
  cardFrames,
27
33
  cardOf,
34
+ cardsOf,
28
35
  catalogueId,
29
36
  chapterCues,
37
+ checkCampaign,
30
38
  checkCatalogue,
31
39
  createGifWriter,
32
40
  createLayers,
33
41
  crop,
34
42
  crossfade,
35
43
  cueAt,
44
+ cursorAt,
36
45
  dataUri,
46
+ direct,
47
+ drawCursor,
37
48
  drawRegion,
38
49
  durationOf,
39
50
  editList,
40
51
  encodeGif,
41
52
  encodeMp4,
53
+ endsWithOf,
54
+ ensureApp,
55
+ filesOf,
42
56
  findFfmpeg,
43
57
  findPlayer,
44
58
  finish,
@@ -50,6 +64,9 @@ import {
50
64
  geminiVoice,
51
65
  layoutOf,
52
66
  linesOf,
67
+ loadCampaign,
68
+ lookOptions,
69
+ makeCampaign,
53
70
  mix,
54
71
  mp4Args,
55
72
  mp4Head,
@@ -61,32 +78,44 @@ import {
61
78
  pageAt,
62
79
  paletteOf,
63
80
  parseScript,
81
+ pathOf,
64
82
  pickFrames,
65
83
  pixel,
66
84
  planNarration,
85
+ progressOf,
67
86
  providerOf,
87
+ readCampaign,
68
88
  render,
89
+ rendersOf,
69
90
  repairGuide,
70
91
  repairScriptOf,
71
92
  resample,
72
93
  resize,
73
94
  runQa,
95
+ sayFrom,
74
96
  sayVoice,
97
+ saysOf,
98
+ shapeTag,
75
99
  sourceAt,
76
100
  spansOf,
77
101
  stallInspector,
102
+ statusOf,
78
103
  stepCues,
79
104
  suggestScript,
80
105
  toVtt,
81
106
  toWav,
107
+ travelMs,
82
108
  trimSilence,
83
109
  voiceOf,
84
110
  vttEnds,
85
111
  watermarkOf,
86
112
  withCards,
113
+ withCursor,
87
114
  withHolds
88
- } from "./chunk-PPVNEPXF.js";
115
+ } from "./chunk-EAMOVIQK.js";
89
116
  export {
117
+ CAMPAIGN_KINDS,
118
+ CAMPAIGN_SHAPES,
90
119
  CANVASES,
91
120
  CATALOGUE_FORMATS,
92
121
  CATALOGUE_KINDS,
@@ -96,11 +125,15 @@ export {
96
125
  CORNERS,
97
126
  DEFAULT_BACKGROUND,
98
127
  DEFAULT_MAX_WAIT_MS,
128
+ DIRECTOR_VIEWPORT,
99
129
  GEMINI_TTS,
100
130
  RenderError,
131
+ SKIP_KEEP_MS,
101
132
  TRACK_RATE,
102
133
  ZOOM_KINDS,
103
134
  actionsOf,
135
+ aliasOf,
136
+ arrowSprite,
104
137
  badgeAt,
105
138
  blank,
106
139
  brandFile,
@@ -113,20 +146,28 @@ export {
113
146
  capture,
114
147
  cardFrames,
115
148
  cardOf,
149
+ cardsOf,
116
150
  catalogueId,
117
151
  chapterCues,
152
+ checkCampaign,
118
153
  checkCatalogue,
119
154
  createGifWriter,
120
155
  createLayers,
121
156
  crop,
122
157
  crossfade,
123
158
  cueAt,
159
+ cursorAt,
124
160
  dataUri,
161
+ direct,
162
+ drawCursor,
125
163
  drawRegion,
126
164
  durationOf,
127
165
  editList,
128
166
  encodeGif,
129
167
  encodeMp4,
168
+ endsWithOf,
169
+ ensureApp,
170
+ filesOf,
130
171
  findFfmpeg,
131
172
  findPlayer,
132
173
  finish,
@@ -138,6 +179,9 @@ export {
138
179
  geminiVoice,
139
180
  layoutOf,
140
181
  linesOf,
182
+ loadCampaign,
183
+ lookOptions,
184
+ makeCampaign,
141
185
  mix,
142
186
  mp4Args,
143
187
  mp4Head,
@@ -149,29 +193,39 @@ export {
149
193
  pageAt,
150
194
  paletteOf,
151
195
  parseScript,
196
+ pathOf,
152
197
  pickFrames,
153
198
  pixel,
154
199
  planNarration,
200
+ progressOf,
155
201
  providerOf,
202
+ readCampaign,
156
203
  render,
204
+ rendersOf,
157
205
  repairGuide,
158
206
  repairScriptOf,
159
207
  resample,
160
208
  resize,
161
209
  runQa,
210
+ sayFrom,
162
211
  sayVoice,
212
+ saysOf,
213
+ shapeTag,
163
214
  sourceAt,
164
215
  spansOf,
165
216
  stallInspector,
217
+ statusOf,
166
218
  stepCues,
167
219
  suggestScript,
168
220
  toVtt,
169
221
  toWav,
222
+ travelMs,
170
223
  trimSilence,
171
224
  voiceOf,
172
225
  vttEnds,
173
226
  watermarkOf,
174
227
  withCards,
228
+ withCursor,
175
229
  withHolds
176
230
  };
177
231
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trace-avatar-render",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
4
4
  "description": "Render a trace-avatar guide to a GIF or MP4 by playing it on your real app in headless Chromium.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -71,5 +71,16 @@
71
71
  "tsup": "^8.5.1",
72
72
  "typescript": "^5.9.3",
73
73
  "vitest": "^3.2.7"
74
+ },
75
+ "optionalDependencies": {
76
+ "ffmpeg-static": "^5.2.0"
77
+ },
78
+ "peerDependencies": {
79
+ "@playwright/test": ">=1.40"
80
+ },
81
+ "peerDependenciesMeta": {
82
+ "@playwright/test": {
83
+ "optional": true
84
+ }
74
85
  }
75
86
  }