@tmhs/screencast-mcp 0.38.0 → 0.44.2

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.
Files changed (329) hide show
  1. package/README.md +58 -14
  2. package/assets/icon.png +0 -0
  3. package/assets/ui/player.html +38 -302
  4. package/assets/ui/player.js +382 -0
  5. package/dist/context.js +0 -5
  6. package/dist/index.js +7 -115
  7. package/dist/prompts.js +0 -7
  8. package/dist/resources.js +2 -14
  9. package/dist/server.js +129 -0
  10. package/dist/tools/assembleHighlights.js +12 -7
  11. package/dist/tools/burnSubtitles.js +12 -6
  12. package/dist/tools/callout.js +32 -16
  13. package/dist/tools/clip.js +12 -9
  14. package/dist/tools/compress.js +10 -5
  15. package/dist/tools/concat.js +16 -15
  16. package/dist/tools/contactSheet.js +26 -22
  17. package/dist/tools/convert.js +12 -6
  18. package/dist/tools/crop.js +12 -7
  19. package/dist/tools/cutIdle.js +15 -9
  20. package/dist/tools/denoise.js +12 -6
  21. package/dist/tools/doctor.js +133 -0
  22. package/dist/tools/exportGif.js +14 -10
  23. package/dist/tools/exportPreset.js +11 -8
  24. package/dist/tools/extractAudio.js +10 -8
  25. package/dist/tools/findText.js +69 -65
  26. package/dist/tools/getMediaInfo.js +17 -3
  27. package/dist/tools/getSession.js +15 -3
  28. package/dist/tools/listAudioDevices.js +14 -7
  29. package/dist/tools/listSessions.js +13 -3
  30. package/dist/tools/listTargets.js +76 -0
  31. package/dist/tools/musicBed.js +14 -10
  32. package/dist/tools/normalizeAudio.js +12 -8
  33. package/dist/tools/overlay.js +16 -12
  34. package/dist/tools/pipeline.js +31 -22
  35. package/dist/tools/readEvents.js +21 -12
  36. package/dist/tools/redactRegion.js +19 -17
  37. package/dist/tools/reframe.js +9 -5
  38. package/dist/tools/reviewRecording.js +63 -22
  39. package/dist/tools/sampleFrames.js +33 -40
  40. package/dist/tools/scale.js +9 -3
  41. package/dist/tools/screenDiff.js +23 -17
  42. package/dist/tools/screenshot.js +21 -17
  43. package/dist/tools/speed.js +15 -4
  44. package/dist/tools/startRecording.js +48 -52
  45. package/dist/tools/stopRecording.js +10 -9
  46. package/dist/tools/titleCard.js +19 -11
  47. package/dist/tools/transcribe.js +13 -7
  48. package/dist/tools/trim.js +11 -10
  49. package/dist/tools/waitForChange.js +37 -22
  50. package/dist/tools/xfadeTransition.js +12 -8
  51. package/dist/tools/zoom.js +26 -29
  52. package/dist/utils/anim.js +1 -21
  53. package/dist/utils/animExport.js +5 -10
  54. package/dist/utils/audio.js +4 -33
  55. package/dist/utils/audioDevices.js +1 -48
  56. package/dist/utils/callout.js +1 -19
  57. package/dist/utils/calloutAssets.js +21 -11
  58. package/dist/utils/capabilities.js +95 -0
  59. package/dist/utils/captions.js +9 -26
  60. package/dist/utils/consent.js +29 -0
  61. package/dist/utils/diff.js +0 -46
  62. package/dist/utils/errors.js +5 -13
  63. package/dist/utils/events.js +21 -77
  64. package/dist/utils/expr.js +11 -0
  65. package/dist/utils/ffmpeg.js +119 -48
  66. package/dist/utils/fontCoverage.js +177 -0
  67. package/dist/utils/fonts.js +139 -23
  68. package/dist/utils/idle.js +12 -24
  69. package/dist/utils/images.js +0 -17
  70. package/dist/utils/jobs.js +42 -41
  71. package/dist/utils/lifecycle.js +0 -29
  72. package/dist/utils/logging.js +75 -0
  73. package/dist/utils/media.js +11 -122
  74. package/dist/utils/monitors.js +7 -43
  75. package/dist/utils/ocr.js +53 -71
  76. package/dist/utils/paths.js +68 -31
  77. package/dist/utils/pipeline.js +0 -23
  78. package/dist/utils/player.js +50 -27
  79. package/dist/utils/produce.js +6 -66
  80. package/dist/utils/resolveTarget.js +0 -19
  81. package/dist/utils/retention.js +1 -15
  82. package/dist/utils/roots.js +42 -0
  83. package/dist/utils/sessions.js +195 -160
  84. package/dist/utils/sheet.js +0 -19
  85. package/dist/utils/still.js +0 -15
  86. package/dist/utils/targetList.js +63 -0
  87. package/dist/utils/targets.js +5 -70
  88. package/dist/utils/toolSpec.js +25 -0
  89. package/dist/utils/toolsets.js +102 -0
  90. package/dist/utils/validate.js +0 -22
  91. package/dist/utils/wgc.js +0 -46
  92. package/dist/utils/windows.js +5 -50
  93. package/dist/utils/zoom.js +55 -85
  94. package/dist/wgcRecorder.js +1 -30
  95. package/package.json +7 -3
  96. package/dist/context.d.ts +0 -9
  97. package/dist/context.d.ts.map +0 -1
  98. package/dist/context.js.map +0 -1
  99. package/dist/index.d.ts +0 -3
  100. package/dist/index.d.ts.map +0 -1
  101. package/dist/index.js.map +0 -1
  102. package/dist/prompts.d.ts +0 -10
  103. package/dist/prompts.d.ts.map +0 -1
  104. package/dist/prompts.js.map +0 -1
  105. package/dist/resources.d.ts +0 -3
  106. package/dist/resources.d.ts.map +0 -1
  107. package/dist/resources.js.map +0 -1
  108. package/dist/tools/assembleHighlights.d.ts +0 -3
  109. package/dist/tools/assembleHighlights.d.ts.map +0 -1
  110. package/dist/tools/assembleHighlights.js.map +0 -1
  111. package/dist/tools/burnSubtitles.d.ts +0 -3
  112. package/dist/tools/burnSubtitles.d.ts.map +0 -1
  113. package/dist/tools/burnSubtitles.js.map +0 -1
  114. package/dist/tools/callout.d.ts +0 -37
  115. package/dist/tools/callout.d.ts.map +0 -1
  116. package/dist/tools/callout.js.map +0 -1
  117. package/dist/tools/clip.d.ts +0 -3
  118. package/dist/tools/clip.d.ts.map +0 -1
  119. package/dist/tools/clip.js.map +0 -1
  120. package/dist/tools/compress.d.ts +0 -3
  121. package/dist/tools/compress.d.ts.map +0 -1
  122. package/dist/tools/compress.js.map +0 -1
  123. package/dist/tools/concat.d.ts +0 -3
  124. package/dist/tools/concat.d.ts.map +0 -1
  125. package/dist/tools/concat.js.map +0 -1
  126. package/dist/tools/contactSheet.d.ts +0 -3
  127. package/dist/tools/contactSheet.d.ts.map +0 -1
  128. package/dist/tools/contactSheet.js.map +0 -1
  129. package/dist/tools/convert.d.ts +0 -3
  130. package/dist/tools/convert.d.ts.map +0 -1
  131. package/dist/tools/convert.js.map +0 -1
  132. package/dist/tools/crop.d.ts +0 -3
  133. package/dist/tools/crop.d.ts.map +0 -1
  134. package/dist/tools/crop.js.map +0 -1
  135. package/dist/tools/cutIdle.d.ts +0 -3
  136. package/dist/tools/cutIdle.d.ts.map +0 -1
  137. package/dist/tools/cutIdle.js.map +0 -1
  138. package/dist/tools/denoise.d.ts +0 -3
  139. package/dist/tools/denoise.d.ts.map +0 -1
  140. package/dist/tools/denoise.js.map +0 -1
  141. package/dist/tools/exportGif.d.ts +0 -3
  142. package/dist/tools/exportGif.d.ts.map +0 -1
  143. package/dist/tools/exportGif.js.map +0 -1
  144. package/dist/tools/exportPreset.d.ts +0 -3
  145. package/dist/tools/exportPreset.d.ts.map +0 -1
  146. package/dist/tools/exportPreset.js.map +0 -1
  147. package/dist/tools/extractAudio.d.ts +0 -3
  148. package/dist/tools/extractAudio.d.ts.map +0 -1
  149. package/dist/tools/extractAudio.js.map +0 -1
  150. package/dist/tools/findText.d.ts +0 -6
  151. package/dist/tools/findText.d.ts.map +0 -1
  152. package/dist/tools/findText.js.map +0 -1
  153. package/dist/tools/getMediaInfo.d.ts +0 -3
  154. package/dist/tools/getMediaInfo.d.ts.map +0 -1
  155. package/dist/tools/getMediaInfo.js.map +0 -1
  156. package/dist/tools/getSession.d.ts +0 -3
  157. package/dist/tools/getSession.d.ts.map +0 -1
  158. package/dist/tools/getSession.js.map +0 -1
  159. package/dist/tools/listAudioDevices.d.ts +0 -3
  160. package/dist/tools/listAudioDevices.d.ts.map +0 -1
  161. package/dist/tools/listAudioDevices.js.map +0 -1
  162. package/dist/tools/listSessions.d.ts +0 -3
  163. package/dist/tools/listSessions.d.ts.map +0 -1
  164. package/dist/tools/listSessions.js.map +0 -1
  165. package/dist/tools/musicBed.d.ts +0 -3
  166. package/dist/tools/musicBed.d.ts.map +0 -1
  167. package/dist/tools/musicBed.js.map +0 -1
  168. package/dist/tools/normalizeAudio.d.ts +0 -3
  169. package/dist/tools/normalizeAudio.d.ts.map +0 -1
  170. package/dist/tools/normalizeAudio.js.map +0 -1
  171. package/dist/tools/overlay.d.ts +0 -3
  172. package/dist/tools/overlay.d.ts.map +0 -1
  173. package/dist/tools/overlay.js.map +0 -1
  174. package/dist/tools/pipeline.d.ts +0 -3
  175. package/dist/tools/pipeline.d.ts.map +0 -1
  176. package/dist/tools/pipeline.js.map +0 -1
  177. package/dist/tools/readEvents.d.ts +0 -6
  178. package/dist/tools/readEvents.d.ts.map +0 -1
  179. package/dist/tools/readEvents.js.map +0 -1
  180. package/dist/tools/redactRegion.d.ts +0 -13
  181. package/dist/tools/redactRegion.d.ts.map +0 -1
  182. package/dist/tools/redactRegion.js.map +0 -1
  183. package/dist/tools/reframe.d.ts +0 -3
  184. package/dist/tools/reframe.d.ts.map +0 -1
  185. package/dist/tools/reframe.js.map +0 -1
  186. package/dist/tools/reviewRecording.d.ts +0 -5
  187. package/dist/tools/reviewRecording.d.ts.map +0 -1
  188. package/dist/tools/reviewRecording.js.map +0 -1
  189. package/dist/tools/sampleFrames.d.ts +0 -3
  190. package/dist/tools/sampleFrames.d.ts.map +0 -1
  191. package/dist/tools/sampleFrames.js.map +0 -1
  192. package/dist/tools/scale.d.ts +0 -3
  193. package/dist/tools/scale.d.ts.map +0 -1
  194. package/dist/tools/scale.js.map +0 -1
  195. package/dist/tools/screenDiff.d.ts +0 -3
  196. package/dist/tools/screenDiff.d.ts.map +0 -1
  197. package/dist/tools/screenDiff.js.map +0 -1
  198. package/dist/tools/screenshot.d.ts +0 -3
  199. package/dist/tools/screenshot.d.ts.map +0 -1
  200. package/dist/tools/screenshot.js.map +0 -1
  201. package/dist/tools/speed.d.ts +0 -3
  202. package/dist/tools/speed.d.ts.map +0 -1
  203. package/dist/tools/speed.js.map +0 -1
  204. package/dist/tools/startRecording.d.ts +0 -3
  205. package/dist/tools/startRecording.d.ts.map +0 -1
  206. package/dist/tools/startRecording.js.map +0 -1
  207. package/dist/tools/stopRecording.d.ts +0 -3
  208. package/dist/tools/stopRecording.d.ts.map +0 -1
  209. package/dist/tools/stopRecording.js.map +0 -1
  210. package/dist/tools/titleCard.d.ts +0 -3
  211. package/dist/tools/titleCard.d.ts.map +0 -1
  212. package/dist/tools/titleCard.js.map +0 -1
  213. package/dist/tools/transcribe.d.ts +0 -3
  214. package/dist/tools/transcribe.d.ts.map +0 -1
  215. package/dist/tools/transcribe.js.map +0 -1
  216. package/dist/tools/trim.d.ts +0 -3
  217. package/dist/tools/trim.d.ts.map +0 -1
  218. package/dist/tools/trim.js.map +0 -1
  219. package/dist/tools/waitForChange.d.ts +0 -3
  220. package/dist/tools/waitForChange.d.ts.map +0 -1
  221. package/dist/tools/waitForChange.js.map +0 -1
  222. package/dist/tools/xfadeTransition.d.ts +0 -3
  223. package/dist/tools/xfadeTransition.d.ts.map +0 -1
  224. package/dist/tools/xfadeTransition.js.map +0 -1
  225. package/dist/tools/zoom.d.ts +0 -15
  226. package/dist/tools/zoom.d.ts.map +0 -1
  227. package/dist/tools/zoom.js.map +0 -1
  228. package/dist/utils/anim.d.ts +0 -33
  229. package/dist/utils/anim.d.ts.map +0 -1
  230. package/dist/utils/anim.js.map +0 -1
  231. package/dist/utils/animExport.d.ts +0 -27
  232. package/dist/utils/animExport.d.ts.map +0 -1
  233. package/dist/utils/animExport.js.map +0 -1
  234. package/dist/utils/audio.d.ts +0 -49
  235. package/dist/utils/audio.d.ts.map +0 -1
  236. package/dist/utils/audio.js.map +0 -1
  237. package/dist/utils/audioDevices.d.ts +0 -33
  238. package/dist/utils/audioDevices.d.ts.map +0 -1
  239. package/dist/utils/audioDevices.js.map +0 -1
  240. package/dist/utils/callout.d.ts +0 -72
  241. package/dist/utils/callout.d.ts.map +0 -1
  242. package/dist/utils/callout.js.map +0 -1
  243. package/dist/utils/calloutAssets.d.ts +0 -3
  244. package/dist/utils/calloutAssets.d.ts.map +0 -1
  245. package/dist/utils/calloutAssets.js.map +0 -1
  246. package/dist/utils/captions.d.ts +0 -26
  247. package/dist/utils/captions.d.ts.map +0 -1
  248. package/dist/utils/captions.js.map +0 -1
  249. package/dist/utils/diff.d.ts +0 -112
  250. package/dist/utils/diff.d.ts.map +0 -1
  251. package/dist/utils/diff.js.map +0 -1
  252. package/dist/utils/errors.d.ts +0 -33
  253. package/dist/utils/errors.d.ts.map +0 -1
  254. package/dist/utils/errors.js.map +0 -1
  255. package/dist/utils/events.d.ts +0 -143
  256. package/dist/utils/events.d.ts.map +0 -1
  257. package/dist/utils/events.js.map +0 -1
  258. package/dist/utils/ffmpeg.d.ts +0 -50
  259. package/dist/utils/ffmpeg.d.ts.map +0 -1
  260. package/dist/utils/ffmpeg.js.map +0 -1
  261. package/dist/utils/fonts.d.ts +0 -17
  262. package/dist/utils/fonts.d.ts.map +0 -1
  263. package/dist/utils/fonts.js.map +0 -1
  264. package/dist/utils/idle.d.ts +0 -23
  265. package/dist/utils/idle.d.ts.map +0 -1
  266. package/dist/utils/idle.js.map +0 -1
  267. package/dist/utils/images.d.ts +0 -21
  268. package/dist/utils/images.d.ts.map +0 -1
  269. package/dist/utils/images.js.map +0 -1
  270. package/dist/utils/jobs.d.ts +0 -44
  271. package/dist/utils/jobs.d.ts.map +0 -1
  272. package/dist/utils/jobs.js.map +0 -1
  273. package/dist/utils/lifecycle.d.ts +0 -29
  274. package/dist/utils/lifecycle.d.ts.map +0 -1
  275. package/dist/utils/lifecycle.js.map +0 -1
  276. package/dist/utils/media.d.ts +0 -272
  277. package/dist/utils/media.d.ts.map +0 -1
  278. package/dist/utils/media.js.map +0 -1
  279. package/dist/utils/monitors.d.ts +0 -47
  280. package/dist/utils/monitors.d.ts.map +0 -1
  281. package/dist/utils/monitors.js.map +0 -1
  282. package/dist/utils/ocr.d.ts +0 -50
  283. package/dist/utils/ocr.d.ts.map +0 -1
  284. package/dist/utils/ocr.js.map +0 -1
  285. package/dist/utils/paths.d.ts +0 -28
  286. package/dist/utils/paths.d.ts.map +0 -1
  287. package/dist/utils/paths.js.map +0 -1
  288. package/dist/utils/pipeline.d.ts +0 -69
  289. package/dist/utils/pipeline.d.ts.map +0 -1
  290. package/dist/utils/pipeline.js.map +0 -1
  291. package/dist/utils/player.d.ts +0 -30
  292. package/dist/utils/player.d.ts.map +0 -1
  293. package/dist/utils/player.js.map +0 -1
  294. package/dist/utils/produce.d.ts +0 -126
  295. package/dist/utils/produce.d.ts.map +0 -1
  296. package/dist/utils/produce.js.map +0 -1
  297. package/dist/utils/resolveTarget.d.ts +0 -32
  298. package/dist/utils/resolveTarget.d.ts.map +0 -1
  299. package/dist/utils/resolveTarget.js.map +0 -1
  300. package/dist/utils/retention.d.ts +0 -10
  301. package/dist/utils/retention.d.ts.map +0 -1
  302. package/dist/utils/retention.js.map +0 -1
  303. package/dist/utils/sessions.d.ts +0 -154
  304. package/dist/utils/sessions.d.ts.map +0 -1
  305. package/dist/utils/sessions.js.map +0 -1
  306. package/dist/utils/sheet.d.ts +0 -26
  307. package/dist/utils/sheet.d.ts.map +0 -1
  308. package/dist/utils/sheet.js.map +0 -1
  309. package/dist/utils/still.d.ts +0 -7
  310. package/dist/utils/still.d.ts.map +0 -1
  311. package/dist/utils/still.js.map +0 -1
  312. package/dist/utils/targets.d.ts +0 -113
  313. package/dist/utils/targets.d.ts.map +0 -1
  314. package/dist/utils/targets.js.map +0 -1
  315. package/dist/utils/validate.d.ts +0 -15
  316. package/dist/utils/validate.d.ts.map +0 -1
  317. package/dist/utils/validate.js.map +0 -1
  318. package/dist/utils/wgc.d.ts +0 -46
  319. package/dist/utils/wgc.d.ts.map +0 -1
  320. package/dist/utils/wgc.js.map +0 -1
  321. package/dist/utils/windows.d.ts +0 -94
  322. package/dist/utils/windows.d.ts.map +0 -1
  323. package/dist/utils/windows.js.map +0 -1
  324. package/dist/utils/zoom.d.ts +0 -95
  325. package/dist/utils/zoom.d.ts.map +0 -1
  326. package/dist/utils/zoom.js.map +0 -1
  327. package/dist/wgcRecorder.d.ts +0 -2
  328. package/dist/wgcRecorder.d.ts.map +0 -1
  329. package/dist/wgcRecorder.js.map +0 -1
