外观
自动生成
本页由 pnpm nodes 从 midscene-node-spec.android.md 生成,不要手改。改了 nodes/ 下的自定义节点后重新生成即可。
Midscene Test Node Spec
This document describes the Nodes available in YAML test files (.yaml or .yml) for the Midscene Test framework (@midscene/test). It lists the Nodes registered by the current Test Project, their inputs, and how to call them in test steps and lifecycle hooks.
Learn about the framework and YAML test authoring:
- Midscene Test overview: framework concepts and the role of Nodes.
- Create and use test projects: write YAML cases, run tests, and inspect results.
- Configure test projects: register Nodes, select case files, and manage runtime resources.
Available Nodes
This table lists all available Nodes. See Node Details below for each Node's usage and input schema.
| Node | Description |
|---|---|
| aiAct | Perform a natural-language task with a Midscene UI Agent. |
| aiAssert | Assert a natural-language condition with a Midscene UI Agent. |
| action | Call a platform or custom action. Its ActionSpace schema validates params when the action executes. |
| aiAsk | Run aiAsk with a Midscene UI Agent and store its value. |
| aiBoolean | Run aiBoolean with a Midscene UI Agent and store its value. |
| aiClearInput | Locate an input element and clear its value with a Midscene UI Agent. |
| aiDoubleClick | Locate and double-click an element with a Midscene UI Agent. |
| aiDragAndDrop | Locate source and destination elements, then drag the source to the destination. |
| aiHover | Locate and hover over an element with a Midscene UI Agent. |
| aiInput | Locate an input element and enter a value with a Midscene UI Agent. |
| aiKeyboardPress | Press a key or key combination, optionally targeting a located element. |
| aiLocate | Locate an element from a natural-language description and store the result. |
| aiLongPress | Locate and long-press an element with a Midscene UI Agent. |
| aiMiddleClick | Locate and middle-click an element with a Midscene UI Agent. |
| aiNumber | Run aiNumber with a Midscene UI Agent and store its value. |
| aiPinch | Perform a pinch-in or pinch-out gesture with a Midscene UI Agent. |
| aiQuery | Extract structured data from the current interface and store the result. |
| aiRightClick | Locate and right-click an element with a Midscene UI Agent. |
| aiScroll | Scroll the page or a located region with a Midscene UI Agent. |
| aiString | Run aiString with a Midscene UI Agent and store its value. |
| aiTap | Locate and tap an element with a Midscene UI Agent. |
| aiWaitFor | Wait until a natural-language condition is satisfied. |
| back | Trigger the Android system back operation. |
| home | Trigger the Android system home operation. |
| javascript | Evaluate JavaScript in the current interface and store the result. |
| launch | Launch an application through the current Android Agent. |
| recentApps | Trigger the Android system recent apps operation. |
| recordToReport | Add text or screenshots to the current Midscene report. |
| runAdbShell | Execute a shell command through the current Android Agent. Pass only the shell command, without the adb shell prefix. |
| runGherkinScenario | Execute a Gherkin scenario with the current Midscene UI Agent. |
| setAIContext | Set or remove Agent-level AI guidance for subsequent calls on the same Agent. |
| sleep | Wait for a fixed number of milliseconds, recording standard UI snapshots and honoring cancellation. |
| terminate | Terminate an application through the current Android Agent. |
| wait | Wait for a fixed duration while honoring cancellation. |
Where to use these Nodes
Use these Nodes in Workflow Documents (.yaml or .yml files) selected by an Execution Project. Case file patterns and the config file path below are relative to this spec file. Case file patterns use glob syntax. A custom --config path does not change where case files are selected.
Projects created by midscene-test create select cases/**/*.{yaml,yml} by default, so you can write test cases in cases/example.yaml or subdirectories of cases/. If an Execution Project has no files configuration, Midscene Test searches **/*.{yaml,yml} recursively instead. Check projects[].files in your configuration before choosing a file location.
Config file: midscene.config.ts
Case files: cases/android/**/*.{yaml,yml} (Execution Project: android)
Files matching files.exclude are not selected. Midscene Test always ignores .git/, .midscene/, midscene_run/, and node_modules/ directories, including nested ones.
Call a Node in cases[].steps, or in the Workflow Document lifecycle steps beforeAll, beforeEach, afterEach, and afterAll. Root Nodes are shared defaults; projects[].nodes adds local Nodes and overrides same-named root Nodes only within that Execution Project. Each Execution Project supplies its own runtime environment.
Workflow Step Contract
Each step uses a node name as its key. The $ object contains engine metadata and is not part of the node input.
yaml
cases:
- name: Example case
steps:
- node.name:
prompt: Describe the task.
$:
timeout: 30000
continue-on-error: falseA Node may map a string step value to one declared input field. Each Node section states whether it supports this shorthand and names the target field.
Each Node's returned data is saved on that Step's result. Results are not named or automatically passed to later Steps. A failed Case does not stop later Cases by default; test.bail controls early stopping across the run.
Node Details
aiAct
Perform a natural-language task with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"anyOf": [
{
"const": "unset"
},
{
"type": "boolean"
}
]
},
"effort": {
"enum": [
"fast",
"balance",
"deepThink"
]
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"fileChooserAllowedDir": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiAssert
Assert a natural-language condition with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"message": {
"type": "string"
},
"options": {
"additionalProperties": false,
"properties": {
"context": {
"type": "string"
},
"domIncluded": {
"anyOf": [
{
"type": "boolean"
},
{
"const": "visible-only"
}
]
},
"keepRawResponse": {
"type": "boolean"
},
"screenshotIncluded": {
"type": "boolean"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}action
Call a platform or custom action. Its ActionSpace schema validates params when the action executes.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"params": {}
},
"required": [
"name"
],
"type": "object"
}aiAsk
Run aiAsk with a Midscene UI Agent and store its value.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"context": {
"type": "string"
},
"domIncluded": {
"anyOf": [
{
"type": "boolean"
},
{
"const": "visible-only"
}
]
},
"screenshotIncluded": {
"type": "boolean"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiBoolean
Run aiBoolean with a Midscene UI Agent and store its value.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"context": {
"type": "string"
},
"domIncluded": {
"anyOf": [
{
"type": "boolean"
},
{
"const": "visible-only"
}
]
},
"screenshotIncluded": {
"type": "boolean"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiClearInput
Locate an input element and clear its value with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiDoubleClick
Locate and double-click an element with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiDragAndDrop
Locate source and destination elements, then drag the source to the destination.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$defs": {
"__schema0": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"from": {
"$ref": "#/$defs/__schema0"
},
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"to": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"from",
"to"
],
"type": "object"
}aiHover
Locate and hover over an element with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiInput
Locate an input element and enter a value with a Midscene UI Agent.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"autoDismissKeyboard": {
"type": "boolean"
},
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"inputStrategy": {
"enum": [
"legacy",
"sequential",
"bulk"
]
},
"keyboardTypeDelay": {
"minimum": 0,
"type": "number"
},
"mode": {
"enum": [
"replace",
"clear",
"typeOnly",
"append"
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
}
]
}
},
"required": [
"prompt",
"value"
],
"type": "object"
}aiKeyboardPress
Press a key or key combination, optionally targeting a located element.
String shorthand: Maps to { keyName: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"keyName": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"keyName"
],
"type": "object"
}aiLocate
Locate an element from a natural-language description and store the result.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiLongPress
Locate and long-press an element with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"duration": {
"minimum": 0,
"type": "number"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiMiddleClick
Locate and middle-click an element with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiNumber
Run aiNumber with a Midscene UI Agent and store its value.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"context": {
"type": "string"
},
"domIncluded": {
"anyOf": [
{
"type": "boolean"
},
{
"const": "visible-only"
}
]
},
"screenshotIncluded": {
"type": "boolean"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiPinch
Perform a pinch-in or pinch-out gesture with a Midscene UI Agent.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"direction": {
"enum": [
"in",
"out"
]
},
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"distance": {
"type": "number"
},
"duration": {
"minimum": 0,
"type": "number"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"direction"
],
"type": "object"
}aiQuery
Extract structured data from the current interface and store the result.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"context": {
"type": "string"
},
"domIncluded": {
"anyOf": [
{
"type": "boolean"
},
{
"const": "visible-only"
}
]
},
"screenshotIncluded": {
"type": "boolean"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": {
"type": "string"
},
"propertyNames": {
"type": "string"
},
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiRightClick
Locate and right-click an element with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiScroll
Scroll the page or a located region with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"direction": {
"enum": [
"down",
"up",
"right",
"left"
]
},
"distance": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"scrollType": {
"enum": [
"singleAction",
"scrollToBottom",
"scrollToTop",
"scrollToRight",
"scrollToLeft",
"once",
"untilBottom",
"untilTop",
"untilRight",
"untilLeft"
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [],
"type": "object"
}aiString
Run aiString with a Midscene UI Agent and store its value.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"context": {
"type": "string"
},
"domIncluded": {
"anyOf": [
{
"type": "boolean"
},
{
"const": "visible-only"
}
]
},
"screenshotIncluded": {
"type": "boolean"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiTap
Locate and tap an element with a Midscene UI Agent.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"type": "boolean"
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"xpath": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}aiWaitFor
Wait until a natural-language condition is satisfied.
String shorthand: Maps to { prompt: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"checkIntervalMs": {
"exclusiveMinimum": 0,
"type": "number"
},
"context": {
"type": "string"
},
"domIncluded": {
"anyOf": [
{
"type": "boolean"
},
{
"const": "visible-only"
}
]
},
"screenshotIncluded": {
"type": "boolean"
},
"timeoutMs": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [],
"type": "object"
},
"prompt": {
"anyOf": [
{
"format": "regex",
"pattern": "\\S",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"convertHttpImage2Base64": {
"type": "boolean"
},
"images": {
"items": {
"additionalProperties": false,
"properties": {
"name": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"url": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"name",
"url"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"prompt": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"prompt"
],
"type": "object"
}
]
}
},
"required": [
"prompt"
],
"type": "object"
}back
Trigger the Android system back operation.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {},
"required": [],
"type": "object"
}home
Trigger the Android system home operation.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {},
"required": [],
"type": "object"
}javascript
Evaluate JavaScript in the current interface and store the result.
String shorthand: Maps to { script: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"script": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"script"
],
"type": "object"
}launch
Launch an application through the current Android Agent.
String shorthand: Maps to { uri: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"uri": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"uri"
],
"type": "object"
}recentApps
Trigger the Android system recent apps operation.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {},
"required": [],
"type": "object"
}recordToReport
Add text or screenshots to the current Midscene report.
String shorthand: Maps to { title: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"content": {
"type": "string"
},
"screenshotBase64": {
"type": "string"
},
"screenshots": {
"items": {
"additionalProperties": false,
"properties": {
"base64": {
"minLength": 1,
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"base64"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [],
"type": "object"
},
"title": {
"type": "string"
}
},
"required": [],
"type": "object"
}runAdbShell
Title: Run an ADB shell command
Execute a shell command through the current Android Agent. Pass only the shell command, without the adb shell prefix.
String shorthand: Maps to { command: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"command": {
"format": "regex",
"pattern": "\\S",
"type": "string"
},
"options": {
"additionalProperties": false,
"properties": {
"timeout": {
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"type": "integer"
}
},
"required": [],
"type": "object"
}
},
"required": [
"command"
],
"type": "object"
}runGherkinScenario
Execute a Gherkin scenario with the current Midscene UI Agent.
String shorthand: Maps to { scenario: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"options": {
"additionalProperties": false,
"properties": {
"cacheable": {
"type": "boolean"
},
"context": {
"type": "string"
},
"deepLocate": {
"type": "boolean"
},
"deepThink": {
"anyOf": [
{
"const": "unset"
},
{
"type": "boolean"
}
]
},
"effort": {
"enum": [
"fast",
"balance",
"deepThink"
]
},
"fileChooserAccept": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"fileChooserAllowedDir": {
"type": "string"
}
},
"required": [],
"type": "object"
},
"scenario": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"scenario"
],
"type": "object"
}setAIContext
Set or remove Agent-level AI guidance for subsequent calls on the same Agent.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"context": {
"type": "string"
},
"target": {
"enum": [
"default",
"aiAct",
"aiTap",
"aiRightClick",
"aiMiddleClick",
"aiDoubleClick",
"aiHover",
"aiInput",
"aiKeyboardPress",
"aiScroll",
"aiPinch",
"aiLongPress",
"aiClearInput",
"aiLocate",
"aiQuery",
"aiBoolean",
"aiNumber",
"aiString",
"aiAsk",
"aiAssert",
"aiWaitFor"
]
}
},
"required": [
"target"
],
"type": "object"
}sleep
Wait for a fixed number of milliseconds, recording standard UI snapshots and honoring cancellation.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"ms": {
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"ms"
],
"type": "object"
}terminate
Terminate an application through the current Android Agent.
String shorthand: Maps to { uri: value }.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"uri": {
"format": "regex",
"pattern": "\\S",
"type": "string"
}
},
"required": [
"uri"
],
"type": "object"
}wait
Wait for a fixed duration while honoring cancellation.
String shorthand: Not supported by this Node.
Input Schema
json
{
"$schema": "https://json-schema.org/draft-2020-12/schema",
"additionalProperties": false,
"properties": {
"duration": {
"exclusiveMinimum": 0,
"type": "number"
},
"unit": {
"default": "ms",
"enum": [
"ms",
"s",
"min"
]
}
},
"required": [
"duration"
],
"type": "object"
}