feat: add mac node screen recording and ssh tunnel

This commit is contained in:
Peter Steinberger
2025-12-19 02:33:43 +01:00
parent 1fbd84da39
commit 95ea67de28
8 changed files with 311 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
import { describe, expect, it } from "vitest";
import {
parseScreenRecordPayload,
screenRecordTempPath,
} from "./nodes-screen.js";
describe("nodes screen helpers", () => {
it("parses screen.record payload", () => {
const payload = parseScreenRecordPayload({
format: "mp4",
base64: "Zm9v",
durationMs: 1000,
fps: 12,
screenIndex: 0,
});
expect(payload.format).toBe("mp4");
expect(payload.base64).toBe("Zm9v");
expect(payload.durationMs).toBe(1000);
expect(payload.fps).toBe(12);
expect(payload.screenIndex).toBe(0);
});
it("rejects invalid screen.record payload", () => {
expect(() => parseScreenRecordPayload({ format: "mp4" })).toThrow(
/invalid screen\.record payload/i,
);
});
it("builds screen record temp path", () => {
const p = screenRecordTempPath({
ext: "mp4",
tmpDir: "/tmp",
id: "id1",
});
expect(p).toBe("/tmp/clawdis-screen-record-id1.mp4");
});
});