@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/assets/ui/player.html
CHANGED
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
<title>Review player</title>
|
|
7
7
|
<!--
|
|
8
8
|
screencast-mcp review player (#128): an MCP Apps view. The host renders it in
|
|
9
|
-
a sandboxed iframe for
|
|
9
|
+
a sandboxed iframe for review_recording results. It talks to
|
|
10
10
|
the host with JSON-RPC over postMessage (ui/initialize, tool notifications,
|
|
11
11
|
tools/call), shows the recording as JPEG frames from player_frames, and sends
|
|
12
|
-
the person's trim and redaction back as one pipeline call. Self-contained
|
|
13
|
-
host's CSP allows no outside origins
|
|
12
|
+
the person's trim and redaction back as one pipeline call. Self-contained when
|
|
13
|
+
served: the host's CSP allows no outside origins, so the server inlines
|
|
14
|
+
player.js in place of its script tag (#243).
|
|
14
15
|
-->
|
|
15
16
|
<style>
|
|
16
17
|
:root {
|
|
@@ -60,6 +61,15 @@
|
|
|
60
61
|
.btn:disabled { opacity: .45; cursor: default; }
|
|
61
62
|
#hint { color: var(--dim); font-size: 12px; }
|
|
62
63
|
.timeline { position: relative; height: 56px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; touch-action: none; }
|
|
64
|
+
.seek { position: absolute; inset: 0; border-radius: 5px; }
|
|
65
|
+
#ticks i { position: absolute; bottom: 0; width: 2px; height: 9px; margin-left: -1px; background: var(--amber); opacity: .8; pointer-events: none; }
|
|
66
|
+
/* Markers (#174): full-height ink ticks, a REC-red cap, and a list below. */
|
|
67
|
+
#marks b { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); opacity: .85; pointer-events: none; }
|
|
68
|
+
#marks b::before { content: ""; position: absolute; top: 0; left: -3px; width: 8px; height: 6px; background: var(--rec); border-radius: 0 0 2px 2px; }
|
|
69
|
+
#markList { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
|
|
70
|
+
#markList button { font: 12px var(--mono); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .15rem .55rem; cursor: pointer; color: var(--ink); }
|
|
71
|
+
#markList button:hover { border-color: var(--rec); }
|
|
72
|
+
#markList button span { color: var(--rec); margin-right: .4rem; font-variant-numeric: tabular-nums; }
|
|
63
73
|
#strip { position: absolute; inset: 0; display: flex; overflow: hidden; border-radius: 5px; opacity: .55; }
|
|
64
74
|
#strip img { height: 100%; flex: 1 1 0; min-width: 0; object-fit: cover; pointer-events: none; }
|
|
65
75
|
.shade { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); pointer-events: none; }
|
|
@@ -68,6 +78,7 @@
|
|
|
68
78
|
position: absolute; top: -6px; bottom: -6px; width: 14px; margin-left: -7px; padding: 0;
|
|
69
79
|
background: var(--amber); border: 0; border-radius: 4px; cursor: ew-resize;
|
|
70
80
|
}
|
|
81
|
+
.handle:focus-visible { outline-color: var(--ink); }
|
|
71
82
|
.handle::after { content: ""; position: absolute; inset: 40% 5px; border-left: 2px solid #111; border-right: 2px solid #111; }
|
|
72
83
|
.times { font: 12px var(--mono); color: var(--dim); gap: 1.2rem; }
|
|
73
84
|
.times b { color: var(--amber); font-weight: 500; }
|
|
@@ -75,6 +86,15 @@
|
|
|
75
86
|
#boxList li { font: 12px var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: .15rem .2rem .15rem .55rem; display: flex; gap: .4rem; align-items: center; }
|
|
76
87
|
#boxList button { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0 .3rem; }
|
|
77
88
|
#boxList button:hover { color: var(--rec); }
|
|
89
|
+
#boxFields { border: 0; margin: 0; padding: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font: 12px var(--mono); color: var(--dim); }
|
|
90
|
+
#boxFields legend { float: left; padding: 0; margin-right: .2rem; }
|
|
91
|
+
#boxFields label { display: flex; align-items: center; gap: .3rem; }
|
|
92
|
+
#boxFields input {
|
|
93
|
+
width: 5.2rem; padding: .3rem .45rem; font: 12px var(--mono); color: var(--ink);
|
|
94
|
+
background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
|
|
95
|
+
}
|
|
96
|
+
#boxFields:disabled { opacity: .45; }
|
|
97
|
+
#sampling { margin-left: auto; }
|
|
78
98
|
#status { font: 12px var(--mono); color: var(--dim); overflow-wrap: anywhere; }
|
|
79
99
|
#status.ok { color: var(--ok); }
|
|
80
100
|
#status.err { color: var(--rec); }
|
|
@@ -95,316 +115,41 @@
|
|
|
95
115
|
<div class="controls">
|
|
96
116
|
<button class="btn" id="play" type="button" disabled>Play</button>
|
|
97
117
|
<button class="btn" id="draw" type="button" aria-pressed="false" disabled>Draw redaction box</button>
|
|
98
|
-
<span id="hint">Drag the amber handles to trim. Draw boxes over anything secret.</span>
|
|
118
|
+
<span id="hint">Drag the amber handles to trim (or focus one and use the arrow keys). Draw or type boxes over anything secret.</span>
|
|
99
119
|
</div>
|
|
100
|
-
<div class="timeline" id="timeline" role="group" aria-label="Timeline
|
|
120
|
+
<div class="timeline" id="timeline" role="group" aria-label="Timeline">
|
|
101
121
|
<div id="strip"></div>
|
|
102
122
|
<div class="shade" id="shadeIn"></div><div class="shade" id="shadeOut"></div>
|
|
123
|
+
<div id="ticks"></div>
|
|
124
|
+
<div id="marks"></div>
|
|
103
125
|
<div id="head"></div>
|
|
104
|
-
|
|
105
|
-
<
|
|
126
|
+
<!-- Sliders (#243): arrows move a frame, Page Up/Down a tenth, Home/End the ends. -->
|
|
127
|
+
<div class="seek" id="seek" role="slider" tabindex="0" aria-label="Playhead" aria-disabled="true"
|
|
128
|
+
aria-valuemin="0" aria-valuemax="0" aria-valuenow="0" aria-valuetext="00:00.0"></div>
|
|
129
|
+
<div class="handle" id="hIn" role="slider" tabindex="0" aria-label="Trim start" aria-disabled="true"
|
|
130
|
+
aria-valuemin="0" aria-valuemax="0" aria-valuenow="0"></div>
|
|
131
|
+
<div class="handle" id="hOut" role="slider" tabindex="0" aria-label="Trim end" aria-disabled="true"
|
|
132
|
+
aria-valuemin="0" aria-valuemax="0" aria-valuenow="0"></div>
|
|
106
133
|
</div>
|
|
107
|
-
<div class="row times"><span>IN <b id="inT">0.0s</b></span><span>OUT <b id="outT">0.0s</b></span><span id="lenT"></span></div>
|
|
134
|
+
<div class="row times"><span>IN <b id="inT">0.0s</b></span><span>OUT <b id="outT">0.0s</b></span><span id="lenT"></span><span id="sampling"></span></div>
|
|
135
|
+
<ul id="markList" aria-label="Markers" hidden></ul>
|
|
108
136
|
<ul id="boxList" aria-label="Redaction boxes"></ul>
|
|
137
|
+
<form id="boxForm" novalidate>
|
|
138
|
+
<fieldset id="boxFields" disabled>
|
|
139
|
+
<legend>ADD BOX (video px)</legend>
|
|
140
|
+
<label>X <input id="bx" type="number" min="0" step="1" inputmode="numeric"></label>
|
|
141
|
+
<label>Y <input id="by" type="number" min="0" step="1" inputmode="numeric"></label>
|
|
142
|
+
<label>W <input id="bw" type="number" min="4" step="1" inputmode="numeric"></label>
|
|
143
|
+
<label>H <input id="bh" type="number" min="4" step="1" inputmode="numeric"></label>
|
|
144
|
+
<button class="btn" type="submit">Add box</button>
|
|
145
|
+
</fieldset>
|
|
146
|
+
</form>
|
|
109
147
|
<div class="row">
|
|
110
148
|
<button class="btn primary" id="apply" type="button" disabled>Export trimmed + redacted copy</button>
|
|
111
149
|
<button class="btn" id="openResult" type="button" hidden>Review the result</button>
|
|
112
150
|
<span id="status" role="status"></span>
|
|
113
151
|
</div>
|
|
114
152
|
</main>
|
|
115
|
-
<script>
|
|
116
|
-
(() => {
|
|
117
|
-
"use strict";
|
|
118
|
-
const $ = (id) => document.getElementById(id);
|
|
119
|
-
const PROTOCOL = "2026-01-26";
|
|
120
|
-
|
|
121
|
-
// --- JSON-RPC over postMessage with the host ---------------------------
|
|
122
|
-
let nextId = 1;
|
|
123
|
-
const pending = new Map();
|
|
124
|
-
const send = (msg) => window.parent.postMessage({ jsonrpc: "2.0", ...msg }, "*");
|
|
125
|
-
const request = (method, params) =>
|
|
126
|
-
new Promise((resolve, reject) => {
|
|
127
|
-
const id = nextId++;
|
|
128
|
-
pending.set(id, { resolve, reject });
|
|
129
|
-
send({ id, method, params });
|
|
130
|
-
});
|
|
131
|
-
const notify = (method, params) => send({ method, params });
|
|
132
|
-
|
|
133
|
-
window.addEventListener("message", (e) => {
|
|
134
|
-
if (e.source !== window.parent) return;
|
|
135
|
-
const m = e.data;
|
|
136
|
-
if (!m || m.jsonrpc !== "2.0") return;
|
|
137
|
-
if (m.id !== undefined && !m.method) {
|
|
138
|
-
const p = pending.get(m.id);
|
|
139
|
-
if (!p) return;
|
|
140
|
-
pending.delete(m.id);
|
|
141
|
-
m.error ? p.reject(new Error(m.error.message || "request failed")) : p.resolve(m.result);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (m.id !== undefined) {
|
|
145
|
-
// A request from the host.
|
|
146
|
-
if (m.method === "ui/resource-teardown" || m.method === "ping") send({ id: m.id, result: {} });
|
|
147
|
-
else send({ id: m.id, error: { code: -32601, message: `Unsupported: ${m.method}` } });
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (m.method === "ui/notifications/tool-input") onToolInput(m.params?.arguments || {});
|
|
151
|
-
else if (m.method === "ui/notifications/tool-result") onToolResult(m.params || {});
|
|
152
|
-
else if (m.method === "ui/notifications/host-context-changed") applyHostContext(m.params || {});
|
|
153
|
-
else if (m.method === "ui/notifications/tool-cancelled") setEmpty("The tool call was cancelled.");
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
const applyHostContext = (ctx) => {
|
|
157
|
-
if (ctx && (ctx.theme === "light" || ctx.theme === "dark")) document.documentElement.dataset.theme = ctx.theme;
|
|
158
|
-
};
|
|
159
|
-
const callTool = async (name, args) => {
|
|
160
|
-
const r = await request("tools/call", { name, arguments: args });
|
|
161
|
-
if (r && r.isError) throw new Error((r.content || []).map((c) => c.text).filter(Boolean).join(" ") || `${name} failed`);
|
|
162
|
-
return r;
|
|
163
|
-
};
|
|
164
|
-
const resultJson = (r) => {
|
|
165
|
-
const t = (r?.content || []).find((c) => c.type === "text");
|
|
166
|
-
try { return t ? JSON.parse(t.text) : null; } catch { return null; }
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
// --- state ---------------------------------------------------------------
|
|
170
|
-
const S = { input: null, duration: 0, W: 0, H: 0, frames: [], times: [], i: 0, inI: 0, outI: 0, boxes: [], drawing: false, playing: null };
|
|
171
|
-
const fmt = (t) => { const m = Math.floor(t / 60), s = t - m * 60; return `${String(m).padStart(2, "0")}:${s.toFixed(1).padStart(4, "0")}`; };
|
|
172
|
-
const sliceStart = (i) => (i * S.duration) / S.frames.length;
|
|
173
|
-
const sliceEnd = (i) => ((i + 1) * S.duration) / S.frames.length;
|
|
174
|
-
const setEmpty = (text) => { $("empty").textContent = text; $("empty").hidden = false; };
|
|
175
|
-
const status = (text, kind) => { const s = $("status"); s.textContent = text; s.className = kind || ""; };
|
|
176
|
-
|
|
177
|
-
function onToolInput(args) {
|
|
178
|
-
if (args.input) $("file").textContent = args.input;
|
|
179
|
-
}
|
|
180
|
-
function onToolResult(result) {
|
|
181
|
-
if (result.isError) return setEmpty((result.content || []).map((c) => c.text).join(" ") || "The tool failed.");
|
|
182
|
-
const j = resultJson(result);
|
|
183
|
-
const input = j && (j.outputPath || j.input);
|
|
184
|
-
if (!input) return setEmpty("No video in this result.");
|
|
185
|
-
load(input);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
async function load(input) {
|
|
189
|
-
S.input = input;
|
|
190
|
-
S.boxes = [];
|
|
191
|
-
$("file").textContent = input.split(/[\\/]/).pop();
|
|
192
|
-
$("file").title = input;
|
|
193
|
-
setEmpty("Loading frames...");
|
|
194
|
-
status("");
|
|
195
|
-
try {
|
|
196
|
-
const r = await callTool("player_frames", { input });
|
|
197
|
-
const meta = resultJson(r);
|
|
198
|
-
S.frames = (r.content || []).filter((c) => c.type === "image").map((c) => `data:${c.mimeType};base64,${c.data}`);
|
|
199
|
-
if (!meta || S.frames.length === 0) throw new Error("No frames came back.");
|
|
200
|
-
Object.assign(S, { duration: meta.durationSec, W: meta.width, H: meta.height, times: meta.frameTimes, i: 0, inI: 0, outI: S.frames.length - 1 });
|
|
201
|
-
} catch (err) {
|
|
202
|
-
return setEmpty(`Could not load the recording: ${err.message}`);
|
|
203
|
-
}
|
|
204
|
-
$("empty").hidden = true;
|
|
205
|
-
$("frame").hidden = false;
|
|
206
|
-
// A strip of up to 40 evenly chosen thumbnails.
|
|
207
|
-
const strip = $("strip");
|
|
208
|
-
strip.replaceChildren();
|
|
209
|
-
const n = Math.min(40, S.frames.length);
|
|
210
|
-
for (let k = 0; k < n; k++) {
|
|
211
|
-
const img = document.createElement("img");
|
|
212
|
-
img.alt = "";
|
|
213
|
-
img.src = S.frames[Math.floor((k * S.frames.length) / n)];
|
|
214
|
-
strip.appendChild(img);
|
|
215
|
-
}
|
|
216
|
-
["play", "draw"].forEach((id) => ($(id).disabled = false));
|
|
217
|
-
show(0);
|
|
218
|
-
render();
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
function show(i) {
|
|
222
|
-
S.i = Math.max(0, Math.min(S.frames.length - 1, i));
|
|
223
|
-
$("frame").src = S.frames[S.i];
|
|
224
|
-
$("tc").textContent = `${fmt(S.times[S.i] || 0)} / ${fmt(S.duration)}`;
|
|
225
|
-
$("head").style.left = `${((S.i + 0.5) / S.frames.length) * 100}%`;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function render() {
|
|
229
|
-
const n = S.frames.length || 1;
|
|
230
|
-
const a = (S.inI / n) * 100, b = ((S.outI + 1) / n) * 100;
|
|
231
|
-
$("hIn").style.left = `${a}%`;
|
|
232
|
-
$("hOut").style.left = `${b}%`;
|
|
233
|
-
$("shadeIn").style.cssText = `left:0;width:${a}%`;
|
|
234
|
-
$("shadeOut").style.cssText = `left:${b}%;right:0`;
|
|
235
|
-
const tin = sliceStart(S.inI), tout = sliceEnd(S.outI);
|
|
236
|
-
$("inT").textContent = `${tin.toFixed(1)}s`;
|
|
237
|
-
$("outT").textContent = `${tout.toFixed(1)}s`;
|
|
238
|
-
$("lenT").textContent = `${(tout - tin).toFixed(1)}s kept`;
|
|
239
|
-
renderBoxes();
|
|
240
|
-
const trimmed = S.inI > 0 || S.outI < S.frames.length - 1;
|
|
241
|
-
$("apply").disabled = !S.input || (!trimmed && S.boxes.length === 0);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// --- timeline: seek and trim handles ----------------------------------
|
|
245
|
-
const tl = $("timeline");
|
|
246
|
-
const indexAt = (clientX) => {
|
|
247
|
-
const r = tl.getBoundingClientRect();
|
|
248
|
-
return Math.floor(((clientX - r.left) / r.width) * S.frames.length);
|
|
249
|
-
};
|
|
250
|
-
let dragging = null;
|
|
251
|
-
tl.addEventListener("pointerdown", (e) => {
|
|
252
|
-
if (!S.frames.length) return;
|
|
253
|
-
dragging = e.target === $("hIn") ? "in" : e.target === $("hOut") ? "out" : "seek";
|
|
254
|
-
tl.setPointerCapture(e.pointerId);
|
|
255
|
-
move(e);
|
|
256
|
-
});
|
|
257
|
-
tl.addEventListener("pointermove", (e) => dragging && move(e));
|
|
258
|
-
tl.addEventListener("pointerup", () => (dragging = null));
|
|
259
|
-
function move(e) {
|
|
260
|
-
const i = Math.max(0, Math.min(S.frames.length - 1, indexAt(e.clientX)));
|
|
261
|
-
if (dragging === "in") S.inI = Math.min(i, S.outI);
|
|
262
|
-
else if (dragging === "out") S.outI = Math.max(i, S.inI);
|
|
263
|
-
show(i);
|
|
264
|
-
render();
|
|
265
|
-
}
|
|
266
|
-
for (const [id, key] of [["hIn", "inI"], ["hOut", "outI"]]) {
|
|
267
|
-
$(id).addEventListener("keydown", (e) => {
|
|
268
|
-
const d = e.key === "ArrowLeft" ? -1 : e.key === "ArrowRight" ? 1 : 0;
|
|
269
|
-
if (!d) return;
|
|
270
|
-
e.preventDefault();
|
|
271
|
-
const v = S[key] + d;
|
|
272
|
-
if (key === "inI") S.inI = Math.max(0, Math.min(v, S.outI));
|
|
273
|
-
else S.outI = Math.min(S.frames.length - 1, Math.max(v, S.inI));
|
|
274
|
-
show(S[key]);
|
|
275
|
-
render();
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// --- playback: a flipbook over the kept range ---------------------------
|
|
280
|
-
$("play").addEventListener("click", () => {
|
|
281
|
-
if (S.playing) return stop();
|
|
282
|
-
$("play").textContent = "Pause";
|
|
283
|
-
let i = S.i < S.inI || S.i >= S.outI ? S.inI : S.i;
|
|
284
|
-
const ms = (S.duration / S.frames.length) * 1000;
|
|
285
|
-
S.playing = setInterval(() => {
|
|
286
|
-
show(i);
|
|
287
|
-
i = i >= S.outI ? S.inI : i + 1;
|
|
288
|
-
}, ms);
|
|
289
|
-
});
|
|
290
|
-
function stop() {
|
|
291
|
-
clearInterval(S.playing);
|
|
292
|
-
S.playing = null;
|
|
293
|
-
$("play").textContent = "Play";
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// --- redaction boxes, in video pixels -----------------------------------
|
|
297
|
-
const stage = $("stage"), img = $("frame");
|
|
298
|
-
$("draw").addEventListener("click", () => {
|
|
299
|
-
S.drawing = !S.drawing;
|
|
300
|
-
$("draw").setAttribute("aria-pressed", String(S.drawing));
|
|
301
|
-
stage.classList.toggle("drawing", S.drawing);
|
|
302
|
-
});
|
|
303
|
-
const toVideo = (clientX, clientY) => {
|
|
304
|
-
const r = img.getBoundingClientRect();
|
|
305
|
-
return {
|
|
306
|
-
x: Math.max(0, Math.min(S.W, ((clientX - r.left) / r.width) * S.W)),
|
|
307
|
-
y: Math.max(0, Math.min(S.H, ((clientY - r.top) / r.height) * S.H)),
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
let start = null, draft = null;
|
|
311
|
-
stage.addEventListener("pointerdown", (e) => {
|
|
312
|
-
if (!S.drawing || !S.frames.length) return;
|
|
313
|
-
start = toVideo(e.clientX, e.clientY);
|
|
314
|
-
stage.setPointerCapture(e.pointerId);
|
|
315
|
-
draft = document.createElement("div");
|
|
316
|
-
draft.className = "box draft";
|
|
317
|
-
stage.appendChild(draft);
|
|
318
|
-
});
|
|
319
|
-
stage.addEventListener("pointermove", (e) => {
|
|
320
|
-
if (!start) return;
|
|
321
|
-
placeBox(draft, rectOf(start, toVideo(e.clientX, e.clientY)));
|
|
322
|
-
});
|
|
323
|
-
stage.addEventListener("pointerup", (e) => {
|
|
324
|
-
if (!start) return;
|
|
325
|
-
const r = rectOf(start, toVideo(e.clientX, e.clientY));
|
|
326
|
-
start = null;
|
|
327
|
-
draft.remove();
|
|
328
|
-
if (r.width >= 4 && r.height >= 4) S.boxes.push(r);
|
|
329
|
-
render();
|
|
330
|
-
});
|
|
331
|
-
const rectOf = (a, b) => {
|
|
332
|
-
const x = Math.floor(Math.min(a.x, b.x)), y = Math.floor(Math.min(a.y, b.y));
|
|
333
|
-
return { x, y, width: Math.ceil(Math.max(a.x, b.x)) - x, height: Math.ceil(Math.max(a.y, b.y)) - y };
|
|
334
|
-
};
|
|
335
|
-
function placeBox(el, r) {
|
|
336
|
-
const ir = img.getBoundingClientRect(), sr = stage.getBoundingClientRect();
|
|
337
|
-
const k = ir.width / S.W;
|
|
338
|
-
el.style.left = `${ir.left - sr.left + r.x * k}px`;
|
|
339
|
-
el.style.top = `${ir.top - sr.top + r.y * k}px`;
|
|
340
|
-
el.style.width = `${r.width * k}px`;
|
|
341
|
-
el.style.height = `${r.height * k}px`;
|
|
342
|
-
}
|
|
343
|
-
function renderBoxes() {
|
|
344
|
-
stage.querySelectorAll(".box:not(.draft)").forEach((b) => b.remove());
|
|
345
|
-
const list = $("boxList");
|
|
346
|
-
list.replaceChildren();
|
|
347
|
-
S.boxes.forEach((r, n) => {
|
|
348
|
-
const el = document.createElement("div");
|
|
349
|
-
el.className = "box";
|
|
350
|
-
el.innerHTML = `<span>${n + 1}</span>`;
|
|
351
|
-
stage.appendChild(el);
|
|
352
|
-
placeBox(el, r);
|
|
353
|
-
const li = document.createElement("li");
|
|
354
|
-
li.textContent = `#${n + 1} ${r.width}\u00d7${r.height} at ${r.x},${r.y}`;
|
|
355
|
-
const rm = document.createElement("button");
|
|
356
|
-
rm.type = "button";
|
|
357
|
-
rm.textContent = "\u2715";
|
|
358
|
-
rm.setAttribute("aria-label", `Remove box ${n + 1}`);
|
|
359
|
-
rm.addEventListener("click", () => { S.boxes.splice(n, 1); render(); });
|
|
360
|
-
li.appendChild(rm);
|
|
361
|
-
list.appendChild(li);
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
img.addEventListener("load", renderBoxes);
|
|
365
|
-
new ResizeObserver(renderBoxes).observe(stage);
|
|
366
|
-
|
|
367
|
-
// --- export: one pipeline call -----------------------------------------
|
|
368
|
-
$("apply").addEventListener("click", async () => {
|
|
369
|
-
stop();
|
|
370
|
-
const steps = [];
|
|
371
|
-
// Redact first, so a box covers every frame of the kept range.
|
|
372
|
-
if (S.boxes.length) steps.push({ op: "redact", regions: S.boxes.map((b) => ({ ...b })) });
|
|
373
|
-
const tin = Math.round(sliceStart(S.inI) * 1000) / 1000, tout = Math.round(sliceEnd(S.outI) * 1000) / 1000;
|
|
374
|
-
if (S.inI > 0 || S.outI < S.frames.length - 1) steps.push({ op: "trim", start: tin, end: Math.min(tout, S.duration) });
|
|
375
|
-
$("apply").disabled = true;
|
|
376
|
-
status("Exporting...");
|
|
377
|
-
try {
|
|
378
|
-
const out = resultJson(await callTool("pipeline", { input: S.input, steps }));
|
|
379
|
-
S.result = out.outputPath;
|
|
380
|
-
status(`Saved ${S.result}`, "ok");
|
|
381
|
-
$("openResult").hidden = false;
|
|
382
|
-
const what = [steps.some((s) => s.op === "trim") ? `trimmed to ${tin}-${tout}s` : "", S.boxes.length ? `${S.boxes.length} region(s) redacted` : ""].filter(Boolean).join(", ");
|
|
383
|
-
// Tell the agent what the person did; the host includes it on the next turn.
|
|
384
|
-
request("ui/update-model-context", {
|
|
385
|
-
content: [{ type: "text", text: `In the review player the user exported ${S.input}, ${what}, to ${S.result}.` }],
|
|
386
|
-
structuredContent: { input: S.input, output: S.result, steps },
|
|
387
|
-
}).catch(() => {});
|
|
388
|
-
} catch (err) {
|
|
389
|
-
status(`Export failed: ${err.message}`, "err");
|
|
390
|
-
} finally {
|
|
391
|
-
render();
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
$("openResult").addEventListener("click", () => {
|
|
395
|
-
$("openResult").hidden = true;
|
|
396
|
-
load(S.result);
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
// --- start ---------------------------------------------------------------
|
|
400
|
-
new ResizeObserver(() => notify("ui/notifications/size-changed", { height: Math.ceil(document.documentElement.scrollHeight) })).observe(document.body);
|
|
401
|
-
request("ui/initialize", { appInfo: { name: "screencast-review-player", version: "1.0.0" }, appCapabilities: {}, protocolVersion: PROTOCOL })
|
|
402
|
-
.then((r) => {
|
|
403
|
-
applyHostContext(r && r.hostContext);
|
|
404
|
-
notify("ui/notifications/initialized", {});
|
|
405
|
-
})
|
|
406
|
-
.catch((err) => setEmpty(`The host did not start the player: ${err.message}`));
|
|
407
|
-
})();
|
|
408
|
-
</script>
|
|
153
|
+
<script src="player.js"></script>
|
|
409
154
|
</body>
|
|
410
155
|
</html>
|