Files
jhonny-editor/bm/premiere-pro-mcp-main/tests/tools/uxp-source-proxy-workflows.test.ts
T
João Henrique b541f502ba feat: initial commit - Jhonny Editor
- Adicionado estrutura completa do projeto
- Configurado MCP server para Premiere Pro
- Adicionado documentação e skills
- Configurado Gitignore para o projeto
2026-09-08 09:59:31 -04:00

36 lines
2.0 KiB
TypeScript
Executable File

import { describe, expect, it, vi } from "vitest";
import { getUxpSourceProxyWorkflowTools } from "../../src/tools/uxp-source-proxy-workflows.js";
import type { UxpWebSocketBridge } from "../../src/bridge/uxp-websocket-bridge.js";
describe("public bounded source-proxy MCP tool", () => {
it("documents a read-only explicit target and translates only a supplied proxy-path opt-in", async () => {
const request = vi.fn().mockResolvedValue({ projectGuid: "project-1" });
const tool = getUxpSourceProxyWorkflowTools({ request } as unknown as UxpWebSocketBridge).inspect_source_proxy_uxp;
expect(tool.parameters).toMatchObject({
additionalProperties: false,
required: ["project_item_id"],
properties: {
project_item_id: { minLength: 1, maxLength: 512 },
include_proxy_path: { type: "boolean" },
},
});
expect(tool.annotations).toEqual({ readOnlyHint: true, destructiveHint: false });
await expect(tool.handler({ project_item_id: "clip-1" })).resolves.toMatchObject({ success: true });
expect(request).toHaveBeenLastCalledWith("source.proxy.inspect", { projectItemId: "clip-1" });
await expect(tool.handler({ project_item_id: "clip-1", include_proxy_path: true })).resolves.toMatchObject({ success: true });
expect(request).toHaveBeenLastCalledWith("source.proxy.inspect", { projectItemId: "clip-1", includeProxyPath: true });
expect(tool.description).toContain("does not enumerate folders");
expect(tool.description).toContain("does not access the filesystem");
expect(tool.description).toContain("licensed-host behavior");
});
it("returns a truthful bridge error without a fallback backend", async () => {
const tool = getUxpSourceProxyWorkflowTools({
request: vi.fn().mockRejectedValue(new Error("source.proxy.inspect unavailable")),
} as unknown as UxpWebSocketBridge).inspect_source_proxy_uxp;
await expect(tool.handler({ project_item_id: "clip-1" })).resolves.toEqual({
success: false, error: "source.proxy.inspect unavailable",
});
});
});