@tmhs/screencast-mcp 0.39.0 → 0.45.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/README.md +95 -17
- package/assets/icon.png +0 -0
- package/assets/ui/player.html +47 -302
- package/assets/ui/player.js +402 -0
- package/dist/context.js +0 -5
- package/dist/index.js +17 -21
- package/dist/prompts.js +18 -8
- package/dist/resources.js +2 -14
- package/dist/server.js +49 -11
- package/dist/tools/addMarker.js +89 -0
- package/dist/tools/assembleHighlights.js +12 -7
- package/dist/tools/backdrop.js +89 -0
- package/dist/tools/bugReport.js +266 -0
- package/dist/tools/burnSubtitles.js +12 -6
- package/dist/tools/callout.js +32 -16
- package/dist/tools/chapters.js +156 -0
- package/dist/tools/clip.js +12 -9
- package/dist/tools/compress.js +10 -5
- package/dist/tools/concat.js +16 -15
- package/dist/tools/contactSheet.js +39 -33
- package/dist/tools/convert.js +12 -6
- package/dist/tools/crop.js +12 -7
- package/dist/tools/cutIdle.js +15 -9
- package/dist/tools/denoise.js +12 -6
- package/dist/tools/doctor.js +133 -0
- package/dist/tools/exportGif.js +14 -10
- package/dist/tools/exportPreset.js +11 -8
- package/dist/tools/extractAudio.js +10 -8
- package/dist/tools/findText.js +52 -98
- package/dist/tools/getMediaInfo.js +17 -3
- package/dist/tools/getSession.js +15 -3
- package/dist/tools/keystrokeOverlay.js +131 -0
- package/dist/tools/listAudioDevices.js +14 -7
- package/dist/tools/listSessions.js +13 -3
- package/dist/tools/listTargets.js +76 -0
- package/dist/tools/musicBed.js +14 -10
- package/dist/tools/normalizeAudio.js +12 -8
- package/dist/tools/overlay.js +16 -12
- package/dist/tools/pipeline.js +86 -25
- package/dist/tools/readEvents.js +21 -12
- package/dist/tools/redactRegion.js +19 -17
- package/dist/tools/reframe.js +9 -5
- package/dist/tools/reviewRecording.js +75 -22
- package/dist/tools/sampleFrames.js +33 -40
- package/dist/tools/saveReplay.js +90 -0
- package/dist/tools/scale.js +9 -3
- package/dist/tools/screenDiff.js +23 -17
- package/dist/tools/screenshot.js +21 -17
- package/dist/tools/speed.js +15 -4
- package/dist/tools/startRecording.js +96 -59
- package/dist/tools/stopRecording.js +35 -10
- package/dist/tools/titleCard.js +19 -11
- package/dist/tools/transcribe.js +13 -7
- package/dist/tools/trim.js +11 -10
- package/dist/tools/waitForChange.js +37 -22
- package/dist/tools/xfadeTransition.js +12 -8
- package/dist/tools/zoom.js +26 -29
- package/dist/utils/anim.js +1 -21
- package/dist/utils/animExport.js +5 -10
- package/dist/utils/audio.js +4 -33
- package/dist/utils/audioDevices.js +1 -48
- package/dist/utils/backdrop.js +151 -0
- package/dist/utils/bugReport.js +246 -0
- package/dist/utils/callout.js +1 -19
- package/dist/utils/calloutAssets.js +21 -11
- package/dist/utils/capabilities.js +95 -0
- package/dist/utils/captions.js +9 -26
- package/dist/utils/chapters.js +222 -0
- package/dist/utils/consent.js +29 -0
- package/dist/utils/diff.js +0 -46
- package/dist/utils/errors.js +5 -13
- package/dist/utils/events.js +21 -77
- package/dist/utils/expr.js +11 -0
- package/dist/utils/ffmpeg.js +119 -48
- package/dist/utils/fontCoverage.js +177 -0
- package/dist/utils/fonts.js +139 -23
- package/dist/utils/idle.js +12 -24
- package/dist/utils/images.js +0 -17
- package/dist/utils/jobs.js +42 -41
- package/dist/utils/keystrokes.js +170 -0
- package/dist/utils/lifecycle.js +11 -31
- package/dist/utils/logging.js +75 -0
- package/dist/utils/media.js +16 -124
- package/dist/utils/monitors.js +7 -43
- package/dist/utils/ocr.js +53 -71
- package/dist/utils/ocrScan.js +77 -0
- package/dist/utils/paths.js +68 -31
- package/dist/utils/pipeline.js +39 -25
- package/dist/utils/player.js +50 -27
- package/dist/utils/produce.js +6 -66
- package/dist/utils/replay.js +278 -0
- package/dist/utils/resolveTarget.js +0 -19
- package/dist/utils/retention.js +1 -15
- package/dist/utils/roots.js +42 -0
- package/dist/utils/sessions.js +195 -160
- package/dist/utils/sheet.js +0 -19
- package/dist/utils/still.js +0 -15
- package/dist/utils/targetList.js +63 -0
- package/dist/utils/targets.js +5 -70
- package/dist/utils/toolSpec.js +25 -0
- package/dist/utils/toolsets.js +122 -0
- package/dist/utils/validate.js +0 -22
- package/dist/utils/wgc.js +0 -46
- package/dist/utils/windows.js +5 -50
- package/dist/utils/zoom.js +55 -85
- package/dist/wgcRecorder.js +1 -30
- package/package.json +7 -3
- package/dist/context.d.ts +0 -9
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/prompts.d.ts +0 -10
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js.map +0 -1
- package/dist/resources.d.ts +0 -3
- package/dist/resources.d.ts.map +0 -1
- package/dist/resources.js.map +0 -1
- package/dist/server.d.ts +0 -3
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/assembleHighlights.d.ts +0 -3
- package/dist/tools/assembleHighlights.d.ts.map +0 -1
- package/dist/tools/assembleHighlights.js.map +0 -1
- package/dist/tools/burnSubtitles.d.ts +0 -3
- package/dist/tools/burnSubtitles.d.ts.map +0 -1
- package/dist/tools/burnSubtitles.js.map +0 -1
- package/dist/tools/callout.d.ts +0 -37
- package/dist/tools/callout.d.ts.map +0 -1
- package/dist/tools/callout.js.map +0 -1
- package/dist/tools/clip.d.ts +0 -3
- package/dist/tools/clip.d.ts.map +0 -1
- package/dist/tools/clip.js.map +0 -1
- package/dist/tools/compress.d.ts +0 -3
- package/dist/tools/compress.d.ts.map +0 -1
- package/dist/tools/compress.js.map +0 -1
- package/dist/tools/concat.d.ts +0 -3
- package/dist/tools/concat.d.ts.map +0 -1
- package/dist/tools/concat.js.map +0 -1
- package/dist/tools/contactSheet.d.ts +0 -3
- package/dist/tools/contactSheet.d.ts.map +0 -1
- package/dist/tools/contactSheet.js.map +0 -1
- package/dist/tools/convert.d.ts +0 -3
- package/dist/tools/convert.d.ts.map +0 -1
- package/dist/tools/convert.js.map +0 -1
- package/dist/tools/crop.d.ts +0 -3
- package/dist/tools/crop.d.ts.map +0 -1
- package/dist/tools/crop.js.map +0 -1
- package/dist/tools/cutIdle.d.ts +0 -3
- package/dist/tools/cutIdle.d.ts.map +0 -1
- package/dist/tools/cutIdle.js.map +0 -1
- package/dist/tools/denoise.d.ts +0 -3
- package/dist/tools/denoise.d.ts.map +0 -1
- package/dist/tools/denoise.js.map +0 -1
- package/dist/tools/exportGif.d.ts +0 -3
- package/dist/tools/exportGif.d.ts.map +0 -1
- package/dist/tools/exportGif.js.map +0 -1
- package/dist/tools/exportPreset.d.ts +0 -3
- package/dist/tools/exportPreset.d.ts.map +0 -1
- package/dist/tools/exportPreset.js.map +0 -1
- package/dist/tools/extractAudio.d.ts +0 -3
- package/dist/tools/extractAudio.d.ts.map +0 -1
- package/dist/tools/extractAudio.js.map +0 -1
- package/dist/tools/findText.d.ts +0 -6
- package/dist/tools/findText.d.ts.map +0 -1
- package/dist/tools/findText.js.map +0 -1
- package/dist/tools/getMediaInfo.d.ts +0 -3
- package/dist/tools/getMediaInfo.d.ts.map +0 -1
- package/dist/tools/getMediaInfo.js.map +0 -1
- package/dist/tools/getSession.d.ts +0 -3
- package/dist/tools/getSession.d.ts.map +0 -1
- package/dist/tools/getSession.js.map +0 -1
- package/dist/tools/listAudioDevices.d.ts +0 -3
- package/dist/tools/listAudioDevices.d.ts.map +0 -1
- package/dist/tools/listAudioDevices.js.map +0 -1
- package/dist/tools/listSessions.d.ts +0 -3
- package/dist/tools/listSessions.d.ts.map +0 -1
- package/dist/tools/listSessions.js.map +0 -1
- package/dist/tools/musicBed.d.ts +0 -3
- package/dist/tools/musicBed.d.ts.map +0 -1
- package/dist/tools/musicBed.js.map +0 -1
- package/dist/tools/normalizeAudio.d.ts +0 -3
- package/dist/tools/normalizeAudio.d.ts.map +0 -1
- package/dist/tools/normalizeAudio.js.map +0 -1
- package/dist/tools/overlay.d.ts +0 -3
- package/dist/tools/overlay.d.ts.map +0 -1
- package/dist/tools/overlay.js.map +0 -1
- package/dist/tools/pipeline.d.ts +0 -3
- package/dist/tools/pipeline.d.ts.map +0 -1
- package/dist/tools/pipeline.js.map +0 -1
- package/dist/tools/readEvents.d.ts +0 -6
- package/dist/tools/readEvents.d.ts.map +0 -1
- package/dist/tools/readEvents.js.map +0 -1
- package/dist/tools/redactRegion.d.ts +0 -13
- package/dist/tools/redactRegion.d.ts.map +0 -1
- package/dist/tools/redactRegion.js.map +0 -1
- package/dist/tools/reframe.d.ts +0 -3
- package/dist/tools/reframe.d.ts.map +0 -1
- package/dist/tools/reframe.js.map +0 -1
- package/dist/tools/reviewRecording.d.ts +0 -5
- package/dist/tools/reviewRecording.d.ts.map +0 -1
- package/dist/tools/reviewRecording.js.map +0 -1
- package/dist/tools/sampleFrames.d.ts +0 -3
- package/dist/tools/sampleFrames.d.ts.map +0 -1
- package/dist/tools/sampleFrames.js.map +0 -1
- package/dist/tools/scale.d.ts +0 -3
- package/dist/tools/scale.d.ts.map +0 -1
- package/dist/tools/scale.js.map +0 -1
- package/dist/tools/screenDiff.d.ts +0 -3
- package/dist/tools/screenDiff.d.ts.map +0 -1
- package/dist/tools/screenDiff.js.map +0 -1
- package/dist/tools/screenshot.d.ts +0 -3
- package/dist/tools/screenshot.d.ts.map +0 -1
- package/dist/tools/screenshot.js.map +0 -1
- package/dist/tools/speed.d.ts +0 -3
- package/dist/tools/speed.d.ts.map +0 -1
- package/dist/tools/speed.js.map +0 -1
- package/dist/tools/startRecording.d.ts +0 -3
- package/dist/tools/startRecording.d.ts.map +0 -1
- package/dist/tools/startRecording.js.map +0 -1
- package/dist/tools/stopRecording.d.ts +0 -3
- package/dist/tools/stopRecording.d.ts.map +0 -1
- package/dist/tools/stopRecording.js.map +0 -1
- package/dist/tools/titleCard.d.ts +0 -3
- package/dist/tools/titleCard.d.ts.map +0 -1
- package/dist/tools/titleCard.js.map +0 -1
- package/dist/tools/transcribe.d.ts +0 -3
- package/dist/tools/transcribe.d.ts.map +0 -1
- package/dist/tools/transcribe.js.map +0 -1
- package/dist/tools/trim.d.ts +0 -3
- package/dist/tools/trim.d.ts.map +0 -1
- package/dist/tools/trim.js.map +0 -1
- package/dist/tools/waitForChange.d.ts +0 -3
- package/dist/tools/waitForChange.d.ts.map +0 -1
- package/dist/tools/waitForChange.js.map +0 -1
- package/dist/tools/xfadeTransition.d.ts +0 -3
- package/dist/tools/xfadeTransition.d.ts.map +0 -1
- package/dist/tools/xfadeTransition.js.map +0 -1
- package/dist/tools/zoom.d.ts +0 -15
- package/dist/tools/zoom.d.ts.map +0 -1
- package/dist/tools/zoom.js.map +0 -1
- package/dist/utils/anim.d.ts +0 -33
- package/dist/utils/anim.d.ts.map +0 -1
- package/dist/utils/anim.js.map +0 -1
- package/dist/utils/animExport.d.ts +0 -27
- package/dist/utils/animExport.d.ts.map +0 -1
- package/dist/utils/animExport.js.map +0 -1
- package/dist/utils/audio.d.ts +0 -49
- package/dist/utils/audio.d.ts.map +0 -1
- package/dist/utils/audio.js.map +0 -1
- package/dist/utils/audioDevices.d.ts +0 -33
- package/dist/utils/audioDevices.d.ts.map +0 -1
- package/dist/utils/audioDevices.js.map +0 -1
- package/dist/utils/callout.d.ts +0 -72
- package/dist/utils/callout.d.ts.map +0 -1
- package/dist/utils/callout.js.map +0 -1
- package/dist/utils/calloutAssets.d.ts +0 -3
- package/dist/utils/calloutAssets.d.ts.map +0 -1
- package/dist/utils/calloutAssets.js.map +0 -1
- package/dist/utils/captions.d.ts +0 -26
- package/dist/utils/captions.d.ts.map +0 -1
- package/dist/utils/captions.js.map +0 -1
- package/dist/utils/diff.d.ts +0 -112
- package/dist/utils/diff.d.ts.map +0 -1
- package/dist/utils/diff.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -33
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/events.d.ts +0 -143
- package/dist/utils/events.d.ts.map +0 -1
- package/dist/utils/events.js.map +0 -1
- package/dist/utils/ffmpeg.d.ts +0 -50
- package/dist/utils/ffmpeg.d.ts.map +0 -1
- package/dist/utils/ffmpeg.js.map +0 -1
- package/dist/utils/fonts.d.ts +0 -17
- package/dist/utils/fonts.d.ts.map +0 -1
- package/dist/utils/fonts.js.map +0 -1
- package/dist/utils/idle.d.ts +0 -23
- package/dist/utils/idle.d.ts.map +0 -1
- package/dist/utils/idle.js.map +0 -1
- package/dist/utils/images.d.ts +0 -21
- package/dist/utils/images.d.ts.map +0 -1
- package/dist/utils/images.js.map +0 -1
- package/dist/utils/jobs.d.ts +0 -44
- package/dist/utils/jobs.d.ts.map +0 -1
- package/dist/utils/jobs.js.map +0 -1
- package/dist/utils/lifecycle.d.ts +0 -29
- package/dist/utils/lifecycle.d.ts.map +0 -1
- package/dist/utils/lifecycle.js.map +0 -1
- package/dist/utils/media.d.ts +0 -272
- package/dist/utils/media.d.ts.map +0 -1
- package/dist/utils/media.js.map +0 -1
- package/dist/utils/monitors.d.ts +0 -47
- package/dist/utils/monitors.d.ts.map +0 -1
- package/dist/utils/monitors.js.map +0 -1
- package/dist/utils/ocr.d.ts +0 -50
- package/dist/utils/ocr.d.ts.map +0 -1
- package/dist/utils/ocr.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -28
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/pipeline.d.ts +0 -69
- package/dist/utils/pipeline.d.ts.map +0 -1
- package/dist/utils/pipeline.js.map +0 -1
- package/dist/utils/player.d.ts +0 -30
- package/dist/utils/player.d.ts.map +0 -1
- package/dist/utils/player.js.map +0 -1
- package/dist/utils/produce.d.ts +0 -126
- package/dist/utils/produce.d.ts.map +0 -1
- package/dist/utils/produce.js.map +0 -1
- package/dist/utils/resolveTarget.d.ts +0 -32
- package/dist/utils/resolveTarget.d.ts.map +0 -1
- package/dist/utils/resolveTarget.js.map +0 -1
- package/dist/utils/retention.d.ts +0 -10
- package/dist/utils/retention.d.ts.map +0 -1
- package/dist/utils/retention.js.map +0 -1
- package/dist/utils/sessions.d.ts +0 -154
- package/dist/utils/sessions.d.ts.map +0 -1
- package/dist/utils/sessions.js.map +0 -1
- package/dist/utils/sheet.d.ts +0 -26
- package/dist/utils/sheet.d.ts.map +0 -1
- package/dist/utils/sheet.js.map +0 -1
- package/dist/utils/still.d.ts +0 -7
- package/dist/utils/still.d.ts.map +0 -1
- package/dist/utils/still.js.map +0 -1
- package/dist/utils/targets.d.ts +0 -113
- package/dist/utils/targets.d.ts.map +0 -1
- package/dist/utils/targets.js.map +0 -1
- package/dist/utils/validate.d.ts +0 -15
- package/dist/utils/validate.d.ts.map +0 -1
- package/dist/utils/validate.js.map +0 -1
- package/dist/utils/wgc.d.ts +0 -46
- package/dist/utils/wgc.d.ts.map +0 -1
- package/dist/utils/wgc.js.map +0 -1
- package/dist/utils/windows.d.ts +0 -94
- package/dist/utils/windows.d.ts.map +0 -1
- package/dist/utils/windows.js.map +0 -1
- package/dist/utils/zoom.d.ts +0 -95
- package/dist/utils/zoom.d.ts.map +0 -1
- package/dist/utils/zoom.js.map +0 -1
- package/dist/wgcRecorder.d.ts +0 -2
- package/dist/wgcRecorder.d.ts.map +0 -1
- package/dist/wgcRecorder.js.map +0 -1
package/dist/tools/musicBed.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
|
|
4
|
+
import { OUTPUT_PATH, WRITES_FILE } from "../utils/toolSpec.js";
|
|
4
5
|
import { requireFfmpeg, probeMedia } from "../utils/ffmpeg.js";
|
|
5
6
|
import { runEditJob } from "../utils/jobs.js";
|
|
6
7
|
import { buildMusicBedArgs } from "../utils/produce.js";
|
|
@@ -8,19 +9,23 @@ import { editOutputExt, assertEditContainer } from "../utils/media.js";
|
|
|
8
9
|
import { resolveOutput, subdir, stamp, rand } from "../utils/paths.js";
|
|
9
10
|
const inputSchema = {
|
|
10
11
|
video: z.string().min(1).describe("Path to the video."),
|
|
11
|
-
music: z.string().min(1).describe("
|
|
12
|
-
musicVolume: z.number().nonnegative().optional().describe("
|
|
13
|
-
fadeIn: z.number().nonnegative().optional().describe("
|
|
14
|
-
fadeOut: z.number().nonnegative().optional().describe("
|
|
15
|
-
duck: z.boolean().optional().describe("Duck the music under the original audio
|
|
12
|
+
music: z.string().min(1).describe("Music audio file."),
|
|
13
|
+
musicVolume: z.number().nonnegative().optional().describe("0..1 (default 0.25 over existing audio, 0.8 alone)."),
|
|
14
|
+
fadeIn: z.number().nonnegative().optional().describe("Fade-in seconds (default 1)."),
|
|
15
|
+
fadeOut: z.number().nonnegative().optional().describe("Fade-out seconds (default 2)."),
|
|
16
|
+
duck: z.boolean().optional().describe("Duck the music under the original audio (default false)."),
|
|
16
17
|
output: z.string().optional().describe("Optional output path. Defaults under SCREENCAST_HOME/edits."),
|
|
17
18
|
overwrite: z.boolean().optional().describe("Allow replacing an existing file at the output path (default false)."),
|
|
18
19
|
};
|
|
19
20
|
export function register(server) {
|
|
20
|
-
server.
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
21
|
+
server.registerTool("music_bed", {
|
|
22
|
+
title: "Add Music Bed",
|
|
23
|
+
description: "Lay music under a video: looped or trimmed to length, faded, leveled, and mixed with any " +
|
|
24
|
+
"existing audio. Video is stream-copied.",
|
|
25
|
+
inputSchema,
|
|
26
|
+
outputSchema: OUTPUT_PATH,
|
|
27
|
+
annotations: WRITES_FILE,
|
|
28
|
+
}, async (args, extra) => {
|
|
24
29
|
try {
|
|
25
30
|
requireFfmpeg();
|
|
26
31
|
for (const f of [args.video, args.music]) {
|
|
@@ -48,4 +53,3 @@ export function register(server) {
|
|
|
48
53
|
}
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
|
-
//# sourceMappingURL=musicBed.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
|
|
4
|
+
import { OUTPUT_PATH, WRITES_FILE } from "../utils/toolSpec.js";
|
|
4
5
|
import { requireFfmpeg, runCapture, probeMedia } from "../utils/ffmpeg.js";
|
|
5
6
|
import { runEditJob, jobTimeoutMs } from "../utils/jobs.js";
|
|
6
7
|
import { loudnessTarget, buildLoudnessMeasureArgs, buildLoudnessApplyArgs, parseLoudnorm, } from "../utils/audio.js";
|
|
@@ -11,15 +12,19 @@ const inputSchema = {
|
|
|
11
12
|
target: z
|
|
12
13
|
.union([z.enum(["youtube", "podcast", "broadcast"]), z.number()])
|
|
13
14
|
.optional()
|
|
14
|
-
.describe("
|
|
15
|
-
"(EBU R128, -23 LUFS), or a LUFS number such as -18."),
|
|
15
|
+
.describe("youtube (-14 LUFS, default), podcast (-16), broadcast (-23), or a LUFS number."),
|
|
16
16
|
output: z.string().optional().describe("Optional output path. Defaults under SCREENCAST_HOME/edits."),
|
|
17
17
|
overwrite: z.boolean().optional().describe("Allow replacing an existing file at the output path (default false)."),
|
|
18
18
|
};
|
|
19
19
|
export function register(server) {
|
|
20
|
-
server.
|
|
21
|
-
"
|
|
22
|
-
"
|
|
20
|
+
server.registerTool("normalize_audio", {
|
|
21
|
+
title: "Normalize Loudness",
|
|
22
|
+
description: "Normalize loudness to a delivery target (two-pass EBU R128 loudnorm); video is copied. " +
|
|
23
|
+
"Reports loudness before and after.",
|
|
24
|
+
inputSchema,
|
|
25
|
+
outputSchema: OUTPUT_PATH,
|
|
26
|
+
annotations: WRITES_FILE,
|
|
27
|
+
}, async (args, extra) => {
|
|
23
28
|
try {
|
|
24
29
|
const { ffmpeg } = requireFfmpeg();
|
|
25
30
|
if (!existsSync(args.input)) {
|
|
@@ -33,14 +38,14 @@ export function register(server) {
|
|
|
33
38
|
const ext = editOutputExt(args.input, { audio: true });
|
|
34
39
|
const output = resolveOutput(args.output, subdir("edits"), `loudnorm-${stamp()}-${rand()}${ext}`, args.overwrite);
|
|
35
40
|
const timeout = jobTimeoutMs(info.durationSec);
|
|
36
|
-
const before = await runCapture(ffmpeg, buildLoudnessMeasureArgs(args.input, t), timeout);
|
|
41
|
+
const before = await runCapture(ffmpeg, buildLoudnessMeasureArgs(args.input, t), timeout, { signal: extra.signal });
|
|
37
42
|
const measured = parseLoudnorm(before.stderr);
|
|
38
43
|
await runEditJob(buildLoudnessApplyArgs(args.input, output, t, measured), {
|
|
39
44
|
output,
|
|
40
45
|
durationSec: info.durationSec,
|
|
41
46
|
extra,
|
|
42
47
|
});
|
|
43
|
-
const after = parseLoudnorm((await runCapture(ffmpeg, buildLoudnessMeasureArgs(output, t), timeout)).stderr);
|
|
48
|
+
const after = parseLoudnorm((await runCapture(ffmpeg, buildLoudnessMeasureArgs(output, t), timeout, { signal: extra.signal })).stderr);
|
|
44
49
|
return okResponse({
|
|
45
50
|
outputPath: output,
|
|
46
51
|
target: { lufs: t.i, truePeakDb: t.tp, lra: t.lra },
|
|
@@ -53,4 +58,3 @@ export function register(server) {
|
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
60
|
}
|
|
56
|
-
//# sourceMappingURL=normalizeAudio.js.map
|
package/dist/tools/overlay.js
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
|
|
4
|
+
import { OUTPUT_PATH, WRITES_FILE } from "../utils/toolSpec.js";
|
|
4
5
|
import { requireFfmpeg } from "../utils/ffmpeg.js";
|
|
5
6
|
import { runEditJob, probeDuration } from "../utils/jobs.js";
|
|
6
7
|
import { buildOverlayArgs, editOutputExt, assertEditContainer } from "../utils/media.js";
|
|
7
8
|
import { resolveOutput, subdir, stamp, rand } from "../utils/paths.js";
|
|
8
9
|
const inputSchema = {
|
|
9
10
|
input: z.string().min(1).describe("Path to the base video."),
|
|
10
|
-
overlay: z.string().min(1).describe("
|
|
11
|
-
x: z.number().int().nonnegative().describe("
|
|
12
|
-
y: z.number().int().nonnegative().describe("
|
|
13
|
-
width: z.number().int().positive().optional().describe("
|
|
14
|
-
height: z.number().int().positive().optional().describe("
|
|
15
|
-
start: z.number().nonnegative().optional().describe("
|
|
16
|
-
end: z.number().positive().optional().describe("
|
|
11
|
+
overlay: z.string().min(1).describe("Overlay image or video path."),
|
|
12
|
+
x: z.number().int().nonnegative().describe("Left, px."),
|
|
13
|
+
y: z.number().int().nonnegative().describe("Top, px."),
|
|
14
|
+
width: z.number().int().positive().optional().describe("Scale to this width (other side keeps aspect)."),
|
|
15
|
+
height: z.number().int().positive().optional().describe("Scale to this height."),
|
|
16
|
+
start: z.number().nonnegative().optional().describe("Show from this second."),
|
|
17
|
+
end: z.number().positive().optional().describe("Hide after this second."),
|
|
17
18
|
output: z.string().optional().describe("Optional output path. Defaults under SCREENCAST_HOME/edits."),
|
|
18
19
|
overwrite: z.boolean().optional().describe("Allow replacing an existing file at the output path (default false)."),
|
|
19
20
|
};
|
|
20
21
|
export function register(server) {
|
|
21
|
-
server.
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
22
|
+
server.registerTool("overlay", {
|
|
23
|
+
title: "Overlay Image or Video",
|
|
24
|
+
description: "Composite an image or video (logo, watermark, picture-in-picture) onto a video at a pixel " +
|
|
25
|
+
"position, optionally scaled and time-limited; keeps the base's audio and length.",
|
|
26
|
+
inputSchema,
|
|
27
|
+
outputSchema: OUTPUT_PATH,
|
|
28
|
+
annotations: WRITES_FILE,
|
|
29
|
+
}, async (args, extra) => {
|
|
25
30
|
try {
|
|
26
31
|
requireFfmpeg();
|
|
27
32
|
if (!existsSync(args.input)) {
|
|
@@ -53,4 +58,3 @@ export function register(server) {
|
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
60
|
}
|
|
56
|
-
//# sourceMappingURL=overlay.js.map
|
package/dist/tools/pipeline.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { existsSync, mkdtempSync, rmSync } from "node:fs";
|
|
3
|
+
import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
|
|
6
|
+
import { WRITES_FILE, looseOutput } from "../utils/toolSpec.js";
|
|
6
7
|
import { requireFfmpeg, probeMedia } from "../utils/ffmpeg.js";
|
|
7
8
|
import { runEditJob } from "../utils/jobs.js";
|
|
8
9
|
import { planPipeline, MAX_PIPELINE_STEPS } from "../utils/pipeline.js";
|
|
9
|
-
import { prepareCalloutAssets } from "../utils/calloutAssets.js";
|
|
10
|
+
import { calloutFonts, prepareCalloutAssets } from "../utils/calloutAssets.js";
|
|
10
11
|
import { exportAnimation } from "../utils/animExport.js";
|
|
11
|
-
import { calloutItemSchema } from "./callout.js";
|
|
12
|
+
import { calloutItemSchema, fontFileSchema } from "./callout.js";
|
|
12
13
|
import { zoomKeyframeSchema } from "./zoom.js";
|
|
13
14
|
import { redactRegionSchema } from "./redactRegion.js";
|
|
14
15
|
import { resolveOutput, subdir, stamp, rand } from "../utils/paths.js";
|
|
15
16
|
import { PLATFORMS } from "../utils/produce.js";
|
|
17
|
+
import { buildChapters, ffmetadata, markerPoints, markersOrChapters, retimeMarkers, writeMarkers } from "../utils/chapters.js";
|
|
18
|
+
import { backdropOptionsSchema } from "./backdrop.js";
|
|
19
|
+
import { keystrokeOptionsSchema, loadBadges, prepareKeystrokeAssets } from "./keystrokeOverlay.js";
|
|
16
20
|
const aspect = z.enum(["16:9", "9:16", "1:1", "4:5"]);
|
|
17
21
|
const fit = z.enum(["pad", "crop"]).optional();
|
|
18
22
|
const step = z.discriminatedUnion("op", [
|
|
@@ -38,9 +42,11 @@ const step = z.discriminatedUnion("op", [
|
|
|
38
42
|
pad: z.number().int().nonnegative().optional(),
|
|
39
43
|
color: z.string().optional(),
|
|
40
44
|
}),
|
|
41
|
-
z.object({ op: z.literal("callout"), items: z.array(calloutItemSchema).min(1).max(50) }),
|
|
45
|
+
z.object({ op: z.literal("callout"), items: z.array(calloutItemSchema).min(1).max(50), fontFile: fontFileSchema }),
|
|
42
46
|
z.object({ op: z.literal("reframe"), aspect, fit }),
|
|
43
47
|
z.object({ op: z.literal("zoom"), keyframes: z.array(zoomKeyframeSchema).min(1).max(100), transitionSec: z.number().positive().max(5).optional() }),
|
|
48
|
+
z.object({ op: z.literal("backdrop"), ...backdropOptionsSchema }),
|
|
49
|
+
z.object({ op: z.literal("keystroke_overlay"), ...keystrokeOptionsSchema }),
|
|
44
50
|
z.object({ op: z.literal("export_preset"), platform: z.enum(PLATFORMS), fit }),
|
|
45
51
|
z.object({
|
|
46
52
|
op: z.literal("export_gif"),
|
|
@@ -56,20 +62,27 @@ const inputSchema = {
|
|
|
56
62
|
.array(step)
|
|
57
63
|
.min(1)
|
|
58
64
|
.max(MAX_PIPELINE_STEPS)
|
|
59
|
-
.describe("Edits in order, each { op, ...
|
|
60
|
-
"
|
|
61
|
-
"or export_gif. Times in a step are on the timeline as it is at that step, after any earlier " +
|
|
62
|
-
"trim or speed change; pixel positions are in the frame as it is at that step."),
|
|
65
|
+
.describe("Edits in order, each { op, ...its tool's options }; export_preset/export_gif only last. Times " +
|
|
66
|
+
"and pixels are relative to the video as it is at that step (after earlier trims, speed, crops)."),
|
|
63
67
|
quality: z.enum(["draft", "standard", "high"]).optional().describe("Encoder preset for an mp4 result (default standard)."),
|
|
64
|
-
dryRun: z.boolean().optional().describe("Return the
|
|
68
|
+
dryRun: z.boolean().optional().describe("Return the plan (ffmpeg command, output size) without running it."),
|
|
65
69
|
output: z.string().optional().describe("Optional output path. Defaults under SCREENCAST_HOME/edits."),
|
|
66
70
|
overwrite: z.boolean().optional().describe("Allow replacing an existing file at the output path (default false)."),
|
|
71
|
+
chapters: z
|
|
72
|
+
.boolean()
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("Keep the input's markers as chapters, re-timed through trims and speed."),
|
|
67
75
|
};
|
|
68
76
|
export function register(server) {
|
|
69
|
-
server.
|
|
70
|
-
"
|
|
71
|
-
"(trim, crop, scale, speed, redact, callout, reframe, zoom
|
|
72
|
-
|
|
77
|
+
server.registerTool("pipeline", {
|
|
78
|
+
title: "Edit Pipeline",
|
|
79
|
+
description: "Run several edits (trim, crop, scale, speed, redact, callout, keystroke_overlay, reframe, zoom, backdrop, then optionally " +
|
|
80
|
+
"export_preset or export_gif) in one ffmpeg pass: one re-encode, no intermediate files. Prefer it " +
|
|
81
|
+
"over chaining edit tools.",
|
|
82
|
+
inputSchema,
|
|
83
|
+
outputSchema: looseOutput({ processes: z.number().int(), steps: z.array(z.string()) }),
|
|
84
|
+
annotations: WRITES_FILE,
|
|
85
|
+
}, async (args, extra) => {
|
|
73
86
|
try {
|
|
74
87
|
requireFfmpeg();
|
|
75
88
|
if (!existsSync(args.input))
|
|
@@ -85,39 +98,88 @@ export function register(server) {
|
|
|
85
98
|
durationSec: info.durationSec,
|
|
86
99
|
hasAudio: info.audioCodec !== null,
|
|
87
100
|
};
|
|
88
|
-
const last = steps
|
|
101
|
+
const last = steps.at(-1);
|
|
102
|
+
if (!last)
|
|
103
|
+
throw new ScreencastError("Provide at least one step.");
|
|
89
104
|
const ext = last.op === "export_gif" ? `.${last.format ?? "gif"}` : ".mp4";
|
|
90
105
|
const output = resolveOutput(args.output, subdir("edits"), `pipeline-${stamp()}-${rand()}${ext}`, args.overwrite);
|
|
91
106
|
const work = mkdtempSync(join(tmpdir(), "screencast-pipeline-"));
|
|
92
107
|
try {
|
|
93
|
-
// Callout text and arrow files; a dry run plans with placeholder paths.
|
|
94
108
|
const assets = {};
|
|
95
|
-
|
|
96
|
-
|
|
109
|
+
const fallbackFonts = [];
|
|
110
|
+
const warnings = [];
|
|
111
|
+
for (const [i, s] of steps.entries()) {
|
|
97
112
|
if (s.op !== "callout")
|
|
98
113
|
continue;
|
|
99
|
-
|
|
100
|
-
? { fontFile: "<font>", textFiles: s.items.map((c) => (c.type === "text" ? "<text>" : null)), arrowFiles: s.items.map((c) => (c.type === "arrow" ? "<arrow.png>" : null)) }
|
|
101
|
-
: await prepareCalloutAssets(s.items, work, `s${i}_
|
|
114
|
+
const a = args.dryRun
|
|
115
|
+
? { fontFile: "<font>", textFiles: s.items.map((c) => (c.type === "text" ? "<text>" : null)), arrowFiles: s.items.map((c) => (c.type === "arrow" ? "<arrow.png>" : null)), ...calloutFonts(s.items, s.fontFile) }
|
|
116
|
+
: await prepareCalloutAssets(s.items, work, `s${i}_`, s.fontFile);
|
|
117
|
+
assets[i] = a;
|
|
118
|
+
fallbackFonts.push(...a.fallbackFonts.map((f) => ({ step: i, ...f })));
|
|
119
|
+
warnings.push(...a.warnings.map((w) => `Step ${i}, ${w.charAt(0).toLowerCase()}${w.slice(1)}`));
|
|
120
|
+
}
|
|
121
|
+
const keystrokes = {};
|
|
122
|
+
for (const [i, s] of steps.entries()) {
|
|
123
|
+
if (s.op === "backdrop" && s.image && !existsSync(s.image)) {
|
|
124
|
+
throw new ScreencastError(`step ${i + 1}: background image not found: ${s.image}`);
|
|
125
|
+
}
|
|
126
|
+
if (s.op !== "keystroke_overlay")
|
|
127
|
+
continue;
|
|
128
|
+
const { badges } = loadBadges(args.input, s.events, s);
|
|
129
|
+
const labels = [...new Set(badges.map((b) => b.label))];
|
|
130
|
+
const k = prepareKeystrokeAssets(labels, args.dryRun ? null : work, `s${i}_`, s.fontFile);
|
|
131
|
+
keystrokes[i] = { badges, fontFile: k.fontFile, textFiles: k.textFiles };
|
|
132
|
+
warnings.push(...k.warnings.map((w) => `Step ${i}, ${w.charAt(0).toLowerCase()}${w.slice(1)}`));
|
|
102
133
|
}
|
|
103
|
-
// An export_gif tail renders to a temporary mp4 first; a dry run names it plainly.
|
|
104
134
|
const target = last.op === "export_gif" ? (args.dryRun ? "<temporary stage1.mp4>" : join(work, "stage1.mp4")) : output;
|
|
105
|
-
|
|
135
|
+
let plan = planPipeline(args.input, target, steps, src, assets, args.quality ?? "standard", { keystrokes });
|
|
136
|
+
let chapterList = [];
|
|
137
|
+
let retimed = [];
|
|
138
|
+
if (args.chapters) {
|
|
139
|
+
const found = plan.gif ? null : await markersOrChapters(args.input, extra.signal);
|
|
140
|
+
if (!found)
|
|
141
|
+
warnings.push("chapters: a GIF/WebP cannot hold chapters; none written.");
|
|
142
|
+
else if (found.markers.length === 0)
|
|
143
|
+
warnings.push("chapters: the input has no markers (add_marker) or chapters; none written.");
|
|
144
|
+
else {
|
|
145
|
+
retimed = retimeMarkers(found.markers, plan.timeOps);
|
|
146
|
+
chapterList = plan.durationSec ? buildChapters(markerPoints(retimed), plan.durationSec) : [];
|
|
147
|
+
if (chapterList.length === 0)
|
|
148
|
+
warnings.push("chapters: no marker falls inside the result; none written.");
|
|
149
|
+
else {
|
|
150
|
+
const file = args.dryRun ? "<chapters.txt>" : join(work, "chapters.txt");
|
|
151
|
+
if (!args.dryRun)
|
|
152
|
+
writeFileSync(file, ffmetadata(chapterList));
|
|
153
|
+
plan = planPipeline(args.input, target, steps, src, assets, args.quality ?? "standard", { chaptersFile: file, keystrokes });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
106
157
|
const result = {
|
|
107
158
|
steps: plan.summary,
|
|
108
159
|
processes: plan.gif ? 2 : 1,
|
|
109
160
|
width: plan.width,
|
|
110
161
|
height: plan.height,
|
|
111
162
|
durationSec: plan.durationSec,
|
|
163
|
+
...(fallbackFonts.length > 0 && { fallbackFonts }),
|
|
164
|
+
...(warnings.length > 0 && { warnings }),
|
|
165
|
+
...(chapterList.length > 0 && { chapters: chapterList }),
|
|
112
166
|
};
|
|
113
167
|
if (args.dryRun)
|
|
114
168
|
return okResponse({ dryRun: true, ...result, ffmpegArgs: plan.args });
|
|
115
|
-
await runEditJob(plan.args, { output: target, durationSec: plan.durationSec, extra });
|
|
169
|
+
await runEditJob(plan.args, { output: target, durationSec: plan.durationSec, inputDurationSec: info.durationSec, extra });
|
|
116
170
|
if (plan.gif) {
|
|
117
171
|
const anim = await exportAnimation(target, output, plan.gif, extra);
|
|
118
172
|
return okResponse({ outputPath: output, ...result, animation: anim });
|
|
119
173
|
}
|
|
120
|
-
|
|
174
|
+
let markersPath;
|
|
175
|
+
if (chapterList.length > 0) {
|
|
176
|
+
try {
|
|
177
|
+
markersPath = writeMarkers(output, retimed.filter((m) => m.t < (plan.durationSec ?? Infinity)));
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return okResponse({ outputPath: output, ...result, ...(markersPath && { markersPath }) });
|
|
121
183
|
}
|
|
122
184
|
finally {
|
|
123
185
|
rmSync(work, { recursive: true, force: true });
|
|
@@ -128,4 +190,3 @@ export function register(server) {
|
|
|
128
190
|
}
|
|
129
191
|
});
|
|
130
192
|
}
|
|
131
|
-
//# sourceMappingURL=pipeline.js.map
|
package/dist/tools/readEvents.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
|
|
4
|
+
import { READ_ONLY, looseOutput } from "../utils/toolSpec.js";
|
|
4
5
|
import { EVENT_TYPES, eventPaths, parseEventsJsonl, selectEvents, summarizeEvents, eventGaps, } from "../utils/events.js";
|
|
5
6
|
import { getStore } from "../context.js";
|
|
6
|
-
/** Events returned per call unless the caller asks for more. */
|
|
7
7
|
export const DEFAULT_EVENT_LIMIT = 200;
|
|
8
8
|
export const MAX_EVENT_LIMIT = 5000;
|
|
9
9
|
const inputSchema = {
|
|
@@ -11,14 +11,14 @@ const inputSchema = {
|
|
|
11
11
|
input: z
|
|
12
12
|
.string()
|
|
13
13
|
.optional()
|
|
14
|
-
.describe("Or a recording path
|
|
15
|
-
from: z.number().min(0).optional().describe("
|
|
16
|
-
to: z.number().min(0).optional().describe("
|
|
14
|
+
.describe("Or a recording path, or its .events.jsonl."),
|
|
15
|
+
from: z.number().min(0).optional().describe("Earliest video second."),
|
|
16
|
+
to: z.number().min(0).optional().describe("Latest video second."),
|
|
17
17
|
types: z
|
|
18
18
|
.array(z.enum(EVENT_TYPES))
|
|
19
19
|
.optional()
|
|
20
|
-
.describe("
|
|
21
|
-
"typing (
|
|
20
|
+
.describe("down/up (mouse buttons; clicks are down), move (sampled cursor), wheel, key (shortcut), " +
|
|
21
|
+
"typing (burst), gap (events may be missing)."),
|
|
22
22
|
inFrameOnly: z.boolean().optional().describe("Drop events whose cursor was outside the recorded area."),
|
|
23
23
|
limit: z
|
|
24
24
|
.number()
|
|
@@ -26,13 +26,23 @@ const inputSchema = {
|
|
|
26
26
|
.min(1)
|
|
27
27
|
.max(MAX_EVENT_LIMIT)
|
|
28
28
|
.optional()
|
|
29
|
-
.describe(`Most events to return (default ${DEFAULT_EVENT_LIMIT})
|
|
29
|
+
.describe(`Most events to return (default ${DEFAULT_EVENT_LIMIT}).`),
|
|
30
30
|
};
|
|
31
31
|
export function register(server) {
|
|
32
|
-
server.
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
32
|
+
server.registerTool("read_events", {
|
|
33
|
+
title: "Read Input Events",
|
|
34
|
+
description: "Read the input events (clicks, scroll, cursor, shortcuts, typing bursts) of a recording made " +
|
|
35
|
+
"with events: true, in video seconds and pixels; e.g. types: ['down'], then sample_frames there.",
|
|
36
|
+
inputSchema,
|
|
37
|
+
outputSchema: looseOutput({
|
|
38
|
+
eventsPath: z.string(),
|
|
39
|
+
total: z.number().int(),
|
|
40
|
+
matched: z.number().int(),
|
|
41
|
+
returned: z.number().int(),
|
|
42
|
+
summary: z.record(z.string(), z.number()),
|
|
43
|
+
}),
|
|
44
|
+
annotations: READ_ONLY,
|
|
45
|
+
}, async (args) => {
|
|
36
46
|
try {
|
|
37
47
|
let path;
|
|
38
48
|
if (args.sessionId) {
|
|
@@ -86,4 +96,3 @@ export function register(server) {
|
|
|
86
96
|
}
|
|
87
97
|
});
|
|
88
98
|
}
|
|
89
|
-
//# sourceMappingURL=readEvents.js.map
|
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
|
|
4
|
+
import { OUTPUT_PATH, WRITES_FILE } from "../utils/toolSpec.js";
|
|
4
5
|
import { requireFfmpeg, probeMedia } from "../utils/ffmpeg.js";
|
|
5
6
|
import { runEditJob } from "../utils/jobs.js";
|
|
6
7
|
import { buildRedactArgs, editOutputExt, assertEditContainer } from "../utils/media.js";
|
|
7
8
|
import { resolveOutput, subdir, stamp, rand } from "../utils/paths.js";
|
|
8
|
-
/** One rectangle to redact; shared with pipeline. */
|
|
9
9
|
export const redactRegionSchema = z.object({
|
|
10
|
-
x: z.number().int().nonnegative()
|
|
11
|
-
y: z.number().int().nonnegative()
|
|
12
|
-
width: z.number().int().positive()
|
|
13
|
-
height: z.number().int().positive()
|
|
14
|
-
start: z.number().nonnegative().optional()
|
|
15
|
-
end: z.number().positive().optional()
|
|
10
|
+
x: z.number().int().nonnegative(),
|
|
11
|
+
y: z.number().int().nonnegative(),
|
|
12
|
+
width: z.number().int().positive(),
|
|
13
|
+
height: z.number().int().positive(),
|
|
14
|
+
start: z.number().nonnegative().optional(),
|
|
15
|
+
end: z.number().positive().optional(),
|
|
16
16
|
});
|
|
17
17
|
const inputSchema = {
|
|
18
18
|
input: z.string().min(1).describe("Path to the source video."),
|
|
19
19
|
regions: z
|
|
20
20
|
.array(redactRegionSchema)
|
|
21
21
|
.min(1)
|
|
22
|
-
.describe("
|
|
22
|
+
.describe("Pixel rectangles (x, y, width, height), each optionally limited to start..end seconds."),
|
|
23
23
|
style: z
|
|
24
24
|
.enum(["box", "blur", "pixelate"])
|
|
25
25
|
.optional()
|
|
26
|
-
.describe("box (default)
|
|
26
|
+
.describe("box (default): irreversible fill; blur/pixelate are partially recoverable."),
|
|
27
27
|
pad: z
|
|
28
28
|
.number()
|
|
29
29
|
.int()
|
|
30
30
|
.nonnegative()
|
|
31
31
|
.optional()
|
|
32
|
-
.describe("
|
|
33
|
-
color: z.string().optional().describe("
|
|
32
|
+
.describe("Grow each region by this many px (default 0)."),
|
|
33
|
+
color: z.string().optional().describe("Box fill color (default black)."),
|
|
34
34
|
output: z.string().optional().describe("Optional output path. Defaults under SCREENCAST_HOME/edits."),
|
|
35
35
|
overwrite: z.boolean().optional().describe("Allow replacing an existing file at the output path (default false)."),
|
|
36
36
|
};
|
|
37
37
|
export function register(server) {
|
|
38
|
-
server.
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
server.registerTool("redact_region", {
|
|
39
|
+
title: "Redact Regions",
|
|
40
|
+
description: "Cover given rectangles in a video (e.g. secrets on screen). Not automatic detection: find " +
|
|
41
|
+
"them with find_text redact: true. Off-frame regions are rejected.",
|
|
42
|
+
inputSchema,
|
|
43
|
+
outputSchema: OUTPUT_PATH,
|
|
44
|
+
annotations: WRITES_FILE,
|
|
45
|
+
}, async (args, extra) => {
|
|
43
46
|
try {
|
|
44
47
|
requireFfmpeg();
|
|
45
48
|
if (!existsSync(args.input)) {
|
|
@@ -66,4 +69,3 @@ export function register(server) {
|
|
|
66
69
|
}
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
|
-
//# sourceMappingURL=redactRegion.js.map
|
package/dist/tools/reframe.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
|
|
4
|
+
import { OUTPUT_PATH, WRITES_FILE } from "../utils/toolSpec.js";
|
|
4
5
|
import { requireFfmpeg } from "../utils/ffmpeg.js";
|
|
5
6
|
import { runEditJob, probeDuration } from "../utils/jobs.js";
|
|
6
7
|
import { buildReframeArgs } from "../utils/produce.js";
|
|
@@ -14,14 +15,18 @@ const inputSchema = {
|
|
|
14
15
|
fit: z
|
|
15
16
|
.enum(["pad", "crop"])
|
|
16
17
|
.optional()
|
|
17
|
-
.describe("pad (default):
|
|
18
|
+
.describe("pad (default): letterbox, nothing lost. crop: fill and center-crop."),
|
|
18
19
|
output: z.string().optional().describe("Optional output path. Defaults under SCREENCAST_HOME/edits."),
|
|
19
20
|
overwrite: z.boolean().optional().describe("Allow replacing an existing file at the output path (default false)."),
|
|
20
21
|
};
|
|
21
22
|
export function register(server) {
|
|
22
|
-
server.
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
server.registerTool("reframe", {
|
|
24
|
+
title: "Reframe Aspect Ratio",
|
|
25
|
+
description: "Re-aspect a video to 16:9, 9:16, 1:1, or 4:5 by padding or cropping.",
|
|
26
|
+
inputSchema,
|
|
27
|
+
outputSchema: OUTPUT_PATH,
|
|
28
|
+
annotations: WRITES_FILE,
|
|
29
|
+
}, async (args, extra) => {
|
|
25
30
|
try {
|
|
26
31
|
requireFfmpeg();
|
|
27
32
|
if (!existsSync(args.input)) {
|
|
@@ -39,4 +44,3 @@ export function register(server) {
|
|
|
39
44
|
}
|
|
40
45
|
});
|
|
41
46
|
}
|
|
42
|
-
//# sourceMappingURL=reframe.js.map
|