@@ -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("Path to the overlay image or video (logo, watermark, picture-in-picture)."),
11
- x: z.number().int().nonnegative().describe("Overlay left position in pixels."),
12
- y: z.number().int().nonnegative().describe("Overlay top position in pixels."),
13
- width: z.number().int().positive().optional().describe("Optional overlay width in px (height auto when omitted)."),
14
- height: z.number().int().positive().optional().describe("Optional overlay height in px (width auto when omitted)."),
15
- start: z.number().nonnegative().optional().describe("Optional second to show the overlay from."),
16
- end: z.number().positive().optional().describe("Optional second to hide the overlay after."),
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.tool("overlay", "Composite an image or video (logo, watermark, picture-in-picture) onto a " +
22
- "base video at a pixel position, optionally scaled and time-limited. A " +
23
- "video overlay starts playing at start and holds its last frame if it ends " +
24
- "early; the output keeps the base video's audio and length.", inputSchema, async (args, extra) => {
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
@@ -3,12 +3,13 @@ import { join } from "node:path";
3
3
  import { existsSync, mkdtempSync, rmSync } 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";
@@ -38,7 +39,7 @@ const step = z.discriminatedUnion("op", [
38
39
  pad: z.number().int().nonnegative().optional(),
39
40
  color: z.string().optional(),
40
41
  }),
41
- z.object({ op: z.literal("callout"), items: z.array(calloutItemSchema).min(1).max(50) }),
42
+ z.object({ op: z.literal("callout"), items: z.array(calloutItemSchema).min(1).max(50), fontFile: fontFileSchema }),
42
43
  z.object({ op: z.literal("reframe"), aspect, fit }),
43
44
  z.object({ op: z.literal("zoom"), keyframes: z.array(zoomKeyframeSchema).min(1).max(100), transitionSec: z.number().positive().max(5).optional() }),
44
45
  z.object({ op: z.literal("export_preset"), platform: z.enum(PLATFORMS), fit }),
@@ -56,20 +57,23 @@ const inputSchema = {
56
57
  .array(step)
57
58
  .min(1)
58
59
  .max(MAX_PIPELINE_STEPS)
59
- .describe("Edits in order, each { op, ...the same options as its tool }: trim, crop, scale, speed, redact " +
60
- "(redact_region), callout, reframe, zoom (keyframes), and as the last step only export_preset " +
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."),
60
+ .describe("Edits in order, each { op, ...its tool's options }; export_preset/export_gif only last. Times " +
61
+ "and pixels are relative to the video as it is at that step (after earlier trims, speed, crops)."),
63
62
  quality: z.enum(["draft", "standard", "high"]).optional().describe("Encoder preset for an mp4 result (default standard)."),
64
- dryRun: z.boolean().optional().describe("Return the planned ffmpeg command and output size without running it."),
63
+ dryRun: z.boolean().optional().describe("Return the plan (ffmpeg command, output size) without running it."),
65
64
  output: z.string().optional().describe("Optional output path. Defaults under SCREENCAST_HOME/edits."),
66
65
  overwrite: z.boolean().optional().describe("Allow replacing an existing file at the output path (default false)."),
67
66
  };
68
67
  export function register(server) {
69
- server.tool("pipeline", "Run several edits as one ffmpeg process: one re-encode and no intermediate files, instead of a " +
70
- "tool call and a re-encode per edit. Steps use the same options as the standalone tools " +
71
- "(trim, crop, scale, speed, redact, callout, reframe, zoom) and may end with export_preset or " +
72
- "export_gif. The same steps can be saved and re-run on another recording. dryRun returns the plan.", inputSchema, async (args, extra) => {
68
+ server.registerTool("pipeline", {
69
+ title: "Edit Pipeline",
70
+ description: "Run several edits (trim, crop, scale, speed, redact, callout, reframe, zoom, then optionally " +
71
+ "export_preset or export_gif) in one ffmpeg pass: one re-encode, no intermediate files. Prefer it " +
72
+ "over chaining edit tools.",
73
+ inputSchema,
74
+ outputSchema: looseOutput({ processes: z.number().int(), steps: z.array(z.string()) }),
75
+ annotations: WRITES_FILE,
76
+ }, async (args, extra) => {
73
77
  try {
74
78
  requireFfmpeg();
75
79
  if (!existsSync(args.input))
@@ -85,22 +89,26 @@ export function register(server) {
85
89
  durationSec: info.durationSec,
86
90
  hasAudio: info.audioCodec !== null,
87
91
  };
88
- const last = steps[steps.length - 1];
92
+ const last = steps.at(-1);
93
+ if (!last)
94
+ throw new ScreencastError("Provide at least one step.");
89
95
  const ext = last.op === "export_gif" ? `.${last.format ?? "gif"}` : ".mp4";
90
96
  const output = resolveOutput(args.output, subdir("edits"), `pipeline-${stamp()}-${rand()}${ext}`, args.overwrite);
91
97
  const work = mkdtempSync(join(tmpdir(), "screencast-pipeline-"));
92
98
  try {
93
- // Callout text and arrow files; a dry run plans with placeholder paths.
94
99
  const assets = {};
95
- for (let i = 0; i < steps.length; i++) {
96
- const s = steps[i];
100
+ const fallbackFonts = [];
101
+ const warnings = [];
102
+ for (const [i, s] of steps.entries()) {
97
103
  if (s.op !== "callout")
98
104
  continue;
99
- assets[i] = args.dryRun
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}_`);
105
+ const a = args.dryRun
106
+ ? { 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) }
107
+ : await prepareCalloutAssets(s.items, work, `s${i}_`, s.fontFile);
108
+ assets[i] = a;
109
+ fallbackFonts.push(...a.fallbackFonts.map((f) => ({ step: i, ...f })));
110
+ warnings.push(...a.warnings.map((w) => `Step ${i}, ${w.charAt(0).toLowerCase()}${w.slice(1)}`));
102
111
  }
103
- // An export_gif tail renders to a temporary mp4 first; a dry run names it plainly.
104
112
  const target = last.op === "export_gif" ? (args.dryRun ? "<temporary stage1.mp4>" : join(work, "stage1.mp4")) : output;
105
113
  const plan = planPipeline(args.input, target, steps, src, assets, args.quality ?? "standard");
106
114
  const result = {
@@ -109,10 +117,12 @@ export function register(server) {
109
117
  width: plan.width,
110
118
  height: plan.height,
111
119
  durationSec: plan.durationSec,
120
+ ...(fallbackFonts.length > 0 && { fallbackFonts }),
121
+ ...(warnings.length > 0 && { warnings }),
112
122
  };
113
123
  if (args.dryRun)
114
124
  return okResponse({ dryRun: true, ...result, ffmpegArgs: plan.args });
115
- await runEditJob(plan.args, { output: target, durationSec: plan.durationSec, extra });
125
+ await runEditJob(plan.args, { output: target, durationSec: plan.durationSec, inputDurationSec: info.durationSec, extra });
116
126
  if (plan.gif) {
117
127
  const anim = await exportAnimation(target, output, plan.gif, extra);
118
128
  return okResponse({ outputPath: output, ...result, animation: anim });
@@ -128,4 +138,3 @@ export function register(server) {
128
138
  }
129
139
  });
130
140
  }
131
- //# sourceMappingURL=pipeline.js.map
@@ -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 (its sibling .events.jsonl is read) or the .events.jsonl itself."),
15
- from: z.number().min(0).optional().describe("Only events at or after this video time, in seconds."),
16
- to: z.number().min(0).optional().describe("Only events at or before this video time, in seconds."),
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("Only these types: down / up (mouse buttons), move (sampled cursor), wheel, key (a named shortcut), " +
21
- "typing (a burst of typing: start and length only), gap (events may be missing). Clicks are down."),
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}); the result says when more matched.`),
29
+ .describe(`Most events to return (default ${DEFAULT_EVENT_LIMIT}).`),
30
30
  };
31
31
  export function register(server) {
32
- server.tool("read_events", "Read the input event log of a recording made with start_recording events: true: " +
33
- "mouse clicks, scroll, cursor positions, shortcuts, and typing bursts, each with its video " +
34
- "time in seconds and position in video pixels. Filter by time range and type, " +
35
- "e.g. types: ['down'] for the clicks, then sample_frames at those times.", inputSchema, async (args) => {
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().describe("Left edge in pixels."),
11
- y: z.number().int().nonnegative().describe("Top edge in pixels."),
12
- width: z.number().int().positive().describe("Region width in pixels."),
13
- height: z.number().int().positive().describe("Region height in pixels."),
14
- start: z.number().nonnegative().optional().describe("Optional second to start redacting from."),
15
- end: z.number().positive().optional().describe("Optional second to stop redacting after."),
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("One or more rectangles to redact. Each may be limited to a time window."),
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) draws an irreversible solid fill; blur and pixelate are softer but partially recoverable."),
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("Optional pixels to expand each region by, to cover anti-aliased edges (default 0)."),
33
- color: z.string().optional().describe("Fill color for box style (default black)."),
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.tool("redact_region", "Redact declared rectangles in a video so secrets on screen are covered. " +
39
- "This covers regions you specify; it is NOT automatic secret detection. " +
40
- "The default style is a solid box, which is irreversible (a blur or mosaic " +
41
- "can be partially recovered). A region that falls outside the frame is " +
42
- "rejected rather than silently doing nothing.", inputSchema, async (args, extra) => {
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
@@ -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): scale to fit and letterbox, no content lost. crop: scale to fill and center-crop."),
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.tool("reframe", "Re-aspect a video to a target ratio (16:9, 9:16, 1:1, 4:5). 'pad' " +
23
- "letterboxes so nothing is lost; 'crop' fills the frame and trims the " +
24
- "overflow. Returns the output path.", inputSchema, async (args, extra) => {
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
@@ -1,14 +1,19 @@
1
1
  import { z } from "zod";
2
- import { existsSync, readFileSync } from "node:fs";
2
+ import { existsSync, readFileSync, rmSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { errorResponse, okResponse, ScreencastError } from "../utils/errors.js";
5
+ import { READ_ONLY, looseOutput } from "../utils/toolSpec.js";
5
6
  import { requireFfmpeg, probeMedia, runFfmpegBuffer } from "../utils/ffmpeg.js";
6
7
  import { jobTimeoutMs } from "../utils/jobs.js";
7
- import { buildPlayerFramesArgs, playerFramePlan, playerFrameTimes, splitJpegs, DEFAULT_PLAYER_FRAMES, DEFAULT_PLAYER_WIDTH, MAX_PLAYER_FRAMES, MCP_APP_MIME, PLAYER_TOOL_META, PLAYER_URI, } from "../utils/player.js";
8
+ import { tempPath } from "../utils/paths.js";
9
+ import { buildPlayerFramesArgs, clientSupportsApps, parsePlayerFrameLog, pickPlayerFrames, playerFramePlan, splitJpegs, DEFAULT_PLAYER_FRAMES, DEFAULT_PLAYER_WIDTH, MAX_PLAYER_FRAMES, MCP_APP_MIME, PLAYER_TOOL_META, PLAYER_URI, } from "../utils/player.js";
8
10
  import { getStore } from "../context.js";
9
- /** The player page, shipped in assets/ui (dist/tools -> ../../assets). */
11
+ const uiAsset = (name) => readFileSync(fileURLToPath(new URL(`../../assets/ui/${name}`, import.meta.url)), "utf8");
10
12
  export function playerHtml() {
11
- return readFileSync(fileURLToPath(new URL("../../assets/ui/player.html", import.meta.url)), "utf8");
13
+ const js = uiAsset("player.js");
14
+ if (/<\/script/i.test(js))
15
+ throw new ScreencastError("player.js must not contain a closing script tag.");
16
+ return uiAsset("player.html").replace('<script src="player.js"></script>', () => `<script>\n${js}</script>`);
12
17
  }
13
18
  function resolveInput(args) {
14
19
  if (args.sessionId) {
@@ -24,7 +29,6 @@ function resolveInput(args) {
24
29
  throw new ScreencastError("Pass input or sessionId.");
25
30
  }
26
31
  export function register(server) {
27
- // The player page itself, for hosts that support MCP Apps.
28
32
  server.registerResource("review-player", PLAYER_URI, {
29
33
  title: "Recording review player",
30
34
  description: "Interactive player: scrub, trim, and draw redaction boxes on a recording.",
@@ -33,14 +37,22 @@ export function register(server) {
33
37
  contents: [{ uri: PLAYER_URI, mimeType: MCP_APP_MIME, text: playerHtml(), _meta: { ui: { prefersBorder: true } } }],
34
38
  }));
35
39
  server.registerTool("review_recording", {
36
- description: "Open a recording for a person to review. In clients that support MCP Apps it shows an " +
37
- "inline player: scrub the timeline, drag trim handles, and draw redaction boxes, then export " +
38
- "a trimmed, redacted copy (their choices run as a pipeline call). Elsewhere it returns the " +
39
- "video's details; use contact_sheet or sample_frames to look at it.",
40
+ title: "Review Recording",
41
+ description: "Open a recording for a person to review: in MCP Apps clients an inline player to scrub, trim, " +
42
+ "and redact, then export; elsewhere just the video's details.",
40
43
  inputSchema: {
41
44
  input: z.string().optional().describe("Path to the video."),
42
45
  sessionId: z.string().optional().describe("Or the session id of a stopped recording."),
43
46
  },
47
+ outputSchema: looseOutput({
48
+ input: z.string(),
49
+ durationSec: z.number().nullable(),
50
+ width: z.number().nullable(),
51
+ height: z.number().nullable(),
52
+ fps: z.number().nullable(),
53
+ hasAudio: z.boolean(),
54
+ }),
55
+ annotations: READ_ONLY,
44
56
  _meta: PLAYER_TOOL_META,
45
57
  }, async (args) => {
46
58
  try {
@@ -64,27 +76,48 @@ export function register(server) {
64
76
  return errorResponse(error);
65
77
  }
66
78
  });
67
- // Called by the player (app visibility only), not by the model.
68
- server.registerTool("player_frames", {
69
- description: "Preview frames for the review player: JPEGs spread evenly over the video, with their times. " +
70
- "Used by the inline player; agents should use sample_frames or contact_sheet instead.",
79
+ const playerFrames = server.registerTool("player_frames", {
80
+ title: "Player Frames",
81
+ description: "Preview frames for the review player: JPEGs on an even grid over the video plus frames at " +
82
+ "scene changes, with their real times. Used by the inline player; agents should use " +
83
+ "sample_frames or contact_sheet instead.",
71
84
  inputSchema: {
72
85
  input: z.string().min(1).describe("Path to the video."),
73
- maxFrames: z.number().int().min(1).max(MAX_PLAYER_FRAMES).optional().describe(`Most frames (default ${DEFAULT_PLAYER_FRAMES}).`),
86
+ maxFrames: z.number().int().min(1).max(MAX_PLAYER_FRAMES).optional().describe(`Frames on the even grid (default ${DEFAULT_PLAYER_FRAMES}); scene-change frames come on top, up to as many again.`),
74
87
  width: z.number().int().min(64).max(1280).optional().describe(`Frame width (default ${DEFAULT_PLAYER_WIDTH}).`),
75
88
  },
89
+ annotations: READ_ONLY,
76
90
  _meta: { ui: { visibility: ["app"] } },
77
- }, async (args) => {
91
+ }, async (args, extra) => {
78
92
  try {
79
93
  requireFfmpeg();
80
94
  if (!existsSync(args.input))
81
95
  throw new ScreencastError(`Input file not found: ${args.input}`);
82
96
  const info = await probeMedia(args.input);
83
97
  const durationSec = info.durationSec ?? 0;
84
- const { count, fps } = playerFramePlan(durationSec, args.maxFrames ?? DEFAULT_PLAYER_FRAMES);
85
- const raw = await runFfmpegBuffer(buildPlayerFramesArgs(args.input, fps, args.width ?? DEFAULT_PLAYER_WIDTH, count), jobTimeoutMs(durationSec));
86
- const jpegs = splitJpegs(raw);
87
- const times = playerFrameTimes(durationSec, jpegs.length);
98
+ const plan = playerFramePlan(durationSec, args.maxFrames ?? DEFAULT_PLAYER_FRAMES);
99
+ const log = tempPath(".txt");
100
+ let jpegs;
101
+ let frames;
102
+ try {
103
+ const raw = await runFfmpegBuffer(buildPlayerFramesArgs(args.input, plan, args.width ?? DEFAULT_PLAYER_WIDTH, log), jobTimeoutMs(durationSec), { signal: extra.signal });
104
+ jpegs = splitJpegs(raw);
105
+ frames = parsePlayerFrameLog(existsSync(log) ? readFileSync(log, "utf8") : "").slice(0, jpegs.length);
106
+ }
107
+ finally {
108
+ rmSync(log, { force: true });
109
+ }
110
+ const [firstFrame] = frames;
111
+ if (!firstFrame)
112
+ throw new ScreencastError("ffmpeg returned no preview frames.");
113
+ const keep = pickPlayerFrames(frames, plan.count).flatMap((i) => {
114
+ const frame = frames[i];
115
+ const jpeg = jpegs[i];
116
+ return frame && jpeg ? [{ frame, jpeg }] : [];
117
+ });
118
+ const t0 = firstFrame.timeSec;
119
+ const frameTimes = keep.map(({ frame }) => Math.round((frame.timeSec - t0) * 1000) / 1000);
120
+ const sceneFrames = keep.flatMap(({ frame }, k) => (frame.scene ? [k] : []));
88
121
  return {
89
122
  content: [
90
123
  {
@@ -95,10 +128,12 @@ export function register(server) {
95
128
  width: info.width,
96
129
  height: info.height,
97
130
  hasAudio: info.audioCodec !== null,
98
- frameTimes: times,
131
+ frameTimes,
132
+ intervalSec: plan.intervalSec,
133
+ sceneFrames,
99
134
  }),
100
135
  },
101
- ...jpegs.map((j) => ({ type: "image", data: j.toString("base64"), mimeType: "image/jpeg" })),
136
+ ...keep.map(({ jpeg }) => ({ type: "image", data: jpeg.toString("base64"), mimeType: "image/jpeg" })),
102
137
  ],
103
138
  };
104
139
  }
@@ -106,5 +141,11 @@ export function register(server) {
106
141
  return errorResponse(error);
107
142
  }
108
143
  });
144
+ playerFrames.disable();
145
+ const previous = server.server.oninitialized;
146
+ server.server.oninitialized = () => {
147
+ previous?.();
148
+ if (clientSupportsApps(server.server.getClientCapabilities()))
149
+ playerFrames.enable();
150
+ };
109
151
  }
110
- //# sourceMappingURL=reviewRecording.js.map