@tmhs/screencast-mcp 0.48.0 → 0.48.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.
@@ -1,6 +1,6 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { existsSync, rmSync } from "node:fs";
3
- import { buildWgcEncodeArgs, buildWgcGrabArgs, framesDue, parseRawSize, nudgeScript, startBanner, yuv420FrameBytes, wgcStopFile, WGC_WINDOW_CLOSED_EXIT, } from "./utils/wgc.js";
3
+ import { buildWgcEncodeArgs, buildWgcGrabArgs, FrameAssembler, framesDue, parseRawSize, nudgeScript, startBanner, yuv420FrameBytes, wgcStopFile, WGC_WINDOW_CLOSED_EXIT, } from "./utils/wgc.js";
4
4
  const FIRST_FRAME_TIMEOUT_MS = 10_000;
5
5
  const MAX_QUEUED_FRAMES = 4;
6
6
  const cfg = JSON.parse(process.argv[2] ?? "{}");
@@ -13,7 +13,7 @@ const nudge = spawn("powershell", ["-NoProfile", "-NonInteractive", "-Command",
13
13
  let grabErr = "";
14
14
  let size = null;
15
15
  let frameBytes = 0;
16
- let carry = Buffer.alloc(0);
16
+ const frames = new FrameAssembler();
17
17
  let latest = null;
18
18
  let encoder = null;
19
19
  let startedAt = 0;
@@ -41,13 +41,9 @@ function exitWith(code) {
41
41
  function drain() {
42
42
  if (!size || finishing)
43
43
  return;
44
- let off = 0;
45
- while (carry.length - off >= frameBytes) {
46
- latest = Buffer.from(carry.subarray(off, off + frameBytes));
47
- off += frameBytes;
48
- }
49
- if (off)
50
- carry = Buffer.from(carry.subarray(off));
44
+ const frame = frames.take();
45
+ if (frame)
46
+ latest = frame;
51
47
  if (latest && !encoder)
52
48
  begin();
53
49
  }
@@ -58,11 +54,12 @@ grab.stderr.on("data", (d) => {
58
54
  size = parseRawSize(grabErr);
59
55
  if (size) {
60
56
  frameBytes = yuv420FrameBytes(size.width, size.height);
57
+ frames.frameBytes = frameBytes;
61
58
  drain();
62
59
  }
63
60
  });
64
61
  grab.stdout.on("data", (chunk) => {
65
- carry = carry.length ? Buffer.concat([carry, chunk]) : chunk;
62
+ frames.push(chunk);
66
63
  drain();
67
64
  });
68
65
  function begin() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmhs/screencast-mcp",
3
- "version": "0.48.0",
3
+ "version": "0.48.2",
4
4
  "description": "Let AI agents record the Windows screen, watch it as frames, and edit it with ffmpeg",
5
5
  "mcpName": "io.github.TMHSDigital/screencast-mcp",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "scripts": {
21
21
  "build": "tsc",
22
- "typecheck": "tsc --noEmit && tsc -p src/__tests__",
22
+ "typecheck": "tsc --noEmit && tsc -p src/__tests__ && tsc -p evals/tsconfig.json",
23
23
  "lint": "eslint .",
24
24
  "dev": "tsx watch src/index.ts",
25
25
  "start": "node dist/index.js",
@@ -72,11 +72,11 @@
72
72
  "@types/jsdom": "^30.0.0",
73
73
  "@types/node": "^22.15.3",
74
74
  "@vitest/coverage-v8": "^5.0.5",
75
- "eslint": "^10.5.0",
76
- "jsdom": "^30.1.3",
75
+ "eslint": "^10.14.0",
76
+ "jsdom": "^31.0.0",
77
77
  "tsx": "^4.19.4",
78
78
  "typescript": "^5.8.3",
79
- "typescript-eslint": "^8.61.1",
80
- "vitest": "^5.0.5"
79
+ "typescript-eslint": "^8.72.1",
80
+ "vitest": "^5.1.0"
81
81
  }
82
82
  }