@zhihand/mcp 0.18.0 → 0.18.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.
@@ -61,6 +61,9 @@ export function createControlCommand(params) {
61
61
  appPayload.url_scheme = params.urlScheme;
62
62
  if (params.appName)
63
63
  appPayload.app_name = params.appName;
64
+ if (!appPayload.app_package && !appPayload.bundle_id && !appPayload.url_scheme) {
65
+ throw new Error("open_app requires at least one of: appPackage, bundleId, urlScheme");
66
+ }
64
67
  return { type: "receive_app", payload: appPayload };
65
68
  }
66
69
  case "screenshot":
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { controlSchema, screenshotSchema, pairSchema } from "./tools/schemas.js"
5
5
  import { executeControl } from "./tools/control.js";
6
6
  import { handleScreenshot } from "./tools/screenshot.js";
7
7
  import { handlePair } from "./tools/pair.js";
8
- const PACKAGE_VERSION = "0.18.0";
8
+ const PACKAGE_VERSION = "0.18.1";
9
9
  export function createServer(deviceName) {
10
10
  const server = new McpServer({
11
11
  name: "zhihand",
@@ -8,7 +8,7 @@ export declare const controlSchema: {
8
8
  amount: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
9
9
  keys: z.ZodOptional<z.ZodString>;
10
10
  clipboardAction: z.ZodOptional<z.ZodEnum<["get", "set"]>>;
11
- durationMs: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
11
+ durationMs: z.ZodOptional<z.ZodNumber>;
12
12
  startXRatio: z.ZodOptional<z.ZodNumber>;
13
13
  startYRatio: z.ZodOptional<z.ZodNumber>;
14
14
  endXRatio: z.ZodOptional<z.ZodNumber>;
@@ -14,7 +14,7 @@ export const controlSchema = {
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
16
  clipboardAction: z.enum(["get", "set"]).optional().describe("Clipboard action"),
17
- durationMs: z.number().int().positive().max(10000).default(1000).optional().describe("Duration in ms for wait, longclick, or swipe (default 1000, max 10000)"),
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]"),
20
20
  endXRatio: z.number().min(0).max(1).optional().describe("Swipe end X [0,1]"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhihand/mcp",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
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",