{
 "version": "330v223",
 "languages": [
  "javascript",
  "python",
  "lua"
 ],
 "notes_en": "ketec scripts can be written in JavaScript, Python or Lua. The three languages share the same modules, function names and parameter order; Python uses `from ketec import action, image, ...` (keyword arguments are supported) and some lower-case module names (appleocr, paddleocr, tomatoocr, dotocr, netcard, hotupdate, yolocls); in Lua modules are global tables and object methods use a colon (selector:getOneNodeInfo()). Coordinates for action/hid/image/OCR are screen pixels (see device.getScreenRealSize(), e.g. 1170x2532 on a 3x iPhone); node bounds are logical points. Run modes: Agent mode (developer disk image mounted, Agent connected) synthesizes touches and text on the device and supports node trees and w3cActions; HID mode drives an external ESP32 USB HID device, needs the screen broadcast for screenshots/OCR, and has no node tree or w3cActions. action.* follows the current mode automatically; hid.* always uses the HID device. Relative file paths resolve to the app Documents folder. Each function has a status: stable = works as described; limited = works with the restriction stated in its description; unsupported = present but returns a fixed failure value. Functions marked ketec_extra are ketec additions beyond the common signature set. Defaults shown are those of the current implementation. Many functions also have Chinese-named aliases; this reference lists the English names. JavaScript snippets can be tried with POST /api/runScript on the device HTTP service (default port 9800, e.g. http://phone-ip:9800); the value of the last expression is returned.",
 "notes_zh": "ketec 脚本可用 JavaScript、Python 或 Lua 编写，三种语言模块名、函数名和参数顺序一致；Python 写法为 `from ketec import action, image, ...`（支持关键字参数），部分模块名为小写（appleocr、paddleocr、tomatoocr、dotocr、netcard、hotupdate、yolocls）；Lua 中模块是全局表，对象方法用冒号（selector:getOneNodeInfo()）。action/hid/image/OCR 的坐标均为屏幕像素（见 device.getScreenRealSize()，3 倍屏 iPhone 如 1170x2532）；node 的 bounds 为逻辑点。运行模式：Agent 模式（已挂载开发者镜像、Agent 已连接）在设备上合成触控与文字输入，支持控件树与 w3cActions；HID 模式通过外接 ESP32 USB HID 设备操作，截图/OCR 需要开启屏幕直播，不支持控件树与 w3cActions。action.* 会按当前模式自动分发，hid.* 始终走 HID 设备。相对文件路径基于 App 的 Documents 目录。每个函数带 status：stable = 按描述可用；limited = 可用但有描述中写明的限制；unsupported = 函数存在但固定返回失败值。标记 ketec_extra 的是 ketec 在通用签名之外额外提供的函数。参数默认值以当前实现为准。很多函数还有中文名别名，本参考只列英文名。JavaScript 片段可在设备 HTTP 服务上用 POST /api/runScript 试运行（默认端口 9800，如 http://phone-ip:9800），返回最后一个表达式的值。",
 "modules": [
  {
   "name": "action",
   "title_en": "Touch & input",
   "title_zh": "触控与输入",
   "summary_en": "High-level touch, swipe and text input. Each call is routed by the current run mode: in Agent mode events are synthesized by the on-device Agent; in HID mode they go through the external HID device. Coordinates are screen pixels (e.g. 1170x2532 on a 3x device).",
   "summary_zh": "高层触控、滑动与文字输入。按当前运行模式分发：Agent 模式由设备端 Agent 合成事件，HID 模式经外接 HID 设备发出。坐标为屏幕像素（如 3 倍屏 1170x2532）。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "action",
    "python": "action",
    "lua": "action"
   },
   "functions": [
    {
     "name": "click",
     "signature": "action.click(x, y, duration?, jitter?)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X coordinate (screen pixels)",
       "desc_zh": "X 坐标（屏幕像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y coordinate (screen pixels)",
       "desc_zh": "Y 坐标（屏幕像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Press time in ms",
       "desc_zh": "按下时长（毫秒）"
      },
      {
       "name": "jitter",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Add random offset (Agent only; ignored in HID mode)",
       "desc_zh": "是否加随机偏移（仅 Agent；HID 模式忽略）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Taps a point.",
     "desc_zh": "点击一个坐标点。",
     "example": "action.click(540, 1200);",
     "status": "stable"
    },
    {
     "name": "clickRandom",
     "signature": "action.clickRandom(x1, y1, x2, y2, duration?)",
     "params": [
      {
       "name": "x1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Left of the area (pixels)",
       "desc_zh": "区域左边界（像素）"
      },
      {
       "name": "y1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Top of the area (pixels)",
       "desc_zh": "区域上边界（像素）"
      },
      {
       "name": "x2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Right of the area (pixels)",
       "desc_zh": "区域右边界（像素）"
      },
      {
       "name": "y2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Bottom of the area (pixels)",
       "desc_zh": "区域下边界（像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Press time in ms",
       "desc_zh": "按下时长（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Taps a random point inside the rectangle. An invalid rectangle (x2<=x1 or y2<=y1) falls back to the whole screen.",
     "desc_zh": "在矩形内随机取点点击；矩形无效（x2<=x1 或 y2<=y1）时按整屏取点。",
     "status": "stable"
    },
    {
     "name": "doubleClick",
     "signature": "action.doubleClick(x, y, duration?, interval?, jitter?)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X coordinate (screen pixels)",
       "desc_zh": "X 坐标（屏幕像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y coordinate (screen pixels)",
       "desc_zh": "Y 坐标（屏幕像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Press time of each tap (ms)",
       "desc_zh": "每次按下时长（毫秒）"
      },
      {
       "name": "interval",
       "type": "number",
       "optional": true,
       "default": 80,
       "desc_en": "Gap between the two taps (ms)",
       "desc_zh": "两次点击间隔（毫秒）"
      },
      {
       "name": "jitter",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Random offset (Agent only)",
       "desc_zh": "随机偏移（仅 Agent）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Double-taps a point.",
     "desc_zh": "双击一个坐标点。",
     "status": "stable"
    },
    {
     "name": "doubleClickRandom",
     "signature": "action.doubleClickRandom(x1, y1, x2, y2, duration?, interval?)",
     "params": [
      {
       "name": "x1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Left of the area (pixels)",
       "desc_zh": "区域左边界（像素）"
      },
      {
       "name": "y1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Top of the area (pixels)",
       "desc_zh": "区域上边界（像素）"
      },
      {
       "name": "x2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Right of the area (pixels)",
       "desc_zh": "区域右边界（像素）"
      },
      {
       "name": "y2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Bottom of the area (pixels)",
       "desc_zh": "区域下边界（像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Press time (ms)",
       "desc_zh": "按下时长（毫秒）"
      },
      {
       "name": "interval",
       "type": "number",
       "optional": true,
       "default": 80,
       "desc_en": "Gap between taps (ms)",
       "desc_zh": "两次点击间隔（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Double-taps a random point inside the rectangle (invalid rectangle = whole screen).",
     "desc_zh": "在矩形内随机取点双击（矩形无效时按整屏）。",
     "status": "stable"
    },
    {
     "name": "swipe",
     "signature": "action.swipe(startX, startY, endX, endY, duration?, jitter?, steps?)",
     "params": [
      {
       "name": "startX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start X (pixels)",
       "desc_zh": "起点 X（像素）"
      },
      {
       "name": "startY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start Y (pixels)",
       "desc_zh": "起点 Y（像素）"
      },
      {
       "name": "endX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End X (pixels)",
       "desc_zh": "终点 X（像素）"
      },
      {
       "name": "endY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End Y (pixels)",
       "desc_zh": "终点 Y（像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 300,
       "desc_en": "Swipe time in ms",
       "desc_zh": "滑动时长（毫秒）"
      },
      {
       "name": "jitter",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Randomize the path (Agent only)",
       "desc_zh": "路径加随机抖动（仅 Agent）"
      },
      {
       "name": "steps",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Intermediate points; 0 = engine default (Agent only)",
       "desc_zh": "中间点数量，0 为默认（仅 Agent）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Swipes in a straight line. In HID mode jitter and steps are ignored.",
     "desc_zh": "直线滑动。HID 模式忽略 jitter 与 steps。",
     "example": "action.swipe(540, 1800, 540, 600, 300);",
     "status": "stable"
    },
    {
     "name": "pressAndSwipe",
     "signature": "action.pressAndSwipe(startX, startY, endX, endY, touch_down_duration?, touch_move_duration?)",
     "params": [
      {
       "name": "startX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start X",
       "desc_zh": "起点 X"
      },
      {
       "name": "startY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start Y",
       "desc_zh": "起点 Y"
      },
      {
       "name": "endX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End X",
       "desc_zh": "终点 X"
      },
      {
       "name": "endY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End Y",
       "desc_zh": "终点 Y"
      },
      {
       "name": "touch_down_duration",
       "type": "number",
       "optional": true,
       "default": 500,
       "desc_en": "Hold time before moving (ms)",
       "desc_zh": "移动前按住时长（毫秒）"
      },
      {
       "name": "touch_move_duration",
       "type": "number",
       "optional": true,
       "default": 300,
       "desc_en": "Move time (ms)",
       "desc_zh": "移动时长（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Long-press then move to the end point. HID mode: real press-drag-release. Agent mode: a long press followed by a separate swipe (finger is lifted in between), so it may not drag items; use action.drag for a held drag. Extra parameters from the signature table (touch_up_duration, jitter, steps) are ignored.",
     "desc_zh": "长按后移到终点。HID 模式为真实的按住-拖动-抬起；Agent 模式是先长按、再单独滑动（中间会抬指），可能拖不动图标，按住拖动请用 action.drag。签名表里的 touch_up_duration / jitter / steps 被忽略。",
     "status": "limited"
    },
    {
     "name": "swipeCurve",
     "signature": "action.swipeCurve(startX, startY, midX, midY, endX, endY, duration?)",
     "params": [
      {
       "name": "startX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start X",
       "desc_zh": "起点 X"
      },
      {
       "name": "startY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start Y",
       "desc_zh": "起点 Y"
      },
      {
       "name": "midX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Middle point X",
       "desc_zh": "中间点 X"
      },
      {
       "name": "midY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Middle point Y",
       "desc_zh": "中间点 Y"
      },
      {
       "name": "endX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End X",
       "desc_zh": "终点 X"
      },
      {
       "name": "endY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End Y",
       "desc_zh": "终点 Y"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 300,
       "desc_en": "Total time (ms)",
       "desc_zh": "总时长（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Swipes through a middle point. Implemented as two straight segments (start→mid, mid→end) by the Agent synthesizer; for a curved HID swipe use hid.swipeCurve.",
     "desc_zh": "经过中间点滑动。由 Agent 合成器实现为两段直线（起点→中间点→终点）；HID 曲线滑动请用 hid.swipeCurve。",
     "status": "limited",
     "modes": [
      "agent"
     ]
    },
    {
     "name": "input",
     "signature": "action.input(text, frequency?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text to type (Unicode supported)",
       "desc_zh": "要输入的文字（支持中文）"
      },
      {
       "name": "frequency",
       "type": "number",
       "optional": true,
       "default": null,
       "desc_en": "Accepted for compatibility; ignored by the current binding",
       "desc_zh": "为兼容保留，当前实现忽略"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Types text into the focused field. Agent mode types through the Agent (fast); in HID mode with the HID device connected it is sent through HID. If the Agent path fails it falls back to HID.",
     "desc_zh": "向当前焦点输入框输入文字。Agent 模式由 Agent 快速打字；HID 模式且设备已连接时经 HID 发送；Agent 失败时回落 HID。",
     "example": "action.input('hello 你好');",
     "status": "stable"
    },
    {
     "name": "inputSimple",
     "signature": "action.inputSimple(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text, typed key by key",
       "desc_zh": "逐键输入的文字"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Types text key by key (about 15 chars/s in Agent mode). In HID mode, if the ketec keyboard is on screen the text is inserted through it, otherwise sent as HID keystrokes (ASCII only).",
     "desc_zh": "逐键输入（Agent 模式约 15 字/秒）。HID 模式下若 ketec 键盘在屏则经键盘插入，否则以 HID 按键发送（仅 ASCII）。",
     "status": "stable"
    },
    {
     "name": "backspace",
     "signature": "action.backspace(count?)",
     "params": [
      {
       "name": "count",
       "type": "number",
       "optional": true,
       "default": 1,
       "desc_en": "Number of deletions",
       "desc_zh": "删除次数"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Deletes characters before the cursor.",
     "desc_zh": "删除光标前的字符。",
     "status": "stable"
    },
    {
     "name": "enter",
     "signature": "action.enter()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Presses Return.",
     "desc_zh": "按回车键。",
     "status": "stable"
    },
    {
     "name": "homeScreen",
     "signature": "action.homeScreen()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Goes to the Home Screen. Only works through HID; in Agent mode it returns false.",
     "desc_zh": "回到主屏幕。只能经 HID 实现，Agent 模式返回 false。",
     "status": "limited",
     "modes": [
      "hid"
     ]
    },
    {
     "name": "pressButton",
     "signature": "action.pressButton(button)",
     "params": [
      {
       "name": "button",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Case-sensitive name: home, volumeup, volumedown, mute, playpause, next, prev, brightnessup, brightnessdown, eject, globe, recent, search, power, snapshot",
       "desc_zh": "按键名（区分大小写）：home、volumeup、volumedown、mute、playpause、next、prev、brightnessup、brightnessdown、eject、globe、recent、search、power、snapshot"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Presses a device/media button through the HID device. Requires a connected HID device in any mode; otherwise returns false.",
     "desc_zh": "经 HID 设备按设备/媒体键。任何模式下都需要已连接 HID 设备，否则返回 false。",
     "status": "limited",
     "modes": [
      "hid"
     ]
    },
    {
     "name": "sendKey",
     "signature": "action.sendKey(keys)",
     "params": [
      {
       "name": "keys",
       "type": "array|number|string",
       "optional": false,
       "default": null,
       "desc_en": "Key combination: key codes (see hidKey), key names such as \"COMMAND\", or single characters, e.g. [hidKey.COMMAND, \"v\"]",
       "desc_zh": "组合键：键码（见 hidKey）、键名如 \"COMMAND\" 或单个字符，例如 [hidKey.COMMAND, \"v\"]"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sends a key combination through the HID device. Requires a connected HID device.",
     "desc_zh": "经 HID 设备发送组合键。需要已连接 HID 设备。",
     "example": "action.sendKey([hidKey.COMMAND, 'a']);",
     "status": "limited",
     "modes": [
      "hid"
     ]
    },
    {
     "name": "w3cActions",
     "signature": "action.w3cActions(json)",
     "params": [
      {
       "name": "json",
       "type": "object|string",
       "optional": false,
       "default": null,
       "desc_en": "W3C Actions body {actions:[{type:\"pointer\", id, parameters:{pointerType:\"touch\"}, actions:[{type:\"pointerMove\",x,y,duration},{type:\"pointerDown\"},{type:\"pause\",duration},{type:\"pointerUp\"}]}]}; several pointers = multi-touch",
       "desc_zh": "W3C Actions 请求体；多个 pointer 即多指"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Runs a W3C Actions gesture sequence (multi-touch, holds, sequences). Agent mode only; returns false in HID mode or for an empty body.",
     "desc_zh": "执行 W3C Actions 手势序列（多指、按住、连续点击）。仅 Agent 模式；HID 模式或空参数返回 false。",
     "status": "stable",
     "modes": [
      "agent"
     ]
    },
    {
     "name": "createBuilder",
     "signature": "action.createBuilder()",
     "params": [],
     "returns": {
      "type": "ActionBuilder",
      "desc_en": "Builder with addPointer(id?) → PointerBuilder {moveTo(x,y,ms?), down(), up(), stay(ms=20), tap(x,y,ms=20), done()}, singleTap(x,y,ms?), multiTap(points,ms?), execute() → boolean",
      "desc_zh": "构建器：addPointer(id?) 返回手指对象 {moveTo、down、up、stay、tap、done}，另有 singleTap、multiTap、execute() → boolean"
     },
     "desc_en": "Creates a gesture builder. Pointers added in one group run in parallel (pinch/rotate); groups and singleTap/multiTap run in call order. Executes through w3cActions, so Agent mode only.",
     "desc_zh": "创建手势构建器。同一组内的多根手指并行执行（缩放/旋转），各组与 singleTap/multiTap 按调用顺序执行。底层走 w3cActions，仅 Agent 模式。",
     "example": "action.createBuilder().addPointer().moveTo(300,800).down().moveTo(300,400,300).up().done().execute();",
     "status": "stable",
     "modes": [
      "agent"
     ]
    },
    {
     "name": "setJitterValue",
     "signature": "action.setJitterValue(value)",
     "params": [
      {
       "name": "value",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Jitter amplitude used when jitter=true (unit not documented, presumably pixels) [unverified]",
       "desc_zh": "jitter=true 时的抖动幅度（单位未写明，推测为像素）[未验证]"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "No return value",
      "desc_zh": "无返回值"
     },
     "desc_en": "Sets the random jitter amplitude for Agent taps/swipes.",
     "desc_zh": "设置 Agent 点击/滑动的随机抖动幅度。",
     "status": "stable",
     "modes": [
      "agent"
     ]
    },
    {
     "name": "getRunMode",
     "signature": "action.getRunMode()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "\"agent\" or \"hid\"",
      "desc_zh": "\"agent\" 或 \"hid\""
     },
     "desc_en": "Returns the current run mode.",
     "desc_zh": "返回当前运行模式。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "longPress",
     "signature": "action.longPress(x, y, duration?)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X coordinate (screen pixels)",
       "desc_zh": "X 坐标（屏幕像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y coordinate (screen pixels)",
       "desc_zh": "Y 坐标（屏幕像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 500,
       "desc_en": "Hold time in ms (HID mode uses at least 600)",
       "desc_zh": "按住时长（毫秒，HID 模式至少 600）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Long-presses a point and returns after the hold time.",
     "desc_zh": "长按一个点，按满时长后返回。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "drag",
     "signature": "action.drag(x1, y1, x2, y2, duration?)",
     "params": [
      {
       "name": "x1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start X",
       "desc_zh": "起点 X"
      },
      {
       "name": "y1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start Y",
       "desc_zh": "起点 Y"
      },
      {
       "name": "x2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End X",
       "desc_zh": "终点 X"
      },
      {
       "name": "y2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End Y",
       "desc_zh": "终点 Y"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 1200,
       "desc_en": "Drag time (ms)",
       "desc_zh": "拖动时长（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Press-hold-drag with the finger kept down. Agent mode only (returns false in HID mode).",
     "desc_zh": "按住并拖动（全程不抬指）。仅 Agent 模式（HID 模式返回 false）。",
     "status": "stable",
     "modes": [
      "agent"
     ],
     "ketec_extra": true
    },
    {
     "name": "findText",
     "signature": "action.findText(text, options?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text to find on screen",
       "desc_zh": "要在屏幕上找的文字"
      },
      {
       "name": "options",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "{exact: boolean}",
       "desc_zh": "{exact: 是否精确匹配}"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{ok, text, confidence, cx, cy, candidates[], recognizedCount, reason?}; cx/cy are screen pixels",
      "desc_zh": "{ok, text, confidence, cx, cy, candidates[], recognizedCount, reason?}，cx/cy 为屏幕像素"
     },
     "desc_en": "Screenshots and OCRs the screen, returning the best match for the text.",
     "desc_zh": "截屏 OCR 并返回与文字最匹配的结果。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "clickText",
     "signature": "action.clickText(text, options?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text to find and tap",
       "desc_zh": "要查找并点击的文字"
      },
      {
       "name": "options",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "{exact: boolean, index: number (which candidate)}",
       "desc_zh": "{exact: 是否精确, index: 第几个候选}"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "findText result plus tapped, clickedText, clickedPoint",
      "desc_zh": "findText 的结果，另加 tapped、clickedText、clickedPoint"
     },
     "desc_en": "Finds text on screen with OCR and taps its center.",
     "desc_zh": "OCR 找到文字后点击其中心。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "node",
   "title_en": "UI element tree",
   "title_zh": "界面节点（控件树）",
   "summary_en": "Find and operate UI elements of the foreground app via the accessibility snapshot. Entry point: createNodeSelector(). Requires Agent mode (developer image mounted, Agent connected). NodeInfo.bounds are in logical points (multiply by device.getScreenScale() before passing to action.click); NodeInfo action methods convert automatically.",
   "summary_zh": "通过无障碍快照查找并操作前台 App 的界面控件。入口：createNodeSelector()。需要 Agent 模式（开发者镜像已挂载、Agent 已连接）。NodeInfo.bounds 为逻辑点（传给 action.click 前需乘 device.getScreenScale()）；NodeInfo 自带的动作方法会自动换算。",
   "modes": [
    "agent"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "node",
    "python": "node",
    "lua": "node"
   },
   "functions": [
    {
     "name": "createNodeSelector",
     "signature": "createNodeSelector(params?)",
     "params": [
      {
       "name": "params",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "{maxDepth=50, mode=1, bundleId?, pid?}. mode: 1 = one snapshot of the whole tree (22 attributes, the default, fastest and most stable); 2 = stitched, 2 levels per request (13 attributes), every cut-off node is requested again and attached in place, for long lists and deep trees, slower; 3 = stitched, 1 level per request (13 attributes, at most 256 children per level). Same modes as GET /api/source?mode=. Also available as node.createNodeSelector in Python/Lua",
       "desc_zh": "{maxDepth=50, mode=1, bundleId?, pid?}。mode：1 = 一次取整棵树（22 个属性，默认，最快最稳定）；2 = 分段拼接，每次请求取 2 层（13 个属性），被截断的节点再单独请求并挂回原位，适合长列表和很深的界面，较慢；3 = 分段拼接，每次只取 1 层（13 个属性，每层最多 256 个子节点）。与 GET /api/source?mode= 相同。Python/Lua 中写作 node.createNodeSelector"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "A new selector",
      "desc_zh": "新的选择器"
     },
     "desc_en": "Creates a node selector. Add conditions (all must match), then call getNodeInfo / getOneNodeInfo.",
     "desc_zh": "创建节点选择器。追加条件（全部满足才命中），再调用 getNodeInfo / getOneNodeInfo。",
     "example": "var n = createNodeSelector().label('Settings').getOneNodeInfo(3000); if (n) n.tap();",
     "status": "stable"
    },
    {
     "name": "Selector.label",
     "signature": "selector.label(value)",
     "params": [
      {
       "name": "value",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Label text",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches label exactly.",
     "desc_zh": "label 精确匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.labelMatch",
     "signature": "selector.labelMatch(pattern)",
     "params": [
      {
       "name": "pattern",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Regular expression",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches label with a regular expression.",
     "desc_zh": "label 正则匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.title",
     "signature": "selector.title(value)",
     "params": [
      {
       "name": "value",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Title",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches title exactly.",
     "desc_zh": "title 精确匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.titleMatch",
     "signature": "selector.titleMatch(pattern)",
     "params": [
      {
       "name": "pattern",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Regular expression",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches title with a regular expression.",
     "desc_zh": "title 正则匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.identifier",
     "signature": "selector.identifier(value)",
     "params": [
      {
       "name": "value",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Identifier",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches accessibility identifier exactly.",
     "desc_zh": "identifier 精确匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.identifierMatch",
     "signature": "selector.identifierMatch(pattern)",
     "params": [
      {
       "name": "pattern",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Regular expression",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches identifier with a regular expression.",
     "desc_zh": "identifier 正则匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.value",
     "signature": "selector.value(value)",
     "params": [
      {
       "name": "value",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Value",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches value exactly.",
     "desc_zh": "value 精确匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.valueMatch",
     "signature": "selector.valueMatch(pattern)",
     "params": [
      {
       "name": "pattern",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Regular expression",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches value with a regular expression.",
     "desc_zh": "value 正则匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.placeholderValue",
     "signature": "selector.placeholderValue(value)",
     "params": [
      {
       "name": "value",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Placeholder",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches placeholder text exactly.",
     "desc_zh": "占位文字精确匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.placeholderValueMatch",
     "signature": "selector.placeholderValueMatch(pattern)",
     "params": [
      {
       "name": "pattern",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Regular expression",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches placeholder with a regular expression.",
     "desc_zh": "占位文字正则匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.type",
     "signature": "selector.type(value)",
     "params": [
      {
       "name": "value",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Full type name",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches element type; use the full name, e.g. \"XCUIElementTypeButton\".",
     "desc_zh": "控件类型匹配，需写完整类型名，如 \"XCUIElementTypeButton\"。",
     "status": "stable"
    },
    {
     "name": "Selector.typeMatch",
     "signature": "selector.typeMatch(pattern)",
     "params": [
      {
       "name": "pattern",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Regular expression",
       "desc_zh": "匹配值"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "The same selector (chainable)",
      "desc_zh": "同一个选择器（可链式调用）"
     },
     "desc_en": "Matches type with a regular expression.",
     "desc_zh": "控件类型正则匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.enabled",
     "signature": "selector.enabled(flag)",
     "params": [
      {
       "name": "flag",
       "type": "boolean",
       "optional": false,
       "default": null,
       "desc_en": "Enabled state",
       "desc_zh": "是否可用"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Matches enabled state.",
     "desc_zh": "按可用状态匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.index",
     "signature": "selector.index(n)",
     "params": [
      {
       "name": "n",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Index among siblings",
       "desc_zh": "兄弟序号"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Matches sibling index.",
     "desc_zh": "按兄弟序号匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.depth",
     "signature": "selector.depth(n)",
     "params": [
      {
       "name": "n",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Tree depth",
       "desc_zh": "树深度"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Matches tree depth.",
     "desc_zh": "按树深度匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.childCount",
     "signature": "selector.childCount(n)",
     "params": [
      {
       "name": "n",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Number of children",
       "desc_zh": "子节点数"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Matches child count.",
     "desc_zh": "按子节点数匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.bounds",
     "signature": "selector.bounds(x, y, width, height)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X (points)",
       "desc_zh": "X（逻辑点）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y (points)",
       "desc_zh": "Y（逻辑点）"
      },
      {
       "name": "width",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Width",
       "desc_zh": "宽"
      },
      {
       "name": "height",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Height",
       "desc_zh": "高"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Matches by element frame.",
     "desc_zh": "按控件区域匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.xpath",
     "signature": "selector.xpath(expr)",
     "params": [
      {
       "name": "expr",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "XPath expression over the element tree XML",
       "desc_zh": "针对控件树 XML 的 XPath 表达式"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Matches elements by XPath.",
     "desc_zh": "按 XPath 匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.id",
     "signature": "selector.id(nodeId)",
     "params": [
      {
       "name": "nodeId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Node id (index path such as \"0/0/1\")",
       "desc_zh": "节点 id（索引路径，如 \"0/0/1\"）"
      }
     ],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Matches a node id.",
     "desc_zh": "按节点 id 匹配。",
     "status": "stable"
    },
    {
     "name": "Selector.getNodeInfo",
     "signature": "selector.getNodeInfo(timeout?)",
     "params": [
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": 5000,
       "desc_en": "Max wait in ms",
       "desc_zh": "最长等待（毫秒）"
      }
     ],
     "returns": {
      "type": "NodeInfo[]",
      "desc_en": "All matching nodes (may be empty)",
      "desc_zh": "全部命中节点（可能为空数组）"
     },
     "desc_en": "Returns all matching nodes.",
     "desc_zh": "返回全部命中节点。",
     "status": "stable"
    },
    {
     "name": "Selector.getOneNodeInfo",
     "signature": "selector.getOneNodeInfo(timeout?)",
     "params": [
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": 5000,
       "desc_en": "Max wait in ms",
       "desc_zh": "最长等待（毫秒）"
      }
     ],
     "returns": {
      "type": "NodeInfo|undefined",
      "desc_en": "First match or undefined",
      "desc_zh": "第一个命中节点，没有则 undefined"
     },
     "desc_en": "Returns the first matching node.",
     "desc_zh": "返回第一个命中节点。",
     "status": "stable"
    },
    {
     "name": "Selector.loadNode",
     "signature": "selector.loadNode(timeout?)",
     "params": [
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": 5000,
       "desc_en": "Max wait in ms",
       "desc_zh": "最长等待（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Forces a fresh snapshot of the element tree.",
     "desc_zh": "强制重新抓取控件树快照。",
     "status": "stable"
    },
    {
     "name": "Selector.releaseNode",
     "signature": "selector.releaseNode()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Releases the cached tree.",
     "desc_zh": "释放缓存的控件树。",
     "status": "stable"
    },
    {
     "name": "Selector.clearSelector",
     "signature": "selector.clearSelector()",
     "params": [],
     "returns": {
      "type": "Selector",
      "desc_en": "Chainable",
      "desc_zh": "可链式调用"
     },
     "desc_en": "Clears all conditions.",
     "desc_zh": "清除所有条件。",
     "status": "stable"
    },
    {
     "name": "Selector.xml",
     "signature": "selector.xml(timeout?)",
     "params": [
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": null,
       "desc_en": "Max wait in ms",
       "desc_zh": "最长等待（毫秒）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Element tree as XML",
      "desc_zh": "控件树 XML"
     },
     "desc_en": "Returns the whole element tree as XML.",
     "desc_zh": "返回整棵控件树的 XML。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.properties",
     "signature": "node.id / label / type / value / title / identifier / placeholderValue / enabled / bounds / depth / index / parentId / childCount",
     "params": [],
     "returns": {
      "type": "various",
      "desc_en": "bounds = {x, y, width, height, centerX, centerY} in logical points",
      "desc_zh": "bounds = {x, y, width, height, centerX, centerY}，单位为逻辑点"
     },
     "desc_en": "Plain data properties of a NodeInfo.",
     "desc_zh": "NodeInfo 的数据属性。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.tap",
     "signature": "node.tap()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Taps the element.",
     "desc_zh": "点击该控件。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.doubleTap",
     "signature": "node.doubleTap()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Double-taps the element.",
     "desc_zh": "双击该控件。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.press",
     "signature": "node.press(duration?)",
     "params": [
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 500,
       "desc_en": "Hold time (ms)",
       "desc_zh": "按住时长（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Long-presses the element.",
     "desc_zh": "长按该控件。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.clickCenter",
     "signature": "node.clickCenter()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Taps the element center.",
     "desc_zh": "点击控件中心。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.clickRandom",
     "signature": "node.clickRandom()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Taps a random point inside the element.",
     "desc_zh": "在控件范围内随机点击。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.hittable",
     "signature": "node.hittable()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Whether the element can receive a tap.",
     "desc_zh": "控件是否可点击（可被命中）。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.scrollToVisible",
     "signature": "node.scrollToVisible()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Scrolls until the element is visible.",
     "desc_zh": "滚动直到控件可见。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.input",
     "signature": "node.input(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text to type",
       "desc_zh": "要输入的文字"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Focuses the element and types text.",
     "desc_zh": "聚焦控件并输入文字。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.clearInput",
     "signature": "node.clearInput()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Clears the text field.",
     "desc_zh": "清空输入框。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.setValue",
     "signature": "node.setValue(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "New value",
       "desc_zh": "新值"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets the element value.",
     "desc_zh": "设置控件的值。",
     "status": "stable"
    },
    {
     "name": "NodeInfo.navigation",
     "signature": "node.parent() / child(i) / allChildren() / siblings() / previousSiblings() / nextSiblings()",
     "params": [],
     "returns": {
      "type": "NodeInfo|NodeInfo[]",
      "desc_en": "Related nodes from the same snapshot",
      "desc_zh": "同一快照中的相关节点"
     },
     "desc_en": "Tree navigation helpers.",
     "desc_zh": "树导航方法。",
     "status": "stable"
    },
    {
     "name": "isAvailable",
     "signature": "node.isAvailable()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Whether the element-tree engine is usable now.",
     "desc_zh": "当前能否取控件树。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "xml",
     "signature": "node.xml(timeout?)",
     "params": [
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": null,
       "desc_en": "Max wait (ms)",
       "desc_zh": "最长等待（毫秒）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Tree XML",
      "desc_zh": "控件树 XML"
     },
     "desc_en": "Shortcut for createNodeSelector().xml().",
     "desc_zh": "createNodeSelector().xml() 的简写。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "refresh",
     "signature": "node.refresh()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Drops the cached tree so the next query re-snapshots.",
     "desc_zh": "丢弃缓存，下次查询重新抓取。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "lastError",
     "signature": "node.lastError()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Error code of the last node query/action, \"\" if none",
      "desc_zh": "最近一次节点查询/动作的错误码，无则 \"\""
     },
     "desc_en": "Returns the last node error code (e.g. node_unavailable).",
     "desc_zh": "返回最近一次节点错误码（如 node_unavailable）。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "lastResult",
     "signature": "node.lastResult()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{ok, via, route, error, detail, ...}",
      "desc_zh": "{ok, via, route, error, detail, ...}"
     },
     "desc_en": "Structured receipt of the last node action.",
     "desc_zh": "最近一次节点动作的结构化回执。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "image",
   "title_en": "Screenshots & image matching",
   "title_zh": "截图与找图找色",
   "summary_en": "Capture the screen and work with images by imageId (string handle). Includes color finding, multi-point color, template matching (OpenCV), cropping, saving and QR/barcode scanning. Coordinates are image pixels; full-screen captures equal screen pixels. In HID mode screenshots come from the screen broadcast, which must be running. Release images you no longer need.",
   "summary_zh": "截屏并以 imageId（字符串句柄）操作图片：找色、多点找色、模板找图（OpenCV）、裁剪、保存、扫码。坐标为图片像素，整屏截图即屏幕像素。HID 模式下截图来自屏幕直播，需先开启直播。不用的图片请 release。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "image",
    "python": "image",
    "lua": "image"
   },
   "functions": [
    {
     "name": "captureScreen",
     "signature": "image.captureScreen(x?, y?, ex?, ey?)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left (pixels)",
       "desc_zh": "区域左（像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right; 0 = image edge",
       "desc_zh": "区域右，0 表示到图片边缘"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom; 0 = image edge",
       "desc_zh": "区域下，0 表示到图片边缘"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "imageId of the screenshot (cropped when a region is given)",
      "desc_zh": "截图的 imageId（给区域时为裁剪后图）"
     },
     "desc_en": "Takes a screenshot, optionally cropped to (x, y)–(ex, ey).",
     "desc_zh": "截屏，可选裁剪到 (x, y)–(ex, ey)。",
     "example": "var img = image.captureScreen(); /* ... */ image.release(img);",
     "status": "stable"
    },
    {
     "name": "captureFullScreen",
     "signature": "image.captureFullScreen()",
     "params": [],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Takes a full-screen screenshot.",
     "desc_zh": "截取整屏。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "captureRect",
     "signature": "image.captureRect(x, y, width, height)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Left",
       "desc_zh": "左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Top",
       "desc_zh": "上"
      },
      {
       "name": "width",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Width",
       "desc_zh": "宽"
      },
      {
       "name": "height",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Height",
       "desc_zh": "高"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Takes a screenshot of a rectangle given as x, y, width, height.",
     "desc_zh": "按 x, y, 宽, 高 截取区域。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "setCaptureImageId",
     "signature": "image.setCaptureImageId(imageId)",
     "params": [
      {
       "name": "imageId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Capture source name",
       "desc_zh": "截图来源名"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets the capture source used by captureScreen. Only \"screen\" produces frames in this build; other sources make captures return undefined. Empty string = no change.",
     "desc_zh": "设置 captureScreen 的截图来源。本版只有 \"screen\" 有画面，其它来源会让截图返回 undefined；传空串不修改。",
     "status": "limited"
    },
    {
     "name": "captureMat",
     "signature": "image.captureMat()",
     "params": [],
     "returns": {
      "type": "numpy.ndarray|None",
      "desc_en": "BGR array (H×W×3)",
      "desc_zh": "BGR 数组（H×W×3）"
     },
     "desc_en": "Python only: screenshot as an OpenCV/numpy BGR array.",
     "desc_zh": "仅 Python：截屏并返回 OpenCV/numpy BGR 数组。",
     "status": "stable",
     "languages": [
      "python"
     ]
    },
    {
     "name": "readImage",
     "signature": "image.readImage(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = Documents) or http(s) URL",
       "desc_zh": "文件路径（相对路径基于 Documents）或 http(s) 地址"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Loads an image file into a new imageId.",
     "desc_zh": "读取图片文件为新的 imageId。",
     "status": "stable"
    },
    {
     "name": "readImageMat",
     "signature": "image.readImageMat(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path",
       "desc_zh": "文件路径"
      }
     ],
     "returns": {
      "type": "numpy.ndarray|None",
      "desc_en": "BGR array",
      "desc_zh": "BGR 数组"
     },
     "desc_en": "Python only: reads an image file as a BGR array.",
     "desc_zh": "仅 Python：读取图片为 BGR 数组。",
     "status": "stable",
     "languages": [
      "python"
     ]
    },
    {
     "name": "imageIdToMat",
     "signature": "image.imageIdToMat(imageId)",
     "params": [
      {
       "name": "imageId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId",
       "desc_zh": "imageId"
      }
     ],
     "returns": {
      "type": "numpy.ndarray|None",
      "desc_en": "BGR array",
      "desc_zh": "BGR 数组"
     },
     "desc_en": "Python only: converts an imageId to a BGR array.",
     "desc_zh": "仅 Python：把 imageId 转成 BGR 数组。",
     "status": "stable",
     "languages": [
      "python"
     ]
    },
    {
     "name": "clip",
     "signature": "image.clip(id, x, y, ex, ey)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Left",
       "desc_zh": "左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Top",
       "desc_zh": "上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Right (0 = edge)",
       "desc_zh": "右（0 为边缘）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Bottom (0 = edge)",
       "desc_zh": "下（0 为边缘）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Crops an image to a new imageId.",
     "desc_zh": "裁剪图片，返回新 imageId。",
     "status": "stable"
    },
    {
     "name": "getSize",
     "signature": "image.getSize(id)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      }
     ],
     "returns": {
      "type": "object|undefined",
      "desc_en": "{width, height} in pixels",
      "desc_zh": "{width, height}（像素）"
     },
     "desc_en": "Returns image size.",
     "desc_zh": "返回图片尺寸。",
     "status": "stable"
    },
    {
     "name": "toBase64Format",
     "signature": "image.toBase64Format(id, format?, q?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "format",
       "type": "string",
       "optional": true,
       "default": "jpg",
       "desc_en": "\"jpg\" or \"png\"",
       "desc_zh": "\"jpg\" 或 \"png\""
      },
      {
       "name": "q",
       "type": "number",
       "optional": true,
       "default": 90,
       "desc_en": "JPEG quality 1–100",
       "desc_zh": "JPEG 质量 1–100"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Base64 string (no data: prefix)",
      "desc_zh": "Base64 字符串（不带 data: 前缀）"
     },
     "desc_en": "Encodes an image as Base64.",
     "desc_zh": "把图片编码为 Base64。",
     "status": "stable"
    },
    {
     "name": "base64ToImage",
     "signature": "image.base64ToImage(base64data)",
     "params": [
      {
       "name": "base64data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Base64 image data",
       "desc_zh": "Base64 图片数据"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Decodes Base64 into a new imageId.",
     "desc_zh": "把 Base64 解码为新 imageId。",
     "status": "stable"
    },
    {
     "name": "isRelease",
     "signature": "image.isRelease(id)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true if released",
      "desc_zh": "已释放返回 true"
     },
     "desc_en": "Whether an imageId has been released.",
     "desc_zh": "imageId 是否已释放。",
     "status": "stable"
    },
    {
     "name": "release",
     "signature": "image.release(id)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true if the image existed",
      "desc_zh": "图片存在并释放返回 true"
     },
     "desc_en": "Releases an image.",
     "desc_zh": "释放图片。",
     "status": "stable"
    },
    {
     "name": "releaseAll",
     "signature": "image.releaseAll()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Releases all images.",
     "desc_zh": "释放全部图片。",
     "status": "stable"
    },
    {
     "name": "saveTo",
     "signature": "image.saveTo(id, path)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Destination; .png saves PNG, otherwise JPEG. Relative = Documents",
       "desc_zh": "保存路径；.png 存 PNG，否则 JPEG；相对路径基于 Documents"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Saves an image to a file (parent folders are created).",
     "desc_zh": "保存图片到文件（自动建目录）。",
     "status": "stable"
    },
    {
     "name": "rotateImage",
     "signature": "image.rotateImage(id, degree)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "degree",
       "type": "number",
       "optional": false,
       "default": 90,
       "desc_en": "Multiples of 90 only",
       "desc_zh": "只支持 90 的倍数"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Rotates an image by a multiple of 90°.",
     "desc_zh": "按 90° 的倍数旋转图片。",
     "status": "stable"
    },
    {
     "name": "cmpColor",
     "signature": "image.cmpColor(id, points, threshold?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "points",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "\"x|y|#RRGGBB,x|y|#RRGGBB-#offset,...\" absolute coordinates",
       "desc_zh": "\"x|y|#RRGGBB,x|y|#RRGGBB-#偏色,...\"（绝对坐标）"
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 0.9,
       "desc_en": "Similarity 0–1",
       "desc_zh": "相似度 0–1"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true if every point matches",
      "desc_zh": "所有点都匹配返回 true"
     },
     "desc_en": "Multi-point color compare at fixed positions.",
     "desc_zh": "多点比色（固定位置）。",
     "status": "stable"
    },
    {
     "name": "findColor",
     "signature": "image.findColor(id, color, threshold?, x?, y?, ex?, ey?, limit?, orz?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "color",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "\"#RRGGBB\", optional offset \"#RRGGBB-#101010\"; several colors joined with \"|\"",
       "desc_zh": "\"#RRGGBB\"，可带偏色 \"#RRGGBB-#101010\"，多色用 \"|\" 连接"
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 0.9,
       "desc_en": "Similarity 0–1",
       "desc_zh": "相似度 0–1"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left (pixels)",
       "desc_zh": "区域左（像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right; 0 = image edge",
       "desc_zh": "区域右，0 表示到图片边缘"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom; 0 = image edge",
       "desc_zh": "区域下，0 表示到图片边缘"
      },
      {
       "name": "limit",
       "type": "number",
       "optional": true,
       "default": 1,
       "desc_en": "Max results (≤5000)",
       "desc_zh": "最多返回个数（≤5000）"
      },
      {
       "name": "orz",
       "type": "number",
       "optional": true,
       "default": 2,
       "desc_en": "Scan direction 1–8 (2 = top-left→bottom-right, row first)",
       "desc_zh": "扫描方向 1–8（2 = 左上→右下、横向优先）"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{x, y, centerX, centerY}] in image pixels; [] if none",
      "desc_zh": "[{x, y, centerX, centerY}]（图片像素），没找到为 []"
     },
     "desc_en": "Finds pixels of a color in a region.",
     "desc_zh": "在区域内找指定颜色的像素。",
     "example": "var pts = image.findColor(img, '#FF3B30', 0.95, 0, 0, 0, 0, 1);",
     "status": "stable"
    },
    {
     "name": "findMultiColor",
     "signature": "image.findMultiColor(id, firstColor, threshold?, points, x?, y?, ex?, ey?, limit?, orz?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "firstColor",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Anchor color \"#RRGGBB[-#offset]\"",
       "desc_zh": "首点颜色 \"#RRGGBB[-#偏色]\""
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 0.9,
       "desc_en": "Similarity 0–1",
       "desc_zh": "相似度 0–1"
      },
      {
       "name": "points",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "\"dx|dy|#RRGGBB,...\" offsets relative to the anchor",
       "desc_zh": "\"dx|dy|#RRGGBB,...\"，相对首点的偏移"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left (pixels)",
       "desc_zh": "区域左（像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right; 0 = image edge",
       "desc_zh": "区域右，0 表示到图片边缘"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom; 0 = image edge",
       "desc_zh": "区域下，0 表示到图片边缘"
      },
      {
       "name": "limit",
       "type": "number",
       "optional": true,
       "default": 1,
       "desc_en": "Max results (≤5000)",
       "desc_zh": "最多返回个数（≤5000）"
      },
      {
       "name": "orz",
       "type": "number",
       "optional": true,
       "default": 2,
       "desc_en": "Scan direction 1–8 (2 = top-left→bottom-right, row first)",
       "desc_zh": "扫描方向 1–8（2 = 左上→右下、横向优先）"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{x, y, centerX, centerY}] in image pixels; [] if none",
      "desc_zh": "[{x, y, centerX, centerY}]（图片像素），没找到为 []"
     },
     "desc_en": "Multi-point color search: finds anchor positions where all offset points also match.",
     "desc_zh": "多点找色：找到首点颜色且所有偏移点也匹配的位置。",
     "status": "stable"
    },
    {
     "name": "countColor",
     "signature": "image.countColor(id, colors, threshold?, x?, y?, ex?, ey?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "colors",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Color(s), \"|\"-separated",
       "desc_zh": "颜色，多个用 \"|\" 分隔"
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 0.9,
       "desc_en": "Similarity 0–1",
       "desc_zh": "相似度 0–1"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left (pixels)",
       "desc_zh": "区域左（像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right; 0 = image edge",
       "desc_zh": "区域右，0 表示到图片边缘"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom; 0 = image edge",
       "desc_zh": "区域下，0 表示到图片边缘"
      }
     ],
     "returns": {
      "type": "number",
      "desc_en": "Matching pixel count",
      "desc_zh": "匹配像素数"
     },
     "desc_en": "Counts pixels matching the color(s).",
     "desc_zh": "统计匹配颜色的像素数。",
     "status": "stable"
    },
    {
     "name": "findImage",
     "signature": "image.findImage(id, templateImageId, x?, y?, ex?, ey?, threshold?, limit?, method?, rgb?, options?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "templateImageId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Template imageId/path; several templates joined with \"|\"",
       "desc_zh": "模板 imageId 或路径，多个用 \"|\" 连接"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left (pixels)",
       "desc_zh": "区域左（像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right; 0 = image edge",
       "desc_zh": "区域右，0 表示到图片边缘"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom; 0 = image edge",
       "desc_zh": "区域下，0 表示到图片边缘"
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 0.9,
       "desc_en": "Similarity 0–1",
       "desc_zh": "相似度 0–1"
      },
      {
       "name": "limit",
       "type": "number",
       "optional": true,
       "default": 1,
       "desc_en": "Max results (≤5000)",
       "desc_zh": "最多返回个数（≤5000）"
      },
      {
       "name": "method",
       "type": "number",
       "optional": true,
       "default": 5,
       "desc_en": "1 SQDIFF_NORMED, 3 CCORR_NORMED, 5 CCOEFF_NORMED, 99 multi-scale, 0 SIFT",
       "desc_zh": "1 SQDIFF_NORMED、3 CCORR_NORMED、5 CCOEFF_NORMED、99 多尺度、0 SIFT"
      },
      {
       "name": "rgb",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Match in color instead of grayscale",
       "desc_zh": "彩色匹配（默认灰度）"
      },
      {
       "name": "options",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "{scaleFactors: number[] (method 99), orz}",
       "desc_zh": "{scaleFactors（method 99 用）, orz}"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{index, x, y, width, height, ex, ey, centerX, centerY, confidence, scaleX, scaleY, ...}] sorted by confidence",
      "desc_zh": "[{index, x, y, width, height, ex, ey, centerX, centerY, confidence, scaleX, scaleY, ...}]，按置信度排序"
     },
     "desc_en": "Template matching with OpenCV. Methods 1/3/5 are the reference path; method 99 picks scales differently for limit>1 and method 0 confidence is inlier ratio — use top-1 / position only. Flat (texture-less) templates give meaningless hits.",
     "desc_zh": "OpenCV 模板找图。1/3/5 为主路径；method 99 在 limit>1 时尺度选择可能不同，method 0 的 confidence 为内点率，只用 top-1 与坐标。无纹理的平坦模板命中无意义。",
     "example": "var r = image.findImage(img, tpl, 0, 0, 0, 0, 0.9, 1); if (r.length) action.click(r[0].centerX, r[0].centerY);",
     "status": "stable"
    },
    {
     "name": "findImageEx",
     "signature": "image.findImageEx(id, kjstPath)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "kjstPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Template project file",
       "desc_zh": "模板工程文件"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "Always []",
      "desc_zh": "恒为 []"
     },
     "desc_en": "Not supported: the template-project file format is not implemented; always returns [].",
     "desc_zh": "不支持：模板工程文件格式未实现，恒返回 []。",
     "status": "unsupported"
    },
    {
     "name": "pixel",
     "signature": "image.pixel(id, x, y)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X",
       "desc_zh": "X"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y",
       "desc_zh": "Y"
      }
     ],
     "returns": {
      "type": "number|undefined",
      "desc_en": "ARGB integer (0xFFRRGGBB)",
      "desc_zh": "ARGB 整数（0xFFRRGGBB）"
     },
     "desc_en": "Reads one pixel color.",
     "desc_zh": "读取单个像素颜色。",
     "status": "stable"
    },
    {
     "name": "argb",
     "signature": "image.argb(color)",
     "params": [
      {
       "name": "color",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "ARGB integer from pixel()",
       "desc_zh": "pixel() 返回的 ARGB 整数"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "\"#RRGGBB\"",
      "desc_zh": "\"#RRGGBB\""
     },
     "desc_en": "Converts an ARGB integer to a hex color string.",
     "desc_zh": "把 ARGB 整数转成十六进制颜色串。",
     "status": "stable"
    },
    {
     "name": "binaryzation",
     "signature": "image.binaryzation(id, threshold?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 128,
       "desc_en": "Gray threshold 0–255",
       "desc_zh": "灰度阈值 0–255"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Black/white thresholding into a new image.",
     "desc_zh": "二值化，返回新图。",
     "status": "stable"
    },
    {
     "name": "gray",
     "signature": "image.gray(id)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "New imageId, undefined on failure",
      "desc_zh": "新的 imageId，失败返回 undefined"
     },
     "desc_en": "Grayscale copy of an image.",
     "desc_zh": "灰度化，返回新图。",
     "status": "stable"
    },
    {
     "name": "scanCode",
     "signature": "image.scanCode(id)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Decoded text",
      "desc_zh": "识别出的文本"
     },
     "desc_en": "Scans a QR code or barcode in the image.",
     "desc_zh": "识别图中的二维码或条码。",
     "status": "stable"
    },
    {
     "name": "drawRect",
     "signature": "image.drawRect(id, x, y, ex, ey, color?, thickness?)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId (also accepts \"screen\", a file path or an http(s) URL)",
       "desc_zh": "图片 imageId（也可传 \"screen\"、文件路径或 http(s) 地址）"
      },
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Left",
       "desc_zh": "左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Top",
       "desc_zh": "上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Right",
       "desc_zh": "右"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Bottom",
       "desc_zh": "下"
      },
      {
       "name": "color",
       "type": "string",
       "optional": true,
       "default": "#FF0000",
       "desc_en": "Stroke color",
       "desc_zh": "线条颜色"
      },
      {
       "name": "thickness",
       "type": "number",
       "optional": true,
       "default": 2,
       "desc_en": "Line width (px)",
       "desc_zh": "线宽（像素）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Draws a rectangle onto the image in place.",
     "desc_zh": "在原图上画矩形（原地修改）。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "appleOcr",
   "title_en": "Apple Vision OCR",
   "title_zh": "苹果 OCR（Vision）",
   "summary_en": "Text recognition with the system Vision framework. No model download needed. The region filters lines that intersect it; returned coordinates are absolute.",
   "summary_zh": "使用系统 Vision 框架识别文字，无需下载模型。区域参数用于过滤与之相交的文本行，返回坐标为绝对坐标。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "appleOcr",
    "python": "appleocr",
    "lua": "appleocr"
   },
   "functions": [
    {
     "name": "recognizeAbs",
     "signature": "appleOcr.recognizeAbs(input?, x?, y?, ex?, ey?, languages?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "\"screen\" or an absolute image file path (imageIds are not accepted by appleOcr)",
       "desc_zh": "\"screen\" 或图片文件绝对路径（appleOcr 不接受 imageId）"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "languages",
       "type": "string[]",
       "optional": true,
       "default": null,
       "desc_en": "Vision language codes; default [\"zh-Hans\",\"en-US\"]",
       "desc_zh": "Vision 语言代码，默认 [\"zh-Hans\",\"en-US\"]"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]; \"screen\" results are in screen pixels",
      "desc_zh": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]；\"screen\" 输入时为屏幕像素"
     },
     "desc_en": "Recognizes all text lines.",
     "desc_zh": "识别全部文本行。",
     "example": "var lines = appleOcr.recognizeAbs('screen');",
     "status": "stable"
    },
    {
     "name": "recognizeNumbersAbs",
     "signature": "appleOcr.recognizeNumbersAbs(input?, x?, y?, ex?, ey?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "\"screen\" or an absolute image file path (imageIds are not accepted by appleOcr)",
       "desc_zh": "\"screen\" 或图片文件绝对路径（appleOcr 不接受 imageId）"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]; \"screen\" results are in screen pixels",
      "desc_zh": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]；\"screen\" 输入时为屏幕像素"
     },
     "desc_en": "Fast recognition keeping only lines made of digits.",
     "desc_zh": "快速识别，只保留纯数字行。",
     "status": "stable"
    },
    {
     "name": "findTextAbs",
     "signature": "appleOcr.findTextAbs(input, texts, x?, y?, ex?, ey?, languages?, exactMatch?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "\"screen\" or an absolute image file path (imageIds are not accepted by appleOcr)",
       "desc_zh": "\"screen\" 或图片文件绝对路径（appleOcr 不接受 imageId）"
      },
      {
       "name": "texts",
       "type": "string[]",
       "optional": false,
       "default": null,
       "desc_en": "Texts to look for",
       "desc_zh": "要查找的文字列表"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "languages",
       "type": "string[]",
       "optional": true,
       "default": null,
       "desc_en": "Vision language codes; default [\"zh-Hans\",\"en-US\"]",
       "desc_zh": "Vision 语言代码，默认 [\"zh-Hans\",\"en-US\"]"
      },
      {
       "name": "exactMatch",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Whole-line equality instead of \"contains\"",
       "desc_zh": "整行相等（默认包含即可）"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]; \"screen\" results are in screen pixels",
      "desc_zh": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]；\"screen\" 输入时为屏幕像素"
     },
     "desc_en": "Recognizes and keeps only lines matching any of the texts.",
     "desc_zh": "识别并只保留匹配任一目标文字的行。",
     "example": "var r = appleOcr.findTextAbs('screen', ['Settings']); if (r.length) action.click(r[0].centerX, r[0].centerY);",
     "status": "stable"
    },
    {
     "name": "recognize",
     "signature": "appleOcr.recognize(input?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "\"screen\" or an absolute image file path (imageIds are not accepted by appleOcr)",
       "desc_zh": "\"screen\" 或图片文件绝对路径（appleOcr 不接受 imageId）"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]; \"screen\" results are in screen pixels",
      "desc_zh": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]；\"screen\" 输入时为屏幕像素"
     },
     "desc_en": "Full-image recognition (shortcut).",
     "desc_zh": "整图识别（简写）。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "findText",
     "signature": "appleOcr.findText(input, texts, exactMatch?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "\"screen\" or an absolute image file path (imageIds are not accepted by appleOcr)",
       "desc_zh": "\"screen\" 或图片文件绝对路径（appleOcr 不接受 imageId）"
      },
      {
       "name": "texts",
       "type": "string[]",
       "optional": false,
       "default": null,
       "desc_en": "Texts",
       "desc_zh": "目标文字"
      },
      {
       "name": "exactMatch",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Exact",
       "desc_zh": "精确匹配"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]; \"screen\" results are in screen pixels",
      "desc_zh": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]；\"screen\" 输入时为屏幕像素"
     },
     "desc_en": "Full-image findTextAbs.",
     "desc_zh": "整图版 findTextAbs。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "recognizeNumbers",
     "signature": "appleOcr.recognizeNumbers(input?, x?, y?, ex?, ey?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "\"screen\" or an absolute image file path (imageIds are not accepted by appleOcr)",
       "desc_zh": "\"screen\" 或图片文件绝对路径（appleOcr 不接受 imageId）"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]; \"screen\" results are in screen pixels",
      "desc_zh": "[{text, confidence, x, y, width, height, ex, ey, centerX, centerY}]；\"screen\" 输入时为屏幕像素"
     },
     "desc_en": "Same as recognizeNumbersAbs.",
     "desc_zh": "同 recognizeNumbersAbs。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "paddleOcr",
   "title_en": "PaddleOCR (on-device)",
   "title_zh": "PaddleOCR（端侧模型）",
   "summary_en": "PP-OCR models running on-device with ncnn, bundled in the app. The default model (ppocr-v6-small) loads automatically on first use. *Abs functions return coordinates in the full image; recognize/findText return coordinates relative to the region.",
   "summary_zh": "App 内置 PP-OCR 模型，ncnn 端侧推理。首次使用自动加载默认模型 ppocr-v6-small。带 Abs 的函数返回整图坐标；recognize/findText 返回相对区域的坐标。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "paddleOcr",
    "python": "paddleocr",
    "lua": "paddleocr"
   },
   "functions": [
    {
     "name": "loadModel",
     "signature": "paddleOcr.loadModel(modelId, useGpu?)",
     "params": [
      {
       "name": "modelId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "\"ppocr-v6-small\", \"ppocr-v6-tiny\" or \"ppocr-v5\"",
       "desc_zh": "\"ppocr-v6-small\"、\"ppocr-v6-tiny\" 或 \"ppocr-v5\""
      },
      {
       "name": "useGpu",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Use GPU",
       "desc_zh": "使用 GPU"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Loads (or switches to) a bundled model.",
     "desc_zh": "加载（或切换到）内置模型。",
     "status": "stable"
    },
    {
     "name": "setMaxSideLen",
     "signature": "paddleOcr.setMaxSideLen(maxSideLen?)",
     "params": [
      {
       "name": "maxSideLen",
       "type": "number",
       "optional": true,
       "default": 768,
       "desc_en": "Longest side used for detection; ≤0 resets to 768",
       "desc_zh": "检测时最长边，≤0 恢复 768"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets the detection input size.",
     "desc_zh": "设置检测输入尺寸。",
     "status": "stable"
    },
    {
     "name": "recognizeAbs",
     "signature": "paddleOcr.recognizeAbs(input?, x?, y?, ex?, ey?, confidenceThreshold?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "imageId, \"screen\", file path or URL",
       "desc_zh": "imageId、\"screen\"、文件路径或 URL"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "confidenceThreshold",
       "type": "number",
       "optional": true,
       "default": 0.6,
       "desc_en": "Minimum confidence",
       "desc_zh": "最低置信度"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]",
      "desc_zh": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]"
     },
     "desc_en": "Recognizes text, absolute coordinates.",
     "desc_zh": "识别文字，返回绝对坐标。",
     "example": "var r = paddleOcr.recognizeAbs('screen');",
     "status": "stable"
    },
    {
     "name": "findTextAbs",
     "signature": "paddleOcr.findTextAbs(input, targetTexts, x?, y?, ex?, ey?, confidenceThreshold?, exactMatch?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "imageId, \"screen\", file path or URL",
       "desc_zh": "imageId、\"screen\"、文件路径或 URL"
      },
      {
       "name": "targetTexts",
       "type": "string|string[]",
       "optional": false,
       "default": null,
       "desc_en": "Text(s) to find",
       "desc_zh": "目标文字"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "confidenceThreshold",
       "type": "number",
       "optional": true,
       "default": 0.6,
       "desc_en": "Minimum confidence",
       "desc_zh": "最低置信度"
      },
      {
       "name": "exactMatch",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Exact match",
       "desc_zh": "精确匹配"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]",
      "desc_zh": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]"
     },
     "desc_en": "Finds target texts, absolute coordinates.",
     "desc_zh": "查找目标文字，返回绝对坐标。",
     "status": "stable"
    },
    {
     "name": "free",
     "signature": "paddleOcr.free()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Unloads the model.",
     "desc_zh": "卸载模型。",
     "status": "stable"
    },
    {
     "name": "recognize",
     "signature": "paddleOcr.recognize(input?, x?, y?, ex?, ey?, confidenceThreshold?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "imageId, \"screen\", file path or URL",
       "desc_zh": "imageId、\"screen\"、文件路径或 URL"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "confidenceThreshold",
       "type": "number",
       "optional": true,
       "default": 0.6,
       "desc_en": "Minimum confidence",
       "desc_zh": "最低置信度"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]",
      "desc_zh": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]"
     },
     "desc_en": "Like recognizeAbs but coordinates are relative to the region.",
     "desc_zh": "同 recognizeAbs，但坐标相对区域。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "findText",
     "signature": "paddleOcr.findText(input, targetTexts, x?, y?, ex?, ey?, confidenceThreshold?, exactMatch?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "imageId, \"screen\", file path or URL",
       "desc_zh": "imageId、\"screen\"、文件路径或 URL"
      },
      {
       "name": "targetTexts",
       "type": "string|string[]",
       "optional": false,
       "default": null,
       "desc_en": "Text(s)",
       "desc_zh": "目标文字"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "confidenceThreshold",
       "type": "number",
       "optional": true,
       "default": 0.6,
       "desc_en": "Minimum confidence",
       "desc_zh": "最低置信度"
      },
      {
       "name": "exactMatch",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Exact",
       "desc_zh": "精确"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]",
      "desc_zh": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY, angle, orientation}]"
     },
     "desc_en": "Like findTextAbs with region-relative coordinates.",
     "desc_zh": "同 findTextAbs，坐标相对区域。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "loadV5",
     "signature": "paddleOcr.loadV5(useGpu?)",
     "params": [
      {
       "name": "useGpu",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "GPU",
       "desc_zh": "GPU"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Shortcut for loadModel(\"ppocr-v5\").",
     "desc_zh": "loadModel(\"ppocr-v5\") 的简写。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "tomatoOcr",
   "title_en": "tomatoOcr-compatible OCR",
   "title_zh": "tomatoOcr 兼容 OCR",
   "summary_en": "Compatibility interface for scripts written against the tomatoOcr API. ketec does not ship that third-party SDK; the same calls run on the bundled open-source PP-OCRv5/v6 models (ncnn). No license key is required.",
   "summary_zh": "为按 tomatoOcr 接口编写的脚本提供兼容层。ketec 不带该第三方 SDK，同一套调用跑在内置开源 PP-OCRv5/v6 模型（ncnn）上，无需授权码。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "tomatoOcr",
    "python": "tomatoocr",
    "lua": "tomatoocr"
   },
   "functions": [
    {
     "name": "initializeWithConfig",
     "signature": "tomatoOcr.initializeWithConfig(mode, licenseData, remark?)",
     "params": [
      {
       "name": "mode",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Ignored",
       "desc_zh": "忽略"
      },
      {
       "name": "licenseData",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Ignored (no license needed)",
       "desc_zh": "忽略（无需授权）"
      },
      {
       "name": "remark",
       "type": "string",
       "optional": true,
       "default": "",
       "desc_en": "Ignored",
       "desc_zh": "忽略"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{status:\"success\", versionName, deviceId:\"\", expiryTime:\"\", message}",
      "desc_zh": "{status:\"success\", versionName, deviceId:\"\", expiryTime:\"\", message}"
     },
     "desc_en": "Always succeeds; reports that the built-in open-source engine is used.",
     "desc_zh": "恒成功，并说明使用内置开源引擎。",
     "status": "stable"
    },
    {
     "name": "setHttpIntervalTime",
     "signature": "tomatoOcr.setHttpIntervalTime(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "No effect (no online licensing)",
       "desc_zh": "无效果（不联网授权）"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "No effect (no online licensing)",
     "desc_zh": "无效果（不联网授权）",
     "status": "stable"
    },
    {
     "name": "setRecType",
     "signature": "tomatoOcr.setRecType(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Model group: \"ch-3.0\" (default) / \"ch-2.0\" / \"ch\" → PP-OCRv6; \"cht\" / \"japan\" → PP-OCRv5; \"korean\"; \"number\" (digits only)",
       "desc_zh": "识别类型：ch-3.0（默认）/ch-2.0/ch → PP-OCRv6；cht/japan → PP-OCRv5；korean；number（仅数字）"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Model group: \"ch-3.0\" (default) / \"ch-2.0\" / \"ch\" → PP-OCRv6; \"cht\" / \"japan\" → PP-OCRv5; \"korean\"; \"number\" (digits only)",
     "desc_zh": "识别类型：ch-3.0（默认）/ch-2.0/ch → PP-OCRv6；cht/japan → PP-OCRv5；korean；number（仅数字）",
     "status": "stable"
    },
    {
     "name": "setDetBoxType",
     "signature": "tomatoOcr.setDetBoxType(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "\"rect\" (default) or \"quad\" box output",
       "desc_zh": "框类型 \"rect\"（默认）或 \"quad\""
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "\"rect\" (default) or \"quad\" box output",
     "desc_zh": "框类型 \"rect\"（默认）或 \"quad\"",
     "status": "stable"
    },
    {
     "name": "setDetUnclipRatio",
     "signature": "tomatoOcr.setDetUnclipRatio(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Detection box expansion (default 1.9)",
       "desc_zh": "检测框扩张比例（默认 1.9）"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Detection box expansion (default 1.9)",
     "desc_zh": "检测框扩张比例（默认 1.9）",
     "status": "stable"
    },
    {
     "name": "setDetScaleRatio",
     "signature": "tomatoOcr.setDetScaleRatio(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Detection scale factor (default 1.0)",
       "desc_zh": "检测缩放比例（默认 1.0）"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Detection scale factor (default 1.0)",
     "desc_zh": "检测缩放比例（默认 1.0）",
     "status": "stable"
    },
    {
     "name": "setRecScoreThreshold",
     "signature": "tomatoOcr.setRecScoreThreshold(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Minimum recognition score (default 0.1)",
       "desc_zh": "识别最低得分（默认 0.1）"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Minimum recognition score (default 0.1)",
     "desc_zh": "识别最低得分（默认 0.1）",
     "status": "stable"
    },
    {
     "name": "setReturnType",
     "signature": "tomatoOcr.setReturnType(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "\"json\" (default), \"text\", \"num\", or a custom character set to keep",
       "desc_zh": "返回类型 \"json\"（默认）、\"text\"、\"num\" 或自定义保留字符集"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "\"json\" (default), \"text\", \"num\", or a custom character set to keep",
     "desc_zh": "返回类型 \"json\"（默认）、\"text\"、\"num\" 或自定义保留字符集",
     "status": "stable"
    },
    {
     "name": "setBinaryThresh",
     "signature": "tomatoOcr.setBinaryThresh(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Binarize before OCR (0–255, 0 = off)",
       "desc_zh": "识别前二值化阈值（0–255，0 关闭）"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Binarize before OCR (0–255, 0 = off)",
     "desc_zh": "识别前二值化阈值（0–255，0 关闭）",
     "status": "stable"
    },
    {
     "name": "setRunMode",
     "signature": "tomatoOcr.setRunMode(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Recorded only; a single CPU engine is used",
       "desc_zh": "只记录，统一用 CPU 推理"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Recorded only; a single CPU engine is used",
     "desc_zh": "只记录，统一用 CPU 推理",
     "status": "stable"
    },
    {
     "name": "setFilterColor",
     "signature": "tomatoOcr.setFilterColor(filterColor, backgroundColor)",
     "params": [
      {
       "name": "filterColor",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Keep-color spec",
       "desc_zh": "保留颜色"
      },
      {
       "name": "backgroundColor",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Background color",
       "desc_zh": "背景色"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Keeps only pixels of the given colors before OCR.",
     "desc_zh": "识别前只保留指定颜色的像素。",
     "status": "stable"
    },
    {
     "name": "ocrImage",
     "signature": "tomatoOcr.ocrImage(input, type?, x?, y?, ex?, ey?)",
     "params": [
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "imageId, \"screen\", file path or URL",
       "desc_zh": "imageId、\"screen\"、文件路径或 URL"
      },
      {
       "name": "type",
       "type": "number",
       "optional": true,
       "default": 3,
       "desc_en": "0 detect only, 1/2 recognize, 3 detect+recognize",
       "desc_zh": "0 仅检测，1/2 识别，3 检测+识别"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "JSON array string [{location:[[x,y]×4], score, words}] (coordinates relative to region), or plain text per setReturnType; \"\" on failure",
      "desc_zh": "JSON 数组字符串 [{location, score, words}]（坐标相对区域），或按 setReturnType 返回纯文本；失败为 \"\""
     },
     "desc_en": "Runs OCR and returns a string.",
     "desc_zh": "执行 OCR，返回字符串。",
     "status": "stable"
    },
    {
     "name": "findTapPoint",
     "signature": "tomatoOcr.findTapPoint(data)",
     "params": [
      {
       "name": "data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text, or '{\"text\":\"OK\"}' / '{\"texts\":[...]}'",
       "desc_zh": "文字，或 '{\"text\":\"确定\"}' / '{\"texts\":[...]}'"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "\"[x,y]\" center of the first matching line from the last ocrImage, \"\" if none",
      "desc_zh": "上次 ocrImage 结果中首个命中行的中心 \"[x,y]\"，无则 \"\""
     },
     "desc_en": "Looks up a tap point in the last OCR result.",
     "desc_zh": "在上次识别结果中查找点击点。",
     "status": "stable"
    },
    {
     "name": "findTapPoints",
     "signature": "tomatoOcr.findTapPoints(data)",
     "params": [
      {
       "name": "data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Same as findTapPoint",
       "desc_zh": "同 findTapPoint"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "\"[[x,y],...]\" or \"\"",
      "desc_zh": "\"[[x,y],...]\" 或 \"\""
     },
     "desc_en": "All matching tap points from the last OCR result.",
     "desc_zh": "上次识别结果中全部命中点。",
     "status": "stable"
    },
    {
     "name": "release",
     "signature": "tomatoOcr.release()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Unloads the model and clears the last result.",
     "desc_zh": "卸载模型并清除上次结果。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "dotOcr",
   "title_en": "Dot-matrix font OCR",
   "title_zh": "点阵字库 OCR",
   "summary_en": "Recognizes fixed bitmap fonts (game digits, LED text) with a JSON glyph library. Font files must use format \"ketec-dot-font\" (a compatible third-party format name is also accepted).",
   "summary_zh": "用 JSON 点阵字库识别固定字形（游戏数字、LED 字等）。字库 format 须为 \"ketec-dot-font\"（也兼容一种第三方字库格式名）。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "dotOcr",
    "python": "dotocr",
    "lua": "dotocr"
   },
   "functions": [
    {
     "name": "loadFont",
     "signature": "dotOcr.loadFont(fontPath)",
     "params": [
      {
       "name": "fontPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Font JSON path (relative = Documents; also tries res/)",
       "desc_zh": "字库 JSON 路径（相对路径基于 Documents，也会查 res/）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "fontId",
      "desc_zh": "字库 ID"
     },
     "desc_en": "Loads a glyph library.",
     "desc_zh": "加载字库。",
     "status": "stable"
    },
    {
     "name": "free",
     "signature": "dotOcr.free(fontId)",
     "params": [
      {
       "name": "fontId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Font id",
       "desc_zh": "字库 ID"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Unloads one font.",
     "desc_zh": "释放一个字库。",
     "status": "stable"
    },
    {
     "name": "freeAll",
     "signature": "dotOcr.freeAll()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Unloads all fonts.",
     "desc_zh": "释放全部字库。",
     "status": "stable"
    },
    {
     "name": "recognizeAbs",
     "signature": "dotOcr.recognizeAbs(fontId, input, x?, y?, ex?, ey?, confidenceThreshold?)",
     "params": [
      {
       "name": "fontId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Font id",
       "desc_zh": "字库 ID"
      },
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "imageId, \"screen\", file path or URL",
       "desc_zh": "imageId、\"screen\"、文件路径或 URL"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "confidenceThreshold",
       "type": "number",
       "optional": true,
       "default": 0.95,
       "desc_en": "Minimum confidence",
       "desc_zh": "最低置信度"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY}]",
      "desc_zh": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY}]"
     },
     "desc_en": "Recognizes characters, absolute coordinates.",
     "desc_zh": "识别字符，返回绝对坐标。",
     "status": "stable"
    },
    {
     "name": "findTextAbs",
     "signature": "dotOcr.findTextAbs(fontId, input, targetTexts, x?, y?, ex?, ey?, confidenceThreshold?, exactMatch?)",
     "params": [
      {
       "name": "fontId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Font id",
       "desc_zh": "字库 ID"
      },
      {
       "name": "input",
       "type": "string",
       "optional": true,
       "default": "screen",
       "desc_en": "imageId, \"screen\", file path or URL",
       "desc_zh": "imageId、\"screen\"、文件路径或 URL"
      },
      {
       "name": "targetTexts",
       "type": "string|string[]",
       "optional": false,
       "default": null,
       "desc_en": "Text(s)",
       "desc_zh": "目标文字"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (ex<=x means whole image)",
       "desc_zh": "区域右（ex<=x 视为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "confidenceThreshold",
       "type": "number",
       "optional": true,
       "default": 0.95,
       "desc_en": "Min confidence",
       "desc_zh": "最低置信度"
      },
      {
       "name": "exactMatch",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Exact",
       "desc_zh": "精确"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY}]",
      "desc_zh": "[{text, confidence, x, y, ex, ey, width, height, centerX, centerY}]"
     },
     "desc_en": "Finds target texts.",
     "desc_zh": "查找目标文字。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "app",
   "title_en": "Apps (ketec helper)",
   "title_zh": "应用（ketec 简化接口）",
   "summary_en": "Small ketec helper module for launching/terminating apps and reading the app list. JavaScript (and dynamic lookup) only; the system module offers the same features with the standard names.",
   "summary_zh": "ketec 自带的应用小模块：启动/结束 App、读取应用列表。供 JavaScript 使用；system 模块提供同样能力的标准名字。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript"
   ],
   "names": {
    "javascript": "app",
    "python": null,
    "lua": null
   },
   "functions": [
    {
     "name": "list",
     "signature": "app.list()",
     "params": [],
     "returns": {
      "type": "array",
      "desc_en": "[{appName, bundleIdentifier, bundleVersion, ...}]",
      "desc_zh": "[{appName, bundleIdentifier, bundleVersion, ...}]"
     },
     "desc_en": "Installed apps.",
     "desc_zh": "已安装应用列表。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "frontmost",
     "signature": "app.frontmost()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{name, bundleId, pid} or {}",
      "desc_zh": "{name, bundleId, pid}，取不到为 {}"
     },
     "desc_en": "Foreground app.",
     "desc_zh": "前台应用。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "launch",
     "signature": "app.launch(bundleId)",
     "params": [
      {
       "name": "bundleId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Bundle id",
       "desc_zh": "Bundle ID"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Launches / brings an app to the front.",
     "desc_zh": "启动或切到前台。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "terminate",
     "signature": "app.terminate(bundleId)",
     "params": [
      {
       "name": "bundleId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Bundle id",
       "desc_zh": "Bundle ID"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Terminates an app (through the Agent).",
     "desc_zh": "结束 App（经 Agent）。",
     "status": "stable",
     "modes": [
      "agent"
     ],
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "system",
   "title_en": "System & apps",
   "title_zh": "系统与应用",
   "summary_en": "App launch/stop, foreground and installed app info, clipboard, URL opening, notifications, lock state, memory and CPU.",
   "summary_zh": "启动/结束应用、前台与已安装应用信息、剪贴板、打开 URL、本地通知、锁屏状态、内存与 CPU。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "system",
    "python": "system",
    "lua": "system"
   },
   "functions": [
    {
     "name": "startApp",
     "signature": "system.startApp(bundle_id)",
     "params": [
      {
       "name": "bundle_id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Bundle identifier, e.g. \"com.apple.Preferences\"",
       "desc_zh": "Bundle ID，如 \"com.apple.Preferences\""
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Launches an app (or brings it to the front).",
     "desc_zh": "启动应用（已运行则切到前台）。",
     "example": "system.startApp('com.apple.calculator');",
     "status": "stable"
    },
    {
     "name": "stopApp",
     "signature": "system.stopApp(bundle_id)",
     "params": [
      {
       "name": "bundle_id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Bundle identifier, e.g. \"com.apple.Preferences\"",
       "desc_zh": "Bundle ID，如 \"com.apple.Preferences\""
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Terminates an app through the Agent. In HID mode use hid.closeApp, which can close apps with a gesture.",
     "desc_zh": "经 Agent 结束应用。HID 模式请用 hid.closeApp（可用手势关闭）。",
     "status": "stable",
     "modes": [
      "agent"
     ]
    },
    {
     "name": "activateApp",
     "signature": "system.activateApp(bundle_id)",
     "params": [
      {
       "name": "bundle_id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Bundle identifier, e.g. \"com.apple.Preferences\"",
       "desc_zh": "Bundle ID，如 \"com.apple.Preferences\""
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Brings an app to the front (same as startApp).",
     "desc_zh": "把应用切到前台（同 startApp）。",
     "status": "stable"
    },
    {
     "name": "activateAppInfo",
     "signature": "system.activateAppInfo()",
     "params": [],
     "returns": {
      "type": "object|undefined",
      "desc_en": "{name, bundleId, pid}; undefined if unknown",
      "desc_zh": "{name, bundleId, pid}；取不到为 undefined"
     },
     "desc_en": "Current foreground app.",
     "desc_zh": "当前前台应用。",
     "status": "stable"
    },
    {
     "name": "foregroundAppInfos",
     "signature": "system.foregroundAppInfos()",
     "params": [],
     "returns": {
      "type": "array",
      "desc_en": "[{name, bundleId, pid}] (0 or 1 item)",
      "desc_zh": "[{name, bundleId, pid}]（0 或 1 项）"
     },
     "desc_en": "Foreground app as a list.",
     "desc_zh": "前台应用（列表形式）。",
     "status": "stable"
    },
    {
     "name": "backgroundAppInfos",
     "signature": "system.backgroundAppInfos()",
     "params": [],
     "returns": {
      "type": "array",
      "desc_en": "[{bundleId, name, pid}]",
      "desc_zh": "[{bundleId, name, pid}]"
     },
     "desc_en": "Background apps from the process list. The iOS sandbox usually hides other processes, so this is often [].",
     "desc_zh": "从进程表列出后台应用。iOS 沙盒通常不允许列出其它进程，因此常为 []。",
     "status": "limited"
    },
    {
     "name": "getInstalledAppList",
     "signature": "system.getInstalledAppList()",
     "params": [],
     "returns": {
      "type": "array",
      "desc_en": "[{appName, bundleIdentifier, bundleVersion}]",
      "desc_zh": "[{appName, bundleIdentifier, bundleVersion}]"
     },
     "desc_en": "Installed apps.",
     "desc_zh": "已安装应用列表。",
     "status": "stable"
    },
    {
     "name": "recent",
     "signature": "system.recent()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "Always undefined",
      "desc_zh": "恒为 undefined"
     },
     "desc_en": "Not implemented in the script binding (returns undefined). Use hid.recent() in HID mode.",
     "desc_zh": "脚本绑定未实现（返回 undefined）。HID 模式请用 hid.recent()。",
     "status": "unsupported"
    },
    {
     "name": "openURL",
     "signature": "system.openURL(url)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "URL or URL scheme",
       "desc_zh": "URL 或 URL Scheme"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true once the request is issued (not a confirmation that it opened)",
      "desc_zh": "请求已发出即 true（不代表一定打开成功）"
     },
     "desc_en": "Opens a URL from inside ketec. Some schemes (e.g. prefs:) or opening while ketec is in background may not work; in HID mode hid.openURL is more reliable.",
     "desc_zh": "由 ketec 内部打开 URL。部分 scheme（如 prefs:）或 ketec 在后台时可能打不开；HID 模式下 hid.openURL 更可靠。",
     "status": "limited"
    },
    {
     "name": "notify",
     "signature": "system.notify(msg, title?, id?)",
     "params": [
      {
       "name": "msg",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Body",
       "desc_zh": "正文"
      },
      {
       "name": "title",
       "type": "string",
       "optional": true,
       "default": "",
       "desc_en": "Title",
       "desc_zh": "标题"
      },
      {
       "name": "id",
       "type": "string",
       "optional": true,
       "default": "",
       "desc_en": "Same id replaces the previous notification",
       "desc_zh": "相同 id 覆盖上一条"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Posts a local notification (asks for permission the first time; also shown while ketec is in front).",
     "desc_zh": "发送本地通知（首次会申请权限；ketec 在前台时也会显示横幅）。",
     "status": "stable"
    },
    {
     "name": "setClipboard",
     "signature": "system.setClipboard(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Writes the clipboard.",
     "desc_zh": "写剪贴板。",
     "status": "stable"
    },
    {
     "name": "getClipboard",
     "signature": "system.getClipboard()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Clipboard text (\"\" if empty)",
      "desc_zh": "剪贴板文本（空为 \"\"）"
     },
     "desc_en": "Reads the clipboard.",
     "desc_zh": "读剪贴板。",
     "status": "stable"
    },
    {
     "name": "isLocked",
     "signature": "system.isLocked()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true if the screen is locked",
      "desc_zh": "锁屏返回 true"
     },
     "desc_en": "Whether the device is locked.",
     "desc_zh": "设备是否锁屏。",
     "status": "stable"
    },
    {
     "name": "lock",
     "signature": "system.lock()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Locks the screen via the HID power key. Requires a connected HID device.",
     "desc_zh": "经 HID 电源键锁屏，需要已连接 HID 设备。",
     "status": "limited",
     "modes": [
      "hid"
     ]
    },
    {
     "name": "unlock",
     "signature": "system.unlock()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Wakes the screen via HID (presses Home twice); does not enter a passcode. Requires HID.",
     "desc_zh": "经 HID 唤醒（按两次 Home），不会输入密码。需要 HID。",
     "status": "limited",
     "modes": [
      "hid"
     ]
    },
    {
     "name": "getMemoryInfo",
     "signature": "system.getMemoryInfo()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{total, available, used, systemUsed, usagePercentage} — MB (system-wide)",
      "desc_zh": "{total, available, used, systemUsed, usagePercentage}，单位 MB（整机）"
     },
     "desc_en": "Memory statistics.",
     "desc_zh": "内存统计。",
     "status": "stable"
    },
    {
     "name": "getUsedMemory",
     "signature": "system.getUsedMemory()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "MB",
      "desc_zh": "MB"
     },
     "desc_en": "Used memory (MB, system-wide).",
     "desc_zh": "已用内存（MB，整机）。",
     "status": "stable"
    },
    {
     "name": "getAvailableMemory",
     "signature": "system.getAvailableMemory()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "MB",
      "desc_zh": "MB"
     },
     "desc_en": "Available memory (MB).",
     "desc_zh": "可用内存（MB）。",
     "status": "stable"
    },
    {
     "name": "getTotalMemory",
     "signature": "system.getTotalMemory()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "MB",
      "desc_zh": "MB"
     },
     "desc_en": "Total physical memory (MB).",
     "desc_zh": "物理内存总量（MB）。",
     "status": "stable"
    },
    {
     "name": "getSystemUsedMemory",
     "signature": "system.getSystemUsedMemory()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "MB",
      "desc_zh": "MB"
     },
     "desc_en": "Currently returns the same value as getUsedMemory (the separate systemUsed figure is in getMemoryInfo()).",
     "desc_zh": "当前与 getUsedMemory 返回同一值（单独的 systemUsed 见 getMemoryInfo()）。",
     "status": "limited"
    },
    {
     "name": "getCpuUsage",
     "signature": "system.getCpuUsage()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "Percent, 0.1 precision",
      "desc_zh": "百分比，精度 0.1"
     },
     "desc_en": "CPU usage of the ketec process (all threads).",
     "desc_zh": "ketec 进程 CPU 占用（全部线程）。",
     "status": "stable"
    },
    {
     "name": "startAgent",
     "signature": "system.startAgent()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "Always undefined",
      "desc_zh": "恒为 undefined"
     },
     "desc_en": "Not implemented: ketec has no separate Agent service to start from scripts.",
     "desc_zh": "未实现：ketec 没有可由脚本启动的独立 Agent 服务。",
     "status": "unsupported"
    },
    {
     "name": "stopAgent",
     "signature": "system.stopAgent()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "Always undefined",
      "desc_zh": "恒为 undefined"
     },
     "desc_en": "Not implemented (see startAgent).",
     "desc_zh": "未实现（同 startAgent）。",
     "status": "unsupported"
    },
    {
     "name": "getAgentStatus",
     "signature": "system.getAgentStatus()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true if the Agent channel is available",
      "desc_zh": "Agent 通道可用返回 true"
     },
     "desc_en": "Whether the Agent channel is connected.",
     "desc_zh": "Agent 通道是否可用。",
     "status": "stable"
    },
    {
     "name": "uptime",
     "signature": "system.uptime()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "Seconds since boot",
      "desc_zh": "开机以来秒数"
     },
     "desc_en": "System uptime.",
     "desc_zh": "系统运行时长。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "device",
   "title_en": "Device info",
   "title_zh": "设备信息",
   "summary_en": "Device identity, screen, battery, storage, volume, brightness, orientation, network address and vibration.",
   "summary_zh": "设备标识、屏幕、电量、存储、音量、亮度、方向、局域网地址与振动。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "device",
    "python": "device",
    "lua": "device"
   },
   "functions": [
    {
     "name": "getBatteryInfo",
     "signature": "device.getBatteryInfo()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{level: 0–100, isCharging: boolean}",
      "desc_zh": "{level: 0–100, isCharging: boolean}"
     },
     "desc_en": "Battery level and charging state.",
     "desc_zh": "电量与充电状态。",
     "status": "stable"
    },
    {
     "name": "getStorageSpace",
     "signature": "device.getStorageSpace()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{total, free, unit: \"GB\"} (decimal GB, 2 decimals)",
      "desc_zh": "{total, free, unit: \"GB\"}（十进制 GB，两位小数）"
     },
     "desc_en": "Storage capacity.",
     "desc_zh": "存储空间。",
     "status": "stable"
    },
    {
     "name": "getDeviceID",
     "signature": "device.getDeviceID()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Device ID",
      "desc_zh": "设备 ID"
     },
     "desc_en": "ketec device identifier.",
     "desc_zh": "ketec 设备标识。",
     "status": "stable"
    },
    {
     "name": "getECID",
     "signature": "device.getECID()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "ECID (\"\" if unavailable)",
      "desc_zh": "ECID（取不到为 \"\"）"
     },
     "desc_en": "Device ECID.",
     "desc_zh": "设备 ECID。",
     "status": "stable"
    },
    {
     "name": "getUDID",
     "signature": "device.getUDID()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "UDID (\"\" if unavailable)",
      "desc_zh": "UDID（取不到为 \"\"）"
     },
     "desc_en": "Device UDID.",
     "desc_zh": "设备 UDID。",
     "status": "stable"
    },
    {
     "name": "getDeviceName",
     "signature": "device.getDeviceName()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Name",
      "desc_zh": "名称"
     },
     "desc_en": "Device name.",
     "desc_zh": "设备名称。",
     "status": "stable"
    },
    {
     "name": "getDeviceModel",
     "signature": "device.getDeviceModel()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Model, e.g. \"iPhone 12\"",
      "desc_zh": "型号，如 \"iPhone 12\""
     },
     "desc_en": "Device model.",
     "desc_zh": "设备型号。",
     "status": "stable"
    },
    {
     "name": "getScreenRealSize",
     "signature": "device.getScreenRealSize()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{width, height} in pixels",
      "desc_zh": "{width, height}（像素）"
     },
     "desc_en": "Screen size in pixels (the coordinate space for action/hid).",
     "desc_zh": "屏幕像素尺寸（action/hid 的坐标空间）。",
     "status": "stable"
    },
    {
     "name": "getScreenSize",
     "signature": "device.getScreenSize()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{width, height} in logical points",
      "desc_zh": "{width, height}（逻辑点）"
     },
     "desc_en": "Screen size in points.",
     "desc_zh": "屏幕逻辑点尺寸。",
     "status": "stable",
     "ketec_extra": true
    },
    {
     "name": "getScreenScale",
     "signature": "device.getScreenScale()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "e.g. 3",
      "desc_zh": "如 3"
     },
     "desc_en": "Pixels per point.",
     "desc_zh": "屏幕缩放倍数（像素/点）。",
     "status": "stable"
    },
    {
     "name": "getScreenBrightness",
     "signature": "device.getScreenBrightness()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "0–1",
      "desc_zh": "0–1"
     },
     "desc_en": "Screen brightness.",
     "desc_zh": "屏幕亮度。",
     "status": "stable"
    },
    {
     "name": "setScreenBrightness",
     "signature": "device.setScreenBrightness(brightness)",
     "params": [
      {
       "name": "brightness",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "0–1",
       "desc_zh": "0–1"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets screen brightness.",
     "desc_zh": "设置屏幕亮度。",
     "status": "stable"
    },
    {
     "name": "getVolume",
     "signature": "device.getVolume()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "0–1",
      "desc_zh": "0–1"
     },
     "desc_en": "Media volume.",
     "desc_zh": "媒体音量。",
     "status": "stable"
    },
    {
     "name": "setVolume",
     "signature": "device.setVolume(volume)",
     "params": [
      {
       "name": "volume",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "0–1",
       "desc_zh": "0–1"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets media volume.",
     "desc_zh": "设置媒体音量。",
     "status": "stable"
    },
    {
     "name": "getOrientation",
     "signature": "device.getOrientation()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "\"PORTRAIT\" or \"LANDSCAPE\"",
      "desc_zh": "\"PORTRAIT\" 或 \"LANDSCAPE\""
     },
     "desc_en": "Screen orientation.",
     "desc_zh": "屏幕方向。",
     "status": "stable"
    },
    {
     "name": "getOSVersion",
     "signature": "device.getOSVersion()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "e.g. \"18.5\"",
      "desc_zh": "如 \"18.5\""
     },
     "desc_en": "iOS version.",
     "desc_zh": "iOS 版本。",
     "status": "stable"
    },
    {
     "name": "getLanIp",
     "signature": "device.getLanIp()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "LAN IPv4 address",
      "desc_zh": "局域网 IPv4 地址"
     },
     "desc_en": "Local network address of the device.",
     "desc_zh": "设备局域网地址。",
     "status": "stable"
    },
    {
     "name": "vibrate",
     "signature": "device.vibrate(duration?, intensity?)",
     "params": [
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 400,
       "desc_en": "Milliseconds (1–10000)",
       "desc_zh": "毫秒（1–10000）"
      },
      {
       "name": "intensity",
       "type": "number",
       "optional": true,
       "default": 0.5,
       "desc_en": "0–1",
       "desc_zh": "0–1"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Vibrates with Core Haptics (falls back to the system vibration).",
     "desc_zh": "用 Core Haptics 振动（不可用时退回系统振动）。",
     "status": "stable"
    },
    {
     "name": "getServerDeviceId",
     "signature": "device.getServerDeviceId()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Server-side device id",
      "desc_zh": "服务端设备 ID"
     },
     "desc_en": "Device id assigned by the ketec service.",
     "desc_zh": "ketec 服务分配的设备 ID。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "hid",
   "title_en": "HID device (ESP32)",
   "title_zh": "HID 外设（ESP32）",
   "summary_en": "Direct control through the external USB HID device (ESP32-S3 firmware): absolute pointer taps/swipes, keyboard keys, media buttons and system shortcuts. Works without the Agent. Coordinates are screen pixels. Key-code constants are available as hidKey (e.g. hidKey.COMMAND, hidKey.RETURN, hidKey.A).",
   "summary_zh": "经外接 USB HID 设备（ESP32-S3 固件）直接控制：绝对坐标点击/滑动、键盘按键、媒体键与系统快捷键，不依赖 Agent。坐标为屏幕像素。键码常量见 hidKey（如 hidKey.COMMAND、hidKey.RETURN、hidKey.A）。",
   "modes": [
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "hid",
    "python": "hid",
    "lua": "hid"
   },
   "functions": [
    {
     "name": "openRecordScreen",
     "signature": "hid.openRecordScreen()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Shows the system screen-broadcast picker (needed for screenshots/OCR in HID mode).",
     "desc_zh": "弹出系统屏幕直播选择器（HID 模式截图/OCR 需要直播）。",
     "status": "stable"
    },
    {
     "name": "isRecording",
     "signature": "hid.isRecording()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true if the screen broadcast (or in-app recording) is active",
      "desc_zh": "屏幕直播（或 App 内录屏）进行中返回 true"
     },
     "desc_en": "Whether screen capture is running.",
     "desc_zh": "屏幕采集是否进行中。",
     "status": "stable"
    },
    {
     "name": "isBLEConnected",
     "signature": "hid.isBLEConnected()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Always false",
      "desc_zh": "恒为 false"
     },
     "desc_en": "Bluetooth HID is not supported (USB firmware only); always false.",
     "desc_zh": "不支持蓝牙 HID（仅 USB 固件），恒为 false。",
     "status": "unsupported"
    },
    {
     "name": "isUSBConnected",
     "signature": "hid.isUSBConnected()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Connection state",
      "desc_zh": "连接状态"
     },
     "desc_en": "Whether the USB HID device is connected.",
     "desc_zh": "USB HID 设备是否已连接。",
     "status": "stable"
    },
    {
     "name": "getBLEHIDDeviceName",
     "signature": "hid.getBLEHIDDeviceName()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Always \"\"",
      "desc_zh": "恒为 \"\""
     },
     "desc_en": "Bluetooth HID not supported; returns \"\".",
     "desc_zh": "不支持蓝牙 HID，返回 \"\"。",
     "status": "unsupported"
    },
    {
     "name": "setBLEHIDDeviceName",
     "signature": "hid.setBLEHIDDeviceName(name)",
     "params": [
      {
       "name": "name",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Name",
       "desc_zh": "名称"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "Always false",
      "desc_zh": "恒为 false"
     },
     "desc_en": "Bluetooth HID not supported; returns false.",
     "desc_zh": "不支持蓝牙 HID，返回 false。",
     "status": "unsupported"
    },
    {
     "name": "getDeviceMac",
     "signature": "hid.getDeviceMac()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "MAC, \"\" if not connected",
      "desc_zh": "MAC，未连接为 \"\""
     },
     "desc_en": "HID device MAC address.",
     "desc_zh": "HID 设备 MAC 地址。",
     "status": "stable"
    },
    {
     "name": "getDeviceModel",
     "signature": "hid.getDeviceModel()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "e.g. \"esp32s3\", \"\" if not connected",
      "desc_zh": "如 \"esp32s3\"，未连接为 \"\""
     },
     "desc_en": "HID device model.",
     "desc_zh": "HID 设备型号。",
     "status": "stable"
    },
    {
     "name": "getDeviceVersion",
     "signature": "hid.getDeviceVersion()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Firmware version",
      "desc_zh": "固件版本"
     },
     "desc_en": "HID firmware version.",
     "desc_zh": "HID 固件版本。",
     "status": "stable"
    },
    {
     "name": "resetPosition",
     "signature": "hid.resetPosition()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Re-sends screen size and coordinate mode to the firmware (re-calibrates the pointer).",
     "desc_zh": "向固件重发屏幕尺寸与坐标模式（重新校准指针）。",
     "status": "stable"
    },
    {
     "name": "restartDevice",
     "signature": "hid.restartDevice()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Restarts the HID device; it reconnects in about a second.",
     "desc_zh": "重启 HID 设备，约 1 秒后重连。",
     "status": "stable"
    },
    {
     "name": "setCharging",
     "signature": "hid.setCharging(on)",
     "params": [
      {
       "name": "on",
       "type": "boolean",
       "optional": false,
       "default": null,
       "desc_en": "On/off",
       "desc_zh": "开/关"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "Always false",
      "desc_zh": "恒为 false"
     },
     "desc_en": "Not supported by the firmware; returns false.",
     "desc_zh": "固件不支持，返回 false。",
     "status": "unsupported"
    },
    {
     "name": "setJitterValue",
     "signature": "hid.setJitterValue(value)",
     "params": [
      {
       "name": "value",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Amplitude",
       "desc_zh": "幅度"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Same as action.setJitterValue; affects Agent-synthesized gestures only (HID taps have no jitter).",
     "desc_zh": "同 action.setJitterValue，只影响 Agent 合成手势（HID 点击无抖动）。",
     "status": "limited"
    },
    {
     "name": "setActionDelay",
     "signature": "hid.setActionDelay(milliseconds)",
     "params": [
      {
       "name": "milliseconds",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "0 = off, >0 = set, <0 = firmware default",
       "desc_zh": "0 关闭，>0 设置，<0 恢复固件默认"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets the firmware delay between actions.",
     "desc_zh": "设置固件动作间延迟。",
     "status": "stable"
    },
    {
     "name": "setMoveDelay",
     "signature": "hid.setMoveDelay(milliseconds)",
     "params": [
      {
       "name": "milliseconds",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "0 = off, >0 = set, <0 = default",
       "desc_zh": "0 关闭，>0 设置，<0 默认"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets the firmware pointer-move delay.",
     "desc_zh": "设置固件指针移动延迟。",
     "status": "stable"
    },
    {
     "name": "move",
     "signature": "hid.move(x, y)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X (screen pixels)",
       "desc_zh": "X（屏幕像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y (screen pixels)",
       "desc_zh": "Y（屏幕像素）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Moves the pointer without pressing.",
     "desc_zh": "移动指针（不按下）。",
     "status": "stable"
    },
    {
     "name": "click",
     "signature": "hid.click(x, y, duration?, jitter?)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X (screen pixels)",
       "desc_zh": "X（屏幕像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y (screen pixels)",
       "desc_zh": "Y（屏幕像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 60,
       "desc_en": "Press time (ms); a long value = long press",
       "desc_zh": "按下时长（毫秒），较长即长按"
      },
      {
       "name": "jitter",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Ignored on HID",
       "desc_zh": "HID 忽略"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Taps a point.",
     "desc_zh": "点击坐标。",
     "example": "hid.click(540, 1200);",
     "status": "stable"
    },
    {
     "name": "mouseDown",
     "signature": "hid.mouseDown()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Presses and holds the pointer button at the current position.",
     "desc_zh": "在当前位置按下并保持。",
     "status": "stable"
    },
    {
     "name": "mouseUp",
     "signature": "hid.mouseUp()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Releases the pointer button.",
     "desc_zh": "抬起。",
     "status": "stable"
    },
    {
     "name": "clickRandom",
     "signature": "hid.clickRandom(x1, y1, x2, y2, duration?)",
     "params": [
      {
       "name": "x1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Left of the area (pixels)",
       "desc_zh": "区域左边界（像素）"
      },
      {
       "name": "y1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Top of the area (pixels)",
       "desc_zh": "区域上边界（像素）"
      },
      {
       "name": "x2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Right of the area (pixels)",
       "desc_zh": "区域右边界（像素）"
      },
      {
       "name": "y2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Bottom of the area (pixels)",
       "desc_zh": "区域下边界（像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Press time (ms)",
       "desc_zh": "按下时长（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "false if the rectangle is invalid",
      "desc_zh": "矩形无效返回 false"
     },
     "desc_en": "Taps a random point inside the rectangle.",
     "desc_zh": "在矩形内随机点击。",
     "status": "stable"
    },
    {
     "name": "doubleClick",
     "signature": "hid.doubleClick(x, y, duration?, interval?, jitter?)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X (screen pixels)",
       "desc_zh": "X（屏幕像素）"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y (screen pixels)",
       "desc_zh": "Y（屏幕像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Press time",
       "desc_zh": "按下时长"
      },
      {
       "name": "interval",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Gap (ms)",
       "desc_zh": "间隔（毫秒）"
      },
      {
       "name": "jitter",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Ignored",
       "desc_zh": "忽略"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Double-taps a point.",
     "desc_zh": "双击坐标。",
     "status": "stable"
    },
    {
     "name": "doubleClickRandom",
     "signature": "hid.doubleClickRandom(x1, y1, x2, y2, duration?, interval?)",
     "params": [
      {
       "name": "x1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Left of the area (pixels)",
       "desc_zh": "区域左边界（像素）"
      },
      {
       "name": "y1",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Top of the area (pixels)",
       "desc_zh": "区域上边界（像素）"
      },
      {
       "name": "x2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Right of the area (pixels)",
       "desc_zh": "区域右边界（像素）"
      },
      {
       "name": "y2",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Bottom of the area (pixels)",
       "desc_zh": "区域下边界（像素）"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Press time",
       "desc_zh": "按下时长"
      },
      {
       "name": "interval",
       "type": "number",
       "optional": true,
       "default": 20,
       "desc_en": "Gap",
       "desc_zh": "间隔"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "false if the rectangle is invalid",
      "desc_zh": "矩形无效返回 false"
     },
     "desc_en": "Double-taps a random point inside the rectangle.",
     "desc_zh": "在矩形内随机双击。",
     "status": "stable"
    },
    {
     "name": "swipe",
     "signature": "hid.swipe(x, y, ex, ey, jitter?, steps?)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start X",
       "desc_zh": "起点 X"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start Y",
       "desc_zh": "起点 Y"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End X",
       "desc_zh": "终点 X"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End Y",
       "desc_zh": "终点 Y"
      },
      {
       "name": "jitter",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Ignored on HID",
       "desc_zh": "HID 忽略"
      },
      {
       "name": "steps",
       "type": "number",
       "optional": true,
       "default": null,
       "desc_en": "Ignored on HID",
       "desc_zh": "HID 忽略"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Straight swipe (about 300 ms). A number as the 5th argument is taken as the duration in ms.",
     "desc_zh": "直线滑动（约 300 毫秒）。第 5 个参数传数字时按毫秒时长处理。",
     "status": "stable"
    },
    {
     "name": "swipeCurve",
     "signature": "hid.swipeCurve(startX, startY, midX, midY, endX, endY)",
     "params": [
      {
       "name": "startX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start X",
       "desc_zh": "起点 X"
      },
      {
       "name": "startY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start Y",
       "desc_zh": "起点 Y"
      },
      {
       "name": "midX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Control X",
       "desc_zh": "控制点 X"
      },
      {
       "name": "midY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Control Y",
       "desc_zh": "控制点 Y"
      },
      {
       "name": "endX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End X",
       "desc_zh": "终点 X"
      },
      {
       "name": "endY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End Y",
       "desc_zh": "终点 Y"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Swipes along a quadratic curve through the control point.",
     "desc_zh": "沿经过控制点的二次曲线滑动。",
     "status": "stable"
    },
    {
     "name": "pressAndSwipe",
     "signature": "hid.pressAndSwipe(startX, startY, endX, endY, duration?)",
     "params": [
      {
       "name": "startX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start X",
       "desc_zh": "起点 X"
      },
      {
       "name": "startY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Start Y",
       "desc_zh": "起点 Y"
      },
      {
       "name": "endX",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End X",
       "desc_zh": "终点 X"
      },
      {
       "name": "endY",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "End Y",
       "desc_zh": "终点 Y"
      },
      {
       "name": "duration",
       "type": "number",
       "optional": true,
       "default": 500,
       "desc_en": "Hold time before moving (ms)",
       "desc_zh": "移动前按住时长（毫秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Press, hold, drag to the end point and release. iOS may only enter jiggle mode on the first try when dragging Home Screen icons.",
     "desc_zh": "按下、保持、拖到终点后抬起。拖动主屏图标时 iOS 可能第一次只进入编辑状态。",
     "status": "limited"
    },
    {
     "name": "homeScreen",
     "signature": "hid.homeScreen()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Goes to the Home Screen (requires HID run mode).",
     "desc_zh": "回到主屏幕（需 HID 运行模式）。",
     "status": "stable"
    },
    {
     "name": "input",
     "signature": "hid.input(text, frequency?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text (Unicode supported)",
       "desc_zh": "文字（支持中文）"
      },
      {
       "name": "frequency",
       "type": "number",
       "optional": true,
       "default": null,
       "desc_en": "Ignored",
       "desc_zh": "忽略"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Types text. Uses the ketec keyboard when it is on screen (recommended for Chinese/symbols), otherwise clipboard/HID fallbacks.",
     "desc_zh": "输入文字。ketec 键盘在屏时经键盘插入（中文、符号推荐），否则走剪贴板/HID 回落。",
     "status": "stable"
    },
    {
     "name": "inputSimple",
     "signature": "hid.inputSimple(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文字"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Types text key by key (same as action.inputSimple).",
     "desc_zh": "逐键输入（同 action.inputSimple）。",
     "status": "stable"
    },
    {
     "name": "space",
     "signature": "hid.space()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Types a space.",
     "desc_zh": "输入空格。",
     "status": "stable"
    },
    {
     "name": "backspace",
     "signature": "hid.backspace(count?)",
     "params": [
      {
       "name": "count",
       "type": "number",
       "optional": true,
       "default": 1,
       "desc_en": "Times",
       "desc_zh": "次数"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Presses Backspace.",
     "desc_zh": "按退格键。",
     "status": "stable"
    },
    {
     "name": "enter",
     "signature": "hid.enter()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Presses Return.",
     "desc_zh": "按回车。",
     "status": "stable"
    },
    {
     "name": "sendKey",
     "signature": "hid.sendKey(keys)",
     "params": [
      {
       "name": "keys",
       "type": "array",
       "optional": false,
       "default": null,
       "desc_en": "Key codes / names / single characters, e.g. [hidKey.COMMAND, \"h\"]",
       "desc_zh": "键码 / 键名 / 单字符数组，如 [hidKey.COMMAND, \"h\"]"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sends a key combination. Modifier shortcuts inside text fields may not work without a software keyboard (iOS limitation); system shortcuts such as Cmd+H / Cmd+Space work.",
     "desc_zh": "发送组合键。无软键盘时文本框内的修饰键快捷键可能无效（iOS 限制）；Cmd+H、Cmd+Space 等系统快捷键有效。",
     "example": "hid.sendKey([hidKey.COMMAND, 'h']);",
     "status": "stable"
    },
    {
     "name": "pressButton",
     "signature": "hid.pressButton(button)",
     "params": [
      {
       "name": "button",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "home, volumeup, volumedown, mute, playpause, next, prev, brightnessup, brightnessdown, eject, globe, recent, search, power, snapshot (case-sensitive)",
       "desc_zh": "home、volumeup、volumedown、mute、playpause、next、prev、brightnessup、brightnessdown、eject、globe、recent、search、power、snapshot（区分大小写）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Presses a media/system button.",
     "desc_zh": "按媒体/系统键。",
     "status": "stable"
    },
    {
     "name": "copyText",
     "signature": "hid.copyText()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sends Cmd+C. May have no effect in text fields without a software keyboard.",
     "desc_zh": "发送 Cmd+C。无软键盘时在文本框内可能无效。",
     "status": "limited"
    },
    {
     "name": "pasteText",
     "signature": "hid.pasteText()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sends Cmd+V. Same limitation as copyText.",
     "desc_zh": "发送 Cmd+V。限制同 copyText。",
     "status": "limited"
    },
    {
     "name": "back",
     "signature": "hid.back()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sends Tab+B (\"back\" in iOS Full Keyboard Access); only works when that accessibility feature is enabled.",
     "desc_zh": "发送 Tab+B（iOS「全键盘控制」的返回），需在系统中开启该辅助功能。",
     "status": "limited"
    },
    {
     "name": "recent",
     "signature": "hid.recent()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Opens the App Switcher (double Home).",
     "desc_zh": "打开多任务（双击 Home）。",
     "status": "stable"
    },
    {
     "name": "lock",
     "signature": "hid.lock()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Locks the screen.",
     "desc_zh": "锁屏。",
     "status": "stable"
    },
    {
     "name": "unlock",
     "signature": "hid.unlock()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Wakes the screen (presses Home twice); does not enter a passcode.",
     "desc_zh": "唤醒屏幕（按两次 Home），不输入密码。",
     "status": "stable"
    },
    {
     "name": "openURL",
     "signature": "hid.openURL(url)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "URL / scheme (scheme optional for web links)",
       "desc_zh": "URL 或 scheme（网页地址可不带 scheme）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Opens a URL through the ketec Shortcuts helper, falling back to opening locally; works while ketec is in background.",
     "desc_zh": "经 ketec 快捷指令通道打开 URL，失败再本地打开；ketec 在后台时也可用。",
     "status": "stable"
    },
    {
     "name": "openApp",
     "signature": "hid.openApp(name)",
     "params": [
      {
       "name": "name",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Bundle id",
       "desc_zh": "Bundle ID"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Launches an app by bundle id.",
     "desc_zh": "按 Bundle ID 启动应用。",
     "status": "stable"
    },
    {
     "name": "closeApp",
     "signature": "hid.closeApp(name)",
     "params": [
      {
       "name": "name",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Bundle id (closeApp also accepts an app name)",
       "desc_zh": "Bundle ID（closeApp 也接受 App 名称）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Closes an app; in HID mode this is done with an App Switcher gesture (takes a few seconds).",
     "desc_zh": "关闭应用；HID 模式下用多任务上划手势完成（耗时数秒）。",
     "status": "stable"
    },
    {
     "name": "takeMeToFront",
     "signature": "hid.takeMeToFront()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Brings ketec to the front.",
     "desc_zh": "把 ketec 切到前台。",
     "status": "stable"
    },
    {
     "name": "currentAppInfo",
     "signature": "hid.currentAppInfo()",
     "params": [],
     "returns": {
      "type": "object|undefined",
      "desc_en": "{name, bundleId} or undefined",
      "desc_zh": "{name, bundleId} 或 undefined"
     },
     "desc_en": "Foreground app; usually undefined in HID mode because there is no foreground-app source without the Agent.",
     "desc_zh": "前台应用；HID 模式没有前台来源，通常为 undefined。",
     "status": "limited"
    },
    {
     "name": "setClipboard",
     "signature": "hid.setClipboard(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Writes the clipboard.",
     "desc_zh": "写剪贴板。",
     "status": "stable"
    },
    {
     "name": "getClipboard",
     "signature": "hid.getClipboard()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Clipboard text",
      "desc_zh": "剪贴板文本"
     },
     "desc_en": "Reads the clipboard.",
     "desc_zh": "读剪贴板。",
     "status": "stable"
    },
    {
     "name": "isConnected",
     "signature": "hid.isConnected()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Connection state",
      "desc_zh": "连接状态"
     },
     "desc_en": "Same as isUSBConnected.",
     "desc_zh": "同 isUSBConnected。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "ime",
   "title_en": "ketec keyboard",
   "title_zh": "ketec 输入法（API 键盘）",
   "summary_en": "Text operations through the ketec keyboard extension. Most functions require the ketec keyboard to be the active keyboard and visible; when it is not, some fall back to Agent/HID key events.",
   "summary_zh": "经 ketec 键盘扩展进行文字操作。多数函数要求 ketec 键盘为当前输入法且已弹出；未弹出时部分函数回落到 Agent/HID 按键。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "ime",
    "python": "ime",
    "lua": "ime"
   },
   "functions": [
    {
     "name": "isOk",
     "signature": "ime.isOk()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true if the ketec keyboard is installed and on screen",
      "desc_zh": "ketec 键盘已安装且在屏返回 true"
     },
     "desc_en": "Checks that the keyboard is ready.",
     "desc_zh": "检查键盘是否就绪。",
     "status": "stable"
    },
    {
     "name": "getText",
     "signature": "ime.getText()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Current field text, \"\" if unavailable",
      "desc_zh": "当前输入框文字，取不到为 \"\""
     },
     "desc_en": "Reads the text of the focused field.",
     "desc_zh": "读取当前输入框文字。",
     "status": "stable"
    },
    {
     "name": "clearText",
     "signature": "ime.clearText()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Clears the focused field.",
     "desc_zh": "清空当前输入框。",
     "status": "stable"
    },
    {
     "name": "input",
     "signature": "ime.input(text, frequency?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文字"
      },
      {
       "name": "frequency",
       "type": "number",
       "optional": true,
       "default": null,
       "desc_en": "Ignored",
       "desc_zh": "忽略"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Inserts text through the keyboard (HID fallback when the keyboard is not visible).",
     "desc_zh": "经键盘插入文字（键盘不在屏时回落 HID）。",
     "example": "if (ime.isOk()) ime.input('你好');",
     "status": "stable"
    },
    {
     "name": "paste",
     "signature": "ime.paste(text?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": true,
       "default": null,
       "desc_en": "Text to paste; omitted = current clipboard",
       "desc_zh": "要粘贴的文字，不传用剪贴板"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Pasted text, \"\" on failure",
      "desc_zh": "粘贴的文字，失败为 \"\""
     },
     "desc_en": "Pastes text into the focused field.",
     "desc_zh": "粘贴到当前输入框。",
     "status": "stable"
    },
    {
     "name": "pressDel",
     "signature": "ime.pressDel()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Deletes one character (Agent key event, or HID in HID mode).",
     "desc_zh": "删除一个字符（Agent 按键事件，HID 模式用 HID）。",
     "status": "stable"
    },
    {
     "name": "pressEnter",
     "signature": "ime.pressEnter()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Presses Return (Agent or HID).",
     "desc_zh": "按回车（Agent 或 HID）。",
     "status": "stable"
    },
    {
     "name": "dismiss",
     "signature": "ime.dismiss()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Hides the keyboard.",
     "desc_zh": "收起键盘。",
     "status": "stable"
    },
    {
     "name": "getClipboard",
     "signature": "ime.getClipboard()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Clipboard text",
      "desc_zh": "剪贴板文本"
     },
     "desc_en": "Reads the clipboard.",
     "desc_zh": "读剪贴板。",
     "status": "stable"
    },
    {
     "name": "setClipboard",
     "signature": "ime.setClipboard(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Writes the clipboard.",
     "desc_zh": "写剪贴板。",
     "status": "stable"
    },
    {
     "name": "switchKeyboard",
     "signature": "ime.switchKeyboard()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Switches to the next input method (keyboard globe action, or Ctrl+Space via HID).",
     "desc_zh": "切换到下一个输入法（键盘地球键，或经 HID 发 Ctrl+空格）。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "http",
   "title_en": "HTTP client",
   "title_zh": "HTTP 请求",
   "summary_en": "Synchronous HTTP requests and file download. Available in JavaScript and Lua; in Python use the bundled requests / urllib instead.",
   "summary_zh": "同步 HTTP 请求与文件下载。JavaScript 与 Lua 可用；Python 请用自带的 requests / urllib。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "lua"
   ],
   "names": {
    "javascript": "http",
    "python": null,
    "lua": "http"
   },
   "functions": [
    {
     "name": "httpGet",
     "signature": "http.httpGet(url, timeout?)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "URL",
       "desc_zh": "地址"
      },
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": 10,
       "desc_en": "Timeout in seconds",
       "desc_zh": "超时（秒）"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{status, body} or {error}",
      "desc_zh": "{status, body} 或 {error}"
     },
     "desc_en": "GET request.",
     "desc_zh": "GET 请求。",
     "example": "var r = http.httpGet('https://example.com'); logi(r.status);",
     "status": "stable"
    },
    {
     "name": "httpPost",
     "signature": "http.httpPost(url, body, timeout?)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "URL",
       "desc_zh": "地址"
      },
      {
       "name": "body",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Request body (sent as application/json when non-empty)",
       "desc_zh": "请求体（非空时按 application/json 发送）"
      },
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": 10,
       "desc_en": "Seconds",
       "desc_zh": "秒"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{status, body} or {error}",
      "desc_zh": "{status, body} 或 {error}"
     },
     "desc_en": "POST request with a string body.",
     "desc_zh": "以字符串为 body 的 POST。",
     "status": "stable"
    },
    {
     "name": "postJSON",
     "signature": "http.postJSON(url, data, timeout?)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "URL",
       "desc_zh": "地址"
      },
      {
       "name": "data",
       "type": "object|string",
       "optional": false,
       "default": null,
       "desc_en": "Object (JSON-encoded) or JSON string",
       "desc_zh": "对象（自动转 JSON）或 JSON 字符串"
      },
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": 10,
       "desc_en": "Seconds",
       "desc_zh": "秒"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{status, body} or {error}",
      "desc_zh": "{status, body} 或 {error}"
     },
     "desc_en": "POST a JSON body.",
     "desc_zh": "POST JSON。",
     "status": "stable"
    },
    {
     "name": "request",
     "signature": "http.request(options)",
     "params": [
      {
       "name": "options",
       "type": "object",
       "optional": false,
       "default": null,
       "desc_en": "{url, method=\"GET\", header:{}, cookie:{}, data:{} (query for GET, form for others), requestBody:string, file:{field: path} (multipart), timeout (ms, default 30000), userAgent, referrer, responseCharset}",
       "desc_zh": "{url, method=\"GET\", header, cookie, data（GET 为查询参数，其它为表单）, requestBody, file（multipart 上传）, timeout（毫秒，默认 30000）, userAgent, referrer, responseCharset}"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{statusCode, statusMessage, contentType, charset, body, header, cookie, error?}",
      "desc_zh": "{statusCode, statusMessage, contentType, charset, body, header, cookie, error?}"
     },
     "desc_en": "Full-featured request. Redirects are always followed. A legacy form request(method, url, body, timeout) is also accepted.",
     "desc_zh": "完整请求。总是跟随重定向。也兼容旧写法 request(method, url, body, timeout)。",
     "status": "stable"
    },
    {
     "name": "downloadFile",
     "signature": "http.downloadFile(url, path, timeout?, headers?)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "URL",
       "desc_zh": "地址"
      },
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Destination inside the app sandbox (relative = Documents)",
       "desc_zh": "沙盒内保存路径（相对路径基于 Documents）"
      },
      {
       "name": "timeout",
       "type": "number",
       "optional": true,
       "default": 10000,
       "desc_en": "Timeout in milliseconds",
       "desc_zh": "超时（毫秒）"
      },
      {
       "name": "headers",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "Request headers",
       "desc_zh": "请求头"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Downloads to a file (2xx only).",
     "desc_zh": "下载到文件（仅 2xx 视为成功）。",
     "status": "stable"
    },
    {
     "name": "newWebsocket",
     "signature": "http.newWebsocket(url)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "ws:// or wss:// URL",
       "desc_zh": "ws:// 或 wss:// 地址"
      }
     ],
     "returns": {
      "type": "object|null",
      "desc_en": "{connect, close, reset, sendText, sendBinary(base64), isConnected, isClosed, onOpen, onText, onBinary, onClose, onError, ...}",
      "desc_zh": "WebSocket 对象"
     },
     "desc_en": "Opens a WebSocket client. Sending works, but the on* callbacks are never invoked and heartbeat/timeout/auto-reconnect setters are no-ops, so incoming messages cannot be read.",
     "desc_zh": "建立 WebSocket 客户端。可以发送，但 on* 回调从不触发，心跳/超时/自动重连设置无效，因此收不到消息。",
     "status": "limited"
    }
   ]
  },
  {
   "name": "file",
   "title_en": "Files",
   "title_zh": "文件",
   "summary_en": "File and folder operations. Relative paths (and paths starting with \"Documents/\") resolve under the app Documents folder; absolute paths must be inside the app sandbox; \"..\" is rejected.",
   "summary_zh": "文件与目录操作。相对路径（及以 \"Documents/\" 开头的路径）基于 App 的 Documents 目录；绝对路径须在 App 沙盒内；不允许 \"..\"。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "file",
    "python": "file",
    "lua": "file"
   },
   "functions": [
    {
     "name": "getInternalDir",
     "signature": "file.getInternalDir(type?)",
     "params": [
      {
       "name": "type",
       "type": "string",
       "optional": true,
       "default": "documents",
       "desc_en": "\"documents\", \"library\", \"caches\" or \"temp\"",
       "desc_zh": "\"documents\"、\"library\"、\"caches\" 或 \"temp\""
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Absolute directory path",
      "desc_zh": "目录绝对路径"
     },
     "desc_en": "Returns an app directory path.",
     "desc_zh": "返回 App 目录路径。",
     "status": "stable"
    },
    {
     "name": "create",
     "signature": "file.create(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Creates an empty file (true if it already exists).",
     "desc_zh": "创建空文件（已存在也返回 true）。",
     "status": "stable"
    },
    {
     "name": "mkdirs",
     "signature": "file.mkdirs(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Directory path",
       "desc_zh": "目录路径"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Creates a directory with parents.",
     "desc_zh": "递归创建目录。",
     "status": "stable"
    },
    {
     "name": "deleteAllFile",
     "signature": "file.deleteAllFile(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File or directory",
       "desc_zh": "文件或目录"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Deletes a file or a whole directory.",
     "desc_zh": "删除文件或整个目录。",
     "status": "stable"
    },
    {
     "name": "readFile",
     "signature": "file.readFile(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "UTF-8 text",
      "desc_zh": "UTF-8 文本"
     },
     "desc_en": "Reads a text file.",
     "desc_zh": "读取文本文件。",
     "status": "stable"
    },
    {
     "name": "readResFile",
     "signature": "file.readResFile(fileName)",
     "params": [
      {
       "name": "fileName",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Resource name",
       "desc_zh": "资源名"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "Always undefined",
      "desc_zh": "恒为 undefined"
     },
     "desc_en": "Not supported: there is no project resource directory; place files under Documents and use readFile.",
     "desc_zh": "不支持：没有工程资源目录；请把文件放到 Documents 后用 readFile。",
     "status": "unsupported"
    },
    {
     "name": "getResFile",
     "signature": "file.getResFile(fileName)",
     "params": [
      {
       "name": "fileName",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Resource name",
       "desc_zh": "资源名"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "Always undefined",
      "desc_zh": "恒为 undefined"
     },
     "desc_en": "Not supported (see readResFile).",
     "desc_zh": "不支持（同 readResFile）。",
     "status": "unsupported"
    },
    {
     "name": "cleanupResFile",
     "signature": "file.cleanupResFile(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "Always undefined",
      "desc_zh": "恒为 undefined"
     },
     "desc_en": "Not supported (see readResFile).",
     "desc_zh": "不支持（同 readResFile）。",
     "status": "unsupported"
    },
    {
     "name": "deleteLine",
     "signature": "file.deleteLine(path, line, contains?)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "line",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "1-based line number; ≤0 to match by text only",
       "desc_zh": "行号（从 1 开始），≤0 表示只按文字匹配"
      },
      {
       "name": "contains",
       "type": "string",
       "optional": true,
       "default": null,
       "desc_en": "Delete lines containing this text (with line>0, both must match)",
       "desc_zh": "删除包含此文字的行（与行号同时给时须同时满足）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true if a line was removed",
      "desc_zh": "删掉了行返回 true"
     },
     "desc_en": "Deletes lines from a text file.",
     "desc_zh": "删除文本文件中的行。",
     "status": "stable"
    },
    {
     "name": "listDir",
     "signature": "file.listDir(path, recursion?)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Directory",
       "desc_zh": "目录"
      },
      {
       "name": "recursion",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Recurse into subfolders",
       "desc_zh": "递归子目录"
      }
     ],
     "returns": {
      "type": "string[]",
      "desc_en": "Absolute paths",
      "desc_zh": "绝对路径数组"
     },
     "desc_en": "Lists a directory.",
     "desc_zh": "列出目录。",
     "status": "stable"
    },
    {
     "name": "writeFile",
     "signature": "file.writeFile(path, data)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Content (overwrites)",
       "desc_zh": "内容（覆盖写）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Writes a text file (creates parent folders).",
     "desc_zh": "写文本文件（自动建父目录）。",
     "status": "stable"
    },
    {
     "name": "appendLine",
     "signature": "file.appendLine(path, data)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Line to append",
       "desc_zh": "追加的内容"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Appends data plus a newline (no newline is inserted before it if the file does not end with one).",
     "desc_zh": "追加内容并补换行（原文件末尾没有换行时不会先补换行）。",
     "status": "stable"
    },
    {
     "name": "readLine",
     "signature": "file.readLine(path, lineNo)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "lineNo",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "1-based line number",
       "desc_zh": "行号（从 1 开始）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Line text",
      "desc_zh": "该行文本"
     },
     "desc_en": "Reads one line.",
     "desc_zh": "读取指定行。",
     "status": "stable"
    },
    {
     "name": "readAllLines",
     "signature": "file.readAllLines(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "string[]|undefined",
      "desc_en": "Lines",
      "desc_zh": "行数组"
     },
     "desc_en": "Reads all lines.",
     "desc_zh": "读取全部行。",
     "status": "stable"
    },
    {
     "name": "exists",
     "signature": "file.exists(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "Exists",
      "desc_zh": "是否存在"
     },
     "desc_en": "Checks whether a path exists.",
     "desc_zh": "判断路径是否存在。",
     "status": "stable"
    },
    {
     "name": "copy",
     "signature": "file.copy(src, dest)",
     "params": [
      {
       "name": "src",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Source",
       "desc_zh": "源路径"
      },
      {
       "name": "dest",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Destination (must not exist)",
       "desc_zh": "目标路径（不能已存在）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Copies a file or folder.",
     "desc_zh": "复制文件或目录。",
     "status": "stable"
    },
    {
     "name": "fileMD5",
     "signature": "file.fileMD5(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Lowercase hex MD5",
      "desc_zh": "小写十六进制 MD5"
     },
     "desc_en": "MD5 of a file.",
     "desc_zh": "计算文件 MD5。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "config",
   "title_en": "Script config",
   "title_zh": "脚本配置",
   "summary_en": "Persistent key/value configuration for the current script package (the same store the package UI page reads and writes). Values keep their JSON type.",
   "summary_zh": "当前软件包的持久化键值配置（与软件包 UI 页面读写的是同一份）。值保留 JSON 类型。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "config",
    "python": "config",
    "lua": "config"
   },
   "functions": [
    {
     "name": "all",
     "signature": "config.all()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "All key/values",
      "desc_zh": "全部键值"
     },
     "desc_en": "Returns all config values.",
     "desc_zh": "返回全部配置。",
     "status": "stable"
    },
    {
     "name": "setAll",
     "signature": "config.setAll(config)",
     "params": [
      {
       "name": "config",
       "type": "object",
       "optional": false,
       "default": null,
       "desc_en": "Key/value object",
       "desc_zh": "键值对象"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Writes several values.",
     "desc_zh": "批量写入。",
     "status": "stable"
    },
    {
     "name": "set",
     "signature": "config.set(key, value)",
     "params": [
      {
       "name": "key",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Key",
       "desc_zh": "键"
      },
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Value",
       "desc_zh": "值"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets one value.",
     "desc_zh": "设置一项。",
     "status": "stable"
    },
    {
     "name": "get",
     "signature": "config.get(key)",
     "params": [
      {
       "name": "key",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Key",
       "desc_zh": "键"
      }
     ],
     "returns": {
      "type": "any",
      "desc_en": "Value or undefined",
      "desc_zh": "值，不存在为 undefined"
     },
     "desc_en": "Reads one value.",
     "desc_zh": "读取一项。",
     "example": "var n = config.get('loops') || 10;",
     "status": "stable"
    },
    {
     "name": "remove",
     "signature": "config.remove(key)",
     "params": [
      {
       "name": "key",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Key",
       "desc_zh": "键"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Removes a key.",
     "desc_zh": "删除一项。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "sharedState",
   "title_en": "Shared state",
   "title_zh": "共享状态",
   "summary_en": "In-memory key/value store shared by all scripts and threads in the ketec process (useful for communication with thread.run workers). Not persisted across app restarts.",
   "summary_zh": "ketec 进程内存中的键值存储，所有脚本与线程共享（可用于和 thread.run 子线程通信）。App 重启后不保留。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "sharedState",
    "python": "sharedState",
    "lua": "sharedState"
   },
   "functions": [
    {
     "name": "set",
     "signature": "sharedState.set(key, value)",
     "params": [
      {
       "name": "key",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Key",
       "desc_zh": "键"
      },
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Value",
       "desc_zh": "值"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets a value.",
     "desc_zh": "设置值。",
     "status": "stable"
    },
    {
     "name": "get",
     "signature": "sharedState.get(key)",
     "params": [
      {
       "name": "key",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Key",
       "desc_zh": "键"
      }
     ],
     "returns": {
      "type": "any",
      "desc_en": "Value or undefined",
      "desc_zh": "值或 undefined"
     },
     "desc_en": "Reads a value.",
     "desc_zh": "读取值。",
     "status": "stable"
    },
    {
     "name": "withBatch",
     "signature": "sharedState.withBatch(block)",
     "params": [
      {
       "name": "block",
       "type": "function|object",
       "optional": false,
       "default": null,
       "desc_en": "A function to run, or an object whose keys are all set",
       "desc_zh": "要执行的函数，或要批量写入的对象"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Runs a function, or sets every key of an object.",
     "desc_zh": "执行函数，或把对象的每个键批量写入。",
     "status": "stable"
    },
    {
     "name": "clear",
     "signature": "sharedState.clear()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Removes all keys.",
     "desc_zh": "清空全部键。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "plist",
   "title_en": "Property lists",
   "title_zh": "plist 文件",
   "summary_en": "Read and modify .plist files. Paths follow the file-module rules.",
   "summary_zh": "读写 .plist 文件。路径规则同 file 模块。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "plist",
    "python": "plist",
    "lua": "plist"
   },
   "functions": [
    {
     "name": "read",
     "signature": "plist.read(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "any",
      "desc_en": "Parsed root object, undefined on failure",
      "desc_zh": "解析后的根对象，失败为 undefined"
     },
     "desc_en": "Reads a plist file.",
     "desc_zh": "读取 plist。",
     "status": "stable"
    },
    {
     "name": "write",
     "signature": "plist.write(path, value, format?)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "value",
       "type": "object|array",
       "optional": false,
       "default": null,
       "desc_en": "Root value",
       "desc_zh": "根对象"
      },
      {
       "name": "format",
       "type": "string",
       "optional": true,
       "default": "xml",
       "desc_en": "\"xml\" or \"binary\"",
       "desc_zh": "\"xml\" 或 \"binary\""
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Writes a plist file.",
     "desc_zh": "写入 plist。",
     "status": "stable"
    },
    {
     "name": "get",
     "signature": "plist.get(path, key)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "key",
       "type": "string|array",
       "optional": false,
       "default": null,
       "desc_en": "Key, or an array path such as [\"a\", 0, \"b\"]",
       "desc_zh": "键，或数组路径如 [\"a\", 0, \"b\"]"
      }
     ],
     "returns": {
      "type": "any",
      "desc_en": "Value or undefined",
      "desc_zh": "值或 undefined"
     },
     "desc_en": "Reads a (nested) key.",
     "desc_zh": "读取（嵌套）键。",
     "status": "stable"
    },
    {
     "name": "set",
     "signature": "plist.set(path, key, value)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "key",
       "type": "string|array",
       "optional": false,
       "default": null,
       "desc_en": "Key, or an array path such as [\"a\", 0, \"b\"]",
       "desc_zh": "键，或数组路径如 [\"a\", 0, \"b\"]"
      },
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Value",
       "desc_zh": "值"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets a (nested) key, creating the file/dictionaries if needed.",
     "desc_zh": "设置（嵌套）键，必要时创建文件与字典。",
     "status": "stable"
    },
    {
     "name": "remove",
     "signature": "plist.remove(path, key)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      },
      {
       "name": "key",
       "type": "string|array",
       "optional": false,
       "default": null,
       "desc_en": "Key, or an array path such as [\"a\", 0, \"b\"]",
       "desc_zh": "键，或数组路径如 [\"a\", 0, \"b\"]"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Removes one key (never deletes the file).",
     "desc_zh": "删除一个键（不会删除文件）。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "sqlite",
   "title_en": "SQLite",
   "title_zh": "SQLite 数据库",
   "summary_en": "Local SQLite databases. open() returns a string handle used by the other functions.",
   "summary_zh": "本地 SQLite 数据库。open() 返回字符串句柄供其它函数使用。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "sqlite",
    "python": "sqlite",
    "lua": "sqlite"
   },
   "functions": [
    {
     "name": "open",
     "signature": "sqlite.open(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "DB file (relative = Documents), \":memory:\" or a file: URI",
       "desc_zh": "数据库文件（相对路径基于 Documents）、\":memory:\" 或 file: URI"
      }
     ],
     "returns": {
      "type": "string|null",
      "desc_en": "Handle",
      "desc_zh": "句柄"
     },
     "desc_en": "Opens (or creates) a database.",
     "desc_zh": "打开（或创建）数据库。",
     "example": "var db = sqlite.open('data.db'); sqlite.execute(db, 'CREATE TABLE IF NOT EXISTS t(a TEXT)');",
     "status": "stable"
    },
    {
     "name": "close",
     "signature": "sqlite.close(handle)",
     "params": [
      {
       "name": "handle",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Handle returned by open()",
       "desc_zh": "open() 返回的句柄"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Closes the database.",
     "desc_zh": "关闭数据库。",
     "status": "stable"
    },
    {
     "name": "isOpen",
     "signature": "sqlite.isOpen(handle)",
     "params": [
      {
       "name": "handle",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Handle returned by open()",
       "desc_zh": "open() 返回的句柄"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "Open state",
      "desc_zh": "是否打开"
     },
     "desc_en": "Whether the handle is open.",
     "desc_zh": "句柄是否打开。",
     "status": "stable"
    },
    {
     "name": "query",
     "signature": "sqlite.query(handle, sql, params?)",
     "params": [
      {
       "name": "handle",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Handle returned by open()",
       "desc_zh": "open() 返回的句柄"
      },
      {
       "name": "sql",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "SQL with ? placeholders",
       "desc_zh": "带 ? 占位符的 SQL"
      },
      {
       "name": "params",
       "type": "array",
       "optional": true,
       "default": [],
       "desc_en": "Bound values",
       "desc_zh": "绑定参数"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{success, rows: [{col: value}], affectedRows, insertId, error}",
      "desc_zh": "{success, rows: [{列: 值}], affectedRows, insertId, error}"
     },
     "desc_en": "Runs a query and returns rows.",
     "desc_zh": "执行查询并返回行。",
     "status": "stable"
    },
    {
     "name": "execute",
     "signature": "sqlite.execute(handle, sql, params?)",
     "params": [
      {
       "name": "handle",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Handle returned by open()",
       "desc_zh": "open() 返回的句柄"
      },
      {
       "name": "sql",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "SQL",
       "desc_zh": "SQL"
      },
      {
       "name": "params",
       "type": "array",
       "optional": true,
       "default": [],
       "desc_en": "Bound values",
       "desc_zh": "绑定参数"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{success, rows: [{col: value}], affectedRows, insertId, error}",
      "desc_zh": "{success, rows: [{列: 值}], affectedRows, insertId, error}"
     },
     "desc_en": "Executes a statement.",
     "desc_zh": "执行语句。",
     "status": "stable"
    },
    {
     "name": "beginTransaction",
     "signature": "sqlite.beginTransaction(handle)",
     "params": [
      {
       "name": "handle",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Handle returned by open()",
       "desc_zh": "open() 返回的句柄"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "BEGIN.",
     "desc_zh": "开始事务。",
     "status": "stable"
    },
    {
     "name": "commit",
     "signature": "sqlite.commit(handle)",
     "params": [
      {
       "name": "handle",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Handle returned by open()",
       "desc_zh": "open() 返回的句柄"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "COMMIT.",
     "desc_zh": "提交事务。",
     "status": "stable"
    },
    {
     "name": "rollback",
     "signature": "sqlite.rollback(handle)",
     "params": [
      {
       "name": "handle",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Handle returned by open()",
       "desc_zh": "open() 返回的句柄"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "ROLLBACK.",
     "desc_zh": "回滚事务。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "mysql",
   "title_en": "MySQL client",
   "title_zh": "MySQL 客户端",
   "summary_en": "Built-in MySQL client with one global connection shared by all scripts. Value mapping: integers come back as strings, DATE/DATETIME as ISO-8601 strings, DECIMAL/DOUBLE as numbers, TIME/JSON as null.",
   "summary_zh": "内置 MySQL 客户端，所有脚本共享一条全局连接。取值映射：整数返回字符串，DATE/DATETIME 返回 ISO-8601 字符串，DECIMAL/DOUBLE 返回数字，TIME/JSON 返回 null。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "mysql",
    "python": "mysql",
    "lua": "mysql"
   },
   "functions": [
    {
     "name": "connect",
     "signature": "mysql.connect(config)",
     "params": [
      {
       "name": "config",
       "type": "object",
       "optional": false,
       "default": null,
       "desc_en": "{host, port=3306, username, password, database, charset=\"utf8mb4\", connectTimeout=5000, queryTimeout=30000}",
       "desc_zh": "{host, port=3306, username, password, database, charset=\"utf8mb4\", connectTimeout=5000, queryTimeout=30000}"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Connects (replacing any previous connection).",
     "desc_zh": "建立连接（替换之前的连接）。",
     "status": "stable"
    },
    {
     "name": "disconnect",
     "signature": "mysql.disconnect()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Closes the connection.",
     "desc_zh": "断开连接。",
     "status": "stable"
    },
    {
     "name": "isConnected",
     "signature": "mysql.isConnected()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Alive",
      "desc_zh": "是否连接中"
     },
     "desc_en": "Connection state.",
     "desc_zh": "连接状态。",
     "status": "stable"
    },
    {
     "name": "query",
     "signature": "mysql.query(sql, params?)",
     "params": [
      {
       "name": "sql",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "SQL with ? placeholders",
       "desc_zh": "带 ? 占位符的 SQL"
      },
      {
       "name": "params",
       "type": "array",
       "optional": true,
       "default": [],
       "desc_en": "Bound values",
       "desc_zh": "绑定参数"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{rows, affectedRows, insertId, success, error}",
      "desc_zh": "{rows, affectedRows, insertId, success, error}"
     },
     "desc_en": "Runs a query.",
     "desc_zh": "执行查询。",
     "status": "stable"
    },
    {
     "name": "execute",
     "signature": "mysql.execute(sql, params?)",
     "params": [
      {
       "name": "sql",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "SQL",
       "desc_zh": "SQL"
      },
      {
       "name": "params",
       "type": "array",
       "optional": true,
       "default": [],
       "desc_en": "Bound values",
       "desc_zh": "绑定参数"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{rows, affectedRows, insertId, success, error}",
      "desc_zh": "{rows, affectedRows, insertId, success, error}"
     },
     "desc_en": "Executes a statement.",
     "desc_zh": "执行语句。",
     "status": "stable"
    },
    {
     "name": "beginTransaction",
     "signature": "mysql.beginTransaction()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "START TRANSACTION.",
     "desc_zh": "开始事务。",
     "status": "stable"
    },
    {
     "name": "commit",
     "signature": "mysql.commit()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "COMMIT.",
     "desc_zh": "提交。",
     "status": "stable"
    },
    {
     "name": "rollback",
     "signature": "mysql.rollback()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "ROLLBACK.",
     "desc_zh": "回滚。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "zipFile",
   "title_en": "ZIP archives",
   "title_zh": "ZIP 压缩",
   "summary_en": "Create and extract ZIP files. Paths follow the file-module rules.",
   "summary_zh": "创建与解压 ZIP。路径规则同 file 模块。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "zipFile",
    "python": "zipFile",
    "lua": "zipFile"
   },
   "functions": [
    {
     "name": "getFileList",
     "signature": "zipFile.getFileList(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "ZIP file",
       "desc_zh": "ZIP 文件"
      }
     ],
     "returns": {
      "type": "string[]",
      "desc_en": "Entry names (directories excluded)",
      "desc_zh": "条目名（不含目录项）"
     },
     "desc_en": "Lists entries of a ZIP.",
     "desc_zh": "列出 ZIP 条目。",
     "status": "stable"
    },
    {
     "name": "isZip",
     "signature": "zipFile.isZip(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "File path (relative = app Documents)",
       "desc_zh": "文件路径（相对路径基于 App 的 Documents）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true if the file starts with the ZIP signature",
      "desc_zh": "文件头为 ZIP 签名返回 true"
     },
     "desc_en": "Checks whether a file is a ZIP.",
     "desc_zh": "判断是否 ZIP。",
     "status": "stable"
    },
    {
     "name": "unzip",
     "signature": "zipFile.unzip(zipPath, destDir)",
     "params": [
      {
       "name": "zipPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "ZIP file",
       "desc_zh": "ZIP 文件"
      },
      {
       "name": "destDir",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Destination folder (created)",
       "desc_zh": "目标目录（自动创建）"
      }
     ],
     "returns": {
      "type": "number|boolean",
      "desc_en": "Number of extracted files; false on error",
      "desc_zh": "解压出的文件数；出错为 false"
     },
     "desc_en": "Extracts a ZIP (entries containing \"..\" are skipped).",
     "desc_zh": "解压（含 \"..\" 的条目会跳过）。",
     "status": "stable"
    },
    {
     "name": "zip",
     "signature": "zipFile.zip(dirPath, zipPath)",
     "params": [
      {
       "name": "dirPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Source folder or file (kept as top-level folder)",
       "desc_zh": "源目录或文件（压缩包内保留顶层目录名）"
      },
      {
       "name": "zipPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Output ZIP path (must not be inside the source)",
       "desc_zh": "输出 ZIP 路径（不能在源目录内）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Compresses a folder or file.",
     "desc_zh": "压缩目录或文件。",
     "example": "zipFile.zip('logs', 'out/logs.zip');",
     "status": "stable"
    }
   ]
  },
  {
   "name": "media",
   "title_en": "Photos & audio",
   "title_zh": "相册与音频",
   "summary_en": "Save to / clean the photo library and play MP3 files. Photo-library access permission is requested when needed.",
   "summary_zh": "保存到相册、清理相册、播放 MP3。需要时会申请相册权限。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "media",
    "python": "media",
    "lua": "media"
   },
   "functions": [
    {
     "name": "saveImageToAlbum",
     "signature": "media.saveImageToAlbum(imageId)",
     "params": [
      {
       "name": "imageId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId from the image module",
       "desc_zh": "image 模块的 imageId"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Saves an image to Photos.",
     "desc_zh": "保存图片到相册。",
     "status": "stable"
    },
    {
     "name": "saveVideoToAlbumPath",
     "signature": "media.saveVideoToAlbumPath(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Video file",
       "desc_zh": "视频文件"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Saves a video file to Photos.",
     "desc_zh": "保存视频文件到相册。",
     "status": "stable"
    },
    {
     "name": "deleteAllPhotos",
     "signature": "media.deleteAllPhotos()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true once the deletion request is submitted",
      "desc_zh": "删除请求提交即 true"
     },
     "desc_en": "Deletes all photos. Returns immediately; iOS then asks the user to confirm.",
     "desc_zh": "删除全部照片。立即返回，随后 iOS 会弹出确认框。",
     "status": "stable"
    },
    {
     "name": "deleteAllVideos",
     "signature": "media.deleteAllVideos()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true once submitted",
      "desc_zh": "提交即 true"
     },
     "desc_en": "Deletes all videos (iOS asks for confirmation).",
     "desc_zh": "删除全部视频（iOS 会弹确认）。",
     "status": "stable"
    },
    {
     "name": "deleteAllScreenshotAssets",
     "signature": "media.deleteAllScreenshotAssets()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true once submitted",
      "desc_zh": "提交即 true"
     },
     "desc_en": "Deletes all screenshots (iOS asks for confirmation).",
     "desc_zh": "删除全部截屏图片（iOS 会弹确认）。",
     "status": "stable"
    },
    {
     "name": "playMp3",
     "signature": "media.playMp3(path, loop?)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Audio file",
       "desc_zh": "音频文件"
      },
      {
       "name": "loop",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Loop forever",
       "desc_zh": "循环播放"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Starts playing an audio file (non-blocking).",
     "desc_zh": "开始播放音频（不阻塞）。",
     "status": "stable"
    },
    {
     "name": "stopMp3",
     "signature": "media.stopMp3()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Stops playback.",
     "desc_zh": "停止播放。",
     "status": "stable"
    },
    {
     "name": "playMp3WaitEnd",
     "signature": "media.playMp3WaitEnd(path)",
     "params": [
      {
       "name": "path",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Audio file",
       "desc_zh": "音频文件"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Plays and blocks until finished.",
     "desc_zh": "播放并阻塞到结束。",
     "status": "stable"
    },
    {
     "name": "isMp3Playing",
     "signature": "media.isMp3Playing()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Playing",
      "desc_zh": "是否在播放"
     },
     "desc_en": "Whether audio is playing.",
     "desc_zh": "是否正在播放。",
     "status": "stable"
    },
    {
     "name": "deleteAllScreenshots",
     "signature": "media.deleteAllScreenshots()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true once submitted",
      "desc_zh": "提交即 true"
     },
     "desc_en": "Same as deleteAllScreenshotAssets.",
     "desc_zh": "同 deleteAllScreenshotAssets。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "utils",
   "title_en": "Utilities",
   "title_zh": "工具函数",
   "summary_en": "Time formatting, random numbers, UUID, Base64/hex conversion, bring ketec to front.",
   "summary_zh": "时间格式化、随机数、UUID、Base64/十六进制转换、ketec 回前台。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "utils",
    "python": "utils",
    "lua": "utils"
   },
   "functions": [
    {
     "name": "timeFormat",
     "signature": "utils.timeFormat(format?)",
     "params": [
      {
       "name": "format",
       "type": "string",
       "optional": true,
       "default": "yyyy-MM-dd HH:mm:ss",
       "desc_en": "Unicode date pattern",
       "desc_zh": "日期格式（Unicode 模式串）"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Formatted current time",
      "desc_zh": "格式化后的当前时间"
     },
     "desc_en": "Formats the current time.",
     "desc_zh": "格式化当前时间。",
     "example": "utils.timeFormat('yyyyMMdd-HHmmss');",
     "status": "stable"
    },
    {
     "name": "random",
     "signature": "utils.random(min, max)",
     "params": [
      {
       "name": "min",
       "type": "number",
       "optional": false,
       "default": 0,
       "desc_en": "Minimum (inclusive)",
       "desc_zh": "最小值（含）"
      },
      {
       "name": "max",
       "type": "number",
       "optional": false,
       "default": 100,
       "desc_en": "Maximum (inclusive)",
       "desc_zh": "最大值（含）"
      }
     ],
     "returns": {
      "type": "number",
      "desc_en": "Integer",
      "desc_zh": "整数"
     },
     "desc_en": "Random integer in [min, max].",
     "desc_zh": "返回 [min, max] 内的随机整数。",
     "status": "stable"
    },
    {
     "name": "takeMeToFront",
     "signature": "utils.takeMeToFront()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Brings ketec to the foreground (asynchronous).",
     "desc_zh": "把 ketec 切到前台（异步）。",
     "status": "stable"
    },
    {
     "name": "randomUUID",
     "signature": "utils.randomUUID()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "UUID",
      "desc_zh": "UUID"
     },
     "desc_en": "Random UUID string.",
     "desc_zh": "随机 UUID。",
     "status": "stable"
    },
    {
     "name": "hexString",
     "signature": "utils.hexString(source)",
     "params": [
      {
       "name": "source",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Lowercase hex of the UTF-8 bytes",
      "desc_zh": "UTF-8 字节的小写十六进制"
     },
     "desc_en": "Text to hex.",
     "desc_zh": "文本转十六进制。",
     "status": "stable"
    },
    {
     "name": "base64Encoded",
     "signature": "utils.base64Encoded(source)",
     "params": [
      {
       "name": "source",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Base64",
      "desc_zh": "Base64"
     },
     "desc_en": "Base64-encodes UTF-8 text.",
     "desc_zh": "UTF-8 文本转 Base64。",
     "status": "stable"
    },
    {
     "name": "base64Decoded",
     "signature": "utils.base64Decoded(source)",
     "params": [
      {
       "name": "source",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Base64",
       "desc_zh": "Base64"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Decoded text (\"\" if invalid)",
      "desc_zh": "解码文本（无效为 \"\"）"
     },
     "desc_en": "Base64 to text.",
     "desc_zh": "Base64 转文本。",
     "status": "stable"
    },
    {
     "name": "hexStringBase64Encoded",
     "signature": "utils.hexStringBase64Encoded(hexString)",
     "params": [
      {
       "name": "hexString",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Hex bytes",
       "desc_zh": "十六进制字节串"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Base64",
      "desc_zh": "Base64"
     },
     "desc_en": "Hex bytes to Base64.",
     "desc_zh": "十六进制字节转 Base64。",
     "status": "stable"
    },
    {
     "name": "hexStringBase64Decoded",
     "signature": "utils.hexStringBase64Decoded(base64HexString)",
     "params": [
      {
       "name": "base64HexString",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Base64",
       "desc_zh": "Base64"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Hex",
      "desc_zh": "十六进制"
     },
     "desc_en": "Base64 to hex bytes.",
     "desc_zh": "Base64 转十六进制字节。",
     "status": "stable"
    },
    {
     "name": "formatDate",
     "signature": "utils.formatDate(timestamp?, format?)",
     "params": [
      {
       "name": "timestamp",
       "type": "number",
       "optional": true,
       "default": null,
       "desc_en": "Seconds or milliseconds; default now",
       "desc_zh": "秒或毫秒时间戳，默认当前时间"
      },
      {
       "name": "format",
       "type": "string",
       "optional": true,
       "default": "yyyy-MM-dd HH:mm:ss",
       "desc_en": "Pattern",
       "desc_zh": "格式"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Formatted time",
      "desc_zh": "格式化时间"
     },
     "desc_en": "Formats a timestamp.",
     "desc_zh": "格式化时间戳。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "cryptoUtils",
   "title_en": "Crypto",
   "title_zh": "加解密与摘要",
   "summary_en": "Hashes/HMAC, AES-ECB and RSA (PKCS#1 v1.5).",
   "summary_zh": "摘要/HMAC、AES-ECB 与 RSA（PKCS#1 v1.5）。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "cryptoUtils",
    "python": "cryptoUtils",
    "lua": "cryptoUtils"
   },
   "functions": [
    {
     "name": "encryptWithAES_ECB",
     "signature": "cryptoUtils.encryptWithAES_ECB(data, aesKey, noPadding?)",
     "params": [
      {
       "name": "data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Plaintext",
       "desc_zh": "明文"
      },
      {
       "name": "aesKey",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "16/24/32-char key, or 32/48/64 hex chars",
       "desc_zh": "16/24/32 位密钥字符串，或 32/48/64 位十六进制"
      },
      {
       "name": "noPadding",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Disable PKCS7 padding",
       "desc_zh": "不使用 PKCS7 填充"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "Base64 ciphertext",
      "desc_zh": "Base64 密文"
     },
     "desc_en": "AES-ECB encryption.",
     "desc_zh": "AES-ECB 加密。",
     "status": "stable"
    },
    {
     "name": "decryptWithAES_ECB",
     "signature": "cryptoUtils.decryptWithAES_ECB(data, aesKey, noPadding?)",
     "params": [
      {
       "name": "data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Base64 ciphertext",
       "desc_zh": "Base64 密文"
      },
      {
       "name": "aesKey",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Key (same rules)",
       "desc_zh": "密钥（规则同上）"
      },
      {
       "name": "noPadding",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "No padding",
       "desc_zh": "不使用填充"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "UTF-8 plaintext",
      "desc_zh": "UTF-8 明文"
     },
     "desc_en": "AES-ECB decryption.",
     "desc_zh": "AES-ECB 解密。",
     "status": "stable"
    },
    {
     "name": "encryptWithRSA",
     "signature": "cryptoUtils.encryptWithRSA(data, publicKeyBase64)",
     "params": [
      {
       "name": "data",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Plaintext",
       "desc_zh": "明文"
      },
      {
       "name": "publicKeyBase64",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Public key, PEM or Base64 DER",
       "desc_zh": "公钥（PEM 或 Base64 DER）"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Base64 ciphertext, \"\" on failure",
      "desc_zh": "Base64 密文，失败为 \"\""
     },
     "desc_en": "RSA encryption (PKCS#1 v1.5).",
     "desc_zh": "RSA 加密（PKCS#1 v1.5）。",
     "status": "stable"
    },
    {
     "name": "decryptWithRSA",
     "signature": "cryptoUtils.decryptWithRSA(encryptedData, privateKeyBase64)",
     "params": [
      {
       "name": "encryptedData",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Base64 ciphertext",
       "desc_zh": "Base64 密文"
      },
      {
       "name": "privateKeyBase64",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Private key, PEM or Base64",
       "desc_zh": "私钥（PEM 或 Base64）"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Plaintext, \"\" on failure",
      "desc_zh": "明文，失败为 \"\""
     },
     "desc_en": "RSA decryption.",
     "desc_zh": "RSA 解密。",
     "status": "stable"
    },
    {
     "name": "md5",
     "signature": "cryptoUtils.md5(source)",
     "params": [
      {
       "name": "source",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Lowercase hex",
      "desc_zh": "小写十六进制"
     },
     "desc_en": "MD5 digest.",
     "desc_zh": "MD5 摘要。",
     "status": "stable"
    },
    {
     "name": "sha1",
     "signature": "cryptoUtils.sha1(source, key?)",
     "params": [
      {
       "name": "source",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      },
      {
       "name": "key",
       "type": "string",
       "optional": true,
       "default": null,
       "desc_en": "If given, HMAC-SHA1 with this key",
       "desc_zh": "给出时计算 HMAC-SHA1"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Lowercase hex",
      "desc_zh": "小写十六进制"
     },
     "desc_en": "SHA-1 or HMAC-SHA1.",
     "desc_zh": "SHA-1 或 HMAC-SHA1。",
     "status": "stable"
    },
    {
     "name": "sha256",
     "signature": "cryptoUtils.sha256(source, key?)",
     "params": [
      {
       "name": "source",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文本"
      },
      {
       "name": "key",
       "type": "string",
       "optional": true,
       "default": null,
       "desc_en": "If given, HMAC-SHA256",
       "desc_zh": "给出时计算 HMAC-SHA256"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Lowercase hex",
      "desc_zh": "小写十六进制"
     },
     "desc_en": "SHA-256 or HMAC-SHA256.",
     "desc_zh": "SHA-256 或 HMAC-SHA256。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "logger",
   "title_en": "Logging",
   "title_zh": "日志",
   "summary_en": "Write log lines. In a running script package lines go to the ketec run log (visible in the app and via the log endpoints).",
   "summary_zh": "写日志。软件包运行时写入 ketec 运行日志（App 内与日志接口可查看）。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "logger",
    "python": "logger",
    "lua": "logger"
   },
   "functions": [
    {
     "name": "debug",
     "signature": "logger.debug(args)",
     "params": [
      {
       "name": "args",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Message (Python joins several arguments)",
       "desc_zh": "消息（Python 可传多个参数并拼接）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Debug-level log.",
     "desc_zh": "调试级日志。",
     "status": "stable"
    },
    {
     "name": "info",
     "signature": "logger.info(args)",
     "params": [
      {
       "name": "args",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Message",
       "desc_zh": "消息"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Info-level log.",
     "desc_zh": "信息级日志。",
     "example": "logger.info('step 1 done');",
     "status": "stable"
    },
    {
     "name": "warn",
     "signature": "logger.warn(args)",
     "params": [
      {
       "name": "args",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Message",
       "desc_zh": "消息"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Warning-level log.",
     "desc_zh": "警告级日志。",
     "status": "stable"
    },
    {
     "name": "error",
     "signature": "logger.error(args)",
     "params": [
      {
       "name": "args",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Message",
       "desc_zh": "消息"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Error-level log.",
     "desc_zh": "错误级日志。",
     "status": "stable"
    },
    {
     "name": "setLoggerLevel",
     "signature": "logger.setLoggerLevel(level)",
     "params": [
      {
       "name": "level",
       "type": "string",
       "optional": true,
       "default": "info",
       "desc_en": "debug / info / warn / error",
       "desc_zh": "debug / info / warn / error"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Stores the minimum log level [effect on output unverified].",
     "desc_zh": "保存最低日志级别 [对输出的影响未验证]。",
     "status": "limited"
    },
    {
     "name": "setLogToFile",
     "signature": "logger.setLogToFile(enabled)",
     "params": [
      {
       "name": "enabled",
       "type": "boolean",
       "optional": false,
       "default": null,
       "desc_en": "On/off",
       "desc_zh": "开/关"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Stores the log-to-file preference [effect unverified].",
     "desc_zh": "保存是否写文件的设置 [效果未验证]。",
     "status": "limited"
    },
    {
     "name": "setMaxLogFileCount",
     "signature": "logger.setMaxLogFileCount(count)",
     "params": [
      {
       "name": "count",
       "type": "number",
       "optional": true,
       "default": 5,
       "desc_en": "Max files",
       "desc_zh": "最多文件数"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Stores the max log file count [effect unverified].",
     "desc_zh": "保存日志文件数上限 [效果未验证]。",
     "status": "limited"
    },
    {
     "name": "setMaxLogFileSize",
     "signature": "logger.setMaxLogFileSize(size)",
     "params": [
      {
       "name": "size",
       "type": "number",
       "optional": true,
       "default": 1048576,
       "desc_en": "Bytes",
       "desc_zh": "字节"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Stores the max log file size [effect unverified].",
     "desc_zh": "保存单个日志文件大小上限 [效果未验证]。",
     "status": "limited"
    },
    {
     "name": "resetLogFile",
     "signature": "logger.resetLogFile()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Deletes the script log file.",
     "desc_zh": "删除脚本日志文件。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "g",
   "title_en": "Globals & run control",
   "title_zh": "全局函数与运行控制",
   "summary_en": "Script-wide functions. JavaScript: global functions (sleep, time, exit, logi/logw/loge/logd, createNodeSelector, setStopCallback ...). Python: from ketec import g (g.setStopCallback(...), constants g.runMode, g.appVersion, g.appName, g.appBundleId, g.appBuildNumber, g.isDebug, g.platform, g.packageJson, g.startParams; use time.sleep). Lua: capitalized globals Sleep, Exit, Time, TakeMeToFront, SetStopCallback, RestartScript, StartThread/StopThread, ToJsonString, constants RunMode, AppVersion, PackageJson, StartParams ...",
   "summary_zh": "脚本级全局函数。JavaScript：全局函数（sleep、time、exit、logi/logw/loge/logd、createNodeSelector、setStopCallback 等）。Python：from ketec import g（g.setStopCallback(...)，常量 g.runMode、g.appVersion、g.appName、g.appBundleId、g.appBuildNumber、g.isDebug、g.platform、g.packageJson、g.startParams；延时用 time.sleep）。Lua：首字母大写的全局函数 Sleep、Exit、Time、TakeMeToFront、SetStopCallback、RestartScript、StartThread/StopThread、ToJsonString，常量 RunMode、AppVersion、PackageJson、StartParams 等。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "(global functions)",
    "python": "g",
    "lua": "(global functions, capitalized)"
   },
   "functions": [
    {
     "name": "takeMeToFront",
     "signature": "takeMeToFront()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Brings ketec to the foreground.",
     "desc_zh": "把 ketec 切到前台。",
     "status": "stable"
    },
    {
     "name": "setAgentTouchMode",
     "signature": "setAgentTouchMode(mode)",
     "params": [
      {
       "name": "mode",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "0 standard, 1 fast, 2 real tap (invalid → 1)",
       "desc_zh": "0 标准、1 快速、2 真实点击（非法值按 1）"
      }
     ],
     "returns": {
      "type": "number",
      "desc_en": "The stored mode",
      "desc_zh": "保存的模式值"
     },
     "desc_en": "Stores the Agent touch mode. In the current build the value is saved and returned but does not change how taps are synthesized.",
     "desc_zh": "保存 Agent 触控模式。当前版本只保存并返回该值，不改变点击的合成方式。",
     "status": "limited"
    },
    {
     "name": "getAgentTouchMode",
     "signature": "getAgentTouchMode()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "0/1/2, default 1",
      "desc_zh": "0/1/2，默认 1"
     },
     "desc_en": "Reads the stored Agent touch mode.",
     "desc_zh": "读取保存的 Agent 触控模式。",
     "status": "stable"
    },
    {
     "name": "setCpuAutoThrottle",
     "signature": "setCpuAutoThrottle(enabled)",
     "params": [
      {
       "name": "enabled",
       "type": "boolean",
       "optional": false,
       "default": null,
       "desc_en": "On/off",
       "desc_zh": "开/关"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "The stored value",
      "desc_zh": "保存的值"
     },
     "desc_en": "Stores the CPU auto-throttle switch. Saved only; no throttling is applied in the current build.",
     "desc_zh": "保存 CPU 自动限流开关。只保存，当前版本不实际限流。",
     "status": "limited"
    },
    {
     "name": "getCpuAutoThrottle",
     "signature": "getCpuAutoThrottle()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Default true",
      "desc_zh": "默认 true"
     },
     "desc_en": "Reads the stored switch.",
     "desc_zh": "读取保存的开关。",
     "status": "stable"
    },
    {
     "name": "setCpuThrottleDelay",
     "signature": "setCpuThrottleDelay(min_ms, max_ms)",
     "params": [
      {
       "name": "min_ms",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Minimum delay (ms); an object {minMs, maxMs} is also accepted",
       "desc_zh": "最小延迟（毫秒），也可传 {minMs, maxMs}"
      },
      {
       "name": "max_ms",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Maximum delay (ms)",
       "desc_zh": "最大延迟（毫秒）"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{minMs, maxMs} as stored",
      "desc_zh": "保存后的 {minMs, maxMs}"
     },
     "desc_en": "Stores the throttle delay range (saved only).",
     "desc_zh": "保存限流延迟区间（只保存）。",
     "status": "limited"
    },
    {
     "name": "getCpuThrottleDelay",
     "signature": "getCpuThrottleDelay()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "{minMs, maxMs}, default {3, 30}",
      "desc_zh": "{minMs, maxMs}，默认 {3, 30}"
     },
     "desc_en": "Reads the stored delay range.",
     "desc_zh": "读取保存的延迟区间。",
     "status": "stable"
    },
    {
     "name": "restartScript",
     "signature": "restartScript(delay_ms?)",
     "params": [
      {
       "name": "delay_ms",
       "type": "number",
       "optional": true,
       "default": 2000,
       "desc_en": "Python: wait before restart (at least 2000 ms); ignored in JavaScript",
       "desc_zh": "Python：重启前等待（至少 2000 毫秒）；JavaScript 忽略"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Ends the current run and restarts the package script.",
     "desc_zh": "结束本次运行并重启软件包脚本。",
     "status": "stable"
    },
    {
     "name": "setStopCallback",
     "signature": "setStopCallback(callback)",
     "params": [
      {
       "name": "callback",
       "type": "function",
       "optional": false,
       "default": null,
       "desc_en": "Called with \"stopped\" when the script is stopped, or \"error\" after an uncaught exception (about 3 s allowed)",
       "desc_zh": "脚本被停止时以 \"stopped\" 调用，未捕获异常后以 \"error\" 调用（限时约 3 秒）"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Registers a stop callback (package runs).",
     "desc_zh": "注册停止回调（软件包运行时）。",
     "example": "setStopCallback(function(status){ logi('stopped: ' + status); });",
     "status": "stable"
    },
    {
     "name": "setExceptionCallback",
     "signature": "setExceptionCallback(callback)",
     "params": [
      {
       "name": "callback",
       "type": "function",
       "optional": false,
       "default": null,
       "desc_en": "Called with the error object",
       "desc_zh": "以错误对象调用"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Registers an uncaught-exception callback (package runs).",
     "desc_zh": "注册未捕获异常回调（软件包运行时）。",
     "status": "stable"
    },
    {
     "name": "sleep",
     "signature": "sleep(ms)",
     "params": [
      {
       "name": "ms",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Milliseconds",
       "desc_zh": "毫秒"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Pauses the script (JavaScript; Lua: Sleep; Python: time.sleep).",
     "desc_zh": "暂停脚本（JavaScript；Lua 为 Sleep；Python 用 time.sleep）。",
     "example": "sleep(500);",
     "status": "stable",
     "languages": [
      "javascript",
      "lua"
     ]
    },
    {
     "name": "time",
     "signature": "time()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "Milliseconds since epoch",
      "desc_zh": "毫秒时间戳"
     },
     "desc_en": "Current timestamp in ms (Lua: Time).",
     "desc_zh": "当前毫秒时间戳（Lua 为 Time）。",
     "status": "stable",
     "languages": [
      "javascript",
      "lua"
     ]
    },
    {
     "name": "exit",
     "signature": "exit()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Ends the script normally (Lua: Exit; Python: sys.exit).",
     "desc_zh": "正常结束脚本（Lua 为 Exit；Python 用 sys.exit）。",
     "status": "stable",
     "languages": [
      "javascript",
      "lua"
     ]
    },
    {
     "name": "logi",
     "signature": "logi(msg) / logw(msg) / loge(msg) / logd(msg)",
     "params": [
      {
       "name": "msg",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Message",
       "desc_zh": "消息"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Writes an info/warn/error/debug line to the run log (console.log maps to info).",
     "desc_zh": "写信息/警告/错误/调试日志（console.log 等同信息级）。",
     "status": "stable",
     "languages": [
      "javascript",
      "lua"
     ]
    },
    {
     "name": "println",
     "signature": "println(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "Ignored",
       "desc_zh": "忽略"
      }
     ],
     "returns": {
      "type": "null",
      "desc_en": "null",
      "desc_zh": "null"
     },
     "desc_en": "No-op kept for compatibility; returns null and writes nothing (use logi).",
     "desc_zh": "兼容保留的空操作，返回 null 且不写日志（请用 logi）。",
     "status": "limited",
     "languages": [
      "javascript"
     ]
    },
    {
     "name": "setTimeout",
     "signature": "setTimeout(fn, ms) / setInterval(fn, ms) / clearTimeout(id) / clearInterval(id)",
     "params": [
      {
       "name": "fn",
       "type": "function",
       "optional": false,
       "default": null,
       "desc_en": "Callback",
       "desc_zh": "回调"
      },
      {
       "name": "ms",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Delay",
       "desc_zh": "延迟"
      }
     ],
     "returns": {
      "type": "number",
      "desc_en": "A handle",
      "desc_zh": "句柄"
     },
     "desc_en": "Timers return a handle but the callback is never executed (no event loop); use sleep() in a loop instead.",
     "desc_zh": "定时器只返回句柄，回调永不执行（没有事件循环）；请用循环 + sleep()。",
     "status": "limited",
     "languages": [
      "javascript"
     ]
    }
   ]
  },
  {
   "name": "ui",
   "title_en": "Dialogs & package UI",
   "title_zh": "对话框与软件包 UI",
   "summary_en": "Toasts and dialogs shown inside the ketec app, plus messaging with the package UI page. Dialogs need ketec in the foreground.",
   "summary_zh": "ketec App 内的提示与对话框，以及与软件包 UI 页面的消息互通。对话框需要 ketec 在前台。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "ui",
    "python": "ui",
    "lua": "ui"
   },
   "functions": [
    {
     "name": "show",
     "signature": "ui.show(text?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": true,
       "default": null,
       "desc_en": "Text shown on the panel",
       "desc_zh": "面板上显示的文字"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Shows a simple translucent text panel over the ketec window. It does not open the package UI page.",
     "desc_zh": "在 ketec 窗口上显示一个简单的半透明文字面板，不会打开软件包 UI 页面。",
     "status": "limited"
    },
    {
     "name": "hide",
     "signature": "ui.hide()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Removes the panel shown by ui.show.",
     "desc_zh": "移除 ui.show 显示的面板。",
     "status": "stable"
    },
    {
     "name": "showToast",
     "signature": "ui.showToast(message)",
     "params": [
      {
       "name": "message",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文字"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Shows a short toast in the ketec window (visible only when ketec is in front).",
     "desc_zh": "在 ketec 窗口显示短暂提示（ketec 在前台才看得到）。",
     "status": "stable"
    },
    {
     "name": "confirm",
     "signature": "ui.confirm(title, message)",
     "params": [
      {
       "name": "title",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Title",
       "desc_zh": "标题"
      },
      {
       "name": "message",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Message",
       "desc_zh": "内容"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true = OK, false = Cancel / no window / timeout (10 min)",
      "desc_zh": "确定为 true；取消、无窗口或超时（10 分钟）为 false"
     },
     "desc_en": "Shows an OK/Cancel dialog and waits for the user.",
     "desc_zh": "显示确定/取消对话框并等待用户选择。",
     "status": "stable"
    },
    {
     "name": "confirmInput",
     "signature": "ui.confirmInput(title, message, defaultInput?)",
     "params": [
      {
       "name": "title",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Title",
       "desc_zh": "标题"
      },
      {
       "name": "message",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Message",
       "desc_zh": "内容"
      },
      {
       "name": "defaultInput",
       "type": "string",
       "optional": true,
       "default": null,
       "desc_en": "Ignored by the current binding",
       "desc_zh": "当前实现忽略"
      }
     ],
     "returns": {
      "type": "string",
      "desc_en": "Entered text, \"\" on cancel",
      "desc_zh": "输入的文字，取消为 \"\""
     },
     "desc_en": "Shows a text-input dialog and waits.",
     "desc_zh": "显示输入对话框并等待。",
     "status": "stable"
    },
    {
     "name": "alert",
     "signature": "ui.alert(title, message)",
     "params": [
      {
       "name": "title",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Title (a single argument is treated as the message)",
       "desc_zh": "标题（只传一个参数时当作内容）"
      },
      {
       "name": "message",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Message",
       "desc_zh": "内容"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Shows an alert; returns immediately without waiting.",
     "desc_zh": "显示提示框，立即返回不等待。",
     "status": "stable"
    },
    {
     "name": "onEvent",
     "signature": "ui.onEvent(eventName, callback)",
     "params": [
      {
       "name": "eventName",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Event name sent by the package UI page",
       "desc_zh": "软件包 UI 页面发送的事件名"
      },
      {
       "name": "callback",
       "type": "function",
       "optional": false,
       "default": null,
       "desc_en": "Receives the event data",
       "desc_zh": "接收事件数据"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Listens for events emitted by the package UI page while the script runs (delivered during sleep()). Note: the current binding takes (eventName, callback), not a single callback.",
     "desc_zh": "监听软件包 UI 页面在脚本运行期间发出的事件（在 sleep() 期间派发）。注意：当前实现参数为 (事件名, 回调)，不是单个回调。",
     "status": "stable"
    },
    {
     "name": "call",
     "signature": "ui.call(key, data?)",
     "params": [
      {
       "name": "key",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Function name registered by the UI page",
       "desc_zh": "UI 页面注册的函数名"
      },
      {
       "name": "data",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "Payload",
       "desc_zh": "数据"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Calls a function registered by the package UI page (package runs; fire-and-forget).",
     "desc_zh": "调用软件包 UI 页面注册的函数（软件包运行时；不等待结果）。",
     "status": "stable"
    },
    {
     "name": "callFloatingWindow",
     "signature": "ui.callFloatingWindow(key, data?)",
     "params": [
      {
       "name": "key",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Name",
       "desc_zh": "函数名"
      },
      {
       "name": "data",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "Payload",
       "desc_zh": "数据"
      }
     ],
     "returns": {
      "type": "any",
      "desc_en": "Same as ui.call",
      "desc_zh": "同 ui.call"
     },
     "desc_en": "There is no separate floating web window; forwards to ui.call.",
     "desc_zh": "没有独立的悬浮网页窗口；转发给 ui.call。",
     "status": "limited"
    },
    {
     "name": "eval",
     "signature": "ui.eval(code)",
     "params": [
      {
       "name": "code",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "JavaScript source",
       "desc_zh": "JavaScript 代码"
      }
     ],
     "returns": {
      "type": "any",
      "desc_en": "Result value",
      "desc_zh": "执行结果"
     },
     "desc_en": "Runs JavaScript in a separate script context (not inside the UI page) with a 10 s limit.",
     "desc_zh": "在独立的脚本上下文（不是 UI 页面内）执行 JavaScript，限时 10 秒。",
     "status": "limited"
    },
    {
     "name": "evalFloatingWindow",
     "signature": "ui.evalFloatingWindow(code)",
     "params": [
      {
       "name": "code",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "JavaScript source",
       "desc_zh": "JavaScript 代码"
      }
     ],
     "returns": {
      "type": "any",
      "desc_en": "Result value",
      "desc_zh": "执行结果"
     },
     "desc_en": "Same as ui.eval.",
     "desc_zh": "同 ui.eval。",
     "status": "limited"
    }
   ]
  },
  {
   "name": "pip",
   "title_en": "Floating window (PiP)",
   "title_zh": "悬浮窗（画中画）",
   "summary_en": "Uses system Picture-in-Picture as a floating window: log mode, keep-alive mode or custom text. Its position is controlled by iOS.",
   "summary_zh": "用系统画中画做悬浮窗：日志模式、保活模式或自定义文字。窗口位置由 iOS 管理。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "pip",
    "python": "pip",
    "lua": "pip"
   },
   "functions": [
    {
     "name": "isPipActive",
     "signature": "pip.isPipActive()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Visible",
      "desc_zh": "是否显示"
     },
     "desc_en": "Whether the floating window is showing.",
     "desc_zh": "悬浮窗是否显示中。",
     "status": "stable"
    },
    {
     "name": "switchToLogMode",
     "signature": "pip.switchToLogMode()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Shows script logs in the window.",
     "desc_zh": "切换为日志模式。",
     "status": "stable"
    },
    {
     "name": "switchToKeepAliveMode",
     "signature": "pip.switchToKeepAliveMode()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Keep-alive mode.",
     "desc_zh": "切换为保活模式。",
     "status": "stable"
    },
    {
     "name": "switchToCustomMode",
     "signature": "pip.switchToCustomMode()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Custom text mode.",
     "desc_zh": "切换为自定义文字模式。",
     "status": "stable"
    },
    {
     "name": "closeWindow",
     "signature": "pip.closeWindow()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Closes the window.",
     "desc_zh": "关闭悬浮窗。",
     "status": "stable"
    },
    {
     "name": "setContentSize",
     "signature": "pip.setContentSize(width, height)",
     "params": [
      {
       "name": "width",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Width",
       "desc_zh": "宽"
      },
      {
       "name": "height",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Height",
       "desc_zh": "高"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets the content size (log/custom mode only).",
     "desc_zh": "设置内容尺寸（仅日志/自定义模式）。",
     "status": "stable"
    },
    {
     "name": "setPosition",
     "signature": "pip.setPosition(x, y)",
     "params": [
      {
       "name": "x",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "X",
       "desc_zh": "X"
      },
      {
       "name": "y",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Y",
       "desc_zh": "Y"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "Always false",
      "desc_zh": "恒为 false"
     },
     "desc_en": "Not supported: iOS decides the PiP position.",
     "desc_zh": "不支持：画中画位置由 iOS 决定。",
     "status": "unsupported"
    },
    {
     "name": "setLogFontSize",
     "signature": "pip.setLogFontSize(fontSize)",
     "params": [
      {
       "name": "fontSize",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Points",
       "desc_zh": "字号"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Log text size.",
     "desc_zh": "日志字号。",
     "status": "stable"
    },
    {
     "name": "setCustomText",
     "signature": "pip.setCustomText(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文字"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Custom-mode text.",
     "desc_zh": "自定义模式文字。",
     "status": "stable"
    },
    {
     "name": "setCustomTextColor",
     "signature": "pip.setCustomTextColor(color)",
     "params": [
      {
       "name": "color",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "e.g. \"#FFFFFF\"",
       "desc_zh": "如 \"#FFFFFF\""
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Custom text color.",
     "desc_zh": "自定义文字颜色。",
     "status": "stable"
    },
    {
     "name": "setCustomTextSize",
     "signature": "pip.setCustomTextSize(fontSize)",
     "params": [
      {
       "name": "fontSize",
       "type": "number",
       "optional": false,
       "default": null,
       "desc_en": "Points",
       "desc_zh": "字号"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Custom text size.",
     "desc_zh": "自定义文字字号。",
     "status": "stable"
    },
    {
     "name": "setCustomBackgroundColor",
     "signature": "pip.setCustomBackgroundColor(color)",
     "params": [
      {
       "name": "color",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "e.g. \"#000000\"",
       "desc_zh": "如 \"#000000\""
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Custom background color.",
     "desc_zh": "自定义背景色。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "thread",
   "title_en": "Script threads",
   "title_zh": "脚本线程",
   "summary_en": "Runs another script file in parallel in its own context. Exchange data through sharedState. JavaScript only (Python: threading; Lua: StartThread / StopThread).",
   "summary_zh": "在独立上下文中并行运行另一个脚本文件，数据交换用 sharedState。仅 JavaScript（Python 用 threading；Lua 用 StartThread / StopThread）。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript"
   ],
   "names": {
    "javascript": "thread",
    "python": null,
    "lua": null
   },
   "functions": [
    {
     "name": "run",
     "signature": "thread.run(fileName, params?)",
     "params": [
      {
       "name": "fileName",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Script file whose name ends with _thread.js",
       "desc_zh": "以 _thread.js 结尾的脚本文件"
      },
      {
       "name": "params",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "Start parameters, readable as __threadParams__ in the thread (__threadName__ holds its name)",
       "desc_zh": "启动参数，线程内用 __threadParams__ 读取（__threadName__ 为线程名）"
      }
     ],
     "returns": {
      "type": "Thread|undefined",
      "desc_en": "{name, cancel(), isCancelled(), isExecuting()}",
      "desc_zh": "{name, cancel(), isCancelled(), isExecuting()}"
     },
     "desc_en": "Starts a script thread.",
     "desc_zh": "启动脚本线程。",
     "example": "var t = thread.run('worker_thread.js', {n: 3});",
     "status": "stable"
    },
    {
     "name": "stopAll",
     "signature": "thread.stopAll()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Requests all running threads to stop.",
     "desc_zh": "请求停止全部线程。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "tts",
   "title_en": "Text to speech",
   "title_zh": "文字转语音",
   "summary_en": "Speech synthesis with the system voices.",
   "summary_zh": "使用系统语音合成。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "tts",
    "python": "tts",
    "lua": "tts"
   },
   "functions": [
    {
     "name": "speak",
     "signature": "tts.speak(text, rate?, pitch?, volume?, language?)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text",
       "desc_zh": "文字"
      },
      {
       "name": "rate",
       "type": "number",
       "optional": true,
       "default": 0.5,
       "desc_en": "0–1",
       "desc_zh": "0–1"
      },
      {
       "name": "pitch",
       "type": "number",
       "optional": true,
       "default": 1,
       "desc_en": "0.5–2",
       "desc_zh": "0.5–2"
      },
      {
       "name": "volume",
       "type": "number",
       "optional": true,
       "default": 1,
       "desc_en": "0–1",
       "desc_zh": "0–1"
      },
      {
       "name": "language",
       "type": "string",
       "optional": true,
       "default": "zh-CN",
       "desc_en": "Language code",
       "desc_zh": "语言代码"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Queues speech (non-blocking).",
     "desc_zh": "排队朗读（不阻塞）。",
     "example": "tts.speak('任务完成'); tts.waitEnd();",
     "status": "stable"
    },
    {
     "name": "waitEnd",
     "signature": "tts.waitEnd()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Blocks until queued speech finishes.",
     "desc_zh": "阻塞到朗读结束。",
     "status": "stable"
    },
    {
     "name": "stop",
     "signature": "tts.stop()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Stops speaking.",
     "desc_zh": "停止朗读。",
     "status": "stable"
    },
    {
     "name": "isSpeaking",
     "signature": "tts.isSpeaking()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Speaking",
      "desc_zh": "是否在朗读"
     },
     "desc_en": "Whether speech is in progress.",
     "desc_zh": "是否正在朗读。",
     "status": "stable"
    },
    {
     "name": "getAvailableVoices",
     "signature": "tts.getAvailableVoices()",
     "params": [],
     "returns": {
      "type": "array",
      "desc_en": "[{identifier, name, language, quality}]",
      "desc_zh": "[{identifier, name, language, quality}]"
     },
     "desc_en": "Lists system voices.",
     "desc_zh": "列出系统音色。",
     "status": "stable"
    },
    {
     "name": "setVoice",
     "signature": "tts.setVoice(voiceIdentifier)",
     "params": [
      {
       "name": "voiceIdentifier",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "identifier from getAvailableVoices",
       "desc_zh": "getAvailableVoices 返回的 identifier"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Selects a voice.",
     "desc_zh": "选择音色。",
     "status": "stable"
    },
    {
     "name": "free",
     "signature": "tts.free()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Stops and releases the synthesizer.",
     "desc_zh": "停止并释放合成器。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "cloud",
   "title_en": "Cloud control link",
   "title_zh": "云控连接",
   "summary_en": "Connect ketec to your own WebSocket control server, report custom data and receive custom events.",
   "summary_zh": "把 ketec 连接到自己的 WebSocket 云控服务端，上报自定义数据并接收自定义事件。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "cloud",
    "python": "cloud",
    "lua": "cloud"
   },
   "functions": [
    {
     "name": "connect",
     "signature": "cloud.connect(url, deviceNo?)",
     "params": [
      {
       "name": "url",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "ws:// or wss:// server URL",
       "desc_zh": "ws:// 或 wss:// 服务端地址"
      },
      {
       "name": "deviceNo",
       "type": "string",
       "optional": true,
       "default": null,
       "desc_en": "Device number; default = the one set in the app",
       "desc_zh": "设备编号，默认用 App 设置里的"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Connects for this run (does not change saved settings).",
     "desc_zh": "本次运行期连接（不改保存的设置）。",
     "status": "stable"
    },
    {
     "name": "isConnected",
     "signature": "cloud.isConnected()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "Connected",
      "desc_zh": "是否已连接"
     },
     "desc_en": "Connection state.",
     "desc_zh": "连接状态。",
     "status": "stable"
    },
    {
     "name": "disconnect",
     "signature": "cloud.disconnect()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Disconnects.",
     "desc_zh": "断开。",
     "status": "stable"
    },
    {
     "name": "report",
     "signature": "cloud.report(event, data)",
     "params": [
      {
       "name": "event",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Non-empty event name (\"cloud:status\" for the overview status)",
       "desc_zh": "非空事件名（设备总览状态用 \"cloud:status\"）"
      },
      {
       "name": "data",
       "type": "object",
       "optional": false,
       "default": null,
       "desc_en": "JSON object",
       "desc_zh": "JSON 对象"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sends {type:\"scriptReport\", event, data} to the server.",
     "desc_zh": "向服务端发送 {type:\"scriptReport\", event, data}。",
     "example": "cloud.report('task.finished', {ok: true});",
     "status": "stable"
    },
    {
     "name": "onEvent",
     "signature": "cloud.onEvent(callback)",
     "params": [
      {
       "name": "callback",
       "type": "function|null",
       "optional": false,
       "default": null,
       "desc_en": "callback(event, data) for server \"scriptEvent\" messages; null removes it",
       "desc_zh": "接收服务端 scriptEvent 的 callback(event, data)；传 null 取消"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Registers the single custom-event listener (delivered while the package script runs).",
     "desc_zh": "注册唯一的自定义事件监听（软件包脚本运行期间派发）。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "netCard",
   "title_en": "License cards",
   "title_zh": "卡密授权",
   "summary_en": "Online card-key verification for the currently loaded script package.",
   "summary_zh": "针对当前加载的软件包做在线卡密验证。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "netCard",
    "python": "netcard",
    "lua": "netcard"
   },
   "functions": [
    {
     "name": "isAuthCardMode",
     "signature": "netCard.isAuthCardMode()",
     "params": [],
     "returns": {
      "type": "boolean",
      "desc_en": "true if card mode is enabled in settings",
      "desc_zh": "设置中开启卡密模式返回 true"
     },
     "desc_en": "Whether card-key mode is on.",
     "desc_zh": "是否卡密模式。",
     "status": "stable"
    },
    {
     "name": "verify",
     "signature": "netCard.verify(cardNo)",
     "params": [
      {
       "name": "cardNo",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Card key; empty = re-verify the stored card",
       "desc_zh": "卡密；空串表示复验已保存的卡"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Verifies online and stores the card for this package.",
     "desc_zh": "在线验证并为本软件包保存卡密。",
     "status": "stable"
    },
    {
     "name": "getCardInfo",
     "signature": "netCard.getCardInfo()",
     "params": [],
     "returns": {
      "type": "object|undefined",
      "desc_en": "Card info of this package, undefined if none",
      "desc_zh": "本软件包的卡密信息，没有为 undefined"
     },
     "desc_en": "Returns verified card info.",
     "desc_zh": "返回已验证卡密信息。",
     "status": "stable"
    },
    {
     "name": "setCardRemark",
     "signature": "netCard.setCardRemark(remark)",
     "params": [
      {
       "name": "remark",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Remark",
       "desc_zh": "备注"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Sets the server-side remark of the card.",
     "desc_zh": "设置卡密的服务端备注。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "hotUpdate",
   "title_en": "Package hot update",
   "title_zh": "软件包热更新",
   "summary_en": "Checks for and installs a newer version of the current script package from the configured distribution server. [unverified on device]",
   "summary_zh": "从配置的分发服务器检查并安装当前软件包的新版本。[未真机验证]",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "hotUpdate",
    "python": "hotupdate",
    "lua": "hotupdate"
   },
   "functions": [
    {
     "name": "checkUpdate",
     "signature": "hotUpdate.checkUpdate()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "Update info [fields unverified]",
      "desc_zh": "更新信息 [字段未验证]"
     },
     "desc_en": "Checks whether an update exists. [unverified]",
     "desc_zh": "检查是否有更新。[未验证]",
     "status": "limited"
    },
    {
     "name": "downloadAndInstall",
     "signature": "hotUpdate.downloadAndInstall()",
     "params": [],
     "returns": {
      "type": "object",
      "desc_en": "Result including updated: boolean [other fields unverified]",
      "desc_zh": "结果，含 updated: boolean [其它字段未验证]"
     },
     "desc_en": "Downloads and installs; in a package run the script restarts at the next sleep() or when it ends. [unverified]",
     "desc_zh": "下载并安装；软件包运行中会在下一次 sleep() 或结束时重启脚本。[未验证]",
     "status": "limited"
    },
    {
     "name": "getCurrentVersion",
     "signature": "hotUpdate.getCurrentVersion()",
     "params": [],
     "returns": {
      "type": "number",
      "desc_en": "Current package appVersion",
      "desc_zh": "当前软件包 appVersion"
     },
     "desc_en": "Current package version.",
     "desc_zh": "当前软件包版本。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "ai",
   "title_en": "LLM helper",
   "title_zh": "AI 大模型",
   "summary_en": "Stores LLM provider settings and sends prompts. [unverified] Not tested on device in this release; see each function for known limitations found in the source.",
   "summary_zh": "保存大模型服务配置并发送提示词。[未验证] 本版未做真机测试；各函数的已知限制见说明（来自源码审阅）。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "ai",
    "python": "ai",
    "lua": "ai"
   },
   "functions": [
    {
     "name": "setProvider",
     "signature": "ai.setProvider(config)",
     "params": [
      {
       "name": "config",
       "type": "object",
       "optional": false,
       "default": null,
       "desc_en": "{id?, name?, baseUrl, model, apiKey?, protocol: \"openai\"|\"anthropic\"|\"gemini\" (default openai), headers?, supportsVision?, isDefault?}; same id updates",
       "desc_zh": "{id?, name?, baseUrl, model, apiKey?, protocol（默认 openai）, headers?, supportsVision?, isDefault?}；同 id 为更新"
      }
     ],
     "returns": {
      "type": "object|undefined",
      "desc_en": "Saved provider, undefined if baseUrl/model missing or protocol invalid",
      "desc_zh": "保存后的配置；缺 baseUrl/model 或 protocol 非法时为 undefined"
     },
     "desc_en": "Adds or updates a provider. [unverified]",
     "desc_zh": "新增或更新服务配置。[未验证]",
     "status": "stable"
    },
    {
     "name": "getProviders",
     "signature": "ai.getProviders()",
     "params": [],
     "returns": {
      "type": "array",
      "desc_en": "Saved providers",
      "desc_zh": "已保存的配置"
     },
     "desc_en": "Lists providers.",
     "desc_zh": "列出配置。",
     "status": "stable"
    },
    {
     "name": "getDefaultProvider",
     "signature": "ai.getDefaultProvider()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Provider id set by setDefaultProvider, \"\" if none",
      "desc_zh": "setDefaultProvider 设置的 id，未设为 \"\""
     },
     "desc_en": "Returns the default provider id (a string, not an object).",
     "desc_zh": "返回默认配置 id（字符串而非对象）。",
     "status": "limited"
    },
    {
     "name": "setDefaultProvider",
     "signature": "ai.setDefaultProvider(id)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Provider id",
       "desc_zh": "配置 id"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true on success",
      "desc_zh": "成功返回 true"
     },
     "desc_en": "Stores the default provider id.",
     "desc_zh": "保存默认配置 id。",
     "status": "stable"
    },
    {
     "name": "removeProvider",
     "signature": "ai.removeProvider(id)",
     "params": [
      {
       "name": "id",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Provider id",
       "desc_zh": "配置 id"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "Always true",
      "desc_zh": "恒为 true"
     },
     "desc_en": "Returns true, but source review shows the provider is not actually removed in this build. [unverified]",
     "desc_zh": "返回 true，但源码显示本版并未真正删除。[未验证]",
     "status": "limited"
    },
    {
     "name": "ask",
     "signature": "ai.ask(prompt, options?)",
     "params": [
      {
       "name": "prompt",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Prompt",
       "desc_zh": "提示词"
      },
      {
       "name": "options",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "Currently ignored",
       "desc_zh": "当前忽略"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{text} or {error}",
      "desc_zh": "{text} 或 {error}"
     },
     "desc_en": "Sends one prompt to an OpenAI-compatible chat endpoint. Source review: it reads an older endpoint setting that setProvider(config) does not write, so it may return {error} even after setProvider. [unverified]",
     "desc_zh": "向 OpenAI 兼容的对话接口发送一次提示词。源码审阅：它读取的是 setProvider(config) 不会写入的旧端点设置，因此即使已 setProvider 也可能返回 {error}。[未验证]",
     "status": "limited"
    },
    {
     "name": "judge",
     "signature": "ai.judge(question, options?)",
     "params": [
      {
       "name": "question",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Statement to judge",
       "desc_zh": "要判断的内容"
      },
      {
       "name": "options",
       "type": "object",
       "optional": true,
       "default": null,
       "desc_en": "Ignored",
       "desc_zh": "忽略"
      }
     ],
     "returns": {
      "type": "boolean",
      "desc_en": "true/false",
      "desc_zh": "true/false"
     },
     "desc_en": "Asks the model for true/false. Returns false without a default provider; since ask() returns an object, the result is false in practice. [unverified]",
     "desc_zh": "让模型回答 true/false。无默认配置时返回 false；由于 ask() 返回对象，实际结果恒为 false。[未验证]",
     "status": "limited"
    },
    {
     "name": "extract",
     "signature": "ai.extract(prompt, options?)",
     "params": [
      {
       "name": "prompt",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Source text",
       "desc_zh": "源文本"
      },
      {
       "name": "options",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "Field description",
       "desc_zh": "要抽取的字段说明"
      }
     ],
     "returns": {
      "type": "object|null|undefined",
      "desc_en": "Parsed JSON",
      "desc_zh": "解析出的 JSON"
     },
     "desc_en": "Asks the model to output JSON fields and parses it. Same limitation as judge. [unverified]",
     "desc_zh": "让模型输出 JSON 字段并解析。限制同 judge。[未验证]",
     "status": "limited"
    },
    {
     "name": "chat",
     "signature": "ai.chat(messages, options?)",
     "params": [
      {
       "name": "messages",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "In this build only a single prompt string is accepted (message arrays are not)",
       "desc_zh": "本版只接受单个提示词字符串（不接受消息数组）"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{text} or {error}",
      "desc_zh": "{text} 或 {error}"
     },
     "desc_en": "Same as ask with a single prompt. [unverified]",
     "desc_zh": "同 ask（单条提示词）。[未验证]",
     "status": "limited"
    },
    {
     "name": "parseJson",
     "signature": "ai.parseJson(text)",
     "params": [
      {
       "name": "text",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Text that contains JSON",
       "desc_zh": "包含 JSON 的文本"
      }
     ],
     "returns": {
      "type": "any|null",
      "desc_en": "Parsed value, null on failure",
      "desc_zh": "解析结果，失败为 null"
     },
     "desc_en": "Parses JSON, also extracting the first {...} or [...] block from surrounding text.",
     "desc_zh": "解析 JSON，也能从夹杂文字中提取第一个 {...} 或 [...]。",
     "status": "stable"
    },
    {
     "name": "lastError",
     "signature": "ai.lastError()",
     "params": [],
     "returns": {
      "type": "string",
      "desc_en": "Last error, usually \"\"",
      "desc_zh": "最近错误，通常为 \"\""
     },
     "desc_en": "Returns the stored last error (not updated by ask in this build). [unverified]",
     "desc_zh": "返回保存的最近错误（本版 ask 不会更新它）。[未验证]",
     "status": "limited"
    }
   ]
  },
  {
   "name": "yolo",
   "title_en": "YOLO object detection",
   "title_zh": "YOLO 目标检测",
   "summary_en": "On-device YOLO detection with ncnn models (.param + .bin; v5/v8/v11/v26). You supply the model files.",
   "summary_zh": "ncnn 端侧 YOLO 检测（.param + .bin，支持 v5/v8/v11/v26），模型文件由用户提供。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "yolo",
    "python": "yolo",
    "lua": "yolo"
   },
   "functions": [
    {
     "name": "load",
     "signature": "yolo.load(paramPath, binPath, nc?, version?, useGpu?)",
     "params": [
      {
       "name": "paramPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": ".param file",
       "desc_zh": ".param 文件"
      },
      {
       "name": "binPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": ".bin file",
       "desc_zh": ".bin 文件"
      },
      {
       "name": "nc",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Number of classes (0 = auto)",
       "desc_zh": "类别数（0 自动）"
      },
      {
       "name": "version",
       "type": "number",
       "optional": true,
       "default": 11,
       "desc_en": "YOLO version (5/8/11/26)",
       "desc_zh": "YOLO 版本（5/8/11/26）"
      },
      {
       "name": "useGpu",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "Use GPU",
       "desc_zh": "使用 GPU"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "modelId",
      "desc_zh": "模型 ID"
     },
     "desc_en": "Loads a model.",
     "desc_zh": "加载模型。",
     "status": "stable"
    },
    {
     "name": "detectAbs",
     "signature": "yolo.detectAbs(modelId, img, x?, y?, ex?, ey?, targetSize?, threshold?, nmsThreshold?)",
     "params": [
      {
       "name": "modelId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Model id from load()",
       "desc_zh": "load() 返回的模型 ID"
      },
      {
       "name": "img",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId, \"screen\" or file path",
       "desc_zh": "imageId、\"screen\" 或文件路径"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region left",
       "desc_zh": "区域左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region top",
       "desc_zh": "区域上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region right (0 = whole)",
       "desc_zh": "区域右（0 为整图）"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Region bottom",
       "desc_zh": "区域下"
      },
      {
       "name": "targetSize",
       "type": "number",
       "optional": true,
       "default": 640,
       "desc_en": "Input size",
       "desc_zh": "输入尺寸"
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 0.4,
       "desc_en": "Confidence threshold",
       "desc_zh": "置信度阈值"
      },
      {
       "name": "nmsThreshold",
       "type": "number",
       "optional": true,
       "default": 0.5,
       "desc_en": "NMS IoU threshold",
       "desc_zh": "NMS 阈值"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "[{x, y, ex, ey, centerX, centerY, width, height, confidence, classId}] absolute coordinates",
      "desc_zh": "[{x, y, ex, ey, centerX, centerY, width, height, confidence, classId}]，绝对坐标"
     },
     "desc_en": "Runs detection.",
     "desc_zh": "执行检测。",
     "example": "var m = yolo.load('m.param','m.bin'); var r = yolo.detectAbs(m, 'screen');",
     "status": "stable"
    },
    {
     "name": "free",
     "signature": "yolo.free(modelId)",
     "params": [
      {
       "name": "modelId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Model id from load()",
       "desc_zh": "load() 返回的模型 ID"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Releases a model.",
     "desc_zh": "释放模型。",
     "status": "stable"
    },
    {
     "name": "freeAll",
     "signature": "yolo.freeAll()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Releases all models.",
     "desc_zh": "释放全部模型。",
     "status": "stable"
    },
    {
     "name": "detect",
     "signature": "yolo.detect(modelId, img, targetSize?, threshold?, nmsThreshold?)",
     "params": [
      {
       "name": "modelId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Model id from load()",
       "desc_zh": "load() 返回的模型 ID"
      },
      {
       "name": "img",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId, \"screen\" or file path",
       "desc_zh": "imageId、\"screen\" 或文件路径"
      },
      {
       "name": "targetSize",
       "type": "number",
       "optional": true,
       "default": 640,
       "desc_en": "Input size",
       "desc_zh": "输入尺寸"
      },
      {
       "name": "threshold",
       "type": "number",
       "optional": true,
       "default": 0.4,
       "desc_en": "Threshold",
       "desc_zh": "阈值"
      },
      {
       "name": "nmsThreshold",
       "type": "number",
       "optional": true,
       "default": 0.5,
       "desc_en": "NMS",
       "desc_zh": "NMS"
      }
     ],
     "returns": {
      "type": "array",
      "desc_en": "Same as detectAbs",
      "desc_zh": "同 detectAbs"
     },
     "desc_en": "Whole-image detection.",
     "desc_zh": "整图检测。",
     "status": "stable",
     "ketec_extra": true
    }
   ]
  },
  {
   "name": "yoloCls",
   "title_en": "YOLO classification",
   "title_zh": "YOLO 图像分类",
   "summary_en": "On-device YOLO classification with ncnn models.",
   "summary_zh": "ncnn 端侧 YOLO 图像分类。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "yoloCls",
    "python": "yolocls",
    "lua": "yolocls"
   },
   "functions": [
    {
     "name": "load",
     "signature": "yoloCls.load(paramPath, binPath, nc?, useGpu?)",
     "params": [
      {
       "name": "paramPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": ".param file",
       "desc_zh": ".param 文件"
      },
      {
       "name": "binPath",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": ".bin file",
       "desc_zh": ".bin 文件"
      },
      {
       "name": "nc",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Classes (0 = auto)",
       "desc_zh": "类别数（0 自动）"
      },
      {
       "name": "useGpu",
       "type": "boolean",
       "optional": true,
       "default": false,
       "desc_en": "GPU",
       "desc_zh": "GPU"
      }
     ],
     "returns": {
      "type": "string|undefined",
      "desc_en": "modelId",
      "desc_zh": "模型 ID"
     },
     "desc_en": "Loads a classifier.",
     "desc_zh": "加载分类模型。",
     "status": "stable"
    },
    {
     "name": "classify",
     "signature": "yoloCls.classify(modelId, img, targetSize?)",
     "params": [
      {
       "name": "modelId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Model id from load()",
       "desc_zh": "load() 返回的模型 ID"
      },
      {
       "name": "img",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId, \"screen\" or file path",
       "desc_zh": "imageId、\"screen\" 或文件路径"
      },
      {
       "name": "targetSize",
       "type": "number",
       "optional": true,
       "default": 224,
       "desc_en": "Input size",
       "desc_zh": "输入尺寸"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "{data, top1, top5, top1conf, top5conf}",
      "desc_zh": "{data, top1, top5, top1conf, top5conf}"
     },
     "desc_en": "Classifies the whole image.",
     "desc_zh": "整图分类。",
     "status": "stable"
    },
    {
     "name": "classifyRegion",
     "signature": "yoloCls.classifyRegion(modelId, img, x?, y?, ex?, ey?, targetSize?)",
     "params": [
      {
       "name": "modelId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Model id from load()",
       "desc_zh": "load() 返回的模型 ID"
      },
      {
       "name": "img",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "imageId, \"screen\" or file path",
       "desc_zh": "imageId、\"screen\" 或文件路径"
      },
      {
       "name": "x",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Left",
       "desc_zh": "左"
      },
      {
       "name": "y",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Top",
       "desc_zh": "上"
      },
      {
       "name": "ex",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Right",
       "desc_zh": "右"
      },
      {
       "name": "ey",
       "type": "number",
       "optional": true,
       "default": 0,
       "desc_en": "Bottom",
       "desc_zh": "下"
      },
      {
       "name": "targetSize",
       "type": "number",
       "optional": true,
       "default": 224,
       "desc_en": "Input size",
       "desc_zh": "输入尺寸"
      }
     ],
     "returns": {
      "type": "object",
      "desc_en": "Same as classify",
      "desc_zh": "同 classify"
     },
     "desc_en": "Classifies a region.",
     "desc_zh": "区域分类。",
     "status": "stable"
    },
    {
     "name": "free",
     "signature": "yoloCls.free(modelId)",
     "params": [
      {
       "name": "modelId",
       "type": "string",
       "optional": false,
       "default": null,
       "desc_en": "Model id from load()",
       "desc_zh": "load() 返回的模型 ID"
      }
     ],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Releases a model.",
     "desc_zh": "释放模型。",
     "status": "stable"
    },
    {
     "name": "freeAll",
     "signature": "yoloCls.freeAll()",
     "params": [],
     "returns": {
      "type": "undefined",
      "desc_en": "—",
      "desc_zh": "无"
     },
     "desc_en": "Releases all models.",
     "desc_zh": "释放全部模型。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "cv",
   "title_en": "OpenCV",
   "title_zh": "OpenCV 图像处理",
   "summary_en": "OpenCV 4.14 bindings for JavaScript and Lua. Images are Mat handles (strings like \"$CV_MAT$_…\"); functions take Mat handle(s) plus an options object using OpenCV parameter names and return new Mat handles or plain values; failures return undefined (reason in the log). Convert with cv.fromImageId / cv.toImageId and release Mats with cv.release. Python scripts use the bundled cv2 + numpy instead (image.captureMat()).",
   "summary_zh": "OpenCV 4.14 的 JavaScript / Lua 绑定。图像是 Mat 句柄（形如 \"$CV_MAT$_…\" 的字符串）；函数接收 Mat 句柄与按 OpenCV 参数名组织的选项对象，返回新的 Mat 句柄或普通值；失败返回 undefined（原因写入日志）。与 image 模块互转用 cv.fromImageId / cv.toImageId，用完请 cv.release。Python 脚本直接用自带的 cv2 + numpy（image.captureMat()）。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript",
    "lua"
   ],
   "names": {
    "javascript": "cv",
    "python": null,
    "lua": "cv"
   },
   "functions": [
    {
     "name": "BFMatcher",
     "signature": "cv.BFMatcher(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Brute-force descriptor matching.",
     "desc_zh": "暴力匹配特征描述子。",
     "status": "stable"
    },
    {
     "name": "CLAHE",
     "signature": "cv.CLAHE(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Contrast-limited adaptive histogram equalization.",
     "desc_zh": "限制对比度的自适应直方图均衡。",
     "status": "stable"
    },
    {
     "name": "Canny",
     "signature": "cv.Canny(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Canny edge detection.",
     "desc_zh": "Canny 边缘检测。",
     "status": "stable"
    },
    {
     "name": "FAST",
     "signature": "cv.FAST(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "FAST corner detection.",
     "desc_zh": "FAST 角点检测。",
     "status": "stable"
    },
    {
     "name": "FlannBasedMatcher",
     "signature": "cv.FlannBasedMatcher(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "FLANN descriptor matching.",
     "desc_zh": "FLANN 特征匹配。",
     "status": "stable"
    },
    {
     "name": "GaussianBlur",
     "signature": "cv.GaussianBlur(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Gaussian blur.",
     "desc_zh": "高斯模糊。",
     "status": "stable"
    },
    {
     "name": "HoughCircles",
     "signature": "cv.HoughCircles(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Detect circles (Hough transform).",
     "desc_zh": "霍夫圆检测。",
     "status": "stable"
    },
    {
     "name": "HoughLinesP",
     "signature": "cv.HoughLinesP(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Detect line segments (probabilistic Hough).",
     "desc_zh": "概率霍夫直线检测。",
     "status": "stable"
    },
    {
     "name": "HuMoments",
     "signature": "cv.HuMoments(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Hu invariant moments from moments.",
     "desc_zh": "由矩计算 Hu 不变矩。",
     "status": "stable"
    },
    {
     "name": "LUT",
     "signature": "cv.LUT(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Look-up table transform.",
     "desc_zh": "查表变换。",
     "status": "stable"
    },
    {
     "name": "Laplacian",
     "signature": "cv.Laplacian(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Laplacian filter.",
     "desc_zh": "拉普拉斯滤波。",
     "status": "stable"
    },
    {
     "name": "Mat",
     "signature": "cv.Mat(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Create a Mat filled with a scalar ({rows, cols, type, scalar}).",
     "desc_zh": "创建以标量填充的 Mat（{rows, cols, type, scalar}）。",
     "status": "stable"
    },
    {
     "name": "ORB",
     "signature": "cv.ORB(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "ORB keypoints and descriptors.",
     "desc_zh": "ORB 特征点与描述子。",
     "status": "stable"
    },
    {
     "name": "SIFT",
     "signature": "cv.SIFT(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "SIFT keypoints and descriptors.",
     "desc_zh": "SIFT 特征点与描述子。",
     "status": "stable"
    },
    {
     "name": "Scharr",
     "signature": "cv.Scharr(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Scharr derivative.",
     "desc_zh": "Scharr 导数。",
     "status": "stable"
    },
    {
     "name": "Sobel",
     "signature": "cv.Sobel(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Sobel derivative.",
     "desc_zh": "Sobel 导数。",
     "status": "stable"
    },
    {
     "name": "absdiff",
     "signature": "cv.absdiff(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element absolute difference.",
     "desc_zh": "逐元素差的绝对值。",
     "status": "stable"
    },
    {
     "name": "adaptiveThreshold",
     "signature": "cv.adaptiveThreshold(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Adaptive threshold.",
     "desc_zh": "自适应阈值。",
     "status": "stable"
    },
    {
     "name": "add",
     "signature": "cv.add(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element addition.",
     "desc_zh": "逐元素相加。",
     "status": "stable"
    },
    {
     "name": "addWeighted",
     "signature": "cv.addWeighted(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Weighted sum of two images.",
     "desc_zh": "两图加权和。",
     "status": "stable"
    },
    {
     "name": "approxPolyDP",
     "signature": "cv.approxPolyDP(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Polygon approximation of a contour.",
     "desc_zh": "轮廓多边形逼近。",
     "status": "stable"
    },
    {
     "name": "arcLength",
     "signature": "cv.arcLength(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Contour perimeter.",
     "desc_zh": "轮廓周长。",
     "status": "stable"
    },
    {
     "name": "arrowedLine",
     "signature": "cv.arrowedLine(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw an arrowed line.",
     "desc_zh": "画箭头线。",
     "status": "stable"
    },
    {
     "name": "at",
     "signature": "cv.at(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Read one pixel (row, col) as a channel array.",
     "desc_zh": "读取单个像素（row, col）的通道值数组。",
     "status": "stable"
    },
    {
     "name": "bilateralFilter",
     "signature": "cv.bilateralFilter(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Bilateral filter.",
     "desc_zh": "双边滤波。",
     "status": "stable"
    },
    {
     "name": "bitwise_and",
     "signature": "cv.bitwise_and(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Bitwise AND.",
     "desc_zh": "按位与。",
     "status": "stable"
    },
    {
     "name": "bitwise_not",
     "signature": "cv.bitwise_not(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Bitwise NOT.",
     "desc_zh": "按位取反。",
     "status": "stable"
    },
    {
     "name": "bitwise_or",
     "signature": "cv.bitwise_or(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Bitwise OR.",
     "desc_zh": "按位或。",
     "status": "stable"
    },
    {
     "name": "bitwise_xor",
     "signature": "cv.bitwise_xor(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Bitwise XOR.",
     "desc_zh": "按位异或。",
     "status": "stable"
    },
    {
     "name": "blur",
     "signature": "cv.blur(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Box blur.",
     "desc_zh": "均值模糊。",
     "status": "stable"
    },
    {
     "name": "boundingRect",
     "signature": "cv.boundingRect(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Upright bounding rectangle.",
     "desc_zh": "外接正矩形。",
     "status": "stable"
    },
    {
     "name": "boxFilter",
     "signature": "cv.boxFilter(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Box filter.",
     "desc_zh": "方框滤波。",
     "status": "stable"
    },
    {
     "name": "boxPoints",
     "signature": "cv.boxPoints(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Corner points of a rotated rectangle.",
     "desc_zh": "旋转矩形四个顶点。",
     "status": "stable"
    },
    {
     "name": "calcBackProject",
     "signature": "cv.calcBackProject(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Histogram back projection.",
     "desc_zh": "直方图反向投影。",
     "status": "stable"
    },
    {
     "name": "calcHist",
     "signature": "cv.calcHist(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Compute a histogram.",
     "desc_zh": "计算直方图。",
     "status": "stable"
    },
    {
     "name": "capture",
     "signature": "cv.capture(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Screenshot as a BGR Mat (optional x, y, ex, ey crop).",
     "desc_zh": "截屏为 BGR Mat（可选 x, y, ex, ey 裁剪）。",
     "status": "stable"
    },
    {
     "name": "circle",
     "signature": "cv.circle(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw a circle.",
     "desc_zh": "画圆。",
     "status": "stable"
    },
    {
     "name": "clone",
     "signature": "cv.clone(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Copy a Mat.",
     "desc_zh": "复制 Mat。",
     "status": "stable"
    },
    {
     "name": "compare",
     "signature": "cv.compare(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element comparison.",
     "desc_zh": "逐元素比较。",
     "status": "stable"
    },
    {
     "name": "compareHist",
     "signature": "cv.compareHist(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Compare two histograms.",
     "desc_zh": "比较两个直方图。",
     "status": "stable"
    },
    {
     "name": "connectedComponents",
     "signature": "cv.connectedComponents(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Label connected components.",
     "desc_zh": "连通域标记。",
     "status": "stable"
    },
    {
     "name": "connectedComponentsWithStats",
     "signature": "cv.connectedComponentsWithStats(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Connected components with statistics.",
     "desc_zh": "带统计信息的连通域。",
     "status": "stable"
    },
    {
     "name": "contourArea",
     "signature": "cv.contourArea(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Contour area.",
     "desc_zh": "轮廓面积。",
     "status": "stable"
    },
    {
     "name": "convertScaleAbs",
     "signature": "cv.convertScaleAbs(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Scale, take absolute value, convert to 8-bit.",
     "desc_zh": "缩放取绝对值并转 8 位。",
     "status": "stable"
    },
    {
     "name": "convexHull",
     "signature": "cv.convexHull(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Convex hull of points.",
     "desc_zh": "凸包。",
     "status": "stable"
    },
    {
     "name": "convexityDefects",
     "signature": "cv.convexityDefects(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Convexity defects of a contour.",
     "desc_zh": "凸缺陷。",
     "status": "stable"
    },
    {
     "name": "copyMakeBorder",
     "signature": "cv.copyMakeBorder(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Add a border around an image.",
     "desc_zh": "给图像加边框。",
     "status": "stable"
    },
    {
     "name": "copyTo",
     "signature": "cv.copyTo(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Copy a Mat (optionally with a mask).",
     "desc_zh": "复制 Mat（可带掩码）。",
     "status": "stable"
    },
    {
     "name": "cornerHarris",
     "signature": "cv.cornerHarris(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Harris corner response.",
     "desc_zh": "Harris 角点响应。",
     "status": "stable"
    },
    {
     "name": "cornerSubPix",
     "signature": "cv.cornerSubPix(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Refine corners to sub-pixel accuracy.",
     "desc_zh": "角点亚像素精化。",
     "status": "stable"
    },
    {
     "name": "countNonZero",
     "signature": "cv.countNonZero(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Count non-zero pixels.",
     "desc_zh": "统计非零像素。",
     "status": "stable"
    },
    {
     "name": "crop",
     "signature": "cv.crop(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Crop to {x, y, ex, ey}.",
     "desc_zh": "按 {x, y, ex, ey} 裁剪。",
     "status": "stable"
    },
    {
     "name": "cvtColor",
     "signature": "cv.cvtColor(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Color space conversion.",
     "desc_zh": "颜色空间转换。",
     "status": "stable"
    },
    {
     "name": "detectBarcode",
     "signature": "cv.detectBarcode(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Detect and decode barcodes → {decoded[], types[], points} or undefined.",
     "desc_zh": "检测并解码条码 → {decoded[], types[], points} 或 undefined。",
     "status": "stable"
    },
    {
     "name": "detectQRCode",
     "signature": "cv.detectQRCode(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Detect and decode a QR code → {decoded, points} or undefined.",
     "desc_zh": "检测并解码二维码 → {decoded, points} 或 undefined。",
     "status": "stable"
    },
    {
     "name": "dilate",
     "signature": "cv.dilate(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Morphological dilation.",
     "desc_zh": "膨胀。",
     "status": "stable"
    },
    {
     "name": "distanceTransform",
     "signature": "cv.distanceTransform(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Distance transform.",
     "desc_zh": "距离变换。",
     "status": "stable"
    },
    {
     "name": "divide",
     "signature": "cv.divide(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element division.",
     "desc_zh": "逐元素相除。",
     "status": "stable"
    },
    {
     "name": "drawContours",
     "signature": "cv.drawContours(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw contours.",
     "desc_zh": "绘制轮廓。",
     "status": "stable"
    },
    {
     "name": "drawKeypoints",
     "signature": "cv.drawKeypoints(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw keypoints.",
     "desc_zh": "绘制特征点。",
     "status": "stable"
    },
    {
     "name": "drawMarker",
     "signature": "cv.drawMarker(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw a marker.",
     "desc_zh": "绘制标记。",
     "status": "stable"
    },
    {
     "name": "drawMatches",
     "signature": "cv.drawMatches(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw keypoint matches.",
     "desc_zh": "绘制匹配结果。",
     "status": "stable"
    },
    {
     "name": "ellipse",
     "signature": "cv.ellipse(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw an ellipse.",
     "desc_zh": "画椭圆。",
     "status": "stable"
    },
    {
     "name": "empty",
     "signature": "cv.empty(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Whether a Mat is empty or invalid.",
     "desc_zh": "Mat 是否为空或无效。",
     "status": "stable"
    },
    {
     "name": "encodeQRCode",
     "signature": "cv.encodeQRCode(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Generate a QR code image (264×264 BGR).",
     "desc_zh": "生成二维码图片（264×264 BGR）。",
     "status": "stable"
    },
    {
     "name": "equalizeHist",
     "signature": "cv.equalizeHist(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Histogram equalization.",
     "desc_zh": "直方图均衡。",
     "status": "stable"
    },
    {
     "name": "erode",
     "signature": "cv.erode(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Morphological erosion.",
     "desc_zh": "腐蚀。",
     "status": "stable"
    },
    {
     "name": "estimateAffine2D",
     "signature": "cv.estimateAffine2D(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Estimate a 2D affine transform.",
     "desc_zh": "估计二维仿射变换。",
     "status": "stable"
    },
    {
     "name": "estimateAffinePartial2D",
     "signature": "cv.estimateAffinePartial2D(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Estimate a similarity transform.",
     "desc_zh": "估计相似变换。",
     "status": "stable"
    },
    {
     "name": "extractChannel",
     "signature": "cv.extractChannel(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Extract one channel.",
     "desc_zh": "提取单个通道。",
     "status": "stable"
    },
    {
     "name": "fastNlMeansDenoising",
     "signature": "cv.fastNlMeansDenoising(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Non-local means denoising (gray).",
     "desc_zh": "非局部均值去噪（灰度）。",
     "status": "stable"
    },
    {
     "name": "fastNlMeansDenoisingColored",
     "signature": "cv.fastNlMeansDenoisingColored(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Non-local means denoising (color).",
     "desc_zh": "非局部均值去噪（彩色）。",
     "status": "stable"
    },
    {
     "name": "fillConvexPoly",
     "signature": "cv.fillConvexPoly(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Fill a convex polygon.",
     "desc_zh": "填充凸多边形。",
     "status": "stable"
    },
    {
     "name": "fillPoly",
     "signature": "cv.fillPoly(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Fill polygons.",
     "desc_zh": "填充多边形。",
     "status": "stable"
    },
    {
     "name": "filter2D",
     "signature": "cv.filter2D(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Convolve with a custom kernel.",
     "desc_zh": "自定义卷积核滤波。",
     "status": "stable"
    },
    {
     "name": "findContours",
     "signature": "cv.findContours(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Find contours.",
     "desc_zh": "查找轮廓。",
     "status": "stable"
    },
    {
     "name": "findHomography",
     "signature": "cv.findHomography(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Find a perspective homography.",
     "desc_zh": "求单应矩阵。",
     "status": "stable"
    },
    {
     "name": "findNonZero",
     "signature": "cv.findNonZero(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Coordinates of non-zero pixels.",
     "desc_zh": "非零像素坐标。",
     "status": "stable"
    },
    {
     "name": "fitEllipse",
     "signature": "cv.fitEllipse(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Fit an ellipse to points.",
     "desc_zh": "拟合椭圆。",
     "status": "stable"
    },
    {
     "name": "fitLine",
     "signature": "cv.fitLine(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Fit a line to points.",
     "desc_zh": "拟合直线。",
     "status": "stable"
    },
    {
     "name": "flannKnnMatch",
     "signature": "cv.flannKnnMatch(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "FLANN k-nearest-neighbour matching.",
     "desc_zh": "FLANN k 近邻匹配。",
     "status": "stable"
    },
    {
     "name": "flip",
     "signature": "cv.flip(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Flip an image.",
     "desc_zh": "翻转图像。",
     "status": "stable"
    },
    {
     "name": "floodFill",
     "signature": "cv.floodFill(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Flood fill.",
     "desc_zh": "漫水填充。",
     "status": "stable"
    },
    {
     "name": "fromImageId",
     "signature": "cv.fromImageId(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Convert an image-module imageId to a Mat.",
     "desc_zh": "把 image 模块的 imageId 转为 Mat。",
     "status": "stable"
    },
    {
     "name": "getAffineTransform",
     "signature": "cv.getAffineTransform(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Affine matrix from 3 point pairs.",
     "desc_zh": "由 3 对点求仿射矩阵。",
     "status": "stable"
    },
    {
     "name": "getPerspectiveTransform",
     "signature": "cv.getPerspectiveTransform(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Perspective matrix from 4 point pairs.",
     "desc_zh": "由 4 对点求透视矩阵。",
     "status": "stable"
    },
    {
     "name": "getRectSubPix",
     "signature": "cv.getRectSubPix(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Sub-pixel rectangle extraction.",
     "desc_zh": "亚像素取矩形。",
     "status": "stable"
    },
    {
     "name": "getRotationMatrix2D",
     "signature": "cv.getRotationMatrix2D(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Rotation matrix.",
     "desc_zh": "旋转矩阵。",
     "status": "stable"
    },
    {
     "name": "getSize",
     "signature": "cv.getSize(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "{width, height, channels, rows, cols, type} of a Mat.",
     "desc_zh": "Mat 的 {width, height, channels, rows, cols, type}。",
     "status": "stable"
    },
    {
     "name": "getStructuringElement",
     "signature": "cv.getStructuringElement(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Create a morphology kernel.",
     "desc_zh": "创建形态学核。",
     "status": "stable"
    },
    {
     "name": "getTextSize",
     "signature": "cv.getTextSize(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Measure text size for putText.",
     "desc_zh": "测量 putText 文字尺寸。",
     "status": "stable"
    },
    {
     "name": "goodFeaturesToTrack",
     "signature": "cv.goodFeaturesToTrack(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Shi-Tomasi corner detection.",
     "desc_zh": "Shi-Tomasi 角点检测。",
     "status": "stable"
    },
    {
     "name": "hconcat",
     "signature": "cv.hconcat(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Concatenate horizontally.",
     "desc_zh": "水平拼接。",
     "status": "stable"
    },
    {
     "name": "imdecode",
     "signature": "cv.imdecode(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Decode Base64 image data to a Mat.",
     "desc_zh": "把 Base64 图片数据解码为 Mat。",
     "status": "stable"
    },
    {
     "name": "imencode",
     "signature": "cv.imencode(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Encode a Mat to Base64 (jpg/png ...).",
     "desc_zh": "把 Mat 编码为 Base64（jpg/png 等）。",
     "status": "stable"
    },
    {
     "name": "imread",
     "signature": "cv.imread(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Read an image file / imageId / \"screen\" / URL to a BGR Mat.",
     "desc_zh": "从文件、imageId、\"screen\" 或 URL 读成 BGR Mat。",
     "status": "stable"
    },
    {
     "name": "imwrite",
     "signature": "cv.imwrite(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Write a Mat to an image file.",
     "desc_zh": "把 Mat 写入图片文件。",
     "status": "stable"
    },
    {
     "name": "inRange",
     "signature": "cv.inRange(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Mask of pixels inside a range.",
     "desc_zh": "范围内像素掩码。",
     "status": "stable"
    },
    {
     "name": "inpaint",
     "signature": "cv.inpaint(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Inpaint a masked region.",
     "desc_zh": "按掩码修补图像。",
     "status": "stable"
    },
    {
     "name": "invertAffineTransform",
     "signature": "cv.invertAffineTransform(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Invert an affine matrix.",
     "desc_zh": "仿射矩阵求逆。",
     "status": "stable"
    },
    {
     "name": "isContourConvex",
     "signature": "cv.isContourConvex(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Whether a contour is convex.",
     "desc_zh": "轮廓是否凸。",
     "status": "stable"
    },
    {
     "name": "isRelease",
     "signature": "cv.isRelease(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Whether a Mat handle has been released.",
     "desc_zh": "Mat 句柄是否已释放。",
     "status": "stable"
    },
    {
     "name": "knnMatch",
     "signature": "cv.knnMatch(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "k-nearest-neighbour descriptor matching.",
     "desc_zh": "k 近邻描述子匹配。",
     "status": "stable"
    },
    {
     "name": "line",
     "signature": "cv.line(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw a line.",
     "desc_zh": "画线。",
     "status": "stable"
    },
    {
     "name": "matchShapes",
     "signature": "cv.matchShapes(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Compare two shapes.",
     "desc_zh": "比较两个形状。",
     "status": "stable"
    },
    {
     "name": "matchTemplate",
     "signature": "cv.matchTemplate(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Template matching score map.",
     "desc_zh": "模板匹配得分图。",
     "status": "stable"
    },
    {
     "name": "matchTemplateLoc",
     "signature": "cv.matchTemplateLoc(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Template matching best location → {x, y, minVal, maxVal}.",
     "desc_zh": "模板匹配最佳位置 → {x, y, minVal, maxVal}。",
     "status": "stable"
    },
    {
     "name": "max",
     "signature": "cv.max(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element maximum.",
     "desc_zh": "逐元素最大值。",
     "status": "stable"
    },
    {
     "name": "mean",
     "signature": "cv.mean(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Mean of each channel.",
     "desc_zh": "各通道均值。",
     "status": "stable"
    },
    {
     "name": "meanStdDev",
     "signature": "cv.meanStdDev(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Mean and standard deviation.",
     "desc_zh": "均值与标准差。",
     "status": "stable"
    },
    {
     "name": "medianBlur",
     "signature": "cv.medianBlur(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Median blur.",
     "desc_zh": "中值滤波。",
     "status": "stable"
    },
    {
     "name": "merge",
     "signature": "cv.merge(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Merge channels.",
     "desc_zh": "合并通道。",
     "status": "stable"
    },
    {
     "name": "min",
     "signature": "cv.min(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element minimum.",
     "desc_zh": "逐元素最小值。",
     "status": "stable"
    },
    {
     "name": "minAreaRect",
     "signature": "cv.minAreaRect(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Minimum-area rotated rectangle.",
     "desc_zh": "最小外接旋转矩形。",
     "status": "stable"
    },
    {
     "name": "minEnclosingCircle",
     "signature": "cv.minEnclosingCircle(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Minimum enclosing circle.",
     "desc_zh": "最小外接圆。",
     "status": "stable"
    },
    {
     "name": "minMaxLoc",
     "signature": "cv.minMaxLoc(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Min/max values and their locations.",
     "desc_zh": "最小/最大值及位置。",
     "status": "stable"
    },
    {
     "name": "moments",
     "signature": "cv.moments(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Image/contour moments.",
     "desc_zh": "图像/轮廓矩。",
     "status": "stable"
    },
    {
     "name": "morphologyEx",
     "signature": "cv.morphologyEx(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Advanced morphology (open, close, gradient ...).",
     "desc_zh": "高级形态学（开、闭、梯度等）。",
     "status": "stable"
    },
    {
     "name": "multiply",
     "signature": "cv.multiply(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element multiplication.",
     "desc_zh": "逐元素相乘。",
     "status": "stable"
    },
    {
     "name": "norm",
     "signature": "cv.norm(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Matrix norm.",
     "desc_zh": "矩阵范数。",
     "status": "stable"
    },
    {
     "name": "normalize",
     "signature": "cv.normalize(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Normalize value range.",
     "desc_zh": "归一化。",
     "status": "stable"
    },
    {
     "name": "ones",
     "signature": "cv.ones(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Create a Mat of ones.",
     "desc_zh": "创建全 1 Mat。",
     "status": "stable"
    },
    {
     "name": "perspectiveTransform",
     "signature": "cv.perspectiveTransform(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Apply a perspective matrix to points.",
     "desc_zh": "对点做透视变换。",
     "status": "stable"
    },
    {
     "name": "phaseCorrelate",
     "signature": "cv.phaseCorrelate(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Translation between two images.",
     "desc_zh": "两图之间的平移量。",
     "status": "stable"
    },
    {
     "name": "pointPolygonTest",
     "signature": "cv.pointPolygonTest(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Point position relative to a contour.",
     "desc_zh": "点与轮廓的位置关系。",
     "status": "stable"
    },
    {
     "name": "polylines",
     "signature": "cv.polylines(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw polylines.",
     "desc_zh": "画折线。",
     "status": "stable"
    },
    {
     "name": "putText",
     "signature": "cv.putText(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw text.",
     "desc_zh": "绘制文字。",
     "status": "stable"
    },
    {
     "name": "pyrDown",
     "signature": "cv.pyrDown(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Downsample (Gaussian pyramid).",
     "desc_zh": "高斯金字塔下采样。",
     "status": "stable"
    },
    {
     "name": "pyrUp",
     "signature": "cv.pyrUp(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Upsample (Gaussian pyramid).",
     "desc_zh": "高斯金字塔上采样。",
     "status": "stable"
    },
    {
     "name": "rectangle",
     "signature": "cv.rectangle(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Draw a rectangle.",
     "desc_zh": "画矩形。",
     "status": "stable"
    },
    {
     "name": "release",
     "signature": "cv.release(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Release a Mat handle.",
     "desc_zh": "释放 Mat 句柄。",
     "status": "stable"
    },
    {
     "name": "releaseAll",
     "signature": "cv.releaseAll(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Release all Mat handles.",
     "desc_zh": "释放全部 Mat 句柄。",
     "status": "stable"
    },
    {
     "name": "resize",
     "signature": "cv.resize(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Resize an image.",
     "desc_zh": "缩放图像。",
     "status": "stable"
    },
    {
     "name": "rotate",
     "signature": "cv.rotate(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Rotate by 90/180/270 degrees.",
     "desc_zh": "旋转 90/180/270 度。",
     "status": "stable"
    },
    {
     "name": "set",
     "signature": "cv.set(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Write one pixel ({row, col, value}).",
     "desc_zh": "写单个像素（{row, col, value}）。",
     "status": "stable"
    },
    {
     "name": "split",
     "signature": "cv.split(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Split channels.",
     "desc_zh": "拆分通道。",
     "status": "stable"
    },
    {
     "name": "subtract",
     "signature": "cv.subtract(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Per-element subtraction.",
     "desc_zh": "逐元素相减。",
     "status": "stable"
    },
    {
     "name": "sum",
     "signature": "cv.sum(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Sum of each channel.",
     "desc_zh": "各通道求和。",
     "status": "stable"
    },
    {
     "name": "threshold",
     "signature": "cv.threshold(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Fixed threshold.",
     "desc_zh": "固定阈值。",
     "status": "stable"
    },
    {
     "name": "toImageId",
     "signature": "cv.toImageId(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Convert a Mat to an image-module imageId.",
     "desc_zh": "把 Mat 转为 image 模块的 imageId。",
     "status": "stable"
    },
    {
     "name": "vconcat",
     "signature": "cv.vconcat(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Concatenate vertically.",
     "desc_zh": "垂直拼接。",
     "status": "stable"
    },
    {
     "name": "warpAffine",
     "signature": "cv.warpAffine(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Apply an affine transform.",
     "desc_zh": "仿射变换。",
     "status": "stable"
    },
    {
     "name": "warpPerspective",
     "signature": "cv.warpPerspective(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Apply a perspective transform.",
     "desc_zh": "透视变换。",
     "status": "stable"
    },
    {
     "name": "zeros",
     "signature": "cv.zeros(...)",
     "params": [],
     "returns": {
      "type": "any",
      "desc_en": "Mat handle, value or undefined",
      "desc_zh": "Mat 句柄、值或 undefined"
     },
     "desc_en": "Create a Mat of zeros.",
     "desc_zh": "创建全 0 Mat。",
     "status": "stable"
    }
   ]
  },
  {
   "name": "console",
   "title_en": "console",
   "title_zh": "console 控制台",
   "summary_en": "Standard console object (JavaScript). log/info/debug write info-level lines, warn/error write warning/error lines; table/dir/trace/assert also log; group*, count*, time*, profile*, clear, record*, timeStamp, takeHeapSnapshot and screenshot are no-ops. Inside a running script package, console provides only log/info/warn/error/debug.",
   "summary_zh": "标准 console 对象（JavaScript）。log/info/debug 写信息级日志，warn/error 写警告/错误日志；table/dir/trace/assert 也会写日志；group*、count*、time*、profile*、clear、record*、timeStamp、takeHeapSnapshot、screenshot 为空操作。 在运行中的软件包里，console 只提供 log/info/warn/error/debug。",
   "modes": [
    "agent",
    "hid"
   ],
   "languages": [
    "javascript"
   ],
   "names": {
    "javascript": "console",
    "python": null,
    "lua": null
   },
   "functions": []
  },
  {
   "name": "jbclear",
   "title_en": "Jailbreak: data cleanup",
   "title_zh": "越狱：数据清理",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbclear",
    "python": "jbclear",
    "lua": "jbclear"
   },
   "functions": [
    {
     "name": "keychain",
     "signature": "jbclear.keychain(identifier)",
     "params": [
      {
       "name": "identifier",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "allKeychain",
     "signature": "jbclear.allKeychain()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "cookies",
     "signature": "jbclear.cookies()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "caches",
     "signature": "jbclear.caches(options?)",
     "params": [
      {
       "name": "options",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "photos",
     "signature": "jbclear.photos()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "appData",
     "signature": "jbclear.appData(bundleId)",
     "params": [
      {
       "name": "bundleId",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getIdfa",
     "signature": "jbclear.getIdfa()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "resetIdfa",
     "signature": "jbclear.resetIdfa()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setIdfa",
     "signature": "jbclear.setIdfa(value)",
     "params": [
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getIdfv",
     "signature": "jbclear.getIdfv(bundleId)",
     "params": [
      {
       "name": "bundleId",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "resetIdfv",
     "signature": "jbclear.resetIdfv(bundleId)",
     "params": [
      {
       "name": "bundleId",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setIdfv",
     "signature": "jbclear.setIdfv(bundleId, value)",
     "params": [
      {
       "name": "bundleId",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "value",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  },
  {
   "name": "jbdevice",
   "title_en": "Jailbreak: device settings",
   "title_zh": "越狱：设备设置",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbdevice",
    "python": "jbdevice",
    "lua": "jbdevice"
   },
   "functions": [
    {
     "name": "setAutoLockMinutes",
     "signature": "jbdevice.setAutoLockMinutes(minutes)",
     "params": [
      {
       "name": "minutes",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "restoreAutoLock",
     "signature": "jbdevice.restoreAutoLock()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getAutoLockMinutes",
     "signature": "jbdevice.getAutoLockMinutes()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "serialNumber",
     "signature": "jbdevice.serialNumber()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "wifiMac",
     "signature": "jbdevice.wifiMac()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "wifiInfo",
     "signature": "jbdevice.wifiInfo()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "wifiOn",
     "signature": "jbdevice.wifiOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "wifiOff",
     "signature": "jbdevice.wifiOff()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "isWifiOn",
     "signature": "jbdevice.isWifiOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "bluetoothOn",
     "signature": "jbdevice.bluetoothOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "bluetoothOff",
     "signature": "jbdevice.bluetoothOff()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "isBluetoothOn",
     "signature": "jbdevice.isBluetoothOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "cellularOn",
     "signature": "jbdevice.cellularOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "cellularOff",
     "signature": "jbdevice.cellularOff()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "isCellularOn",
     "signature": "jbdevice.isCellularOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "airplaneOn",
     "signature": "jbdevice.airplaneOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "airplaneOff",
     "signature": "jbdevice.airplaneOff()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "isAirplaneOn",
     "signature": "jbdevice.isAirplaneOn()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "joinWifi",
     "signature": "jbdevice.joinWifi(ssid, password?, timeoutMs?)",
     "params": [
      {
       "name": "ssid",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "password",
       "type": "any",
       "optional": true,
       "default": "",
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "timeoutMs",
       "type": "any",
       "optional": true,
       "default": 0,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "forgetWifi",
     "signature": "jbdevice.forgetWifi(ssid)",
     "params": [
      {
       "name": "ssid",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "listWifi",
     "signature": "jbdevice.listWifi()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "scanWifi",
     "signature": "jbdevice.scanWifi(timeoutMs?)",
     "params": [
      {
       "name": "timeoutMs",
       "type": "any",
       "optional": true,
       "default": 0,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setVolume",
     "signature": "jbdevice.setVolume(volume)",
     "params": [
      {
       "name": "volume",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getVolume",
     "signature": "jbdevice.getVolume()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setBrightness",
     "signature": "jbdevice.setBrightness(brightness)",
     "params": [
      {
       "name": "brightness",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getBrightness",
     "signature": "jbdevice.getBrightness()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  },
  {
   "name": "jbdraw",
   "title_en": "Jailbreak: screen overlay drawing",
   "title_zh": "越狱：屏幕绘制",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbdraw",
    "python": "jbdraw",
    "lua": "jbdraw"
   },
   "functions": [
    {
     "name": "rect",
     "signature": "jbdraw.rect(x, y, width, height, options?)",
     "params": [
      {
       "name": "x",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "y",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "width",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "height",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "options",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "text",
     "signature": "jbdraw.text(x, y, text, options?)",
     "params": [
      {
       "name": "x",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "y",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "text",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "options",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "clear",
     "signature": "jbdraw.clear(id)",
     "params": [
      {
       "name": "id",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "clearAll",
     "signature": "jbdraw.clearAll()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  },
  {
   "name": "jbdylib",
   "title_en": "Jailbreak: dynamic libraries",
   "title_zh": "越狱：动态库",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbdylib",
    "python": "jbdylib",
    "lua": "jbdylib"
   },
   "functions": [
    {
     "name": "open",
     "signature": "jbdylib.open(name, defs?)",
     "params": [
      {
       "name": "name",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "defs",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "isLoaded",
     "signature": "jbdylib.isLoaded(name)",
     "params": [
      {
       "name": "name",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  },
  {
   "name": "jbpower",
   "title_en": "Jailbreak: power / charging",
   "title_zh": "越狱：电源与充电",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbpower",
    "python": "jbpower",
    "lua": "jbpower"
   },
   "functions": [
    {
     "name": "info",
     "signature": "jbpower.info()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "stopCharging",
     "signature": "jbpower.stopCharging()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "startCharging",
     "signature": "jbpower.startCharging()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setSmartCharging",
     "signature": "jbpower.setSmartCharging(min, max)",
     "params": [
      {
       "name": "min",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "max",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "clearSmartCharging",
     "signature": "jbpower.clearSmartCharging()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  },
  {
   "name": "jbshell",
   "title_en": "Jailbreak: shell",
   "title_zh": "越狱：Shell",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbshell",
    "python": "jbshell",
    "lua": "jbshell"
   },
   "functions": [
    {
     "name": "exec",
     "signature": "jbshell.exec(command, timeoutMs?)",
     "params": [
      {
       "name": "command",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      },
      {
       "name": "timeoutMs",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  },
  {
   "name": "jbsystem",
   "title_en": "Jailbreak: system control",
   "title_zh": "越狱：系统控制",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbsystem",
    "python": "jbsystem",
    "lua": "jbsystem"
   },
   "functions": [
    {
     "name": "respring",
     "signature": "jbsystem.respring()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "reboot",
     "signature": "jbsystem.reboot()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "restartSelf",
     "signature": "jbsystem.restartSelf()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getUserTracking",
     "signature": "jbsystem.getUserTracking()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setUserTracking",
     "signature": "jbsystem.setUserTracking(enabled)",
     "params": [
      {
       "name": "enabled",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getPersonalizedAdvertising",
     "signature": "jbsystem.getPersonalizedAdvertising()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setPersonalizedAdvertising",
     "signature": "jbsystem.setPersonalizedAdvertising(enabled)",
     "params": [
      {
       "name": "enabled",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "getLocationServices",
     "signature": "jbsystem.getLocationServices()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "setLocationServices",
     "signature": "jbsystem.setLocationServices(enabled)",
     "params": [
      {
       "name": "enabled",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "jbroot",
     "signature": "jbsystem.jbroot(path)",
     "params": [
      {
       "name": "path",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "rootfs",
     "signature": "jbsystem.rootfs(path)",
     "params": [
      {
       "name": "path",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  },
  {
   "name": "jbvpn",
   "title_en": "Jailbreak: VPN",
   "title_zh": "越狱：VPN",
   "summary_en": "Requires a jailbroken environment; not available in the TestFlight build.",
   "summary_zh": "需要越狱环境，TestFlight 版不可用。",
   "modes": [],
   "languages": [
    "javascript",
    "python",
    "lua"
   ],
   "names": {
    "javascript": "jbvpn",
    "python": "jbvpn",
    "lua": "jbvpn"
   },
   "functions": [
    {
     "name": "create",
     "signature": "jbvpn.create(config)",
     "params": [
      {
       "name": "config",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "list",
     "signature": "jbvpn.list()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "current",
     "signature": "jbvpn.current()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "select",
     "signature": "jbvpn.select(nameOrId)",
     "params": [
      {
       "name": "nameOrId",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "remove",
     "signature": "jbvpn.remove(nameOrId)",
     "params": [
      {
       "name": "nameOrId",
       "type": "any",
       "optional": false,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "connect",
     "signature": "jbvpn.connect(nameOrId?)",
     "params": [
      {
       "name": "nameOrId",
       "type": "any",
       "optional": true,
       "default": null,
       "desc_en": "—",
       "desc_zh": "—"
      }
     ],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "disconnect",
     "signature": "jbvpn.disconnect()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    },
    {
     "name": "status",
     "signature": "jbvpn.status()",
     "params": [],
     "returns": {
      "type": "—",
      "desc_en": "Not available",
      "desc_zh": "不可用"
     },
     "desc_en": "Requires a jailbroken environment; not available in the TestFlight build.",
     "desc_zh": "需要越狱环境，TestFlight 版不可用。",
     "status": "unsupported"
    }
   ]
  }
 ]
}
