@wa008/ui-audit-mcp 2.4.0 → 2.4.1
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/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-demo.d.ts","sourceRoot":"","sources":["../../examples/agent-demo.ts"],"names":[],"mappings":""}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
|
-
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
// Connect to the local MCP server
|
|
5
|
-
async function run() {
|
|
6
|
-
console.log("Starting MCP Client...");
|
|
7
|
-
const transport = new StdioClientTransport({
|
|
8
|
-
command: "node",
|
|
9
|
-
args: [path.join(process.cwd(), "dist/src/index.js")],
|
|
10
|
-
});
|
|
11
|
-
const client = new Client({
|
|
12
|
-
name: "test-agent",
|
|
13
|
-
version: "1.0.0",
|
|
14
|
-
}, {
|
|
15
|
-
capabilities: {},
|
|
16
|
-
});
|
|
17
|
-
try {
|
|
18
|
-
await client.connect(transport);
|
|
19
|
-
console.log("Connected to MCP server.");
|
|
20
|
-
// 1. Launch App
|
|
21
|
-
console.log("Launching Preferences app...");
|
|
22
|
-
await client.callTool({
|
|
23
|
-
name: "launch_app",
|
|
24
|
-
arguments: { appId: "com.apple.Preferences" },
|
|
25
|
-
});
|
|
26
|
-
// 2. Take Screenshot
|
|
27
|
-
console.log("Taking screenshot...");
|
|
28
|
-
const screenshotResult = await client.callTool({
|
|
29
|
-
name: "take_screenshot",
|
|
30
|
-
arguments: {},
|
|
31
|
-
});
|
|
32
|
-
if (screenshotResult.imageBase64) {
|
|
33
|
-
console.log(`Screenshot captured (${screenshotResult.width}x${screenshotResult.height})`);
|
|
34
|
-
}
|
|
35
|
-
// 3. Get Checklist (Screen)
|
|
36
|
-
console.log("Getting checklist for 'SettingsScreen'...");
|
|
37
|
-
const checklistResult = await client.callTool({
|
|
38
|
-
name: "get_checklist",
|
|
39
|
-
arguments: { type: "screen", screenName: "SettingsScreen" },
|
|
40
|
-
});
|
|
41
|
-
const checklistData = JSON.parse(checklistResult.content[0].text);
|
|
42
|
-
const sessionId = checklistData.sessionId;
|
|
43
|
-
const items = checklistData.checklist;
|
|
44
|
-
console.log(`Session ID: ${sessionId}`);
|
|
45
|
-
console.log(`Checklist items: ${items.map((i) => i.id).join(", ")}`);
|
|
46
|
-
// 4. Submit Evaluation (Simulate passing)
|
|
47
|
-
console.log("Submitting passing evaluation...");
|
|
48
|
-
const scores = items.map((item) => ({
|
|
49
|
-
id: item.id,
|
|
50
|
-
score: 5,
|
|
51
|
-
}));
|
|
52
|
-
const evalResult = await client.callTool({
|
|
53
|
-
name: "submit_evaluation",
|
|
54
|
-
arguments: {
|
|
55
|
-
sessionId: sessionId,
|
|
56
|
-
scores: scores,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
console.log("Evaluation result:", JSON.parse(evalResult.content[0].text));
|
|
60
|
-
// 5. Get Logs
|
|
61
|
-
console.log("Fetching logs...");
|
|
62
|
-
const logResult = await client.callTool({
|
|
63
|
-
name: "get_evaluation_log",
|
|
64
|
-
arguments: { limit: 1 },
|
|
65
|
-
});
|
|
66
|
-
console.log("Logs retrieved.");
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
console.error("Error running test agent:", error);
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
// transport.close() is not exposed directly on StdioClientTransport in some versions,
|
|
73
|
-
// but client.close() should handle it?
|
|
74
|
-
// Actually, just exit process.
|
|
75
|
-
process.exit(0);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
run();
|
|
79
|
-
//# sourceMappingURL=agent-demo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-demo.js","sourceRoot":"","sources":["../../examples/agent-demo.ts"],"names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