@zhihand/mcp 0.26.3 → 0.26.4

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/bin/zhihand CHANGED
@@ -440,35 +440,11 @@ switch (command) {
440
440
  await runHidStep("11. Press Back", { action: "back" });
441
441
  await pause();
442
442
 
443
- // ── Phase 4: Clipboard Roundtrip ─────────────────────────
444
- console.log(" ── Phase 4: Clipboard Roundtrip ──");
443
+ // ── Phase 4: Clipboard Set ─────────────────────────────
444
+ // Note: App only supports clipboard set, not get
445
+ console.log(" ── Phase 4: Clipboard ──");
445
446
  const clipboardTestText = `zhihand_test_${Date.now()}`;
446
-
447
- const setAck = await runHidStep("12. Clipboard set", { action: "clipboard", clipboardAction: "set", text: clipboardTestText });
448
- await pause();
449
-
450
- const getAck = await runHidStep("13. Clipboard get", { action: "clipboard", clipboardAction: "get" });
451
- await pause();
452
-
453
- // Verify roundtrip
454
- totalSteps++;
455
- process.stdout.write(" 14. Clipboard roundtrip verify... ");
456
- if (setAck && getAck) {
457
- const returned = getAck.command?.ack_result?.text ?? getAck.command?.ack_result?.clipboard ?? null;
458
- if (returned === clipboardTestText) {
459
- console.log(`✅ Match: "${clipboardTestText}"`);
460
- passed++;
461
- } else if (returned) {
462
- console.log(`⚠️ Mismatch: sent "${clipboardTestText}", got "${returned}"`);
463
- failed++;
464
- } else {
465
- console.log(`⚠️ No text in ack_result (keys: ${JSON.stringify(Object.keys(getAck.command?.ack_result ?? {}))})`);
466
- failed++;
467
- }
468
- } else {
469
- console.log(`⏭️ Skipped (clipboard set/get failed)`);
470
- failed++;
471
- }
447
+ await runHidStep("12. Clipboard set", { action: "clipboard", text: clipboardTestText });
472
448
 
473
449
  // ── Summary ──────────────────────────────────────────────
474
450
  console.log(`\n Result: ${passed}/${totalSteps} passed`);
@@ -1,6 +1,5 @@
1
1
  import type { ZhiHandConfig } from "./config.ts";
2
2
  export type ScrollDirection = "up" | "down" | "left" | "right";
3
- export type ClipboardAction = "get" | "set";
4
3
  export interface ControlParams {
5
4
  action: string;
6
5
  xRatio?: number;
@@ -9,7 +8,6 @@ export interface ControlParams {
9
8
  direction?: ScrollDirection;
10
9
  amount?: number;
11
10
  keys?: string;
12
- clipboardAction?: ClipboardAction;
13
11
  durationMs?: number;
14
12
  startXRatio?: number;
15
13
  startYRatio?: number;
@@ -49,9 +49,11 @@ export function createControlCommand(params) {
49
49
  case "enter":
50
50
  return { type: "receive_enter", payload: {} };
51
51
  case "clipboard":
52
+ // App only supports set — payload: { clipboard: "text" }
53
+ // No get support on device side; clipboardAction is ignored
52
54
  return {
53
55
  type: "receive_clipboard",
54
- payload: { action: params.clipboardAction, text: params.text },
56
+ payload: { clipboard: params.text ?? "" },
55
57
  };
56
58
  case "open_app": {
57
59
  const appPayload = {};
@@ -397,7 +397,7 @@ Control the phone. Requires "action" parameter. All coordinates use normalized r
397
397
  - home: Press Home button (no params)
398
398
  - enter: Press Enter key (no params)
399
399
  ${openAppDoc}
400
- - clipboard: Read/write clipboard. Params: clipboardAction ("get"/"set"), text
400
+ - clipboard: Set clipboard text. Params: text (the content to copy)
401
401
  - screenshot: Capture screen via control (same as zhihand_screenshot)
402
402
  - wait: Wait before next action. Params: durationMs (default 1000)
403
403
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare const PACKAGE_VERSION = "0.26.3";
2
+ export declare const PACKAGE_VERSION = "0.26.4";
3
3
  export declare function createServer(deviceName?: string): McpServer;
4
4
  export declare function startStdioServer(deviceName?: string): Promise<void>;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { executeControl } from "./tools/control.js";
6
6
  import { handleScreenshot } from "./tools/screenshot.js";
7
7
  import { handlePair } from "./tools/pair.js";
8
8
  import { getStaticContext, getDynamicContext, fetchDeviceProfile, buildControlToolDescription, buildScreenshotToolDescription, formatDeviceStatus, } from "./core/device.js";
9
- export const PACKAGE_VERSION = "0.26.3";
9
+ export const PACKAGE_VERSION = "0.26.4";
10
10
  export function createServer(deviceName) {
11
11
  const server = new McpServer({
12
12
  name: "zhihand",
@@ -7,7 +7,6 @@ export declare const controlSchema: {
7
7
  direction: z.ZodOptional<z.ZodEnum<["up", "down", "left", "right"]>>;
8
8
  amount: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
9
9
  keys: z.ZodOptional<z.ZodString>;
10
- clipboardAction: z.ZodOptional<z.ZodEnum<["get", "set"]>>;
11
10
  durationMs: z.ZodOptional<z.ZodNumber>;
12
11
  startXRatio: z.ZodOptional<z.ZodNumber>;
13
12
  startYRatio: z.ZodOptional<z.ZodNumber>;
@@ -13,7 +13,7 @@ export const controlSchema = {
13
13
  direction: z.enum(["up", "down", "left", "right"]).optional().describe("Scroll direction"),
14
14
  amount: z.number().int().positive().default(3).optional().describe("Scroll steps (default 3)"),
15
15
  keys: z.string().optional().describe("Key combo string, e.g. 'ctrl+c', 'alt+tab'"),
16
- clipboardAction: z.enum(["get", "set"]).optional().describe("Clipboard action"),
16
+ // clipboardAction removed — app only supports set (text via "text" param)
17
17
  durationMs: z.number().int().positive().max(10000).optional().describe("Duration in ms: wait (default 1000), longclick (default 800), swipe (default 300). Max 10000"),
18
18
  startXRatio: z.number().min(0).max(1).optional().describe("Swipe start X [0,1]"),
19
19
  startYRatio: z.number().min(0).max(1).optional().describe("Swipe start Y [0,1]"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhihand/mcp",
3
- "version": "0.26.3",
3
+ "version": "0.26.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "ZhiHand MCP Server — phone control tools for Claude Code, Codex, Gemini CLI, and OpenClaw",