screencli 0.1.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/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +14 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/src/agent/loop.d.ts +21 -0
- package/dist/src/agent/loop.d.ts.map +1 -0
- package/dist/src/agent/loop.js +119 -0
- package/dist/src/agent/loop.js.map +1 -0
- package/dist/src/agent/system-prompt.d.ts +2 -0
- package/dist/src/agent/system-prompt.d.ts.map +1 -0
- package/dist/src/agent/system-prompt.js +43 -0
- package/dist/src/agent/system-prompt.js.map +1 -0
- package/dist/src/agent/tool-handlers.d.ts +44 -0
- package/dist/src/agent/tool-handlers.d.ts.map +1 -0
- package/dist/src/agent/tool-handlers.js +242 -0
- package/dist/src/agent/tool-handlers.js.map +1 -0
- package/dist/src/agent/tools.d.ts +5 -0
- package/dist/src/agent/tools.d.ts.map +1 -0
- package/dist/src/agent/tools.js +251 -0
- package/dist/src/agent/tools.js.map +1 -0
- package/dist/src/browser/accessibility.d.ts +28 -0
- package/dist/src/browser/accessibility.d.ts.map +1 -0
- package/dist/src/browser/accessibility.js +47 -0
- package/dist/src/browser/accessibility.js.map +1 -0
- package/dist/src/browser/actions.d.ts +32 -0
- package/dist/src/browser/actions.d.ts.map +1 -0
- package/dist/src/browser/actions.js +122 -0
- package/dist/src/browser/actions.js.map +1 -0
- package/dist/src/browser/auth.d.ts +12 -0
- package/dist/src/browser/auth.d.ts.map +1 -0
- package/dist/src/browser/auth.js +53 -0
- package/dist/src/browser/auth.js.map +1 -0
- package/dist/src/browser/resolve-locator.d.ts +15 -0
- package/dist/src/browser/resolve-locator.d.ts.map +1 -0
- package/dist/src/browser/resolve-locator.js +27 -0
- package/dist/src/browser/resolve-locator.js.map +1 -0
- package/dist/src/browser/session.d.ts +16 -0
- package/dist/src/browser/session.d.ts.map +1 -0
- package/dist/src/browser/session.js +47 -0
- package/dist/src/browser/session.js.map +1 -0
- package/dist/src/cli/commands/export.d.ts +3 -0
- package/dist/src/cli/commands/export.d.ts.map +1 -0
- package/dist/src/cli/commands/export.js +76 -0
- package/dist/src/cli/commands/export.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts +8 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -0
- package/dist/src/cli/commands/init.js +64 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/record.d.ts +3 -0
- package/dist/src/cli/commands/record.d.ts.map +1 -0
- package/dist/src/cli/commands/record.js +215 -0
- package/dist/src/cli/commands/record.js.map +1 -0
- package/dist/src/cli/options.d.ts +24 -0
- package/dist/src/cli/options.d.ts.map +1 -0
- package/dist/src/cli/options.js +35 -0
- package/dist/src/cli/options.js.map +1 -0
- package/dist/src/cli/output.d.ts +10 -0
- package/dist/src/cli/output.d.ts.map +1 -0
- package/dist/src/cli/output.js +29 -0
- package/dist/src/cli/output.js.map +1 -0
- package/dist/src/export/exporter.d.ts +16 -0
- package/dist/src/export/exporter.d.ts.map +1 -0
- package/dist/src/export/exporter.js +66 -0
- package/dist/src/export/exporter.js.map +1 -0
- package/dist/src/export/gif.d.ts +3 -0
- package/dist/src/export/gif.d.ts.map +1 -0
- package/dist/src/export/gif.js +36 -0
- package/dist/src/export/gif.js.map +1 -0
- package/dist/src/export/presets.d.ts +4 -0
- package/dist/src/export/presets.d.ts.map +1 -0
- package/dist/src/export/presets.js +68 -0
- package/dist/src/export/presets.js.map +1 -0
- package/dist/src/export/smart-crop.d.ts +10 -0
- package/dist/src/export/smart-crop.d.ts.map +1 -0
- package/dist/src/export/smart-crop.js +50 -0
- package/dist/src/export/smart-crop.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/recording/chapters.d.ts +3 -0
- package/dist/src/recording/chapters.d.ts.map +1 -0
- package/dist/src/recording/chapters.js +37 -0
- package/dist/src/recording/chapters.js.map +1 -0
- package/dist/src/recording/event-log.d.ts +20 -0
- package/dist/src/recording/event-log.d.ts.map +1 -0
- package/dist/src/recording/event-log.js +37 -0
- package/dist/src/recording/event-log.js.map +1 -0
- package/dist/src/recording/metadata.d.ts +4 -0
- package/dist/src/recording/metadata.d.ts.map +1 -0
- package/dist/src/recording/metadata.js +8 -0
- package/dist/src/recording/metadata.js.map +1 -0
- package/dist/src/recording/types.d.ts +81 -0
- package/dist/src/recording/types.d.ts.map +1 -0
- package/dist/src/recording/types.js +2 -0
- package/dist/src/recording/types.js.map +1 -0
- package/dist/src/utils/config.d.ts +13 -0
- package/dist/src/utils/config.d.ts.map +1 -0
- package/dist/src/utils/config.js +37 -0
- package/dist/src/utils/config.js.map +1 -0
- package/dist/src/utils/errors.d.ts +20 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/errors.js +39 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/logger.d.ts +9 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +40 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/paths.d.ts +9 -0
- package/dist/src/utils/paths.d.ts.map +1 -0
- package/dist/src/utils/paths.js +28 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/video/background.d.ts +39 -0
- package/dist/src/video/background.d.ts.map +1 -0
- package/dist/src/video/background.js +141 -0
- package/dist/src/video/background.js.map +1 -0
- package/dist/src/video/compose.d.ts +14 -0
- package/dist/src/video/compose.d.ts.map +1 -0
- package/dist/src/video/compose.js +149 -0
- package/dist/src/video/compose.js.map +1 -0
- package/dist/src/video/cursor.d.ts +10 -0
- package/dist/src/video/cursor.d.ts.map +1 -0
- package/dist/src/video/cursor.js +31 -0
- package/dist/src/video/cursor.js.map +1 -0
- package/dist/src/video/ffmpeg.d.ts +10 -0
- package/dist/src/video/ffmpeg.d.ts.map +1 -0
- package/dist/src/video/ffmpeg.js +71 -0
- package/dist/src/video/ffmpeg.js.map +1 -0
- package/dist/src/video/highlight.d.ts +3 -0
- package/dist/src/video/highlight.d.ts.map +1 -0
- package/dist/src/video/highlight.js +21 -0
- package/dist/src/video/highlight.js.map +1 -0
- package/dist/src/video/trim.d.ts +19 -0
- package/dist/src/video/trim.d.ts.map +1 -0
- package/dist/src/video/trim.js +47 -0
- package/dist/src/video/trim.js.map +1 -0
- package/dist/src/video/zoom.d.ts +11 -0
- package/dist/src/video/zoom.d.ts.map +1 -0
- package/dist/src/video/zoom.js +88 -0
- package/dist/src/video/zoom.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { getPreset } from './presets.js';
|
|
3
|
+
import { computeSmartCrop, buildCropFilter } from './smart-crop.js';
|
|
4
|
+
import { exportGif } from './gif.js';
|
|
5
|
+
import { runFFmpeg } from '../video/ffmpeg.js';
|
|
6
|
+
import { buildBackgroundFilterComplex, computeFitLayout } from '../video/background.js';
|
|
7
|
+
import { logger } from '../utils/logger.js';
|
|
8
|
+
export async function runExport(options) {
|
|
9
|
+
const preset = getPreset(options.presetName);
|
|
10
|
+
const ext = preset.format === 'gif' ? 'gif' : 'mp4';
|
|
11
|
+
const outputPath = options.outputPath ?? join(options.outputDir, `${preset.name}.${ext}`);
|
|
12
|
+
logger.info(`Exporting with preset: ${preset.name} (${preset.width}x${preset.height})`);
|
|
13
|
+
// Compute smart crop for aspect ratio conversion
|
|
14
|
+
const crop = computeSmartCrop(options.events, options.metadata.viewport, preset);
|
|
15
|
+
const cropFilter = buildCropFilter(crop, preset);
|
|
16
|
+
if (preset.format === 'gif') {
|
|
17
|
+
await exportGif(options.sourceVideo, outputPath, preset, cropFilter);
|
|
18
|
+
return outputPath;
|
|
19
|
+
}
|
|
20
|
+
// MP4 export
|
|
21
|
+
if (options.background) {
|
|
22
|
+
// With background: fit video inside gradient at preset dimensions
|
|
23
|
+
const outputVP = { width: preset.width, height: preset.height };
|
|
24
|
+
const layout = computeFitLayout(options.metadata.viewport, outputVP, options.background.padding);
|
|
25
|
+
const fc = buildBackgroundFilterComplex([], outputVP, options.background, layout);
|
|
26
|
+
logger.info(`Applying ${options.background.gradient} background at ${preset.width}x${preset.height}`);
|
|
27
|
+
const args = [
|
|
28
|
+
'-map', '[out]',
|
|
29
|
+
'-c:v', preset.codec,
|
|
30
|
+
'-preset', 'fast',
|
|
31
|
+
'-crf', '23',
|
|
32
|
+
'-pix_fmt', 'yuv420p',
|
|
33
|
+
'-r', String(preset.fps),
|
|
34
|
+
];
|
|
35
|
+
if (preset.max_duration_s) {
|
|
36
|
+
args.push('-t', String(preset.max_duration_s));
|
|
37
|
+
}
|
|
38
|
+
await runFFmpeg({
|
|
39
|
+
input: options.sourceVideo,
|
|
40
|
+
output: outputPath,
|
|
41
|
+
filterComplex: fc,
|
|
42
|
+
outputArgs: args,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const filters = [cropFilter];
|
|
47
|
+
const args = [
|
|
48
|
+
'-vf', filters.join(','),
|
|
49
|
+
'-c:v', preset.codec,
|
|
50
|
+
'-preset', 'fast',
|
|
51
|
+
'-crf', '23',
|
|
52
|
+
'-pix_fmt', 'yuv420p',
|
|
53
|
+
'-r', String(preset.fps),
|
|
54
|
+
];
|
|
55
|
+
if (preset.max_duration_s) {
|
|
56
|
+
args.push('-t', String(preset.max_duration_s));
|
|
57
|
+
}
|
|
58
|
+
await runFFmpeg({
|
|
59
|
+
input: options.sourceVideo,
|
|
60
|
+
output: outputPath,
|
|
61
|
+
outputArgs: args,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return outputPath;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=exporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../../src/export/exporter.ts"],"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AAC,GAAG,CAAC;YACxB,MAAM,EAAE,MAAM,CAAC,KAAK;YACpB,SAAS,EAAE,MAAM;YACjB,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,SAAS;YACrB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;SACzB,CAAC;QAEF,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,SAAS,CAAC;YACd,KAAK,EAAE,OAAO,CAAC,WAAW;YAC1B,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gif.d.ts","sourceRoot":"","sources":["../../../src/export/gif.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,wBAAsB,SAAS,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,YAAY,EACpB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAmCf"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { runFFmpeg } from '../video/ffmpeg.js';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
export async function exportGif(inputPath, outputPath, preset, cropFilter) {
|
|
4
|
+
const palettePath = join(dirname(outputPath), '_palette.png');
|
|
5
|
+
const baseFilter = cropFilter
|
|
6
|
+
? `${cropFilter},fps=${preset.fps}`
|
|
7
|
+
: `scale=${preset.width}:${preset.height},fps=${preset.fps}`;
|
|
8
|
+
// Pass 1: Generate palette
|
|
9
|
+
await runFFmpeg({
|
|
10
|
+
input: inputPath,
|
|
11
|
+
output: palettePath,
|
|
12
|
+
outputArgs: [
|
|
13
|
+
'-vf', `${baseFilter},palettegen=stats_mode=diff`,
|
|
14
|
+
...(preset.max_duration_s ? ['-t', String(preset.max_duration_s)] : []),
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
// Pass 2: Use palette to create GIF
|
|
18
|
+
await runFFmpeg({
|
|
19
|
+
input: inputPath,
|
|
20
|
+
output: outputPath,
|
|
21
|
+
outputArgs: [
|
|
22
|
+
'-i', palettePath,
|
|
23
|
+
'-lavfi', `${baseFilter}[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=3`,
|
|
24
|
+
...(preset.max_duration_s ? ['-t', String(preset.max_duration_s)] : []),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
// Clean up palette
|
|
28
|
+
try {
|
|
29
|
+
const { unlinkSync } = await import('node:fs');
|
|
30
|
+
unlinkSync(palettePath);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// ignore
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=gif.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gif.js","sourceRoot":"","sources":["../../../src/export/gif.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,SAAiB,EACjB,UAAkB,EAClB,MAAoB,EACpB,UAAmB;IAEnB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;IAE9D,MAAM,UAAU,GAAG,UAAU;QAC3B,CAAC,CAAC,GAAG,UAAU,QAAQ,MAAM,CAAC,GAAG,EAAE;QACnC,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,QAAQ,MAAM,CAAC,GAAG,EAAE,CAAC;IAE/D,2BAA2B;IAC3B,MAAM,SAAS,CAAC;QACd,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE;YACV,KAAK,EAAE,GAAG,UAAU,6BAA6B;YACjD,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACxE;KACF,CAAC,CAAC;IAEH,oCAAoC;IACpC,MAAM,SAAS,CAAC;QACd,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE;YACV,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,GAAG,UAAU,mDAAmD;YAC1E,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACxE;KACF,CAAC,CAAC;IAEH,mBAAmB;IACnB,IAAI,CAAC;QACH,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;QAC/C,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/export/presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA2DhD,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAMpD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const presets = {
|
|
2
|
+
youtube: {
|
|
3
|
+
name: 'youtube',
|
|
4
|
+
aspect_ratio: [16, 9],
|
|
5
|
+
width: 1920,
|
|
6
|
+
height: 1080,
|
|
7
|
+
format: 'mp4',
|
|
8
|
+
codec: 'libx264',
|
|
9
|
+
fps: 30,
|
|
10
|
+
},
|
|
11
|
+
twitter: {
|
|
12
|
+
name: 'twitter',
|
|
13
|
+
aspect_ratio: [16, 9],
|
|
14
|
+
width: 1280,
|
|
15
|
+
height: 720,
|
|
16
|
+
format: 'mp4',
|
|
17
|
+
codec: 'libx264',
|
|
18
|
+
fps: 30,
|
|
19
|
+
max_duration_s: 140,
|
|
20
|
+
},
|
|
21
|
+
instagram: {
|
|
22
|
+
name: 'instagram',
|
|
23
|
+
aspect_ratio: [9, 16],
|
|
24
|
+
width: 1080,
|
|
25
|
+
height: 1920,
|
|
26
|
+
format: 'mp4',
|
|
27
|
+
codec: 'libx264',
|
|
28
|
+
fps: 30,
|
|
29
|
+
max_duration_s: 90,
|
|
30
|
+
},
|
|
31
|
+
tiktok: {
|
|
32
|
+
name: 'tiktok',
|
|
33
|
+
aspect_ratio: [9, 16],
|
|
34
|
+
width: 1080,
|
|
35
|
+
height: 1920,
|
|
36
|
+
format: 'mp4',
|
|
37
|
+
codec: 'libx264',
|
|
38
|
+
fps: 30,
|
|
39
|
+
},
|
|
40
|
+
linkedin: {
|
|
41
|
+
name: 'linkedin',
|
|
42
|
+
aspect_ratio: [1, 1],
|
|
43
|
+
width: 1080,
|
|
44
|
+
height: 1080,
|
|
45
|
+
format: 'mp4',
|
|
46
|
+
codec: 'libx264',
|
|
47
|
+
fps: 30,
|
|
48
|
+
},
|
|
49
|
+
'github-gif': {
|
|
50
|
+
name: 'github-gif',
|
|
51
|
+
aspect_ratio: [16, 9],
|
|
52
|
+
width: 800,
|
|
53
|
+
height: 450,
|
|
54
|
+
format: 'gif',
|
|
55
|
+
codec: 'gif',
|
|
56
|
+
fps: 15,
|
|
57
|
+
max_duration_s: 12,
|
|
58
|
+
max_file_size_bytes: 8 * 1024 * 1024,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export function getPreset(name) {
|
|
62
|
+
const preset = presets[name];
|
|
63
|
+
if (!preset) {
|
|
64
|
+
throw new Error(`Unknown preset: ${name}. Available: ${Object.keys(presets).join(', ')}`);
|
|
65
|
+
}
|
|
66
|
+
return preset;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../src/export/presets.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAiC;IACnD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACrB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,EAAE;KACR;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACrB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,EAAE;QACP,cAAc,EAAE,GAAG;KACpB;IACD,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACrB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,EAAE;QACP,cAAc,EAAE,EAAE;KACnB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;QACrB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,EAAE;KACR;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACpB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,EAAE;KACR;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACrB,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,EAAE;QACP,cAAc,EAAE,EAAE;QAClB,mBAAmB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;KACrC;CACF,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,gBAAgB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5F,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RecordingEvent, Viewport, ExportPreset } from '../recording/types.js';
|
|
2
|
+
export interface CropWindow {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function computeSmartCrop(events: RecordingEvent[], sourceViewport: Viewport, preset: ExportPreset): CropWindow;
|
|
9
|
+
export declare function buildCropFilter(crop: CropWindow, preset: ExportPreset): string;
|
|
10
|
+
//# sourceMappingURL=smart-crop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-crop.d.ts","sourceRoot":"","sources":["../../../src/export/smart-crop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEpF,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,cAAc,EAAE,EACxB,cAAc,EAAE,QAAQ,EACxB,MAAM,EAAE,YAAY,GACnB,UAAU,CAqDZ;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAE9E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export function computeSmartCrop(events, sourceViewport, preset) {
|
|
2
|
+
const targetAspect = preset.aspect_ratio[0] / preset.aspect_ratio[1];
|
|
3
|
+
const sourceAspect = sourceViewport.width / sourceViewport.height;
|
|
4
|
+
// If same aspect ratio, no crop needed
|
|
5
|
+
if (Math.abs(targetAspect - sourceAspect) < 0.01) {
|
|
6
|
+
return { x: 0, y: 0, width: sourceViewport.width, height: sourceViewport.height };
|
|
7
|
+
}
|
|
8
|
+
// Calculate crop dimensions maintaining target aspect ratio
|
|
9
|
+
let cropW;
|
|
10
|
+
let cropH;
|
|
11
|
+
if (targetAspect < sourceAspect) {
|
|
12
|
+
// Target is taller (e.g. 9:16) — crop width
|
|
13
|
+
cropH = sourceViewport.height;
|
|
14
|
+
cropW = Math.round(cropH * targetAspect);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
// Target is wider — crop height
|
|
18
|
+
cropW = sourceViewport.width;
|
|
19
|
+
cropH = Math.round(cropW / targetAspect);
|
|
20
|
+
}
|
|
21
|
+
// Find average focus point from events with bounding boxes
|
|
22
|
+
const eventsWithBoxes = events.filter((e) => e.bounding_box);
|
|
23
|
+
let focusX = sourceViewport.width / 2;
|
|
24
|
+
let focusY = sourceViewport.height / 2;
|
|
25
|
+
if (eventsWithBoxes.length > 0) {
|
|
26
|
+
let totalWeight = 0;
|
|
27
|
+
let weightedX = 0;
|
|
28
|
+
let weightedY = 0;
|
|
29
|
+
for (let i = 0; i < eventsWithBoxes.length; i++) {
|
|
30
|
+
const box = eventsWithBoxes[i].bounding_box;
|
|
31
|
+
// Weight recent events more heavily
|
|
32
|
+
const weight = (i + 1) / eventsWithBoxes.length;
|
|
33
|
+
weightedX += (box.x + box.width / 2) * weight;
|
|
34
|
+
weightedY += (box.y + box.height / 2) * weight;
|
|
35
|
+
totalWeight += weight;
|
|
36
|
+
}
|
|
37
|
+
focusX = weightedX / totalWeight;
|
|
38
|
+
focusY = weightedY / totalWeight;
|
|
39
|
+
}
|
|
40
|
+
// Center crop on focus point, clamped to viewport
|
|
41
|
+
let cropX = Math.round(focusX - cropW / 2);
|
|
42
|
+
let cropY = Math.round(focusY - cropH / 2);
|
|
43
|
+
cropX = Math.max(0, Math.min(cropX, sourceViewport.width - cropW));
|
|
44
|
+
cropY = Math.max(0, Math.min(cropY, sourceViewport.height - cropH));
|
|
45
|
+
return { x: cropX, y: cropY, width: cropW, height: cropH };
|
|
46
|
+
}
|
|
47
|
+
export function buildCropFilter(crop, preset) {
|
|
48
|
+
return `crop=${crop.width}:${crop.height}:${crop.x}:${crop.y},scale=${preset.width}:${preset.height}`;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=smart-crop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-crop.js","sourceRoot":"","sources":["../../../src/export/smart-crop.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,gBAAgB,CAC9B,MAAwB,EACxB,cAAwB,EACxB,MAAoB;IAEpB,MAAM,YAAY,GAAG,MAAM,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C,IAAgB,EAAE,MAAoB;IACpE,OAAO,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { runAgentLoop, type AgentLoopOptions, type AgentLoopResult } from './agent/loop.js';
|
|
2
|
+
export { launchSession, type BrowserSession } from './browser/session.js';
|
|
3
|
+
export { EventLog } from './recording/event-log.js';
|
|
4
|
+
export { writeMetadata, readMetadata } from './recording/metadata.js';
|
|
5
|
+
export { deriveChapters } from './recording/chapters.js';
|
|
6
|
+
export { composeVideo, type ComposeOptions } from './video/compose.js';
|
|
7
|
+
export { runExport, type ExportRunOptions } from './export/exporter.js';
|
|
8
|
+
export { getPreset, presets } from './export/presets.js';
|
|
9
|
+
export type { RecordingEvent, RecordingMetadata, ExportPreset, RecordOptions, ExportOptions, Viewport, BoundingBox, Chapter, AgentStats, } from './recording/types.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,QAAQ,EACR,WAAW,EACX,OAAO,EACP,UAAU,GACX,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { runAgentLoop } from './agent/loop.js';
|
|
2
|
+
export { launchSession } from './browser/session.js';
|
|
3
|
+
export { EventLog } from './recording/event-log.js';
|
|
4
|
+
export { writeMetadata, readMetadata } from './recording/metadata.js';
|
|
5
|
+
export { deriveChapters } from './recording/chapters.js';
|
|
6
|
+
export { composeVideo } from './video/compose.js';
|
|
7
|
+
export { runExport } from './export/exporter.js';
|
|
8
|
+
export { getPreset, presets } from './export/presets.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+C,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAuB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAuB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chapters.d.ts","sourceRoot":"","sources":["../../../src/recording/chapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1D,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,EAAE,CAyClE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function deriveChapters(events) {
|
|
2
|
+
if (events.length === 0)
|
|
3
|
+
return [];
|
|
4
|
+
const chapters = [];
|
|
5
|
+
const narrations = events.filter((e) => e.type === 'narrate');
|
|
6
|
+
if (narrations.length === 0) {
|
|
7
|
+
// No narrations — create one chapter per navigation event, or a single chapter
|
|
8
|
+
const navigations = events.filter((e) => e.type === 'navigate');
|
|
9
|
+
if (navigations.length <= 1) {
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
start_ms: 0,
|
|
13
|
+
end_ms: events[events.length - 1].timestamp_ms,
|
|
14
|
+
title: events[0]?.description ?? 'Recording',
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
for (let i = 0; i < navigations.length; i++) {
|
|
19
|
+
const start = navigations[i].timestamp_ms;
|
|
20
|
+
const end = i < navigations.length - 1
|
|
21
|
+
? navigations[i + 1].timestamp_ms
|
|
22
|
+
: events[events.length - 1].timestamp_ms;
|
|
23
|
+
chapters.push({ start_ms: start, end_ms: end, title: navigations[i].description });
|
|
24
|
+
}
|
|
25
|
+
return chapters;
|
|
26
|
+
}
|
|
27
|
+
// Use narration events as chapter boundaries
|
|
28
|
+
for (let i = 0; i < narrations.length; i++) {
|
|
29
|
+
const start = narrations[i].timestamp_ms;
|
|
30
|
+
const end = i < narrations.length - 1
|
|
31
|
+
? narrations[i + 1].timestamp_ms
|
|
32
|
+
: events[events.length - 1].timestamp_ms;
|
|
33
|
+
chapters.push({ start_ms: start, end_ms: end, title: narrations[i].value ?? narrations[i].description });
|
|
34
|
+
}
|
|
35
|
+
return chapters;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=chapters.js.map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QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,6CAA6C;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAE,CAAC,YAAY,CAAC;QAC1C,MAAM,GAAG,GACP,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC;YACvB,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,YAAY;YACjC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,YAAY,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAE,CAAC,KAAK,IAAI,UAAU,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7G,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RecordingEvent, EventType, BoundingBox, Viewport } from './types.js';
|
|
2
|
+
export declare class EventLog {
|
|
3
|
+
private filePath;
|
|
4
|
+
private events;
|
|
5
|
+
private startTime;
|
|
6
|
+
private nextId;
|
|
7
|
+
constructor(filePath: string);
|
|
8
|
+
append(params: {
|
|
9
|
+
type: EventType;
|
|
10
|
+
description: string;
|
|
11
|
+
bounding_box?: BoundingBox;
|
|
12
|
+
viewport: Viewport;
|
|
13
|
+
value?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
}): RecordingEvent;
|
|
16
|
+
getEvents(): RecordingEvent[];
|
|
17
|
+
getDurationMs(): number;
|
|
18
|
+
flush(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=event-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-log.d.ts","sourceRoot":"","sources":["../../../src/recording/event-log.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEnF,qBAAa,QAAQ;IAKP,OAAO,CAAC,QAAQ;IAJ5B,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAK;gBAEC,QAAQ,EAAE,MAAM;IAIpC,MAAM,CAAC,MAAM,EAAE;QACb,IAAI,EAAE,SAAS,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,WAAW,CAAC;QAC3B,QAAQ,EAAE,QAAQ,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,cAAc;IAelB,SAAS,IAAI,cAAc,EAAE;IAI7B,aAAa,IAAI,MAAM;IAKvB,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { writeFileSync } from 'node:fs';
|
|
2
|
+
export class EventLog {
|
|
3
|
+
filePath;
|
|
4
|
+
events = [];
|
|
5
|
+
startTime;
|
|
6
|
+
nextId = 1;
|
|
7
|
+
constructor(filePath) {
|
|
8
|
+
this.filePath = filePath;
|
|
9
|
+
this.startTime = Date.now();
|
|
10
|
+
}
|
|
11
|
+
append(params) {
|
|
12
|
+
const event = {
|
|
13
|
+
id: this.nextId++,
|
|
14
|
+
timestamp_ms: Date.now() - this.startTime,
|
|
15
|
+
type: params.type,
|
|
16
|
+
description: params.description,
|
|
17
|
+
viewport: params.viewport,
|
|
18
|
+
bounding_box: params.bounding_box,
|
|
19
|
+
value: params.value,
|
|
20
|
+
url: params.url,
|
|
21
|
+
};
|
|
22
|
+
this.events.push(event);
|
|
23
|
+
return event;
|
|
24
|
+
}
|
|
25
|
+
getEvents() {
|
|
26
|
+
return [...this.events];
|
|
27
|
+
}
|
|
28
|
+
getDurationMs() {
|
|
29
|
+
if (this.events.length === 0)
|
|
30
|
+
return 0;
|
|
31
|
+
return this.events[this.events.length - 1].timestamp_ms;
|
|
32
|
+
}
|
|
33
|
+
flush() {
|
|
34
|
+
writeFileSync(this.filePath, JSON.stringify(this.events, null, 2));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=event-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-log.js","sourceRoot":"","sources":["../../../src/recording/event-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,OAAO,QAAQ;IAKC;IAJZ,MAAM,GAAqB,EAAE,CAAC;IAC9B,SAAS,CAAS;IAClB,MAAM,GAAG,CAAC,CAAC;IAEnB,YAAoB,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,MAON;QACC,MAAM,KAAK,GAAmB;YAC5B,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;YACjB,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS;YACzC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,GAAG,EAAE,MAAM,CAAC,GAAG;SAChB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS;QACP,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,YAAY,CAAC;IAC3D,CAAC;IAED,KAAK;QACH,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/recording/metadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAE7E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAE5D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { writeFileSync, readFileSync } from 'node:fs';
|
|
2
|
+
export function writeMetadata(path, metadata) {
|
|
3
|
+
writeFileSync(path, JSON.stringify(metadata, null, 2));
|
|
4
|
+
}
|
|
5
|
+
export function readMetadata(path) {
|
|
6
|
+
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/recording/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGtD,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,QAA2B;IACrE,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface BoundingBox {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Viewport {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export type EventType = 'click' | 'type' | 'scroll' | 'hover' | 'navigate' | 'wait' | 'press_key' | 'select_option' | 'narrate' | 'done';
|
|
12
|
+
export interface RecordingEvent {
|
|
13
|
+
id: number;
|
|
14
|
+
timestamp_ms: number;
|
|
15
|
+
type: EventType;
|
|
16
|
+
bounding_box?: BoundingBox;
|
|
17
|
+
viewport: Viewport;
|
|
18
|
+
description: string;
|
|
19
|
+
value?: string;
|
|
20
|
+
url?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface Chapter {
|
|
23
|
+
start_ms: number;
|
|
24
|
+
end_ms: number;
|
|
25
|
+
title: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AgentStats {
|
|
28
|
+
total_actions: number;
|
|
29
|
+
input_tokens: number;
|
|
30
|
+
output_tokens: number;
|
|
31
|
+
}
|
|
32
|
+
export interface RecordingMetadata {
|
|
33
|
+
id: string;
|
|
34
|
+
created_at: string;
|
|
35
|
+
url: string;
|
|
36
|
+
prompt: string;
|
|
37
|
+
model: string;
|
|
38
|
+
viewport: Viewport;
|
|
39
|
+
duration_ms: number;
|
|
40
|
+
raw_video_path: string;
|
|
41
|
+
event_log_path: string;
|
|
42
|
+
chapters: Chapter[];
|
|
43
|
+
agent_stats: AgentStats;
|
|
44
|
+
}
|
|
45
|
+
export interface ExportPreset {
|
|
46
|
+
name: string;
|
|
47
|
+
aspect_ratio: [number, number];
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
format: 'mp4' | 'webm' | 'gif';
|
|
51
|
+
codec: string;
|
|
52
|
+
fps: number;
|
|
53
|
+
max_duration_s?: number;
|
|
54
|
+
max_file_size_bytes?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface RecordOptions {
|
|
57
|
+
url: string;
|
|
58
|
+
prompt: string;
|
|
59
|
+
output: string;
|
|
60
|
+
viewport: Viewport;
|
|
61
|
+
model: string;
|
|
62
|
+
headless: boolean;
|
|
63
|
+
slowMo: number;
|
|
64
|
+
maxSteps: number;
|
|
65
|
+
}
|
|
66
|
+
export interface BackgroundConfig {
|
|
67
|
+
gradient: string;
|
|
68
|
+
padding: number;
|
|
69
|
+
cornerRadius: number;
|
|
70
|
+
shadow: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface ExportOptions {
|
|
73
|
+
recordingDir: string;
|
|
74
|
+
preset: string;
|
|
75
|
+
zoom: boolean;
|
|
76
|
+
highlight: boolean;
|
|
77
|
+
cursor: boolean;
|
|
78
|
+
output?: string;
|
|
79
|
+
background?: BackgroundConfig;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/recording/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAA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AM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/recording/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface AppConfig {
|
|
2
|
+
anthropicApiKey: string;
|
|
3
|
+
defaultModel: string;
|
|
4
|
+
defaultViewport: {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
actionDelayMs: number;
|
|
9
|
+
}
|
|
10
|
+
/** Returns true when a valid API key is available. */
|
|
11
|
+
export declare function isConfigured(): boolean;
|
|
12
|
+
export declare function loadConfig(): AppConfig;
|
|
13
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,SAAS;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,aAAa,EAAE,MAAM,CAAC;CACvB;AAcD,sDAAsD;AACtD,wBAAgB,YAAY,IAAI,OAAO,CAItC;AAED,wBAAgB,UAAU,IAAI,SAAS,CAetC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { ConfigError } from './errors.js';
|
|
5
|
+
const CONFIG_DIR = join(homedir(), '.screencli');
|
|
6
|
+
const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
|
|
7
|
+
function loadFileConfig() {
|
|
8
|
+
if (!existsSync(CONFIG_FILE))
|
|
9
|
+
return {};
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(readFileSync(CONFIG_FILE, 'utf-8'));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** Returns true when a valid API key is available. */
|
|
18
|
+
export function isConfigured() {
|
|
19
|
+
if (process.env['ANTHROPIC_API_KEY'])
|
|
20
|
+
return true;
|
|
21
|
+
const file = loadFileConfig();
|
|
22
|
+
return !!file.anthropicApiKey;
|
|
23
|
+
}
|
|
24
|
+
export function loadConfig() {
|
|
25
|
+
const file = loadFileConfig();
|
|
26
|
+
const apiKey = process.env['ANTHROPIC_API_KEY'] ?? file.anthropicApiKey;
|
|
27
|
+
if (!apiKey) {
|
|
28
|
+
throw new ConfigError('Missing ANTHROPIC_API_KEY. Run `screencli init` to configure, or set it as an environment variable.');
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
anthropicApiKey: apiKey,
|
|
32
|
+
defaultModel: file.defaultModel ?? 'claude-sonnet-4-20250514',
|
|
33
|
+
defaultViewport: file.defaultViewport ?? { width: 1920, height: 1080 },
|
|
34
|
+
actionDelayMs: file.actionDelayMs ?? 400,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAEpD,SAAS,cAAc;IACrB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,YAAY;IAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAAE,OAAO,IAAI,CAAC;IAClD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC;IACxE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,WAAW,CACnB,qGAAqG,CACtG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,eAAe,EAAE,MAAM;QACvB,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,0BAA0B;QAC7D,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QACtE,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,GAAG;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class ScreencliError extends Error {
|
|
2
|
+
code: string;
|
|
3
|
+
constructor(message: string, code: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class BrowserError extends ScreencliError {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class AgentError extends ScreencliError {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class FFmpegError extends ScreencliError {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class ExportError extends ScreencliError {
|
|
15
|
+
constructor(message: string);
|
|
16
|
+
}
|
|
17
|
+
export declare class ConfigError extends ScreencliError {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=errors.d.ts.map
|