@kvman/kvvideo 0.1.1 → 0.1.3
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/api.d.ts +5 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/compose/compose-size.d.ts +0 -1
- package/dist/compose/compose-size.d.ts.map +1 -1
- package/dist/compose/compose-size.js +2 -7
- package/dist/compose/compose-size.js.map +1 -1
- package/dist/compose/register-compose.d.ts.map +1 -1
- package/dist/compose/register-compose.js +4 -6
- package/dist/compose/register-compose.js.map +1 -1
- package/dist/connector.d.ts +17 -5
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js +7 -1
- package/dist/connector.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/look/look-at.d.ts +15 -0
- package/dist/look/look-at.d.ts.map +1 -0
- package/dist/look/look-at.js +20 -0
- package/dist/look/look-at.js.map +1 -0
- package/dist/look/look-input.d.ts +22 -0
- package/dist/look/look-input.d.ts.map +1 -0
- package/dist/look/look-input.js +25 -0
- package/dist/look/look-input.js.map +1 -0
- package/dist/look/register-look.d.ts +3 -0
- package/dist/look/register-look.d.ts.map +1 -0
- package/dist/look/register-look.js +52 -0
- package/dist/look/register-look.js.map +1 -0
- package/dist/record/page-clock.d.ts +7 -0
- package/dist/record/page-clock.d.ts.map +1 -0
- package/dist/record/page-clock.js +13 -0
- package/dist/record/page-clock.js.map +1 -0
- package/dist/record/record-source.d.ts +16 -0
- package/dist/record/record-source.d.ts.map +1 -0
- package/dist/record/record-source.js +11 -0
- package/dist/record/record-source.js.map +1 -0
- package/dist/record/recorder.d.ts +3 -1
- package/dist/record/recorder.d.ts.map +1 -1
- package/dist/record/recorder.js +6 -2
- package/dist/record/recorder.js.map +1 -1
- package/dist/record/register-record.d.ts.map +1 -1
- package/dist/record/register-record.js +4 -6
- package/dist/record/register-record.js.map +1 -1
- package/dist/record/steps.d.ts +2 -0
- package/dist/record/steps.d.ts.map +1 -1
- package/dist/record/steps.js +2 -2
- package/dist/record/steps.js.map +1 -1
- package/docs/guide.md +36 -18
- package/package.json +2 -2
- package/dist/compose/srt.d.ts +0 -3
- package/dist/compose/srt.d.ts.map +0 -1
- package/dist/compose/srt.js +0 -10
- package/dist/compose/srt.js.map +0 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { z } from '@kvman/sdk';
|
|
2
2
|
import type { composeInputSchema, composeOutputSchema } from './compose/compose-input.ts';
|
|
3
|
+
import type { lookInputSchema, lookOutputSchema } from './look/look-input.ts';
|
|
3
4
|
import type { narrateInputSchema, narrateOutputSchema } from './narration/register-narration.ts';
|
|
4
5
|
import type { recordInputSchema, recordOutputSchema } from './record/steps.ts';
|
|
5
6
|
import type { reviewOutputSchema } from './review/register-review.ts';
|
|
@@ -29,6 +30,10 @@ declare module '@kvman/sdk' {
|
|
|
29
30
|
input: z.input<typeof recordInputSchema>;
|
|
30
31
|
output: z.output<typeof recordOutputSchema>;
|
|
31
32
|
};
|
|
33
|
+
'kvvideo.frame.capture': {
|
|
34
|
+
input: z.input<typeof lookInputSchema>;
|
|
35
|
+
output: z.output<typeof lookOutputSchema>;
|
|
36
|
+
};
|
|
32
37
|
'kvvideo.brand.set': {
|
|
33
38
|
input: Brand;
|
|
34
39
|
output: Empty;
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,M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AC;QACnG,mBAAmB,EAAE;YAAE,KAAK,EAAE,KAAK,CAAC;YAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAA;SAAE,CAAC;KAC7D;IACD,UAAU,QAAQ;QAChB,2BAA2B,EAAE,gBAAgB,GAAG,IAAI,CAAC;QACrD,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;QACzC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;QACzC,kCAAkC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACpE,eAAe,EAAE,KAAK,GAAG,IAAI,CAAC;QAC9B,iBAAiB,EAAE,aAAa,CAAC;QACjC,yBAAyB,EAAE,MAAM,CAAC;QAClC,0BAA0B,EAAE,MAAM,CAAC;QACnC,wBAAwB,EAAE,MAAM,CAAC;KAClC;CACF"}
|
|
@@ -43,7 +43,6 @@ export type Composition = {
|
|
|
43
43
|
export type SizeResult = {
|
|
44
44
|
video: string;
|
|
45
45
|
poster: string;
|
|
46
|
-
srt: string | undefined;
|
|
47
46
|
captions: Caption[];
|
|
48
47
|
};
|
|
49
48
|
export declare function composeSize(composition: Composition, size: Size, folder: string): Promise<SizeResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-size.d.ts","sourceRoot":"","sources":["../../src/compose/compose-size.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compose-size.d.ts","sourceRoot":"","sources":["../../src/compose/compose-size.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM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AI,IAAI,CAAC;QAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AAqBhF,wBAAsB,WAAW,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA2C3G"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { mkdirSync
|
|
2
|
-
import path from 'node:path';
|
|
1
|
+
import { mkdirSync } from 'node:fs';
|
|
3
2
|
import { narrationLeadMs } from "../record/narration-cues.js";
|
|
4
3
|
import { drawScene, needsDrawing } from "./compose-drawing.js";
|
|
5
4
|
import { pictureOf, recordingOf } from "./compose-plan.js";
|
|
@@ -7,7 +6,6 @@ import { painterOf } from "./drawn-images.js";
|
|
|
7
6
|
import { otherShape, recordPageAgain } from "./page-again.js";
|
|
8
7
|
import { render } from "./render.js";
|
|
9
8
|
import { soundEvents } from "./sound-effects.js";
|
|
10
|
-
import { srtFile } from "./srt.js";
|
|
11
9
|
const noDrawing = (picture) => ({ layout: undefined, chrome: undefined, mask: undefined, overlayImages: picture.look.overlays.map(() => undefined) });
|
|
12
10
|
async function scenesFor(composition, size, folder) {
|
|
13
11
|
const scenes = [];
|
|
@@ -64,9 +62,6 @@ export async function composeSize(composition, size, folder) {
|
|
|
64
62
|
finalAt: composition.progress.final,
|
|
65
63
|
});
|
|
66
64
|
const timeline = captions.flatMap((sceneCaptions, index) => sceneCaptions.map((caption) => ({ text: caption.text, startMs: caption.startMs + (composition.starts[index] ?? 0), endMs: caption.endMs + (composition.starts[index] ?? 0) })));
|
|
67
|
-
|
|
68
|
-
if (srt !== undefined)
|
|
69
|
-
writeFileSync(srt, srtFile(timeline));
|
|
70
|
-
return { ...made, srt, captions: timeline };
|
|
65
|
+
return { ...made, captions: timeline };
|
|
71
66
|
}
|
|
72
67
|
//# sourceMappingURL=compose-size.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-size.js","sourceRoot":"","sources":["../../src/compose/compose-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"compose-size.js","sourceRoot":"","sources":["../../src/compose/compose-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAI9D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AA0BjD,MAAM,SAAS,GAAG,CAAC,OAAqB,EAAc,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAEhL,KAAK,UAAU,SAAS,CAAC,WAAwB,EAAE,IAAU,EAAE,MAAc;IAC3E,MAAM,MAAM,GAAmB,EAAE,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACxC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,KA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EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM;QACnC,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK;QACxC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK;KACpC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5O,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-compose.d.ts","sourceRoot":"","sources":["../../src/compose/register-compose.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAyDtC,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"register-compose.d.ts","sourceRoot":"","sources":["../../src/compose/register-compose.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAyDtC,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAuF9C"}
|
|
@@ -19,7 +19,7 @@ import { keepCopy } from "./player-copies.js";
|
|
|
19
19
|
import { audioExtensions, checkScene, imageExtensions, isImage, planScene, videoExtensions } from "./scene-plan.js";
|
|
20
20
|
import { sceneStarts, transitionsOf } from "./transitions.js";
|
|
21
21
|
// `video compose` (plan 16 §16.8): every file and output is checked before ffmpeg runs; each size is composed in its
|
|
22
|
-
// own folder; the render runs inside the call (ADR 0107, 12); the video, its
|
|
22
|
+
// own folder; the render runs inside the call (ADR 0107, 12); the video, its poster and sidecar, and the other
|
|
23
23
|
// sizes are placed beside its path, and the video is copied for the chat's player.
|
|
24
24
|
async function lengthOf(ffprobe, file, scene, signal) {
|
|
25
25
|
const duration = await mediaDuration(ffprobe, file, signal);
|
|
@@ -37,12 +37,12 @@ async function planAll(scenes, files, ffprobe, signal) {
|
|
|
37
37
|
}
|
|
38
38
|
return planned;
|
|
39
39
|
}
|
|
40
|
-
// The files a size writes, each checked as an output: the video, its
|
|
40
|
+
// The files a size writes, each checked as an output: the video, its poster, and the main one's sidecar (no `.srt`, ADR 0117, 7).
|
|
41
41
|
function outputsOf(root, file, size, replace) {
|
|
42
42
|
outputPath(root, file, '.mp4', replace);
|
|
43
43
|
const base = file.slice(0, file.length - path.extname(file).length) + (size === undefined ? '' : `-${String(size.width)}x${String(size.height)}`);
|
|
44
44
|
const video = outputPath(root, `${base}.mp4`, '.mp4', replace);
|
|
45
|
-
return { video,
|
|
45
|
+
return { video, poster: outputPath(root, `${base}.jpg`, '.jpg', replace), sidecar: size === undefined ? sidecarOutputPath(video, replace, file) : undefined };
|
|
46
46
|
}
|
|
47
47
|
function checkSizes(main, extra) {
|
|
48
48
|
const key = (size) => `${String(size.width)}x${String(size.height)}`;
|
|
@@ -52,7 +52,7 @@ function checkSizes(main, extra) {
|
|
|
52
52
|
}
|
|
53
53
|
export function registerCompose(ctx) {
|
|
54
54
|
ctx.registerCommand('kvvideo.video.compose', {
|
|
55
|
-
description: 'Composes scenes of recorded clips, pages, or images, framed, with camera moves, overlays, transitions, sound effects, narrations, and burned-in captions, into an MP4 file in the workspace, levelled, with its
|
|
55
|
+
description: 'Composes scenes of recorded clips, pages, or images, framed, with camera moves, overlays, transitions, sound effects, narrations, and burned-in captions, into an MP4 file in the workspace, levelled, with its poster.',
|
|
56
56
|
input: composeInputSchema,
|
|
57
57
|
output: composeOutputSchema,
|
|
58
58
|
public: true,
|
|
@@ -128,8 +128,6 @@ export function registerCompose(ctx) {
|
|
|
128
128
|
continue;
|
|
129
129
|
placeOutput(result.video, placed.video);
|
|
130
130
|
placeOutput(result.poster, placed.poster);
|
|
131
|
-
if (result.srt !== undefined)
|
|
132
|
-
placeOutput(result.srt, placed.srt);
|
|
133
131
|
if (index > 0)
|
|
134
132
|
others.push({ file: answerPath(root, placed.video), bytes: statSync(placed.video).size });
|
|
135
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-compose.js","sourceRoot":"","sources":["../../src/compose/register-compose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,C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UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;YACxJ,CAAC;oBAAS,CAAC;gBACT,KAAK,MAAM,OAAO,IAAI,MAAM;oBAAE,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;gBACpD,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/connector.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export declare const videoConnector: {
|
|
|
10
10
|
description: string;
|
|
11
11
|
input: {};
|
|
12
12
|
}[];
|
|
13
|
-
card?: never;
|
|
14
13
|
images?: never;
|
|
14
|
+
card?: never;
|
|
15
15
|
} | {
|
|
16
16
|
name: string;
|
|
17
17
|
command: string;
|
|
@@ -27,8 +27,8 @@ export declare const videoConnector: {
|
|
|
27
27
|
font: string;
|
|
28
28
|
};
|
|
29
29
|
}[];
|
|
30
|
-
card?: never;
|
|
31
30
|
images?: never;
|
|
31
|
+
card?: never;
|
|
32
32
|
} | {
|
|
33
33
|
name: string;
|
|
34
34
|
command: string;
|
|
@@ -51,8 +51,20 @@ export declare const videoConnector: {
|
|
|
51
51
|
})[];
|
|
52
52
|
};
|
|
53
53
|
}[];
|
|
54
|
-
card?: never;
|
|
55
54
|
images?: never;
|
|
55
|
+
card?: never;
|
|
56
|
+
} | {
|
|
57
|
+
name: string;
|
|
58
|
+
command: string;
|
|
59
|
+
images: true;
|
|
60
|
+
examples: {
|
|
61
|
+
description: string;
|
|
62
|
+
input: {
|
|
63
|
+
page: string;
|
|
64
|
+
atMs: number[];
|
|
65
|
+
};
|
|
66
|
+
}[];
|
|
67
|
+
card?: never;
|
|
56
68
|
} | {
|
|
57
69
|
name: string;
|
|
58
70
|
command: string;
|
|
@@ -65,8 +77,8 @@ export declare const videoConnector: {
|
|
|
65
77
|
speed: number;
|
|
66
78
|
};
|
|
67
79
|
}[];
|
|
68
|
-
card?: never;
|
|
69
80
|
images?: never;
|
|
81
|
+
card?: never;
|
|
70
82
|
} | {
|
|
71
83
|
name: string;
|
|
72
84
|
command: string;
|
|
@@ -80,8 +92,8 @@ export declare const videoConnector: {
|
|
|
80
92
|
file: string;
|
|
81
93
|
};
|
|
82
94
|
}[];
|
|
83
|
-
card?: never;
|
|
84
95
|
images?: never;
|
|
96
|
+
card?: never;
|
|
85
97
|
} | {
|
|
86
98
|
name: string;
|
|
87
99
|
command: string;
|
package/dist/connector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE1B,CAAC"}
|
package/dist/connector.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The `video` connector (plan 16 §16.1 and §16.3; ADR 0107, 11; ADR 0115, 55): `optIn`, so a chat has it only after
|
|
1
|
+
// The `video` connector (plan 16 §16.1 and §16.3; ADR 0107, 11; ADR 0115, 55; ADR 0117, 4): `optIn`, so a chat has it only after
|
|
2
2
|
// `/video`. Each command has one example of what it takes.
|
|
3
3
|
export const connectorName = 'video';
|
|
4
4
|
export const videoConnector = {
|
|
@@ -24,6 +24,12 @@ export const videoConnector = {
|
|
|
24
24
|
},
|
|
25
25
|
],
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
name: 'look',
|
|
29
|
+
command: 'kvvideo.frame.capture',
|
|
30
|
+
images: true,
|
|
31
|
+
examples: [{ description: "Look at a title scene as its words come in, before recording it", input: { page: 'videos/tour/00-title.html', atMs: [500, 1500, 3000] } }],
|
|
32
|
+
},
|
|
27
33
|
{
|
|
28
34
|
name: 'narrate',
|
|
29
35
|
command: 'kvvideo.narration.make',
|
package/dist/connector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,2DAA2D;AAE3D,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AAErC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,IAAa;IACpB,WAAW,EACT,2TAA2T;IAC7T,QAAQ,EAAE;QACR,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE;QAClI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE;QACzH,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE;QACrH;YACE,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,mBAAmB;YAC5B,QAAQ,E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ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAetC,YAAY,EAAE,MAAM,UAAU,CAAC;yBAKf,KAAK,GAAG,KAAG,IAAI;AAA/B,wBAcE"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { registerBrand } from "./brand/brand.js";
|
|
2
2
|
import { registerCompose } from "./compose/register-compose.js";
|
|
3
3
|
import { registerFonts } from "./fonts/register-fonts.js";
|
|
4
|
+
import { registerLook } from "./look/register-look.js";
|
|
4
5
|
import { registerNarration } from "./narration/register-narration.js";
|
|
5
6
|
import { registerVoice } from "./narration/register-voice.js";
|
|
6
7
|
import { registerRecord } from "./record/register-record.js";
|
|
@@ -20,6 +21,7 @@ export default (ctx) => {
|
|
|
20
21
|
registerSetup(ctx);
|
|
21
22
|
registerFonts(ctx);
|
|
22
23
|
registerRecord(ctx);
|
|
24
|
+
registerLook(ctx);
|
|
23
25
|
registerNarration(ctx);
|
|
24
26
|
registerVoice(ctx);
|
|
25
27
|
registerCompose(ctx);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM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+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAItD,6GAA6G;AAC7G,iHAAiH;AACjH,yCAAyC;AACzC,eAAe,CAAC,GAAQ,EAAQ,EAAE;IAChC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACtB,aAAa,CAAC,GAAG,CAAC,CAAC;IACnB,UAAU,CAAC,GAAG,CAAC,CAAC;IAChB,aAAa,CAAC,GAAG,CAAC,CAAC;IACnB,aAAa,CAAC,GAAG,CAAC,CAAC;IACnB,cAAc,CAAC,GAAG,CAAC,CAAC;IACpB,YAAY,CAAC,GAAG,CAAC,CAAC;IAClB,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACvB,aAAa,CAAC,GAAG,CAAC,CAAC;IACnB,eAAe,CAAC,GAAG,CAAC,CAAC;IACrB,cAAc,CAAC,GAAG,CAAC,CAAC;IACpB,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACxB,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Browser } from 'playwright-core';
|
|
2
|
+
import { type RecordSource } from '../record/recorder.ts';
|
|
3
|
+
export type LookPlan = {
|
|
4
|
+
source: RecordSource;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
device: 'desktop' | 'phone';
|
|
8
|
+
ownPort: number | null;
|
|
9
|
+
moments: readonly number[];
|
|
10
|
+
};
|
|
11
|
+
export declare function lookAt(browser: Browser, plan: LookPlan): Promise<{
|
|
12
|
+
atMs: number;
|
|
13
|
+
image: Buffer;
|
|
14
|
+
}[]>;
|
|
15
|
+
//# sourceMappingURL=look-at.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"look-at.d.ts","sourceRoot":"","sources":["../../src/look/look-at.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAKxF,MAAM,MAAM,QAAQ,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAEhK,wBAAsB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAezG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { holdPageClock } from "../record/page-clock.js";
|
|
2
|
+
import { openSource, recordingContext } from "../record/recorder.js";
|
|
3
|
+
export async function lookAt(browser, plan) {
|
|
4
|
+
const context = await recordingContext(browser, plan);
|
|
5
|
+
try {
|
|
6
|
+
const page = await context.newPage();
|
|
7
|
+
const clock = await holdPageClock(page);
|
|
8
|
+
await openSource(page, plan.source);
|
|
9
|
+
const frames = [];
|
|
10
|
+
for (const atMs of [...plan.moments].sort((first, second) => first - second)) {
|
|
11
|
+
await clock.seek(atMs);
|
|
12
|
+
frames.push({ atMs, image: await page.screenshot({ type: 'jpeg', quality: 85, scale: 'css' }) });
|
|
13
|
+
}
|
|
14
|
+
return frames;
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
await context.close();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=look-at.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"look-at.js","sourceRoot":"","sources":["../../src/look/look-at.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAqB,MAAM,uBAAuB,CAAC;AAOxF,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAgB,EAAE,IAAc;IAC3D,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACtD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;YAC7E,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACnG,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from '@kvman/sdk';
|
|
2
|
+
export declare const lookInputSchema: z.ZodObject<{
|
|
3
|
+
url: z.ZodExactOptional<z.ZodString>;
|
|
4
|
+
page: z.ZodExactOptional<z.ZodString>;
|
|
5
|
+
atMs: z.ZodExactOptional<z.ZodArray<z.ZodNumber>>;
|
|
6
|
+
width: z.ZodExactOptional<z.ZodNumber>;
|
|
7
|
+
height: z.ZodExactOptional<z.ZodNumber>;
|
|
8
|
+
device: z.ZodExactOptional<z.ZodEnum<{
|
|
9
|
+
phone: "phone";
|
|
10
|
+
desktop: "desktop";
|
|
11
|
+
}>>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
/** `look`'s input. */
|
|
14
|
+
export type LookInput = z.output<typeof lookInputSchema>;
|
|
15
|
+
export declare const lookOutputSchema: z.ZodObject<{
|
|
16
|
+
images: z.ZodArray<z.ZodObject<{
|
|
17
|
+
fileId: z.ZodString;
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
atMs: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
//# sourceMappingURL=look-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"look-input.d.ts","sourceRoot":"","sources":["../../src/look/look-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAuB/B,eAAO,MAAM,eAAe;;;;;;;;;;kBAE1B,CAAC;AAEH,sBAAsB;AACtB,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAEzD,eAAO,MAAM,gBAAgB;;;;;;iBAAkG,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from '@kvman/sdk';
|
|
2
|
+
import { address, side } from "../record/steps.js";
|
|
3
|
+
// `look`'s input and answer (plan 16 §16.5 Looking; ADR 0117, 19): a website or a page as `record` opens it, and 1 to 6
|
|
4
|
+
// distinct moments of its clock, `[1000]` when left out.
|
|
5
|
+
const moment = z.number().int().min(0).max(60_000);
|
|
6
|
+
const lookFields = z.strictObject({
|
|
7
|
+
url: address.describe('A website to look at: any http or https address.').exactOptional(),
|
|
8
|
+
page: z.string().min(1).max(1000).describe('An .html file of the workspace to look at, with the files beside it.').exactOptional(),
|
|
9
|
+
atMs: z
|
|
10
|
+
.array(moment)
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(6)
|
|
13
|
+
.refine((moments) => new Set(moments).size === moments.length, 'Each moment is given once.')
|
|
14
|
+
.describe("The moments to show, in ms from the page's clock start (0 to 60000); 1000 when left out.")
|
|
15
|
+
.exactOptional(),
|
|
16
|
+
width: side.describe('The page width in CSS pixels: 1280 by default, 390 on a phone.').exactOptional(),
|
|
17
|
+
height: side.describe('The page height in CSS pixels: 720 by default, 844 on a phone.').exactOptional(),
|
|
18
|
+
device: z.enum(['desktop', 'phone']).describe('desktop (the default), or phone.').exactOptional(),
|
|
19
|
+
});
|
|
20
|
+
export const lookInputSchema = lookFields.superRefine((input, context) => {
|
|
21
|
+
if ((input.url === undefined) === (input.page === undefined))
|
|
22
|
+
context.addIssue({ code: 'custom', path: ['url'], message: 'Give exactly one of url and page.' });
|
|
23
|
+
});
|
|
24
|
+
export const lookOutputSchema = z.object({ images: z.array(z.object({ fileId: z.string(), name: z.string(), atMs: moment })) });
|
|
25
|
+
//# sourceMappingURL=look-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"look-input.js","sourceRoot":"","sources":["../../src/look/look-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEnD,wHAAwH;AACxH,yDAAyD;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,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC,CAAC;AAClK,CAAC,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-look.d.ts","sourceRoot":"","sources":["../../src/look/register-look.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAkBzC,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAkC3C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from '@kvman/sdk';
|
|
2
|
+
import { launchChannel } from "../browser/launch.js";
|
|
3
|
+
import { startBrowser } from "../browser/start-browser.js";
|
|
4
|
+
import { trimOldest } from "../narration/narration-cache.js";
|
|
5
|
+
import { ownPortOf } from "../record/own-port.js";
|
|
6
|
+
import { defaultSize, sourceOf } from "../record/record-source.js";
|
|
7
|
+
import { lookAt } from "./look-at.js";
|
|
8
|
+
import { lookInputSchema, lookOutputSchema } from "./look-input.js";
|
|
9
|
+
// `video look` (plan 16 §16.5 Looking; ADR 0117, 4 and 19): a page's or a website's frames at chosen moments, which the
|
|
10
|
+
// model sees through kvcoder (`images: true`), to check a scene before it is narrated and recorded. The source is
|
|
11
|
+
// checked before a browser starts; the browser is closed when the call ends, fails, or is cancelled. The newest 24
|
|
12
|
+
// frames of the workspace are kept in the kernel's files.
|
|
13
|
+
const keptFrames = 24;
|
|
14
|
+
const frameRowSchema = z.object({ fileId: z.string(), createdAt: z.string() });
|
|
15
|
+
export function registerLook(ctx) {
|
|
16
|
+
ctx.registerCommand('kvvideo.frame.capture', {
|
|
17
|
+
description: "Shows a website's or an HTML page's frames at chosen moments of its clock, to look at a scene before it is recorded.",
|
|
18
|
+
input: lookInputSchema,
|
|
19
|
+
output: lookOutputSchema,
|
|
20
|
+
public: true,
|
|
21
|
+
retries: 0,
|
|
22
|
+
timeoutMs: 120_000,
|
|
23
|
+
handle: async (input) => {
|
|
24
|
+
const ownPort = ownPortOf(process.env['KVMAN_HOME']);
|
|
25
|
+
const source = sourceOf(ctx.job.workspace.path, input, ownPort);
|
|
26
|
+
const device = input.device ?? 'desktop';
|
|
27
|
+
const size = { width: input.width ?? defaultSize[device].width, height: input.height ?? defaultSize[device].height };
|
|
28
|
+
const browser = await startBrowser(await ctx.settings.get('kvvideo.browser'), launchChannel);
|
|
29
|
+
const stop = () => void browser.close();
|
|
30
|
+
ctx.job.signal.addEventListener('abort', stop, { once: true });
|
|
31
|
+
try {
|
|
32
|
+
const frames = await lookAt(browser, { source, ...size, device, ownPort, moments: input.atMs ?? [1000] });
|
|
33
|
+
const images = [];
|
|
34
|
+
for (const [index, frame] of frames.entries()) {
|
|
35
|
+
const name = `look-${String(index + 1)}.jpg`;
|
|
36
|
+
const stored = await ctx.files.write(name, frame.image, 'image/jpeg');
|
|
37
|
+
images.push({ fileId: stored.id, name, atMs: frame.atMs });
|
|
38
|
+
}
|
|
39
|
+
const rows = ctx.store.collection('lookFrames', frameRowSchema);
|
|
40
|
+
for (const image of images)
|
|
41
|
+
await rows.insert({ fileId: image.fileId, createdAt: new Date().toISOString() });
|
|
42
|
+
await trimOldest(rows, ctx.files, keptFrames);
|
|
43
|
+
return { images };
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
ctx.job.signal.removeEventListener('abort', stop);
|
|
47
|
+
await browser.close();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=register-look.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-look.js","sourceRoot":"","sources":["../../src/look/register-look.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,wHAAwH;AACxH,kHAAkH;AAClH,mHAAmH;AACnH,0DAA0D;AAE1D,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE/E,MAAM,UAAU,YAAY,CAAC,GAAQ;IACnC,GAAG,CAAC,eAAe,CAAC,uBAAuB,EAAE;QAC3C,WAAW,EAAE,sHAAsH;QACnI,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,gBAAgB;QACxB,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACtB,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,QAAQ,CAAC,G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E,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC7D,CAAC;gBACD,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;gBAChE,KAAK,MAAM,KAAK,IAAI,MAAM;oBAAE,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;gBAC7G,MAAM,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;gBAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,CAAC;oBAAS,CAAC;gBACT,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAClD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YACxB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-clock.d.ts","sourceRoot":"","sources":["../../src/record/page-clock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAO5C,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAEpF,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,CAWlE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export async function holdPageClock(page) {
|
|
2
|
+
const session = await page.context().newCDPSession(page);
|
|
3
|
+
await session.send('Animation.setPlaybackRate', { playbackRate: 0 });
|
|
4
|
+
return {
|
|
5
|
+
start: async () => {
|
|
6
|
+
await session.send('Animation.setPlaybackRate', { playbackRate: 1 });
|
|
7
|
+
},
|
|
8
|
+
seek: async (ms) => {
|
|
9
|
+
await page.evaluate(`for (const animation of document.getAnimations()) animation.currentTime = ${String(ms)};`);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=page-clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-clock.js","sourceRoot":"","sources":["../../src/record/page-clock.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAU;IAC5C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC;IACrE,OAAO;QACL,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,MAAM,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;YACjB,MAAM,IAAI,CAAC,QAAQ,CAAC,6EAA6E,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAClH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RecordSource } from './recorder.ts';
|
|
2
|
+
export declare const defaultSize: {
|
|
3
|
+
desktop: {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
phone: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function sourceOf(root: string, input: {
|
|
13
|
+
url?: string;
|
|
14
|
+
page?: string;
|
|
15
|
+
}, ownPort: number | null): RecordSource;
|
|
16
|
+
//# sourceMappingURL=record-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-source.d.ts","sourceRoot":"","sources":["../../src/record/record-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAKlD,eAAO,MAAM,WAAW;;;;;;;;;CAAgF,CAAC;AAEzG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY,CAGnH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { inputPath } from "../files/workspace-paths.js";
|
|
2
|
+
import { recordableAddress } from "./address.js";
|
|
3
|
+
// What `record` and `look` open (plan 16 §16.5): a page of the workspace, or a website that isn't kvman's own address,
|
|
4
|
+
// at the device's size unless one is given.
|
|
5
|
+
export const defaultSize = { desktop: { width: 1280, height: 720 }, phone: { width: 390, height: 844 } };
|
|
6
|
+
export function sourceOf(root, input, ownPort) {
|
|
7
|
+
if (input.page !== undefined)
|
|
8
|
+
return { kind: 'page', file: inputPath(root, input.page, ['.html', '.htm']) };
|
|
9
|
+
return { kind: 'site', url: recordableAddress(input.url ?? '', ownPort).href };
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=record-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-source.js","sourceRoot":"","sources":["../../src/record/record-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,uHAAuH;AACvH,4CAA4C;AAE5C,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;AAEzG,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAsC,EAAE,OAAsB;IACnG,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAC5G,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Browser, BrowserContext } from 'playwright-core';
|
|
1
|
+
import type { Browser, BrowserContext, Page } from 'playwright-core';
|
|
2
2
|
import { type Program } from '../programs/run-program.ts';
|
|
3
3
|
import { type Cues } from './narration-cues.ts';
|
|
4
4
|
import type { Action, Step } from './steps.ts';
|
|
@@ -30,5 +30,7 @@ export type Recording = {
|
|
|
30
30
|
};
|
|
31
31
|
/** A fresh browser context for a recording: its size and device, kvman's port aborted, a page's files, the pointer. */
|
|
32
32
|
export declare function recordingContext(browser: Browser, plan: Pick<RecordPlan, 'source' | 'width' | 'height' | 'device' | 'ownPort'>): Promise<BrowserContext>;
|
|
33
|
+
/** Opens the website or the page and waits until it is ready, or fails `kvvideo/STEP_FAILED` with step 0. */
|
|
34
|
+
export declare function openSource(page: Page, source: RecordSource): Promise<void>;
|
|
33
35
|
export declare function record(browser: Browser, plan: RecordPlan): Promise<Recording>;
|
|
34
36
|
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../src/record/recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../src/record/recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAMrE,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAM7D,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQ/C,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,IAAI,MAAM,CAAC;IACd,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAMjF,uHAAuH;AACvH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAa9J;AAED,6GAA6G;AAC7G,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhF;AAgCD,wBAAsB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAwBnF"}
|
package/dist/record/recorder.js
CHANGED
|
@@ -8,6 +8,7 @@ import { recordEncoderArgs } from "./encoder-args.js";
|
|
|
8
8
|
import { frameWriter } from "./frame-writer.js";
|
|
9
9
|
import { waitUntilMs } from "./narration-cues.js";
|
|
10
10
|
import { answerPageRequest, pageAddress, pageOrigin } from "./page-route.js";
|
|
11
|
+
import { holdPageClock } from "./page-clock.js";
|
|
11
12
|
import { waitUntilReady } from "./page-ready.js";
|
|
12
13
|
import { pausesAfter, runStep } from "./run-step.js";
|
|
13
14
|
import { startScreencast } from "./screencast.js";
|
|
@@ -28,7 +29,8 @@ export async function recordingContext(browser, plan) {
|
|
|
28
29
|
await context.addInitScript(cursorScript(plan.device));
|
|
29
30
|
return context;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
/** Opens the website or the page and waits until it is ready, or fails `kvvideo/STEP_FAILED` with step 0. */
|
|
33
|
+
export async function openSource(page, source) {
|
|
32
34
|
const address = source.kind === 'site' ? source.url : pageAddress(source.file);
|
|
33
35
|
try {
|
|
34
36
|
await page.goto(address, { waitUntil: 'load', timeout: 30_000 });
|
|
@@ -74,13 +76,15 @@ async function play(page, plan, startedAt) {
|
|
|
74
76
|
export async function record(browser, plan) {
|
|
75
77
|
const context = await recordingContext(browser, plan);
|
|
76
78
|
const page = await context.newPage();
|
|
77
|
-
await
|
|
79
|
+
const clock = await holdPageClock(page);
|
|
80
|
+
await openSource(page, plan.source);
|
|
78
81
|
const size = { width: plan.width * scale, height: plan.height * scale };
|
|
79
82
|
const video = path.join(plan.folder, 'recording.mp4');
|
|
80
83
|
const stopEncoder = new AbortController();
|
|
81
84
|
const encoder = await startPiped(plan.ffmpeg, recordEncoderArgs(size.width, size.height, video), AbortSignal.any([plan.signal, stopEncoder.signal]));
|
|
82
85
|
try {
|
|
83
86
|
const startedAt = plan.now();
|
|
87
|
+
await clock.start();
|
|
84
88
|
const writer = frameWriter((frame) => encoder.write(frame), startedAt);
|
|
85
89
|
const screencast = await startScreencast(page, size, (frame, atMs) => writer.frame(frame, atMs), plan.now);
|
|
86
90
|
const actions = await play(page, plan, startedAt).finally(() => screencast.stop());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.js","sourceRoot":"","sources":["../../src/record/recorder.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAgB,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAa,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,cAAc,E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G,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;QAChC,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC;YAAE,MAAM,cAAc,CAAC,eAAe,EAAE,8CAA8C,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzK,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACzE,CAAC;YAAS,CAAC;QACT,WAAW,CAAC,KAAK,EAAE,CAAC;QACpB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-record.d.ts","sourceRoot":"","sources":["../../src/record/register-record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"register-record.d.ts","sourceRoot":"","sources":["../../src/record/register-record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAqCtC,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAwC7C"}
|
|
@@ -12,18 +12,16 @@ import { recordableAddress } from "./address.js";
|
|
|
12
12
|
import { cuesOf } from "./narration-cues.js";
|
|
13
13
|
import { ownPortOf } from "./own-port.js";
|
|
14
14
|
import { record } from "./recorder.js";
|
|
15
|
+
import { defaultSize, sourceOf } from "./record-source.js";
|
|
15
16
|
import { recordInputSchema, recordOutputSchema } from "./steps.js";
|
|
16
17
|
// `video record` (plan 16 §16.5): the addresses, the page, the narration, and the outputs are checked before a browser
|
|
17
18
|
// starts; the browser is closed when the call ends, fails, or is cancelled, and the work folder removed. The
|
|
18
19
|
// recording's sidecar is placed beside it (ADR 0115, 31).
|
|
19
|
-
|
|
20
|
-
function sourceOf(root, input, ownPort) {
|
|
20
|
+
function recordSourceOf(root, input, ownPort) {
|
|
21
21
|
for (const step of input.steps ?? [])
|
|
22
22
|
if (step.do === 'goto')
|
|
23
23
|
recordableAddress(step.url, ownPort);
|
|
24
|
-
|
|
25
|
-
return { kind: 'page', file: inputPath(root, input.page, ['.html', '.htm']) };
|
|
26
|
-
return { kind: 'site', url: recordableAddress(input.url ?? '', ownPort).href };
|
|
24
|
+
return sourceOf(root, input, ownPort);
|
|
27
25
|
}
|
|
28
26
|
function cuesFor(root, input) {
|
|
29
27
|
if (input.narration === undefined)
|
|
@@ -49,7 +47,7 @@ export function registerRecord(ctx) {
|
|
|
49
47
|
handle: async (input) => {
|
|
50
48
|
const root = ctx.job.workspace.path;
|
|
51
49
|
const ownPort = ownPortOf(process.env['KVMAN_HOME']);
|
|
52
|
-
const source =
|
|
50
|
+
const source = recordSourceOf(root, input, ownPort);
|
|
53
51
|
const cues = cuesFor(root, input);
|
|
54
52
|
const replace = input.replace === true;
|
|
55
53
|
const output = outputPath(root, input.file, '.mp4', replace);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-record.js","sourceRoot":"","sources":["../../src/record/register-record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,SAAS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AI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;gBACvF,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;gBACpM,WAAW,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACrC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC3B,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC;YACxG,CAAC;oBAAS,CAAC;gBACT,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAClD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;gBACtB,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/record/steps.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from '@kvman/sdk';
|
|
2
|
+
export declare const address: z.ZodString;
|
|
2
3
|
export declare const stepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
4
|
do: z.ZodLiteral<"goto">;
|
|
4
5
|
url: z.ZodString;
|
|
@@ -34,6 +35,7 @@ export declare const stepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
34
35
|
}, z.core.$strict>], "do">;
|
|
35
36
|
/** One step of a recording. */
|
|
36
37
|
export type Step = z.output<typeof stepSchema>;
|
|
38
|
+
export declare const side: z.ZodNumber;
|
|
37
39
|
export declare const recordInputSchema: z.ZodObject<{
|
|
38
40
|
url: z.ZodExactOptional<z.ZodString>;
|
|
39
41
|
page: z.ZodExactOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/record/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/record/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAM/B,eAAO,MAAM,OAAO,aAA8B,CAAC;AAGnD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BASrB,CAAC;AAEH,+BAA+B;AAC/B,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/C,eAAO,MAAM,IAAI,aAAkH,CAAC;AAcpI,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK5B,CAAC;AAEH,2BAA2B;AAC3B,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D,QAAA,MAAM,SAAS;;;;;iBAAwI,CAAC;AAExJ,qDAAqD;AACrD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7C,eAAO,MAAM,YAAY;;;;;;;;;;;iBAMvB,CAAC;AAEH,6DAA6D;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AAEnD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAA2G,CAAC"}
|
package/dist/record/steps.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from '@kvman/sdk';
|
|
|
2
2
|
// A recording's input and answer (plan 16 §16.5): a website or a page of the workspace, up to 200 steps, the size and
|
|
3
3
|
// device, the narration whose caption lines the steps may wait for, and the output.
|
|
4
4
|
const target = z.string().min(1).max(500).describe('A Playwright selector: CSS, text=Save, or role=button[name="Save"]; its first match is used once visible.');
|
|
5
|
-
const address = z.string().min(1).max(2000);
|
|
5
|
+
export const address = z.string().min(1).max(2000);
|
|
6
6
|
const atLine = z.number().int().min(1).max(1000).describe('Start no earlier than this caption line (from 1) of the narration is heard.').exactOptional();
|
|
7
7
|
export const stepSchema = z.discriminatedUnion('do', [
|
|
8
8
|
z.strictObject({ do: z.literal('goto'), url: address.describe('An http or https address to open.'), atLine }),
|
|
@@ -14,7 +14,7 @@ export const stepSchema = z.discriminatedUnion('do', [
|
|
|
14
14
|
z.strictObject({ do: z.literal('wait'), ms: z.number().int().min(0).max(60_000).describe('How long the picture holds.') }),
|
|
15
15
|
z.strictObject({ do: z.literal('waitFor'), target, atLine }),
|
|
16
16
|
]);
|
|
17
|
-
const side = z.number().int().min(320).max(1920).refine((pixels) => pixels % 2 === 0, 'A side is an even number of pixels.');
|
|
17
|
+
export const side = z.number().int().min(320).max(1920).refine((pixels) => pixels % 2 === 0, 'A side is an even number of pixels.');
|
|
18
18
|
const recordFields = z.strictObject({
|
|
19
19
|
url: address.describe('A website to record: any http or https address.').exactOptional(),
|
|
20
20
|
page: z.string().min(1).max(1000).describe('An .html file of the workspace to record, with the files beside it.').exactOptional(),
|
package/dist/record/steps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../src/record/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,sHAAsH;AACtH,oFAAoF;AAEpF,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC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AAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAKxJ,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAChD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACrC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;CAC1B,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
package/docs/guide.md
CHANGED
|
@@ -1,28 +1,46 @@
|
|
|
1
|
-
You can make any kind of video with the `video` connector: a lesson, an explainer, a tutorial of an app or a website, a promotion, an announcement, a story, a social clip. A video is composed, not generated:
|
|
1
|
+
You can make any kind of video with the `video` connector: a lesson, an explainer, a tutorial of an app or a website, a promotion, an announcement, a story, a social clip. A video is composed, not generated: HTML scenes you write and websites, recorded in the installed browser; the person's images and clips, and licensed ones from the web; a narration from a voice service or recorded by the person; captions; joined with ffmpeg. Never generate images. Make it polished unless the person asks otherwise.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Make every video through these stages, in order; each ends with what it gives the next, and a stage the request already settles takes a line (a script the person gave settles the concept). Keep a video's files in its own folder, such as `videos/<name>/`, and the video beside it.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
5
|
+
1. **Ready.** Run `video check`. When ffmpeg or the browser is missing, tell the person in plain words what to install, and stop until it is there: ffmpeg (with libass and libfreetype) from https://ffmpeg.org/download.html; Google Chrome or Microsoft Edge. A narration service is needed only for a video with a voice: when it is the only thing missing, go on and settle the voice in the brief. When the video has a voice (generated, or the person's own, whose examples are generated) and no service is ready, tell the person to choose one on kvvideo's extension page, with its key added there as a secret (`elevenlabs.apiKey` or `openai.apiKey`), or Piper (`pip install piper-tts`) with a voice file, and stop until it is there.
|
|
6
|
+
2. **Brief.** Read everything the person sent, and look at what the video is about (their app, site, or files, and the workspace's brand with `video brand`) before you ask. Then ask in one round only what is still open, your recommendation first in each: what the viewer should know or do after watching, who they are, where it will be shown (this sets the shapes and the length: a social clip is 1080 × 1920, under 60 s, and works on mute), the length, the language, and the voice: generated, the person's own, or none (on-screen text and sound effects only). Write the answers to `brief.md` in the video's folder.
|
|
7
|
+
3. **Research.** Gather the facts with their sources, the person's media, and licensed media from the web, and add them to `brief.md`. When the video shows an app of the workspace, start it in the background with `shell`, walk its flows once in the browser, and note the real labels, the selectors, and the demo data each scene needs: clean, believable data, never the person's private data.
|
|
8
|
+
4. **Concept.** Write the core message in one sentence, the hook of the first 3 s, and the structure, starting from the video's kind:
|
|
9
|
+
- a tutorial: the goal, each step in order, the result, what to do next;
|
|
10
|
+
- an explainer: the problem, why it matters, how it works, an example, a recap;
|
|
11
|
+
- a promotion: a hook, the pain, the product as the answer, proof, the offer and its call to action;
|
|
12
|
+
- an announcement: what is new, why it matters, how to get it;
|
|
13
|
+
- a story: the setting, the turn, the resolution;
|
|
14
|
+
- a social clip: the payoff promised in the first 2 s, delivered fast, then a call to action.
|
|
15
|
+
When the concept is open (a promotion, a story, an explainer without a script, or any video whose angle could go several ways), hand the brief in one `delegate run` to the worker that debates approaches, when the `delegate` entry lists one, asking for two or three directions, the strongest first, each with its hook, structure, and look; then offer them to the person with `ask choice`. Choose the concept yourself for a tutorial of clear steps or a script the person gave. Add the chosen concept to `brief.md`.
|
|
16
|
+
5. **Treatment.** Show the person the whole video before anything costs money:
|
|
17
|
+
- a Markdown artifact: the concept in a line; "Look and sound" (the shapes, the brand, the framing, the caption style, the transitions, the sound effects, and the voice: generated, with its service, tone, and speed, recorded by the person, with what the examples cost, or none); a table with one row per scene: its purpose, its narration, its picture (an HTML scene, a website, an image, or a clip), its on-screen text, its motion, its transition, and its length; then the media from the web with their sources and licences;
|
|
18
|
+
- `style.css` in the video's folder: the colours, fonts, type sizes, spacing, and motion (easing and durations) that every HTML scene uses, from the brand;
|
|
19
|
+
- one or two style frames, the title and a typical scene, as HTML scenes you checked with `video look`, each shown as an HTML artifact with `style.css` copied into a `<style>` element, since an artifact can't load the workspace's files.
|
|
20
|
+
Narration runs about 2.5 words a second in English and 2 in Arabic: each scene's narration fits its length, and the whole is within 10% of the length asked. With no voice, each scene lasts long enough to read its on-screen text, and the whole is within 10% of the length asked. Then ask with `ask choice`, the option that makes the video first and one that changes something. The person's agreement covers everything the treatment lists and is the go-ahead for the production map: never ask it again. When they change something, change the treatment and ask again. Save a new brand with `video brand-set` once they agree.
|
|
21
|
+
6. **Production map.** When the `execution-map` connector is listed, set a map from the treatment: the voice, the scenes, the recordings, the assembly and review, and the delivery, with scenes that can be made at once as parallel steps, and start at once.
|
|
22
|
+
7. **Voice first.** Make each scene's narration before its picture: `narrate`; or, for the person's own voice, `narrate` each sentence as an example, `ask record` with one card per scene (each sentence a line, with the words to stress and where to pause), and `voice` with the takes it answers. The caption times it answers are the clock the picture follows. With no voice, skip this stage.
|
|
23
|
+
8. **Pictures.**
|
|
24
|
+
- **HTML scenes** link `style.css` and move with CSS animations and transitions only, never script timers. Time each element to its words: a page's clock starts when its recording starts and the narration 300 ms later, so an element that comes in with caption line n has an `animation-delay` of 300 ms plus that line's `startMs`. Look at each scene with `video look` at the moments that matter, and fix it before you record it. With four or more HTML scenes besides the style frames, hand them to designer workers of the `delegate` connector, one scene file each, all in the same reply: each brief, titled motion graphics designer, names `brief.md`, `style.css`, and the style frames in its context, gives the scene's row of the treatment and its caption times, and says to check the scene with `video look`; check each again with `video look` when it comes back.
|
|
25
|
+
- **Websites**: `record` with the scene's `narration`, each action at its caption line with `atLine`. Mark where the eye must go with a `callout` or a `highlight` in `compose`, and `blur` anything private.
|
|
26
|
+
- **Images and clips** go to `compose` as they are, a clip's part chosen with `from` and `to`.
|
|
27
|
+
Then `record` each HTML scene with its `narration`.
|
|
28
|
+
- **With no voice**, the on-screen text carries the words: time an HTML scene's elements from the recording's start, record a website with `wait` steps between its actions and no `narration` or `atLine`, give each scene its `durationMs` in `compose`, and leave out captions. The sound effects stay.
|
|
29
|
+
9. **Assemble and review.** `compose`, then `video review`, and look at every sheet against the treatment: each scene says and shows what its row says; actions land on their words; text is spelled right, readable on its background, and inside the middle 90% of the frame; nothing is cut off, overlapping, empty, or badly zoomed; the look is the same in every scene; private data is blurred; credits are there; and the review reports no problem. Fix each fault at its cause and compose again, at most three rounds; after the third, tell the person what is still wrong. With no voice, `silence` and `loudness` problems are expected and aren't faults.
|
|
30
|
+
10. **Deliver.** Make the other shapes the brief needs with `extraSizes`. Tell the person where the file is, its length, and its shapes; the chat shows a player. When they ask for a change at a time ("at 0:42"), find its scene from the video's scene times, make only that scene again, and compose again: unchanged narration comes free from the cache.
|
|
12
31
|
|
|
13
|
-
|
|
32
|
+
How a good video looks and sounds:
|
|
14
33
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
- **Story.** Show rather than tell: the narration explains what the picture can't, and on-screen text is a few words. One idea per scene, in a logical order, ending with the next step or a call to action. No filler, repetition, or long still shots; scenes of 3 to 12 s unless the content needs more.
|
|
35
|
+
- **Look.** The same colours, type, and style in every scene, from `style.css`. For the first video, take the brand from what the person gave or what the video is about (their app's or site's styles, their logo file), or design one. Give each HTML scene a clear hierarchy, alignment, contrast, and space, with important things inside the middle 90% of the frame. Draw titles, diagrams, charts, and illustrations as HTML, CSS, and SVG; use the person's media and licensed media from the web for what drawing can't show. Show a recorded website in a `window` frame, a phone site in a `phone` frame.
|
|
36
|
+
- **Motion.** Let `record` and `compose` move the pointer and the camera. In an HTML scene, enter with an ease-out of 300 to 600 ms, never linear, one thing moving at a time, and kinetic text only for the key words. Use `crossfade` between scenes, `slide` for a step forward in a sequence, and `fade-black` before the ending.
|
|
37
|
+
- **Text.** Short, correctly spelled, readable on its background, and in the video's language. Arabic reads right to left in an Arabic font, with `dir="auto"` on every text element of an HTML scene.
|
|
38
|
+
- **Sound.** When the video has a voice, a clear, natural one whose `tone` and `speed` fit the purpose; names said right through the pronunciation list (`kvvideo.narration.pronunciations`). Sound effects stay on unless the person asks otherwise. There is no music.
|
|
39
|
+
- **Accuracy and licences.** Say only what is true: what the person gave, what was recorded, or what a source read through a connector says; no invented numbers, features, quotes, or claims. Blur emails, keys, names, and other personal data on screen. A font, library, image, or clip from the web is used only under a licence that allows it, saved in the video's folder, with its source and licence in the treatment and its credit in the end scene when the licence asks for one; pin a library's exact version.
|
|
21
40
|
|
|
22
41
|
Rules:
|
|
23
42
|
|
|
24
|
-
-
|
|
43
|
+
- In a chat without `ask` (Decide for me), choose the concept yourself, show the treatment, say what you chose, and go on; the person's voice can't be recorded there, so use a generated one and say so in the treatment.
|
|
25
44
|
- Narrate a sentence again only when it changed; the cache makes an unchanged one free.
|
|
26
|
-
- Put the parts of a video in their own folder, such as `videos/<name>/`, and the video beside it.
|
|
27
45
|
- When the person asks for a font, find it on the web, save its `.ttf` or `.otf` file in the workspace, and name that file.
|
|
28
46
|
- A target in `record` is a Playwright selector: prefer `role=button[name="Save"]` or `text=Save` to CSS classes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvman/kvvideo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "kvvideo: the kvcoder extension that makes any kind of video, from websites and pages recorded in the browser, narrated, and captioned.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@kvman/kvai": "0.1.9",
|
|
41
|
-
"@kvman/kvcoder": "0.1.
|
|
41
|
+
"@kvman/kvcoder": "0.1.23",
|
|
42
42
|
"@kvman/kvwebui": "0.1.8",
|
|
43
43
|
"@kvman/sdk": "0.1.5",
|
|
44
44
|
"@kvman/testkit": "0.1.10",
|
package/dist/compose/srt.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"srt.d.ts","sourceRoot":"","sources":["../../src/compose/srt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAUxD,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAE5D"}
|
package/dist/compose/srt.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// The `.srt` beside a video (plan 16 §16.8; ADR 0115, 18): its captions on the video's time line, numbered from 1, for
|
|
2
|
-
// players and sites that show their own captions.
|
|
3
|
-
function srtTime(ms) {
|
|
4
|
-
const pad = (value, size = 2) => String(value).padStart(size, '0');
|
|
5
|
-
return `${pad(Math.floor(ms / 3_600_000))}:${pad(Math.floor(ms / 60_000) % 60)}:${pad(Math.floor(ms / 1000) % 60)},${pad(ms % 1000, 3)}`;
|
|
6
|
-
}
|
|
7
|
-
export function srtFile(captions) {
|
|
8
|
-
return captions.map((caption, index) => `${String(index + 1)}\n${srtTime(caption.startMs)} --> ${srtTime(caption.endMs)}\n${caption.text.replace(/\s+/g, ' ').trim()}\n`).join('\n');
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=srt.js.map
|
package/dist/compose/srt.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"srt.js","sourceRoot":"","sources":["../../src/compose/srt.ts"],"names":[],"mappings":"AAEA,uHAAuH;AACvH,kDAAkD;AAElD,SAAS,OAAO,CAAC,EAAU;IACzB,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,IAAI,GAAG,CAAC,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACnF,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AAC3I,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,QAA4B;IAClD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvL,CAAC"}
|