{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://wanxiang.ai/contracts/play-loop/actor-selection.schema.json", "title": "ActorSelectionV1", "description": "ActorSelection/1。Actor 只能选择 runner 提供的目标 ID、棋盘单元、安全按键或有限等待,不能直接写屏幕坐标。", "oneOf": [ { "$ref": "#/$defs/tapSelection" }, { "$ref": "#/$defs/dragSelection" }, { "$ref": "#/$defs/keySelection" }, { "$ref": "#/$defs/waitSelection" } ], "$defs": { "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "cell": { "type": "object", "required": ["row", "column"], "properties": { "row": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 } }, "additionalProperties": false }, "targetRef": { "type": "object", "required": ["id"], "properties": { "id": { "type": "string", "pattern": "^(r|l|g)[0-9]{2}$" }, "cell": { "$ref": "#/$defs/cell" }, "subAnchor": { "enum": [ "center", "north", "south", "east", "west", "northwest", "northeast", "southwest", "southeast" ] } }, "additionalProperties": false, "allOf": [ { "if": { "required": ["subAnchor"] }, "then": { "required": ["cell"] } } ] }, "tapSelection": { "type": "object", "required": ["schemaVersion", "type", "targetSetHash", "target"], "properties": { "schemaVersion": { "const": "ActorSelection/1" }, "type": { "const": "tap" }, "targetSetHash": { "$ref": "#/$defs/sha256" }, "target": { "$ref": "#/$defs/targetRef" } }, "additionalProperties": false }, "dragSelection": { "type": "object", "required": ["schemaVersion", "type", "targetSetHash", "from", "to", "ms"], "properties": { "schemaVersion": { "const": "ActorSelection/1" }, "type": { "const": "drag" }, "targetSetHash": { "$ref": "#/$defs/sha256" }, "from": { "$ref": "#/$defs/targetRef" }, "to": { "$ref": "#/$defs/targetRef" }, "ms": { "const": 600 } }, "additionalProperties": false }, "keySelection": { "type": "object", "required": ["schemaVersion", "type", "key"], "properties": { "schemaVersion": { "const": "ActorSelection/1" }, "type": { "const": "key" }, "key": { "enum": [ "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "KeyW", "KeyA", "KeyS", "KeyD", "Enter", "Escape", "Space" ] } }, "additionalProperties": false }, "waitSelection": { "type": "object", "required": ["schemaVersion", "type", "ms"], "properties": { "schemaVersion": { "const": "ActorSelection/1" }, "type": { "const": "wait" }, "ms": { "type": "integer", "minimum": 100, "maximum": 600 } }, "additionalProperties": false } } }